This is a Raspberry pi Based flight controller that can be applied to almost any flying vehicle.
The motivation was to create an open-source, modular, easy-to-maintain platform and foundation based on a processor with enough computational capability. So, each new algorithm can be implemented and tested easily on flying vehicles, no matter their computational cost.
First, the hardware contains three parts, and all of them are connected via I2C. To get the fastest behaviour, fast(400KHz) I2C is enabled on the Raspberry pi, which can be applied as described here.
The receiver inputs have to be read. An Arduino module reads all the receiver inputs with an interrupt routine and sends it over I2C on the 0x08 address.
Receiver outputs are connected to Arduino in this setup:
Receiver Channel | Arduino Interrupt Pin |
---|---|
1 | 8 |
2 | 9 |
3 | 10 |
4 | 11 |
Note: Code for the Arduino itself is located in the this folder.
A BNO055 BOSCH IMU is used for the feedback. This is a high-quality Inertial measurement unit with precise outputs calculated with Kalman filtering. All the sensor outputs are available through the class created for the purpose.
PCA9685 LED driver module is used for creating the PWM signals necessary for driving the motors.
Note: I made a circuit like this which connects to the Raspberry pi I2C pins.
The is so easy to maintain.
There is a file in the data folder where the motor pins are stored and can be modified.
Also there are lots of tools made for testing each component.
- IMU Calibration and testing.
- IMU offset Calculation.
- Reciever input testing.
- ESC calibration
- ESC testing.
- Killing the Motors(Stopping them of spinning).
***Note:***For the tuning of the controller, PID gains of each axis can be determined in the data folder.
For the controller, a very precise Anti-Windup PID Controller is used with a lowpass filter cascaded to the derivative block(where Tau can be set to zero to deactivate it).
- Flight Controller
- Tools
- Setup Sequence for the motor pins
- Arming and DisArming Functionality
- Upgrading for 8 Channel Radio Controller