Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would...

15
Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote-controlled helicopter to fly without user interaction.

Transcript of Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would...

Page 1: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Autonomous Helicopter:

James Lyden Harris Okazaki EE 496

A project to create a system that would allow a remote-controlled helicopter to fly without user interaction.

Page 2: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Project Design: Initial Goals

Create a system to allow computer control of a remote-controlled helicopter.

Utilize sensors and wireless communications

Replace existing on-board control system

Create software to allow hybrid control

Stabilization controlled by software

User input used to determine expected flight path

User override to shut down helicopter

Page 3: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Project Design: Approach

Hardware: Bottom-up Approach

Determined what sensors we would need

Selected a means of wireless communication

Selected a microcontroller that would be able to interface with other devices

Tested each piece of hardware individually

Assembled and integrated components

Used microcontroller to pull it all together

Page 4: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Project Design: Approach

Software: Top-down Approach

First characterized the entire helicopter as a class

Spun off complex parts into separate classes

Continued refinement until sufficiently modular

Exported all relevant functionality to helicopter class

Wrote an example driver for the helicopter class

Page 5: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Project Design: Structure

User: input flight plan

3 AxisAccel

Gyro

Servos

PC w/BT:calculates

control signals

Master μCBT

transceiver

Slave μC

OFFBOARD ONBOARD

Page 6: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Project Design: HardwareSecondary μCSoftware Flow

Initialize:Open Serial PortInitialize PWMs

Get Correction Data:Wait For UART ReadyRead 4-Byte Word

Set Control Signals:Parse First 2 BytesSet PWM Duty Cycles

Primary μCSoftware Flow

Initialize:Open Serial PortsInitialize SensorsInitialize PWMs

Get Sensor Data:Send CommandsRead/Save Responses

Format Sensor Data:Use 8 MSbsCast To Chars

Send Sensor Data:fprintf Each ByteWrap Word With Tags

Get Correction Data:Wait For UART ReadyRead 4-Byte Word

Set Control Signals:Parse First 2 BytesSet PWM Duty Cycles

Page 7: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Project Design: Hardware

Schematic

Page 8: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Project Design: Hardware

AccelerometAccelerometerer

Angular Angular Rate SensorRate Sensor

Secondary Secondary PICPIC

Primary PICPrimary PIC

BluetoothBluetoothModuleModule

Voltage Voltage RegulatorRegulator

Master Master Power Power SwitchSwitch

HeadersHeaders

UART TX UART RX

PWM0+ PWM0- PWM1+ PWM1- PWM2+ PWM2- PWM3+ PWM3-

NC GND VDD

BAT+ BAT-

Page 9: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Project Design: Software

PC Software Flow

Initialize:Open Serial PortTest Serial Port

Get Data:Listen for PacketParse Packet

Store Data:Update Pos/Vel/AccUpdate Error Values

PID Calculations:Read Error ValuesCompute Corrections

Flight Planning:Check Flight ModeAdd Desired Offsets

Format Output:Combine Offsets+PIDPut Data Into Buffer

Send Data:Write Buffer to Serial Port

Class Diagram

Page 10: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Project Design: Design Choices

Guidance system

Fully on-board the helicopter vs. separate

Microcontroller-based

PC-based

Sensor arrangement and type

Off-center accelerometer vs. angular rate sensor

Three single-axis devices vs. one three axis device

Relative location vs. absolute location

Page 11: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Project Design: Design Changes

Sensor interfaces (from analog to digital)

Analog was simpler to implement

Digital updates faster, uses sensors' ADCs

Power supply (from separate to helicopter's)

The helicopter battery is rechargeable, longer life

Separate power supply took more space and weight

Correction algorithm (from proportional to PID)

Proportional was simpler to implement

PID is better at smooth corrections

Page 12: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Final Status

PC software complete

Tested with simulations

Communications complete

Microcontroller can talk to PC via bluetooth

Servo control complete

PWM outputs can drive helicopter control surfaces

Sensors problematic

Data received is garbled and often static

Perhaps sensors are broken, or high noise on data lines

Page 13: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Remaining Issues

Sensors not giving reliable data

Accelerometer readings are unintelligible

Intermittent error codes from both devices

The implementation of I²C and/or SPI may be faulty

Not getting full range from servos

PWM swing is from 0-5V

Original swing was from 0-7.8V

Darlington pairs can be used to step up the voltage

Page 14: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Future Work

Data logging

Record both sensor readings and corrections

Save in a format that can be used by MATLAB

Load information from files

A configuration file that can initialize PID constants

Get flight plan information from user-specified file

Real-time user control

Computer performs stabilization

User specifies flight patterns on the fly

Printed circuit board

Page 15: Autonomous Helicopter: James Lyden Harris Okazaki EE 496 A project to create a system that would allow a remote- controlled helicopter to fly without user.

Demonstration