Slide 1

advertisement
Quad-Copter
Group 3
Fall 2010
David Malgoza
Engers F Davance Mercedes
Stephen Smith
Joshua West
Project Description
Design a flying robot
 Robot must be able to:

◦ Autonomously Fly
◦ Communicate Wirelessly
◦ Wireless Manual Control
Project 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!
Project 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
Goals/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)

Specifications/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)


Quad-Copter Concept
Frame
Frame
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
Materials 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 Easily
and Stiffness.
Replaceable.
Durable.
Less Costly.
Disadvantages
Can chip or
shatter.
More costly.
Can easily bend
or dent.
Design 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.
Diagram of Frame
Motors/ESC
Motors
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
Brushless Motor
1.
2.
Advantages
1. Less friction on the rotor
2. Typically faster RPM.
3. PWM or I2C controlled by an electronic speed
control (ESC) module.
Disadvantages
1. Require more power.
2. Sensorless motors are the standard
3. Typically more expensive
TowerPro 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.
Sensorless 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.

Power Supply System
Power
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
Power Distribution
9V Battery
Digital
Compass
LM7805
GPS
LD1117V33
Main
Processor
Wireless
Processor
Transceiver
11.1V LiPo
LM317
Ultrasonic
Ultrasonic
Gyroscope
Accel.
Motor
Motor
Motor
Motor
LiPo Battery
Specifications on the EM-35
 Rated at 11.1V
 Charge Capacity: 2200mAH
 Continuous Discharge: 35C, which delivers 77A,
typically.
 Mass: 195g
Logic 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_id=8745
Sensors
Sensor 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
Flight 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
Flight 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
Flight 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
IMU 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
ADXL335 – 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 > 50Hz
X,Y, Z outputs to MCU A/D converters
S1 self test switch
IDG500 – 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
IMU Code

Get sensor data from ADC’s:
accel[ROLL] = convertADC(4);
accel[PITCH] = convertADC(5);
accel[YAW] = convertADC(6);
gyro[ROLL] = convertADC(0);
gyro[PITCH] = convertADC(1);

Find adjustments for each axis (accelerometer):
Motor_Adj_Y = PID(&Y, angle[PITCH], 504, G_dt);
Motor_Adj_X = PID(&X, angle[ROLL], 502, G_dt);
IMU 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 = gyro[PITCH] - 418;
Gx_Adj = gyro[ROLL] - 417;
Gy_Adj = Gy_Adj / gyro_divisorY; // 3
Gx_Adj = Gx_Adj / gyro_divisorX; // 3
IMU 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);
Direction 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
HMC6352 – 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.
HMC6352 – 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).
HMC6352 – 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 < -1800)
{
yaw_temp += 3600;
error = yaw_temp;
}
…
HMC6352 – Code
• Yaw_PID (cont)
else if (yaw_temp > 1800){
yaw_temp -= 3600;
error = yaw_temp;}
else
error = yaw_temp;
dTerm = PID_Status->D*((PID_Status->
lastError - error));
temp = (PID_Status->P*error + dTerm);
PID_Status->lastError = error;
return temp;
}
Proximity Sensors (future application)

Bottom and forward sonar application
using the Maxbotix
LV-EZ2 ultrasonic sensor
 Detect the ground at 1-15 feet
 Obstacles 30˚ arc forward 1- 8 feet
 6 inches resolution
GPS - 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.
Microcontroller
Goals/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)
ATmega2560 Specs
0 – 16Mhz @ 4.5 – 5.5 volts
 256 KB Flash memory
 4 KB RAM
 4 16-bit timers
 16 10-bit ADC
 4 UART
 TWI (I2C)

Microcontroller Information
The main MCU will be programmed
through the SPI pins using the AVRISPMKII.
 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

Code
Code: 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.

PID Loop
error = desiredValue - value;
 PID_Status->integratedError +=
error*dt;
 dTerm = PID_Status->D*((error)/dt);
 (PID_Status->P*error + PID_Status>I*PID_Status->integratedError +
dTerm);

Testing 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.
PID Controller Constants
Kp
Ki
Kd
X-Axis
1.809
0.0699
-0.0409
Y-Axis
1.809
0.1099
-0.0429
0.1
0
0
Yaw
Code: 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();
Code: 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);
Code: Digital Sensors

I2C will be used to retrieve data from the
compass
◦ MCU – master
◦ Compass – slave

Functions:
◦ initI2C( );
◦ ISR(TWI_vect);
Code: 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);
Code: 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
Code: Overview
Compass
Wireless
Comm
I2C
UART
ADCs
IMU
PWM
Update
PIDs
Wireless Communication
Requirements
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.

Xbee 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.

Xbee 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.

Xbee: 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.
Xbee: 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 device’s channel
◦ bit2: if set the coordinator will allow end
devices to associate to it.
PCB Hardware Layout
Requirements






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 QuadCopter 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
Main Board - Initial
Modifications
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.

Main board - Final
Project Management
Project 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
Project 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
Problems
I2C not working on main board
 Fix: Use another MCU that it was tested
with

Problems
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)
Problems
Sensor fusion algorithms not working.
 Starlino’s 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.

Problems

Grounding on our first PCB was
problematic.
◦ Fix: Designed a new PCB with wider ground
traces
Questions, Comments,
Concerns?
Download