Autonomous Robotic Boat Platform
Team: Ryan Burke, Leah Cramer, Noah Dupes, & Darren McDannald
November 20th, 2014
Advisors: Mr. Nick Schmidt, Dr. José Sánchez, & Dr. Gary Dempsey
Department of Electrical and
Computer Engineering
1
Presentation Outline
• Background– Objective– Block Diagram– Division of Labor
• L. Cramer– Circle Detection
• R. Burke– GPS/Compass/MCU Interfacing
• D. McDannald– Central Processing and Remote Control
• N. Dupes– Motor Control
2
Presentation Outline
3
• Background– Objective– Block Diagram– Division of Labor
• L. Cramer– Circle Detection
• R. Burke– GPS/Compass/MCU Interfacing
• D. McDannald– Central Processing and Remote Control
• N. Dupes– Motor Control
Objective
• Design and build an autonomous boat platform– Versatile
– Robust
• 8th annual RoboBoat competition
(Virginia Beach, VA)
• Competition time frame: June – July
4Images taken from [1].
Catamaran Boat Design
5Image taken from [1].
6
Division of Labor
7
Task Person(s) Assigned to Task
Central Processing Darren
Image Processing Leah, Noah
GPS/Compass Interfacing Ryan
Motor Control Noah, Ryan
Remote Control Darren
Presentation Outline
8
• Background– Objective– Block Diagram– Division of Labor
• L. Cramer– Circle Detection
• R. Burke– GPS/Compass/MCU Interfacing
• D. McDannald– Central Processing and Remote Control
• N. Dupes– Motor Control
9
C++
Images taken from [2], [3], [4].
10
Competition Snapshots
Images taken from [1].
Circle Detection
11
Simple Background Test Image Complex Background Test Image
Impact of Color Space on Hough Transform
12
XYZ Colorspace RGB Colorspace L*a*b Colorspace
Impact of Edge Detection on Hough Transform
Original Image
13
Results of Canny edge detection and Hough Transform
Impact of Edge Detection on Hough Transform
Results of Sobel edge detection and Hough Transform
14
Impact of Gaussian Filtering on Hough Transform
Results of Sobel edge detection and Hough Transform
16
Circle Detection with OpenCV
Original Image
Processed Image
Experimental OpenCV Results
17
Circle detection results using OpenCV.
Project Task Progress
18
Gantt Chart
Presentation Outline
19
• Background– Objective– Block Diagram– Division of Labor
• L. Cramer– Circle Detection
• R. Burke– GPS/Compass/MCU Interfacing
• D. McDannald– Central Processing and Remote Control
• N. Dupes– Motor Control
Gantt Chart Revisions
20
GPS/Compass Unit Block Diagram
21
Processor Interface
22
RS-232 Serial CommunicationFrame format & baud rate:
• 8 data bits
• No parity bit
• 1 stop bit
• 9600 baud
Serial message received after transmitting “a”
23
Compass/Processor Interface
24
Compass Data Collection
Compass readings:
• Values 0 – 3600
• Represent 0.0° – 360.0°
Serial stream containing compass bearings
25
Preliminary GPS Interface
26
Raw GPS Output
GPS readings:
• Six serial data packets
• Transmission every second
• Transmission at 9600 baud
Serial stream directly from GPS sensor
27
Verification of GPS Data
28
GPS/Processor Interface
29
Initialized GPS Output
Initialized GPS readings:
• Single data packet
• 10 Hz transmission
• 115.2 kbaud
Serial stream containing GLL (Geographic Latitude and Longitude) data
30
Compass/GPS/Processor Interface
31
Parsed GPS Data
Parsed NMEA sentence:
• Extracted longitude & latitude data
– Degrees (±)
– Minutes
– Decimal minutes
Serial stream containing GLL and parsed longitude and latitude data
32
Final GPS/Compass Unit Output
Processor message:
• Longitude
• Latitude
• Bearing
Baud Rate:
• 115.2 kbaud
33
Serial stream containing bearing and parsed longitude and latitude data
Progress
34
Presentation Outline
35
• Background– Objective– Block Diagram– Division of Labor
• L. Cramer– Circle Detection
• R. Burke– GPS/Compass/µC Interfacing
• D. McDannald– Central Processing and Remote Control
• N. Dupes– Motor Control
Schedule changes
Proposed Gantt Chart
Changes to the Gantt Chart
36
RC Subsystem Block Diagram
37
Futaba T6EX and the R617FS
• 2 joy sticks
• 2 switches
• 2.4 Ghz
38Image taken from [5,6].
How the Remote Works
• X and Y potentiometer for each joystick
• Each potentiometer maps to a channels 1 – 4 respectively
• Two switches maps to channel
5 – 6
39Image taken from [7].
Design Approach
• Measure pulse widths using a MCU
• Decide if you send data from the central processor or the RC unit
• Convert pulse widths into motor commands
Output of the RC Receiver Channels 1-4
2.5 ms/devV
olt
age
40
Time calculation
• Fclk_I/0 = 16 Mhz
• N = 256
• Top = 249
• 4 ms to overflow
• Each time step is 16 µs
41
Results
• For the joysticks the neutral position
• Switch 1 is in the on position
• Min = 63 (1 ms)
• Neutral = 94 (1.5 ms)
• Max = 125 (2 ms)
Channels 1 – 4 are the 2 joysticks channel 5 is the kill switch
42
Deciding on an OS for the Central Processor
• Ubuntu 14.04 release
• Open-Source
• ROS support
43Image taken from [8].
Serial Communication Between the Central Processor and Various Subsystems
• A C++ class to access a subsystem
• Sets attributes and have multiple instances of each connection
• Able to request and receive data
44Image taken from [9].
Camera Driver and Installation of OpenCV on Our Linux Machine
• Installed Camera under the UVC driver
• Ubuntu has a script to install OpenCV
45Image taken from [2,4].
Completion of Tasks
46
Presentation Outline
47
• Background– Objective– Block Diagram– Division of Labor
• L. Cramer– Circle Detection
• R. Burke– GPS/Compass/µC Interfacing
• D. McDannald– Central Processing and Remote Control
• N. Dupes– Motor Control
Motor Configuration Selection
• Diamond configuration
– Consists of four motors
– Allows for strafing
– Allows for 360 rotation
Diamond configuration on a catamaran platform
48
Thruster Selection-T100
• Created by Blue Robotics
• Brushless DC (BLDC)
• Sensorless
• Provides 2.36 kgf ( 5.2 lbf )
of forward thrust
• 11.5 A max current
• Weighs 295 g ( 0.65 lbs )
• Costs $110 (budget of $1500) T100 Thruster Size Comparison
49Image taken from [11].
Brushless Motors
• Utilize a three phase configuration
Figure 1: Y-configuration of a three phase motor
Figure 2: Three phase digital commutation
50Images taken from [12], [13].
Transistor Configuration For Three Phase Drive
Three phase drive circuit consisting of six transistors, six flyback diodes, and a y-configuration three phase motor
51Image taken from [14].
Power Consumption Of Transistors
Type MOSFET BJT IGBT
Power consumption calculation
𝐼𝐷2 × 𝑅𝐷𝑆 𝑉𝐶𝐸(𝑆𝑎𝑡) × 𝐼𝐶 + 𝑉𝐵𝐸(𝑆𝑎𝑡) × 𝐼𝐵 𝑉𝐶𝐸(𝑆𝑎𝑡) × 𝐼𝐶
Typical values 𝑅𝐷𝑆 = 10 𝑚Ω 𝑉𝐶𝐸(𝑠𝑎𝑡) = 2 𝑉
𝑉𝐵𝐸(𝑠𝑎𝑡) = 1.3 𝑉
𝐻𝑓𝑒 = 10
𝑉𝐶𝐸(𝑆𝑎𝑡) = 1.8 𝑉
Power consumption of a 11.5 A drive using typical transistor values
11.52 𝐴 × 10 𝑚Ω=
1.15 𝑊
2 𝑉 × 11.5 𝐴 + 1.3 𝑉 × 1.15 𝐴=
24.5 𝑊
1.8 𝑉 × 11.5 𝐴=
20.7 𝑊
52
Selection of a Three Phase Commutation Driver
• Pre-driver
• Sensorless
• Input complexity
• Output characteristics
53Image taken from [15].
Selection of the A4960 by Allegro
The Allegro pre-driver A4960 motor controller attached to a six FET BLDC motor drive configuration. Image obtained from
54Image taken from [15].
Selection of the A4960 by Allegro
The Allegro pre-driver A4960 motor controller with MCU input
55Image taken from [15].
Selection of the A4960 by Allegro
The Allegro pre-driver A4960 motor controller with MCU input
56Image taken from [15].
Latest Progression of Gantt
57
Autonomous Robotic Boat Platform
Team: Ryan Burke, Leah Cramer, Noah Dupes, & Darren McDannald
November 20th, 2014
Advisors: Mr. Nick Schmidt, Dr. José Sánchez, & Dr. Gary Dempsey
Department of Electrical and
Computer Engineering
58
APPENDIX
59
60
[source: wikipedia]http://en.wikipedia.org/wiki/Hough_transform
𝑦 = −𝑐𝑜𝑠𝜃
𝑠𝑖𝑛𝜃𝑥 +
𝑟
𝑠𝑖𝑛𝜃
𝑟 = 𝑥𝑐𝑜𝑠𝜃 + 𝑦𝑠𝑖𝑛𝜃
61
[source: wikipedia]http://en.wikipedia.org/wiki/Hough_transform
62
[source: wikipedia]http://en.wikipedia.org/wiki/Hough_transform
63
𝑥 = 𝑎 + 𝑟𝑐𝑜𝑠𝜃
𝑦 = 𝑏 + 𝑟𝑠𝑖𝑛𝜃
64
65
21HT Hough Transform Method• Reduces the amount of memory required.• Uses edge direction • Two step process1.) The center of any given circle is the intersection point of all the normal lines from the circle edge. A 2-dimensional array is used to record the "votes" along the normal line of each detected edge point.2.) "To identify the radius of circles, the distance of each point from a candidate center is calculated and a radius histogram is produced."
PROS: This method is low on storage space. Only a 2-d array is used and a 1-d histogram.CONS: If the radius threshold is very low (i.e. The 21HT is being used to detect very small circles) there is a risk of many false peaks occurring in step 1. This can increase the amount of computational work necessary in step 2.
Gaussian Filtering
66
𝐺 𝑥, 𝑦 =1
2𝜋𝜎2𝑒−𝑥2+𝑦2
2𝜎2
67
OpenCV Results using:• RGB Colorspace• Gaussian Filtering• Canny Edge Detection• Hough Transform
GPS/Compass Unit Block Diagram
68
GPS/Compass Unit Flow Chart
69
Software flowchartMain ISR(INT0) ISR(INT1) ISR(PCINT)
IDX > 5Mode
Kill Switch
Decode pulse
widths
Encode Motor
Commands
Output Data
Read Data From
Central Processor
Index = 0
Record time
State
Record time
Record Time
Calculate Pulse Width
Index++
Record Time
70
Analysis Approach
• I started by looking at P.W.M. signals
• Decided on how to measure them
• Compared measured to actual
71
Image Processing-Rectangle Detection
• Purpose of Research and Testing: Determine How to Detect Polygons Contained within an Image
• Research– OpenCV Utilizes Contours For Detection Of Polygons
• Contours: Outline or Enclosed Border of a Shape or Form
• The Contour Detection Algorithm Used By OpenCV:
Topological Structural Analysis of Digitized Binary Images by Border Following by Satoshi Suzuki and Keiichi Abe[]
• MATLAB Testing– Imcontour() Implementation
– Contour Algorithm Testing72
MATLAB Imcontour()-Original Image
Image obtained from[16]73
MATLAB Imcontour()-Contour Detection
100 200 300 400 500 600 700 800 900
150
200
250
300
350
400
450
500
550
600
74
H-Bridges
• Purpose of Research and Testing:
Understand the Benefits and Drawbacks of Using H-Bridges
• Features
– Bi-Directional Motor Control
– Four Transistor Configuration
– Provides Dynamic Breaking Capabilities
– Allows For Current Sensing
75
H-Bridge Testing
• L298 H-Bridge
– Contains Two Internal H-Bridge Configurations
– Two Enable Signals
– Allows for a 150w motor(50v, 3A Max Rating)
• Fly Back Diode: 1N4004
• Motor
– 12V
– >2A While In Air
76
L298 H-Bridge Internal Configuration
Image obtained from[17]77
H-Bridge Free Running Motor Stop
78
H-Bridge Dynamic Motor Stop
79
H-Bridge Conclusion
• Benefits:– Simple Configuration
– Easily Controllable
– Provides Bi-Directional Control
• Drawbacks:– Large Power Dissipation
• The Internal BJT Configuration Has Constant Power Dissipation
– Limits Design
80
Choosing A Transistor Type
• There Are Two Primary Transistor Types: MOSFET and BJT
MOSFET BJT
Output Is Controlled By Gate Voltage Output Is Controlled By Base Current
Positive Temperature Coefficients Negative Temperature Coefficients
Power Dissipation Depends On Internal Resistance
Power Dissipation Depends Terminal Voltage Differentials
High Gate Capacitance Low Gate Capacitance
Higher Switching Frequencies Lower Switching Frequencies
81
Choosing A MOSFET
• IPP040N06N – RDS max=4 mΩ
– VDS max=60 V
– ID max= 80 A
– QG max= 44nC
• IPP060N06N – RDS max=6 mΩ
– VDS max=60 V
– ID max= 40 A
– QG max= 32nC
• IRLB8721PbF– RDS max=8.7 mΩ
– VDS max=30 V
– ID max= 44 A
– QG max= 13nC
• IRLB8748PbF * *– RDS max=4.8 mΩ
– VDS max=30 V
– ID max= 44 A
– QG max= 23nC
* * Indicates the current choice for the MOSFET configuration 82
PWM Driven Transistor Configuration
• Purpose of Research and Testing :
Design a Transistor Switch Configuration Driven by a Microcontroller Generated PWM Controlled by an Analog Input.
83
Block Diagram For System
MCU Load
Power
Joystick PWM On/OffTransistor
Configuration
84
Design And Testing
• IRF520
– VDS Max = 100V
– RDS(ON) Max = 0.27 Ω
– Max Gate Charge = 16 nC
• Atmega168 Microcontroller• Minimum Pin Output Voltage = 4.2V
• Maximum Pin Output Current = 40mA
• 2N2222A• Hfe(Gain) = 75
• Max VCE(Sat) = 1.6V
• Max VBE(Sat) = 2.6V
Output Characteristics of the IRF520 obtained from[18]
85
Observations of the Gate Input for the IRF520
Gate input with Rc equal to 1.2KΩ Gate input with Rc equal to 10KΩ Gate input with Rc equal to 100KΩ
86
A4960 Specs
• Absolute Ratings
– Max Load Supply Voltage: 50 V
– Max Logic Supply Voltage: 6 V
– Max Sink Current: 150 mA
– Max Gate Output Turn on/off: 20 ns
– Max System Clock Period: 57 ns (17.5 MHz)
– Minimum Input Pulse Filter Time: 500 us (2 KHz)
87
Three Phase Back EMF Output
Image obtained from [15]88
IRF520 Circuit Configuration
Circuit 1:Motor Drive IRF520 Configuration
Circuit 2:IRF520 Test Configuration
89
Circuit Design for the Transistor Switch Configuration
90
References
[1] AUVSI Foundation. (2014). RoboBoat – Foundation [Online]. Available: http://www.auvsifoundation.org/foundation/competitions/roboboat/
[2] Amazon. (2014). HP Deluxe Webcam [Online]. Available: http://www.amazon.com/HP-KQ246AA-8-0-Deluxe-Webcam/dp/B001D8AGA2
[3] Comtrade Computers. (2014). CPU Intel i3 [Online]. Available: http://www.comtrade-ks.com/product.php?product_id=7591/
[4] Wikimedia. (2014). OpenCV logo with text [Online]. Available: http://commons.wikimedia.org/wiki/File:OpenCV_Logo_with_text_svg_version.svg
[5]RC Radical. (2012) Fubata T6EX 2,4 GHZ [Online] Available: http://www.rcradical.com/en/futaba/925-futaba-t6ex-24ghz.html
[6]rctecnic. (2012) Receptor Futaba R617FS 7 canales 2.4GHz FASST [Online] Available: http://www.rctecnic.com/receptores/2905-receptor-futaba-r617fs-7-canales-24ghz-fasst.html
[7]Berkley. (2014) ME102 Lab 4: RC Servo [Online] Available: http://www.me.berkeley.edu/ME102B/lab4.html
[8]JcoPro. (2014) Ubuntu logo [Online] Available: http://www.jcopro.net/2011/12/19/crashed-hdd-disk-ubuntu-to-the-rescue-day3-first-impressions/ubuntu-logo1/
[9]Honmann Designs.(2014) DB9 Female to Male Serial Cable [Online] Available: http://www.homanndesigns.com/store/index.php?main_page=product_info&cPath=11&products_id=26
91
References cont.
[10] Blue Robotics. (2014). T100 Thruster [Online]. Available: http://www.bluerobotics.com/store/thrusters/t100-thruster/
[11] Global Spec. (2011). Synchronous Motor Grounding [Online]. Available: http://cr4.globalspec.com/thread/67306
[12] Embedded. (2008). Designing a MCU-driver permanent magnet BLDC motor controller: Part 1 [Online]. Available: http://www.embedded.com/print/4007628
[13] Analog Dialogue. (2008). High Current Sensing [Online]. Available: http://www.analog.com/library/analogdialogue/archives/42-01/high_side_current_sensing.html
[14] Allegro MicroSystems. (2014). A4933: Automotive 3-Phase MOSFET Driver [Online]. Available: http://www.allegromicro.com/en/Products/Motor-Driver-And-Interface-ICs/Brushless-DC-Motor-Drivers/A4933.aspx
[15] St. Cyprain’s Greek Orthodox Primary Academy. (2014). 29.9.14 [Online]. Available:
http://www.stcypriansprimaryacademy.co.uk/29-9-14/
[16] SparkFun Electronics. (2014). Dual Full-Bridge Driver [Online]. Available: https://www.sparkfun.com/datasheets/Robotics/L298_H_Bridge.pdf
[17] Vishay. (2011). IRF520 Power MOSFET [Online]. Available: http://www.vishay.com/docs/91017/91017.pdf
92