mbedRTOS quadcopter quadrotor RATE and ATTITUDE mode (default). Altitude Hold soon to come. pHysiX Coding 2014.

Feel free to look at the code and implement your own. Don't forget to add in the correct licences, and relevant citation for the relevant developers if you do end up following parts of my code. Sharing is caring :) PM me for queries/code.

This article will be updated slowly, whenever I get a break from rock climbing, university and work commitments. Feel free to comment or ask me questions as need be.

Refer to Wiki Page for complete documentation!

Trung Tin Ian HUA - pHysiX Coding May 2014.

SAFETY FIRST

Quadcopters are inherently dangerous! When a quadcopter is on, it is a live saw!

NEVER UNDER ANY CIRCUMSTANCES DO THE FOLLOWING:

  • Fly in a closed or confined space.
    • Always allow enough room so that the quadcopter does not get near to people or valuables, and always allow enough room to take evasive action should you lose control.
  • Touch the quadcopter when it is armed, even if the propellors are not spinning!!!
    • The last thing you need is a trip to the ER/ED at 12am because the props cut off half your pinky (personal experience).

Please be observant when flying. If it looks as if you are losing control, just bring the quadcopter back to Earth. A broken motor/prop/frame/circuit can be replaced. Damaged property or worse yet, personal injury, can be irreversible!

Obey your local laws too regarding RC models. Be sensible so that others too can enjoy this wonderful hobby.

DISCLAIMER

My code is tailored to have a general approach in terms of flight motion and control. The safety features however are specific to my build!

A quirk is that even when the mbed enters deadlock or is taken offline, the ESCs will continue to run for a period until it figures out it has lost a signal. Chances are that the ESC may even shoot to 100% power!

You are free to use and test my code, BUT I TAKE NO RESPONSIBILITY in any circumstance for any problems you encounter, including and not limited to damage of any sort and especially injury to any person or animal.

With that aside, happy flying everyone!!! :D

Results/Demonstrations

Click on image to go to 1-Build Wiki. Link to youtube video

To do/discussions (respective order of priority)

  1. Switch to body frame instead of current YPR.
  2. Implement Altitude hold!
  3. Add support for EEPROM to store tuned gains outside of default
  4. Remap keyboard input for intuitive Telemetry/control
  5. Remove Bluetooth arming dependency
  6. Add in LCD output for offline setting/debugging
  7. Add in voltage sensing alarm
  8. Build GUI using Processing for Multiwii-like control
  9. Finish this article!
Download repository: zip gz

Files at revision 55:fc7cc7a4821c

Name Size Actions
[up]