Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile &...

26
Mobile & Marine Robotics www.mmrrc.ul.ie Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre University of Limerick Thruster Control using LabVIEW Real-Time & FPGA Graphical Programming Contact: Edin Omerdic [email protected] University of Limerick

Transcript of Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile &...

Page 1: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

www.mmrrc.ul.ie

Edin OmerdicSenior Research Fellow

Mobile & Marine Robotics Research Centre

University of Limerick

Thruster Control using LabVIEWReal-Time & FPGA Graphical Programming

Contact:

Edin Omerdic

[email protected]

University of Limerick

Page 2: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Outline

Introduction 15:00 – 15:30 (30 min)

RT&FPGA Tutorial: Motor Control with PWM Signal

Group 1 15:30 – 16:15 (45 min)Group 2 16:15 – 17:00 (45 min)Group 3 17:00 – 17:45 (45 min)

Page 3: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Introduction

myRIO

• 40 DIO

• 6 AO

• 10 AI

• 2 UART

• Audio In

• Audio Out

• Accelerometer

Features:

Page 4: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Introduction

Page 5: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Introduction

Page 6: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Introduction

Real-Time & FPGA cRIO Architecture

Page 7: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Introduction

• USB

• WiFi 802.11b,g,n

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

Connectivity:

Page 8: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Introduction

What is inside FPGA?

Page 9: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

T200 Thruster

FPGA Tutorial

• 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

Motor Control with PWM Signal

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

Page 10: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

ESC (AfroESC 30A)

FPGA Tutorial

Motor Control with PWM Signal

Page 11: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

FPGA Tutorial

Motor Control with PWM Signal

• 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 12: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

myRIO

FPGA Tutorial

Motor Control with PWM Signal

Page 13: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

myRIO-Oscilloscope Connection Diagram

FPGA Tutorial

Motor Control with PWM Signal

Connector A: DIO8/PWM0

Connector A: GND

Page 14: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 1: PWM Signal Generation with Express VI

FPGA Tutorial

Motor Control with PWM Signal

TPWM = 1/PWM Frequency (Hz)

Duty Cycle = Ts/TPWM

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

Ts(ms) Live Demo: RT_Main.vi

Page 15: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 1: PWM Signal Generation with Express VI

FPGA Tutorial

Motor Control with PWM Signal

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 16: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 1: PWM Signal Generation with Express VI

FPGA Tutorial

Motor Control with PWM Signal

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 17: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 1: PWM Signal Generation with Express VI

FPGA Tutorial

Motor Control with PWM Signal

Live Demo: RT_Main2.vi

Page 18: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 1: PWM Signal Generation with Express VI

FPGA Tutorial

Motor Control with PWM Signal

Duty Cycle

Stopped Max Forward

Max Reverse

+1000-100

nd (%)

0.44

0.60

0.76

0.62

0.58

A+

B+

A-B-

Taking into account motor friction (Dead Zone)!

nd > 0

nd < 0

nd = 0

Page 19: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 1: PWM Signal Generation with Express VI

FPGA Tutorial

Motor Control with PWM Signal

Taking into account motor friction (Dead Zone)!

Live Demo: RT_Main3.vi

Page 20: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 1: PWM Signal Generation with Express VI

FPGA Tutorial

Motor Control with PWM Signal

myRIO – T200 Thruster Interconnection Diagram

Page 21: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 2: PWM Signal Generation with FPGA

FPGA Tutorial

Motor Control with PWM Signal

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)

Page 22: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 2: PWM Signal Generation with FPGA

FPGA Tutorial

Motor Control with PWM Signal

Page 23: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 2: PWM Signal Generation with FPGA

FPGA Tutorial

Motor Control with PWM Signal

Page 24: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 2: PWM Signal Generation with FPGA

FPGA Tutorial

Motor Control with PWM Signal

Page 25: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Solution 2: PWM Signal Generation with FPGA

FPGA Tutorial

Motor Control with PWM Signal

Page 26: Thruster Control using LabVIEW Real-Time & FPGA Graphical ... · University of Limerick. Mobile & Marine Robotics Outline Introduction 15:00 –15:30 (30 min) RT&FPGA Tutorial: Motor

Mobile & Marine Robotics

Next Steps

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

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

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