Title: Quad-Copter
1Quad-Copter
David Malgoza Engers F Davance Mercedes
Stephen Smith Joshua West
2Project Description
- Design a flying robot
- Robot must be able to
- Autonomously Fly
- Communicate Wirelessly
- Wireless Manual Control
3Project Motivation
- The Big Question, WHY?
- Wanted to design an aerial vehicle with
autonomous features - Wanted to do a project with fair amount of
hardware and software - Most of all wanted to do something cool and fun!
4Project Overview
- To do this we must
- Design and code a control system for the
Quad-Copter (move up, take-off, etc) - Design and code a sensor fusion algorithm for
keeping the copter stable - Design and build a power distribution system
- Design and build a chassis
5Goals/Objectives
- FLY
- The Quad-copter must be able to remain stable and
balance itself. - The copter must be able to rise and descend
- The copter must be able to signal when power is
running low (audible and visual)
6Specifications/Requirements
- Lift at least 2 kg of mass
- Must be able to hover at least 6 inches from the
ground - The Quad-Copter must communicate wirelessly at
least 100m - The Quad-Copter must be able flight for a minimum
of 5 minutes (battery power)
7Quad-Copter Concept
8Frame
9Frame
- Goals
- Create a lightweight chassis for the Quad-Copter
- The chassis must support all batteries, external
sensors, motors, and the main board - Cost Effective
- Requirements
- Create a chassis with a mass of 800g or less
- The area the Quad-Copter cannot exceed a radius
of 18in. - Must be able to support at least a 1.2kg load
10Materials Comparison
- There were 2 lightweight materials we considered
for the chassis Aluminum and Carbon Fiber - Both have capabilities of being entirely used as
a chassis and meet the maximum mass requirements
Carbon Fiber Aluminum
Advantages Excellent Strength and Stiffness. Durable. Easily Replaceable. Less Costly.
Disadvantages Can chip or shatter. More costly. Can easily bend or dent.
11Design of Frame
- 2 aluminum square plates will be used as the main
structural support - 4 rods will be screwed to the top square plate at
and secured at the corners - Below the plate, two additional aluminum rods
will be used to support the battery. Landing gear
will be shaped as standard helicopter legs. - 4 coat hangers will be used as landing gear.
12Diagram of Frame
13Motors/ESC
14Motors
- Goals
- To use lightweight motors for flight
- The motors must be cost effective
- Requirements
- Use motors with a total mass of 300g
- Each motor must be able to go above 2700 rpm
- Each motor is to be controlled via PWM signal
from the processor
15Brushless Motor
- Advantages
- Less friction on the rotor
- Typically faster RPM.
- PWM or I2C controlled by an electronic speed
control (ESC) module. - Disadvantages
- Require more power.
- Sensorless motors are the standard
- Typically more expensive
16TowerPro 2410-09Y BLDC
- Minimum required voltage 10.5V
- Continuous Current 8.4A
- Maximum Burst Current 13.8A
- Mass 55g
- Speed/Voltage Constant 840 rpm/V
- Sensorless ESC required for operation.
17Sensorless ESC
- The ESC translates a PWM signal from the
microprocessor into a three-phase signal,
otherwise known as an inverter. - Based on a duty cycle between 10 and 20, the
ESC will have operation. - Based on the requirements given by the
manufacturer, the PWM frequency will be 50Hz.
18Power Supply System
19Power
- Goals and Objectives
- The ability to efficiently and safely deliver
power to all of the components of the quadcopter - Requirements
- The total mass of the batteries should be no more
than 500g - A total of 3 low-power regulators are to be used
- Must be able to sustain flight for at least 1
minute
20Power Distribution
9V Battery
Digital Compass
LM7805
GPS
Main Processor
LD1117V33
Wireless Processor
Transceiver
11.1V LiPo
Motor
LM317
Ultrasonic
Motor
Ultrasonic
Motor
Gyroscope
Accel.
Motor
21LiPo Battery
- Specifications on the EM-35
- Rated at 11.1V
- Charge Capacity 2200mAH
- Continuous Discharge 35C, which delivers 77A,
typically. - Mass 195g
22Logic Converter
- Allows for step-up and step-down in voltage when
data travels between a lower referenced voltage
signal to a higher referenced voltage signal. - This will be used to communicate the GPS and the
wireless communication system with the main
processor
Source http//www.sparkfun.com/commerce/product_info.php?products_id8745
23Sensors
24Sensor Subsystems/Functions
- Flight stability sensors
- Monitor, correct tilt
- Direction/Yaw sensor
- Maintain stable heading, establish flight path
- Proximity sensors (future application)
- Detect obstacles, ground at low altitude
- Navigation/Location sensor (future application)
- Monitor position, establish flight path
- Minimize cost and weight for all choices
25Flight Stability Sensors
- Goals/Objectives
- A sensor system is needed to detect/correct the
roll and pitch of the quad-copter, to maintain
a steady hover. - Specifications/Requirements
- Operational range 3.0 3.3 V supply
- Weigh less than 25 grams
- Operate at a minimum rate of 10 Hz
26Flight Stability Sensors
- Options (one or more)
- Infrared horizon sensing
- Expensive, unpractical, interesting
- Magnetometer (3-axis)
- Better for heading than tilt, little expensive
- Accelerometer
- Measures g-force, magnitude and direction
- Gyroscope
- Measure angular rotation about axes
27Flight Stability Sensors
- IMU (Inertial Measurement Unit)
- Combination of accelerometer and gyroscope
- ADXL335 - triple axis accelerometer (X, Y, Z)
- Analog Devices
- IDG500 dual axis gyroscope (X and Y)
- InvenSense
- 5 DoF (Degrees of Freedom) IMU
- Sensor fusion algorithm
- Combines sensor outputs into weighted average
- More accurate than 1 type of sensor
28IMU Hardware
- ADXL335 - triple axis accelerometer
- /- 3 g range adequate
- 50 Hz bandwidth adequate, adjustable
- 1.8 3.6 V supply
- Analog output
- IDG500 dual axis gyroscope
- Measures /- 500 º/s angular rate
- 2 mV/deg/s sensitivity
- 2.7 3.3 V supply
- Analog output
29ADXL335 PCB Layout
- Surface mount soldered to main PCB
- 3.3 V supply filtered by .1µf cap
- .1µf caps at C2, C3, C4 that filter gt 50Hz
- X, Y, Z outputs to MCU A/D converters
- S1 self test switch
30IDG500 Board Layout
- Soldered to main PCB
- 3.0V supply
- X Y gyro outputs with low pass filter, to A/D
- C5-C6 for internal regulation
31IMU Code
- Get sensor data from ADCs
- accelROLL convertADC(4)
- accelPITCH convertADC(5)
- accelYAW convertADC(6)
- gyroROLL convertADC(0)
- gyroPITCH convertADC(1)
- Find adjustments for each axis (accelerometer)
- Motor_Adj_Y PID(Y, anglePITCH, 504, G_dt)
- Motor_Adj_X PID(X, angleROLL, 502, G_dt)
32IMU Code
- Find an adjustment based on the magnitude and
direction of the gyro data that is used to dampen
movement/ inertia about the axes - Gy_Adj gyroPITCH - 418
- Gx_Adj gyroROLL - 417
- Gy_Adj Gy_Adj / gyro_divisorY // 3
- Gx_Adj Gx_Adj / gyro_divisorX // 3
33IMU Code
- Gy_Adj effectively dampens oscillations of the P
term of the PID loop by acting in opposition to
it - MOTOR_R (int)limitRange((hover_speed idkno2
yawAdj - Motor_Adj_Y - Gy_Adj),560,800)
34Direction sensor (Compass)
- Goals/Objectives
- Establish an external reference to direction
- For maintaining a stable heading, turning,
- The module should not suffer from excessive
magnetic interference (compass) - The module should be placed away from interfering
fields and metals (compass) - Specifications/Requirements
- Accurate to within 3 degrees
35HMC6352 Compass Module
- 3.3 V supply
- I 2Cserial interface
- .5 degree resolution
- 1 to 20 Hz adjustable update rate advertised but,
higher update rate difficult to encode with
current hardware layout.
36HMC6352 Compass Module
- In coding the I2C interface for the HMC6352, a
data update rate of only 2 Hz. was achieved - As a result, the Yaw_PID function produced a
loose heading. - This limitation was addressed by adding a
dampening term (to the P term).
37HMC6352 Code
- Yaw PID function using compass
- float YAW_PID(struct PID_Data PID_Status, float
value, float desiredValue, float yaw_dt) -
- float error, temp, dTerm, yaw_temp 0.0
- yaw_temp desiredValue - value
- if (yaw_temp lt -1800)
-
- yaw_temp 3600
- error yaw_temp
-
38HMC6352 Code
- Yaw_PID (cont)
- else if (yaw_temp gt 1800)
- yaw_temp - 3600
- error yaw_temp
- else
- error yaw_temp
- dTerm PID_Status-gtD((PID_Status-gt
lastError - error)) - temp (PID_Status-gtPerror dTerm)
- PID_Status-gtlastError error
- return temp
-
-
39Proximity Sensors (future application)
- Bottom and forward sonar application using the
MaxbotixLV-EZ2 ultrasonic sensor - Detect the ground at 1-15 feet
- Obstacles 30 arc forward 1- 8 feet
- 6 inches resolution
40GPS - future application
- Goals/Objectives
- Needed for autonomous flight mode
- The system could establish an external reference
to position (latitude and longitude) - The system would have a serial output
- Should be compact, requiring minimal external
support (internal antenna) - Requirements/Specifications
- The system would need to be accurate to within 3
meters (latitude and longitude). - The update rate should be at least 1Hz.
41Microcontroller
42Goals/Objectives
- Able to produce PWM signal
- Send/Receive UART signals
- Hardware ADCs not just comparators
- I2C capability
Specifications/Requirements
- 16-bit timers with 4 output compare registers
- 2 UART ports
- 8 ADC ports (minimum 10-bit accuracy)
43ATmega2560 Specs
- 0 16Mhz _at_ 4.5 5.5 volts
- 256 KB Flash memory
- 4 KB RAM
- 4 16-bit timers
- 16 10-bit ADC
- 4 UART
- TWI (I2C)
44Microcontroller Information
- The main MCU will be programmed through the SPI
pins using the AVRISP-MKII. - AVRStudio 4.18 is the IDE that will be used for
development - The main MCU will be responsible for the
obtaining sensor data, updating the control
system, and talking to the wireless communication
unit
45Code
46Code Linear Control System
- struct PID_Data
- float P
- float I
- float D
- float lastError
- float integratedError
-
- void initPID(struct PID_Data PID_Status, float
kp, float ki, float kd) - float PID(struct PID_Data PID_Status, float
value, float desiredValue, float dt) - In addition to this the gyro is used to slow down
the momentum of the Quad-Copter.
47PID Loop
- error desiredValue - value
- PID_Status-gtintegratedError errordt
- dTerm PID_Status-gtD((error)/dt)
- (PID_Status-gtPerror PID_Status-gtIPID_Status-gti
ntegratedError dTerm)
48Testing the PID
- Trail and error
- The Ziegler-Nichols method
- Center of gravity
- The testing procedure is as follow
- Isolate an axis
- Increase P gain until oscillation occur
- Increase D gain until it dampens the oscillation
- Increase the effect of the gyro to slow the speed
of rotation - Increase I just enough so that it corrects steady
errors slowly.
49PID Controller Constants
Kp Ki Kd
X-Axis 1.809 0.0699 -0.0409
Y-Axis 1.809 0.1099 -0.0429
Yaw 0.1 0 0
50Code Motor Control
- A PWM signal will be produced by the MCU to
control the motors - Once the PWM signal is setup, they run
independent of the MCU - Functions
- initPWM( )
- updateMotor()
51Code Analog Sensors
- The ADC will be used to retrieve data from the
sensors. - A switch statement will be used to gather data
correctly - Functions
- initADC ( )
- convertADC(uint8_t value)
52Code Digital Sensors
- I2C will be used to retrieve data from the
compass - MCU master
- Compass slave
- Functions
- initI2C( )
- ISR(TWI_vect)
53Code Communication
- UART is going to be used to retrieve data from
GPS module and send/receive data from the
wireless communication module - Functions
- UART_Setup( )
- ISR(USART0_RX_vect)
- ISR(USART0_TX_vect)
- ISR(USART2_RX_vect)
- ISR(USART2_TX_vect)
54Code C GUI
- C will be used for coding the GUI
- Standard Libraries for serial port communication
- Easy to learn
- Function of GUI
- Retrieve sensor data and display to user
55Code Overview
Compass
I2C
Wireless Comm
UART
IMU
PWM
56Wireless Communication
57Requirements
- Work on the 2.4 GHz band.
- Data rate of minimum 56 Kbs.
- To have a range of 100 meters.
- To cost less than 70.
58Xbee Module
- The Xbee module is a Zigbee compatible device.
- Zigbee meets all the requirements of the wireless
communication. - Xbee will be used to control and get status
messages from the Quad-Copter. - Xbee modules can be setup as end device or
coordinator.
59Xbee Setup
- PANID This is the ID of the network
- MY Is the 16 bit address of the source device
- DL Is the 16 bit address of the destination
device. - A1 Register that controls who the end device can
talk to. - A2 Register that controls how the Coordinator
manages the network.
60Xbee A1 Register
- A1 has three bits that decide how the end device
connects to a network - bit0 if set it will allow the end device to join
any network - bit1 if set it the end device will allow the
channel to be change by a coordinator - bit2 if set the end device will try to auto
associate.
61Xbee A2 register
- A2 has three bits that decide how the coordinator
manages a network - bit0 if set it will allow the coordinator to
look for a free PANID - bit1 if set it will allow a coordinator to
change the end devices channel - bit2 if set the coordinator will allow end
devices to associate to it.
62PCB Hardware Layout
63Requirements
- Must be able to mount the MCU, the wireless
system, and the IMU components - For easy plug-and-play, the level logic
converters are to be mounted for all UART
connections - Power distribution for the digital section of the
board is to be distributed using a star design - IMU components must be relative central to the
Quad-Copter for the most accurate readings - Male header pins are to be used for connecting to
all external components - Due to time and cost, through-hole parts are
preferred for all passive components
64Main Board - Initial
65Modifications
- Design flaws in the schematic for the level logic
converters created a setback in implementing UART
devices were fixed. - All voltage regulators are connected to the main
power lines to prevent voltage dropout effects - All regulators were exchanged to TO-220 packaging
- Xbee module is mounted.
66Main board - Final
67Project Management
68Project Distribution
Subsystem Responsible
Main Software Josh
Linear Control System Engers
Frame All
Motors David
Power Supply David
Microcontroller Josh
Sensors Steve
Wireless Communication Engers
Video System Steve
PBC Board All
Autonomous Algorithm All
69Project Finance
- Goal was to be under 700
- Unfortunately the group did not meet this goal.
- Estimated spent 1500.00
- Reason Underestimated the amount of parts that
would need to be replaced and shipping costs
70Problems
- I2C not working on main board
- Fix Use another MCU that it was tested with
71Problems
- Accelerometer is susceptible to vibration noise
- The vibration from the motors induces oscillation
on the accelerometer. - Fix Use a software low-pass filter
- y(nT) y(nT T)
- (dt/(dt RC))(x(nT)-y(nt-T)
72Problems
- Sensor fusion algorithms not working.
- Starlinos sensor fusion algorithm would get
stuck on a angle. - Kalman filter would get stuck on a angle.
- Fix Instead of using a combination of
accelerometer and gyro to get a better estimate
of position, we used the accelerometer value and
passed it through a low pass filter.
73Problems
- Grounding on our first PCB was problematic.
- Fix Designed a new PCB with wider ground traces
74- Questions, Comments, Concerns?