LaunchPad Flight Controller
As some of you might know I have been studying in San Francisco the last semester at San Francisco State University. For that reason I have not done as much as development as I usually do, due to all my equipment being back in Denmark and also because I prioritised being social and not just sit behind my desk coding all night 😉
Anyway I did not fully stop working. I actually started working on my own flight controller written from scratch in one of by courses. Below is the result so far:
As you can see it hovers just fine and I am able to control it using my 9XR. The receiver used is a OrangeRX R615X outputting a CPPM (Coherent Pulse Position Modulation) signal where each pulse represent a channel sent from the transmitter. The width of each pulse is measured using Timer Input Capture interrupt in hardware. More information about this and the fundamentals can be found in the brief report I wrote for the course: https://github.com/Lauszus/LaunchPadFlightController/raw/752b9e841471f10ffa8bab8c53d25bf1fa7cec26/docs/Report.pdf.
The code is written in C for the Tiva C Series TM4C123GXL LaunchPad. It features the TM4C123GH6PM 32-bit ARM Cortex-M4 microcontroller running at 80 MHz with a FPU which is a big upgrade if you are used to 8-bit microcontrollers like the ATmega328P which is found on the Arduino Uno.
The full specs for my current setup is as follows:
- Microcontroller: Tiva C Series TM4C123G LaunchPad
- IMU: MPU-6500
- Motors: Sunnysky X2204 2300kv
- ESC’s: Blue Series 12A RapidESC (SimonK v2013-05-15)
- Props: Gemfan 5×3
- Frame: 250 FPV Quadcopter (Bought on eBay)
- LiPo: Turnigy nano-tech 1500 mAh
- RX: OrangeRX R615X
- TX: Turnigy 9XR
- TX module: OrangeRX 2.4GHz transmitter module
The full source code is available under the GPLv2 license at my Github: https://github.com/Lauszus/LaunchPadFlightController. The code is a bit limited, as it currently only gyro mode (acro mode) is supported, but I intend to implement accelerometer (self-level mode) in the future, as I will properly continue working on this project for my Bachelor thesis this semester – so expect some more updates in a future blog post.
Furthermore it only works with my specific hardware and only works on a quadcopter in X-configuration. If you want to use other hardware or mixes I recommend checking out MultiWii for 8-bit microcontrollers or Cleanflight for 32-bit microcontrollers. Both of them supports a variety of microcontrollers and sensors.