The code is released under the GNU General Public License.
This is a flight controller used for a quadcopter in X-configuration.
It is written for the Tiva C Series TM4C123G LaunchPad running at 80 MHz.
In order to built this project you need to download Keil µVision IDE 5. Then open the project file.
More information can be found at the following blog post: http://blog.tkjelectronics.dk/2015/01/launchpad-flight-controller/.
Android application is available at the following repository: https://github.com/Lauszus/LaunchPadFlightControllerAndroid.
Some video demonstrations of the flight controller can be seen at my YouTube channel.
A simple GUI can be found inside the GUI directory. It can be used to visualize the orientation of the flight controller.
- Store PID values, calibration values etc. in EEPROM
- Gyro & accelerometer calibration routine
- Magnetometer calibration routine (turns on Blue LED when calibrating)
- Arm/disarm using rudder
- Status LEDs
- Supports CPPM receivers
- Gyro & accelerometer (MPU-6500)
- Magnetometer (HMC5883L)
- Ultrasound sensor aka sonar (HC-SR04)
- Rate mode, self level mode and heading hold mode
- Android application
- OneShot125 ESC support
- Buzzer feedback
- Motors: Dualsky 980kv
- ESC's: Hobby King 20A ESC 3A UBEC (F-20A) - flashed with SimonK bs_nfet with OneShot125 and COMP_PWM = 1
- Props: 10x4.5
- Frame: Hobby King Q450 V3 Glass Fiber Quadcopter Frame 450mm
- LiPo: Turnigy 3300mAh 3S 30C Lipo Pack
- RX: OrangeRX R615X
- TX: Turnigy 9XR flashed with OpenTX
- TX module: OrangeRX 2.4GHz transmitter module
Pin | Connection |
---|---|
PB6 | Motor 1 |
PB7 | Motor 2 |
PB4 | Motor 3 |
PB5 | Motor 4 |
PC6 | CPPM input |
PA6 | SCL |
PA7 | SDA |
PE3 | MPU-6500 INT |
PC4 | Sonar echo |
PC5 | Sonar trigger |
PB0* | UART1 RX |
PB1* | UART1 TX |
PA5 | Buzzer |
PE4 | HMC5883L DRDY |
* Not 5V tolerant
UART1 is connected to a HC-06 Bluetooth module running at a baudrate of 115200.
Note that the motor layout follow the Naze32 in x-configuration i.e. motor 1 is bottom right, motor 2 is top right, motor 3 is bottom left and motor 4 is top left when looking from the back.
Make sure that roll increases when tilting quadcopter to the right, pitch increases when pitching quadcopter downward and yaw increases when rotation quadcopter clockwise.
It is a good idea to run the accelerometer, magnetometer and ESCs calibration routines before flying the aircraft.
WARNING: Take propellers OFF when testing and calibrating ESCs!!
A lot of the inspiration for this code came from Cleanflight and other open source flight controller projects.
For more information send me an email at kristianl@tkjelectronics.dk.