LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR...

28
LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre University of Limerick

Transcript of LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR...

Page 1: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

LabVIEW FPGA Programming

BRUSHLESS DC MOTOR CONTROLEdin OmerdicSenior Research FellowMobile & Marine Robotics Research CentreUniversity of Limerick

Page 2: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Outline

Brushless DC Motor ControlIntroduction

myRIO

T200 Thruster

Motor Control with PWM SignalIntroduction

Solution 1: PWM Signal Generation with Express VI

Solution 2: PWM Signal Generation with FPGA

Next Steps

Page 3: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

GNC Signal Flow

GNC Signal Flow

Weather routing

program

Trajectory

Generator

Motion Control

System

Control

Allocation

Fusion Marine Craft INS (GNSS + AHRS)

OA Sensors

(Radar, Cameras, etc.)

Observer

Weather

data

Waypoints

Guidance

System

Control

System

Obstacle

Avoidance

Module

Estimated

positions and

velocities Navigation

System

Waves, wind

and ocean

currents

Page 4: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlIntroductionmyRIO

myRIO

• 40 DIO

• 6 AO

• 10 AI

• 2 UART

•Audio In

•Audio Out

•Accelerometer

Features:

Page 5: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlIntroductionmyRIO

Page 6: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlIntroductionmyRIO

Page 7: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlIntroductionmyRIO

Real-Time & FPGA cRIO Architecture

Page 8: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlIntroductionmyRIO

Connectivity

•USB

•WiFi 802.11b,g,n

• (Optional) USB 2.0 – Gigabit Network Adapter Sabrent USB-G1000

Page 9: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlIntroductionmyRIO

What is inside FPGA?

Page 10: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlIntroductionT200 Thruster

T200 Thruster

•Operating Voltage: 6-20V

•Max Current: 25A

•Max Power: 350W

•Max Forward Thrust (16V) 5.1kgf

•Max ReverseThrust (16V) 4.1kgf

•Max Forward Thrust (12V) 3.5kgf

•Max ReverseThrust (12V) 3.0kgf

https://www.bluerobotics.com/store/thrusters/t200-thruster/

Page 11: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlIntroductionT200 Thruster

ESC (AfroESC 30A)

Motor Control with PWM Signal

Page 12: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalIntroduction

• Signal Voltage: 3.3-5V

•Max Update Rate: 400Hz

• Stopped: 1500ms

•Max Forward: 1900ms

•Max Reverse: 1100ms

PWM Signal:

TPWM = 1/400Hz = 2500ms

Stopped

TS = 1500ms

TPWM = 1/400Hz = 2500ms

Max Forward

TS = 1900ms

TPWM = 1/400Hz = 2500ms

Max Reverse

TS = 1100ms

Page 13: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalIntroduction

myRIO

Page 14: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalIntroduction

myRIO-Oscilloscope Connection Diagram

Connector A: DIO8/PWM0

Connector A: GND

Page 15: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalSolution 1: PWM Signal Generation with Express VI

Motor Control with PWM Signal

Solution 1: PWM Signal Generation with Express VI

TPWM = 1/PWM Frequency (Hz)

Duty Cycle = Ts/TPWM

TPWM = 1/400 (Hz) = 2.5 (ms)

Ts(ms)

Page 16: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalSolution 1: PWM Signal Generation with Express VI

TPWM = 2.5 (ms)

Stopped

TS = 1.5 (ms)

TPWM = 2.5 (ms)

Max Forward

TS = 1.9 (ms)

TPWM = 2.5 (ms)

Max Reverse

TS = 1.1 (ms)

Duty Cycle = 0.60

Duty Cycle = 0.76

Duty Cycle = 0.44

Stopped Max Forward

Max Reverse

+1000-100

nd (%)

Duty Cycle

0.44

0.60

0.76

Page 17: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalSolution 1: PWM Signal Generation with Express VI

Stopped Max Forward

Max Reverse

+1000-100

nd (%)

Duty Cycle

0.44

0.60

0.76

11

12

12

12

12

1

1 yxxxx

yyy

xx

yy

xx

yy

x2x1

x

x

y1

y2

y

y

Note: Motor friction (Dead Zone problem) neglected!

Page 18: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalSolution 1: PWM Signal Generation with Express VI

Page 19: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalSolution 1: PWM Signal Generation with Express VI

Taking into account motor friction (Dead Zone)!

nd > 0

nd < 0

nd = 0

Duty Cycle

Stopped Max Forward

Max Reverse

+1000-100

nd (%)

0.44

0.60

0.76

0.62

0.58

A+

B+

A-B-

Page 20: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalSolution 1: PWM Signal Generation with Express VI

Page 21: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Solution 1: PWM Signal Generation with Express VI

myRIO – T200 Thruster Interconnection Diagram

Brushless DC Motor ControlMotor Control with PWM SignalSolution 1: PWM Signal Generation with Express VI

Page 22: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

FPGA Clock Frequency: fFPGA = 40MHz

FPGA Tick Period: TFPGA = 1/40MHz = 25ns

TPWM = 1/400 (Hz) = 2.5 (ms)

CPWM (ticks) = TPWM / TFPGA = 100000 (ticks)

(Ts/TPWM) * CPWM (ticks)

TPWM = 2.5 (ms)

Ts(ms)

CPWM = 100000 (ticks)

TPWM = 2.5 (ms)

Stopped

TS = 1.5 (ms)

TPWM = 2.5 (ms)

Max Forward

TS = 1.9 (ms)

TPWM = 2.5 (ms)

Max Reverse

TS = 1.1 (ms)

CS = 60000 (ticks)

CS = 76000 (ticks)

CPWM = 100000 (ticks)

CS = 44000 (ticks)

Brushless DC Motor ControlMotor Control with PWM SignalSolution 2: PWM Signal Generation with FPGA

Page 23: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalSolution 2: PWM Signal Generation with FPGA

Page 24: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalSolution 2: PWM Signal Generation with FPGA

Page 25: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalSolution 2: PWM Signal Generation with FPGA

Page 26: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlMotor Control with PWM SignalSolution 2: PWM Signal Generation with FPGA

Page 27: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre

Mobile & Marine Robotics Research Centre

University of Limerick

Brushless DC Motor ControlNext Steps

http://www.ni.com/compactrio/

http://www.ni.com/myrio/

https://www.ni.com/compactriodevguide/

Page 28: LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL · LabVIEW FPGA Programming BRUSHLESS DC MOTOR CONTROL Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre