Beginning the PID Control

Now we have access to the input from the RC receiver, and the current orientation from the gyro and accelerometer, the next big hurdle is to actually process these into motor outputs.

Now the algorithm for the job is called a proportional integral derivative controller, or a PID loop. There is plenty of stuff out there on this, but basically it takes the desired value (setpoint), and the actual value (input), calculates the error value and then puts this through 3 different terms to calculate an output.

Here’s a diagram explaining this:

PIDforDummies_pid_controller1
(continued)

Read More

Pin Map and Program Outline for Flight Controller

This is the mammoth in the project: the code. To be able to correctly power the motors from sensor and user inputs requires a several layers of algorithms and then there are all the trivial things like mode control, LED output, etc.

N.B. From now on I’ll refer to the sensor board (gyro, accelerometer, magnetometer, barometer) as the IMU (Inertial Measurement Unit).

Arduino Uno Pin Map

First I’ve started by drafting a pin map for the Arduino Uno. This is where, I expect, everything will connect, but I will of course keep pin numbers as constants in the program to make it easy to change.
(continued)

Read More