Connecting the Electronics and Starting to Design the Casing

Ok – Christmas is over and I’m back to work. I’m leaving the program for now and moving on to the physical quadcopter: once I have a finished and connected product it will be significantly easier to complete the code and test it.

The first step is to work out everything that will need to go into the quadcopter. Here’s a shortlist:

  • The 4-motor ESC. I’ve acquired a central speed controller that contains the circuitry for powering all four motors, negating the need to have a seperate ESC on each arm.

    4-motor ESC
    4-motor ESC


(continued)

Read More

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

RTIMULib Sensor Fusion Library

Right as mentioned in my last post I have decided not to stick to Polulu’s quite unreliable Arduino sketch that I assembled into a library, because of the significant drift in the results.

Rather, I’ve now (for the time being) settled on richards-tech’s RTIMULib-Arduino library which is a very complex but highly functional library designed specifically for use with the IMU board I’m using (and some others). What this means for me is that I can include the library in my sketch and not have to worry about the inner workings of it for now – although I’d like to produce my own algorithm at some point in the future.
(continued)

Read More

More Sensor Fusion

Right, I’ve spent the last few hours condensing and altering Polulu’s AHRS System, which I have been planning to use for getting orientation data from my IMU board. As it came, it was just one large sketch (actually a group of 7 files, I think) that took the raw data from the board and turned it into Euler angles for orientation. I had to put it all into a class and alter the function names, etc. etc. so that I could use it as a library with my main Arduino sketch.

The long and short of it is, I’ve finally got it working as a library but on further testing I’ve noticed a significant drift in the sensor values.
(continued)

Read More

IMU Readings and Sensor Fusion

I’ve been having a look at ways to read the raw sensor data from the IMU and translate it into an absolute orientation estimate.

Here’s the problem.

Accelerometers measure forces of acceleration, so that when the board accelerates, it knows. Gravity is a force of acceleration (9.8ms-2, or 1g, towards the earth), so by combining the X,Y and Z vectors of the reading of a stationary accelerometer we can work out the direction of gravity, and hence the orientation of the board.

But as soon as you start moving the accelerometer – as will, of course, happen a lot in a flying quadcopter – it picks up these lateral forces of acceleration as well as the force of gravity (and vibrations affect it too, which are just very fast lateral movements).
(continued)

Read More