×

Warning

Error loading component: com_tags, Component not found.

Summary of Project Idea

I've been thinking about designing autopilots for some time now. To get the project off the ground, I'm planning on starting with a little and hopefully easy to control helicopter, initially understanding the concepts for the helicopter to fly, and then later on automating those functions so the helicopter just hovers. From there, complete the control system to allow the helicopter to fly around controlled via an RC kit (reusing the kit used from understanding the concepts for the helicopter to fly) or a joystick connected to a computer, then adding in positioning functions (GPS and air speed sensors) to allow for a basic autopilot which can be built on.

After this project has been done, the next step would be implementing the autopilot system in a larger scale and on different type of aircraft.

Other projects required for this project

None

Project Details

Hardware:

A near ready to fly helicopter was chosen as I don't have experience designing aircraft, but also it has the advantage of replacement parts readily available in the event of a crash damaging the aircraft, a small but cheap helicopter kit was selected for the project. Parts to complete the kit were picked using a similar method as the helicopter.

The electronics needed to be small and light enough to fit on the helicopter but easy to interface with. The main microcontroller, the Leaflabs Maple Mini, was selected due to the processing power required for the software and control systems, additionally the hardware built into the microcontroller met the requirements for the project. The main features looked at are as follows:

  • 6 external interrupt channels for RC receiver input
  • 5 Pulse Width Modulation (PWM) channels for controlling the Electronic Speed Controller (ESC) and the servos
  • Independent Watchdog Timer to allow for systems recovery in the event of a software crash
  • 2 Universal Synchronous/Asynchronous Receiver/Transmitter (USART) ports for GPS input and communication via a wireless module to a remote computer
  • 1 Hardware I2C port

All of the electronics run on a 3.3v system (apart from the servos and electronic speed controller) and don't require any level converting (the servos and ESC can accept 3.3v signals) which reduces design complexity and points of failures. However the electronics could be affected by EMI, however whether this will be a problem is unknown.

Software:

The software would be designed to run as efficiently as possible to allow fast updates for the helicopter but also accurate enough not to cause instability. Where possible, it would be desirable to avoid floating point maths and use fixed point maths instead to help speed up the calculations.

Sensor blending is most likely going to be used initially as a filter until a kalman filter can be developed and integrated into the system. A dynamics analysis will also need to be performed on the helicopter when designing the PD controller, if a PD controller is determined to be too unstable, a PID controller will be used.

The autopilot software developed will be designed for flexibility in mind, allowing to quickly place the software in another aircraft with a few small variable changes (type of aircraft, maximum rate of roll and ascent/decent). It takes an input of virtual flight instruments (outputted by the control system) and processes the data to determine what course of action needs to be taken, moving the 'control stick' and feeding that back into the control system. The autopilot should also have the ability to detect emergency conditions such as:

  • Motor stops responding to commands
  • Power source falls below thresholds
  • Vortex Ring State (VRS)
  • Sensor failure

It should handle these quickly as possible, and if it calls for it, shut down the helicopter. The autopilot also sends the current status of the aircraft over a serial link to a remote computer. The serial link is also used to feed coordinates to the aircraft, then the microprocessor in the aircraft will work out how to get to those coordinates and feed a flight plan back to the remote computer whist also executing it.

The autopilot function can also be disabled and the user can manually control the aircraft, this is done with a switch on the RC transmitter, however this is dependent on the microcontroller detecting the change and feeding the values back into the control system.

Project Plan

Stage 1:

Assemble helicopter and test control surfaces. Observe how the helicopter manipulates the control surfaces; look at the limits of the surfaces. Make sure the helicopter can achieve flight, additionally adding weights to the aircraft to measure lifting capacity. Start a basic design of the control system for stage 2. This stage will take an estimated 2 weeks to complete and requires all parts on the bill of materials (stage 1) for the stage to be completed. Stage 2 can start 1 week into stage 1 if assembly and tests are completed.

Stage 2:

Start to automate basic functions (take off, hovering and landing) while also implementing the control system for the helicopter to maintain stability of the helicopter during movement commands from the RX-TX while also feeding back sensor data through the Bluetooth link. The tail gyro is used to simplify the control system initially. This stage could take up to 6 weeks to get the full control system implemented and working, although can start during Stage 1 depending on progress in that stage. Stage 2 requires all of the parts on the bill of materials (stage 1+2) for the stage to be completed. Stage 3 cannot completely begin until Stage 2 is complete, although implementing of new sensors can start.

Stage 3:

Implement the new sensors into the control system before initial implementation of the advanced autopilot, additionally removing the tail gyro and letting the system controlling the rear gyro directly. Should be able to receive commands from a computer to move from where it is to a new location and work out a flight plan (and know it needs to avoid certain areas and make sure it has enough flight time to reach the destination) to move to that location.

Completion of stage 3 is dependent on the completion of previous stages and the acquisition of new electronics listed on the bill of materials up to stage 3. This stage should be able to be completed in 4 weeks.

Stage 4:

After previous stages are implemented, create a dedicated board for the helicopter containing the microcontroller, communication module and sensors on it, although GPS can stay on a separate board for signal purposes. Create new boards for servos (possibly based off OpenServo) and speed controllers to allow them to communicate over I2C, updating the control system for this change. Stage 4 is the last stage of the helicopter and doesn’t have a bill of materials yet due to designs not being finalised yet.

Resources needed for project

This is a rough list of the resources needed for developing this autopilot system, as the project develops, more resources may be needed.

Bill of Materials for Stage 1:

Item Name
Qty
Unit Price
Sub-Total
1
$ 19.99
$ 19.99
1
$ 9.80
$ 9.80
1
$ 7.38
$ 7.38
2
$ 6.64
$ 13.28
5
$ 2.99
$ 14.95
1
$ 9.99
$ 9.99
1
$ 23.54
$ 23.54
1
$ 2.56
$ 2.56
1
$ 0.61
$ 0.61
1
$ 17.99
$ 17.99
1
$ 1.32
$ 1.32
1
$ 0.06
$ 0.06
1
$ 0.06
$ 0.06
1
$ 0.18
$ 0.18
1
$ 0.51
$ 0.51
1
$ 0.51
$ 0.51
1
$ 3.76
$ 3.76
1
$ 0.99
$ 0.99
1
$ 2.01
$ 2.01
1
$ 2.81
$ 2.81
1
$ 11.10
$ 11.10
1
$ 1.40
$ 1.40
1
$ 1.29
$ 1.29
1
$ 2.45
$ 2.45
EMS Package Max 3KG No Lipo
1
$ 48.12
$ 48.12
Total in USD
$ 196.66

Bill of Materials for Stage 2:

Item Name
Qty
Unit Price
Sub-Total
1
$ 34.99
$ 34.99
1
$ 27.95
$ 27.95
1
$ 39.95
$ 39.95
1
$ 23.50
$ 23.50
Total in USD
$ 126.39

Bill of Materials for Stage 3:

Item Name
Qty
Unit Price
Sub-Total
1
$ 49.95
$ 49.95
1
$ 49.95
$ 49.95
2
$ 37.95
$ 75.90
2
$ 19.95
$ 39.90
1
$ 89.95
$ 89.95
Total in USD
$ 305.65

Notes and design changes

Majority of the electronics (ADXL345, IDG500, Bluetooth Bee) I already have from a project I'm currently working on, and can probably initially start on a LeafLabs Maple then later move onto a LeafLabs Maple Mini. Sadly, none of the other components I have.

When I originally started to plan out the project, I picked an Fire Fox EP100 Micro 3D Helicopter w/ Motor only due it being cheap and easy to get parts for, however during the planning, I realised that the helicopter may not actually give the lifting capacity I need for the extra electronics in stage 2 due to its small size. I started looking for similar cheap helicopters, and found 2 viable options, the Fire Fox EP200 Micro 3D Helicopter (KIT ONLY) and the HK-250GT Electric Helicopter Kit (Alloy/CF w/ Blades). I picked the Fire Fox EP200 over the HK-250GT base on user feedback telling of problems with the rear tail assembly needing to be replaced.

I still didn't know of what kind of lift I'd generate with the setup I was planning, but I found a website (Dark Horse - Helicopter Power & Setup Calculator) to allow me to give a rough calculation of thrust by plugging in the details of the aircraft. I came up with a thrust of 464g, at 89.4% Throttle and 7.76° which should be enough to be able to hover and fly with an estimated payload of 100g and aircraft weight of 240g.

2011/05/19 Update - Well, I have another slight design change for stage 1. I've moved from 800mAh batteries to 1000mAh batteries as I've been reading that the larger batteries happily fit on the EP200. I've also got 2 so when I go to do testing, I have enough flying time to run multiple tests or do some field coding. Although I might be able to get away with a single one if I have to. I've also added in some Carbon Fibre Blades due to feedback from the kit stating the blades provided can be warped and quite fragile, I've also seen many mentions of carbon fibre blades making the helicopter more responsive to control inputs. Additionally I've added a small lightweight camera to put on the helicopter when I do testing as an additional point of feedback that I may not see from a distance. I do have a camera to record, however it's slightly more expensive than the $11 camera, plus it's a lot heavier than the new camera. The List has been updated and I might make another post later showing the various part changes.

2011/07/21 Update - I'm in the final phase of ordering Stage 1, I've added minor things to assist with learning to fly the helicopter as well as a few other components like some battery tape, spare servo and extension wires. I also replaced the carbon fibre blades with cheaper fibreglass blades which apparently weigh the same. The JST connector pigtails have been replaced with JST connector sets which allows me to crimp it myself to save on the cost slightly. Lastly, the postage has been changed to EMS shipping due to needing to get the components to me sooner.