Stanford APM:Plane Overview
description
Transcript of Stanford APM:Plane Overview
![Page 1: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/1.jpg)
1
Stanford APM:Plane Overview
Trent LukaczykApril 7, 2014
AA241X – UAV Design and Build
![Page 2: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/2.jpg)
2
The Problem
Fly AutonomouslyAirframe Construction
State EstimationAlgorithm Processing
Control ActuationGround Monitoring
![Page 3: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/3.jpg)
3
The Components
• Autopilot Unit• Wireless Telemetry• Remote Control Radio• GPS Radio• Compass Magnetometer• Airspeed Sensor • Battery Monitor• Servos, ESC, Motor
![Page 4: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/4.jpg)
4
Autopilot Unit
• Auto Pilot Module (APM) • ArduPilot Mega (APM) 2.6• Based on Arduino • 16MHz Atmega2560 processor• 16 MB dataflash memory
~ 2hours of logging (download often)
• Needs: to point forward to be securely attached accelerometer calibration if relocated
![Page 5: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/5.jpg)
5
Wireless Telemetry
• Wireless Telemetry• 915 MHz, 100mW• Shares a “NetID”• “MAVLink Protocol”
![Page 6: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/6.jpg)
6
Wireless Telemetry
USB Micro B
USB A
DF13 6-Pin
DF13 5-Pin
![Page 7: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/7.jpg)
7
DF13 Connectors
• Pain and a Half to use• Easy to break• But small, reconfigurable• Be careful when
disconnecting!
Can shave these hooks off with a knife
Can add hot glue at the wire-connector joint.
Do not use super glue here.
Lift this lip gently with a screwdriver
![Page 8: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/8.jpg)
8
Radio Control Setup
• RC Transmitter, 2.4 GHz• “Binds” with Receiver– Always carry the bind plug
• Four axes + mode switch• Turn on first, before plane
Autopilot Mode Switch
![Page 9: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/9.jpg)
9
Radio Control
3pin Servo Wires x5
![Page 10: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/10.jpg)
10
Radio Control Setup
Autopilot Mode Switch
The order of these vary with receiver
![Page 11: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/11.jpg)
11
Servo Wires
Mixing up signal and ground can fry electronics
Look for markings like this -
![Page 12: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/12.jpg)
12
GPS + Compass
• 1.57 GHz GPS radio– 5Hz position update– Needs clear sight of sky
• Magnetometer– Provides heading estimate– Needs to be clear of
high-current electronics– Needs: to point forward calibration if relocated
![Page 13: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/13.jpg)
13
DF13 6pinGPS DF13 5pin
DF13 4pinMAG DF13 4pin
Remember to point GPS and APM forward
![Page 14: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/14.jpg)
14
Airspeed Sensor
• Pitot tube measures difference in “Static” and “Total” pressure, which is related to airspeed.
• Airspeed is relative to wind – will be higher or lower if you
travel against or with the wind
![Page 15: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/15.jpg)
15
Airspeed SensorSilcone Tubing
3pin Servo Wire
A1
![Page 16: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/16.jpg)
16
Power Module
• Records current and voltage from battery • Integrate for energy usage, and battery level• Powers APM, Receiver, Radios, and Servos
![Page 17: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/17.jpg)
17
Lithium Polymer Batteries
• 3.7 Volts per Cell• Metrics:– N-Cells (2S = 2 Cells = 7.4V)– Capacity (C = 1100 mAh)– Discharge Rate (25C = 27.5A)– Charge Rate (2C = 2.2A)
• Can catch fire or leak during charging– Always be present during charging
• Capacity loss or Bricking if over-discharged – i.e. leaving plugged in over night
![Page 18: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/18.jpg)
18
LiPo Discharge• LiPo’s die suddenly around 3.4Volts/Cell• Be ready to land around 3.5Volt/Cell
traxxas.com
Higher Current
![Page 19: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/19.jpg)
19
Speed Controller
• Rated by Max Current and Max Voltage• Direct Current Power in,
Three-phase Alternating Current out• “Opto” vs “BEC”– BEC can power RC gear, Opto can’t
![Page 20: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/20.jpg)
20
Brushless Outrunner Motor
• “Outrunner” - magnets rotate around stator• Rated by kV = no load rpm/V– High kV = fast rpm, low torque– Low kV = low rpm, high torque
• Too much power melts windings, burns out motor
![Page 21: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/21.jpg)
21
Power Electronics Setup
DC Power
DC Power
3 Phase AC
DF13 6-Pin
![Page 22: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/22.jpg)
22
Carbon Folding Props
• More rigid, more efficient, more expensive (vs plastic props)
• More dangerous – they are spinning knives• Spinner cap lets them fold on landing,
or if motor braking is on (more efficient glide)
![Page 23: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/23.jpg)
23
Servos
• Drive Motor + Rotation Sensor + PID Control board … in 8-grams
• Forcing the control arms by hand wrecks gears
www.twf8.ws
![Page 24: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/24.jpg)
24
Servo Setup
Ailerons
Elevator Rudder
Throttle
Servo Wire “Y”
3pin Servo Wires
![Page 25: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/25.jpg)
25
The Components
• Autopilot Unit• Wireless Telemetry• Remote Control Radio• GPS Radio• Compass Magnetometer• Airspeed Sensor • Battery Monitor• Servos, ESC, Motor
![Page 26: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/26.jpg)
26
The Problem
Fly AutonomouslyAirframe Construction
State EstimationAlgorithm Processing
Control ActuationGround Monitoring
![Page 27: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/27.jpg)
27
Stanford_ArduPlane
• An easy embedded flight control software for Aerospace Engineers, based on ArduPlane
• ArduPlane code without the control law
https://github.com/rbunge/Stanford_ArduPlane
![Page 28: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/28.jpg)
28
Development Tools
• Download and install the ArduPilot Arduino IDE
• Download Libraries and place in the Arduino sketch folder
• Download Stanford ArduPlane
![Page 29: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/29.jpg)
29
Building
• Open \Stanford_ArduPlane\ \Stanford_ArduPlane.ino with Arduino
• Check the board type (Mega 2560) and COM port
• “Verify” = compile• “Upload” = compile and upload to APM
![Page 30: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/30.jpg)
30
The Code
• Editable:– AA241X_ControlLaw.ino– AA241X_ControlLaw.h
• Not Editable:– AA241X_Competition.h– AA241X_aux.ino– AA241X_aux.h– Everything Else…
![Page 31: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/31.jpg)
31
The Code
• State and Control Variables (AA241X_aux.h)– Roll, pitch, yaw angles and rates– Inertial velocity and accelerations– Heading– Airspeed– GPS X-Y positions– GPS and Barometric Altitudes– Battery Consumption– RC Inputs, Servo + Throttle Outputs
![Page 32: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/32.jpg)
32
The Control Loops
• AA241X_ControlLaw.ino– AA241X_AUTO_FastLoop(void){}
Executes @ ~50Hz– AA241X_AUTO_MediumLoop(void){}
Executes @ ~10 Hz– AA241X_AUTO_SlowLoop(void){}
Executes @ ~3.3 Hz• Distribute algorithm to use CPU cycles wisely• Beware of APM Memory limits– 256k Flash Program Memory, 8K SRAM, 4K EEPROM
![Page 33: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/33.jpg)
33
The Camera Function
• AA241X_aux.h
![Page 34: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/34.jpg)
34
Telemetry Plotting
• Two types of logs – Telemetry log– Dataflash log• store at higher log-rates• Download from APM over USB Cable
• Mission Planner can dump matlab data files
![Page 35: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/35.jpg)
35
The Problem
Fly AutonomouslyAirframe Construction
State EstimationAlgorithm Processing
Control ActuationGround Monitoring
![Page 36: Stanford APM:Plane Overview](https://reader035.fdocuments.net/reader035/viewer/2022062410/568163bf550346895dd4e033/html5/thumbnails/36.jpg)
36
Resources
• FliteTest: youtube channel• DIY Drones: forum• RC groups: forum• GrabCAD: community CAD models• 3DRobotics: Store and Manuals• GitHub: Stanford_ArduPlane Code