Quadrocopter revisited

I started talking about multirotors with a colleague a couple of days ago and I suddenly got the motivation back to finish my quadrocopter that I started to build over a year ago. I wanted to build my own quadrocopter controller based on my kalman filter for angle estimation. But I never really got the control parameters tuned good enough for stable flight.

I don’t think I’ve posted any pictures on the quadrocopter in my previous posts so I’ll post some here.

Assembled quadrocopter before painting
Assembled quadrocopter before painting
Earplugs used to isolate controller board from vibrations
Earplugs used to isolate controller board from vibrations

and some videos to show how far I got with the controller tuning.

The first thing I did when starting to work on the controller again was to rewrite the controller part of the code from scratch. This time I think I’ll implement two different control modes, one that I call stable and one that I call acrobatic. Actually I’m more interested in the stable mode since I want to use the quad as a camera platform but it’ll be nice to have an acrobatic mode as well. This is two rough sketches on how I plan to implement them.

Stable quadrocopter controller
Stable quadrocopter controller
Acrobatic quadrocopter controller
Acrobatic quadrocopter controller

In the stable controller the angle of the platform is controlled by the radio, while the acrobatic takes the angular rate as an input. If you tilt the stable platform 15° and then release the controller it will return to horizontal level while the acrobatic will continue to lean 15° until you pull the lever in the opposite direction and tilt the platform back.

As I wrote in my post about the Kalman filter it is actually two identical filters for pitch and roll working completely individually. This works great for angles up to somewhere around 45° but the filter will go crazy if you start doing loops  and rolls. That’s why the Kalman filter is removed in the acrobatic mode leaving a controller that works directly on the gyro signals.

Right now the code is ready and parameters for the new PID controllers needs to be found. Last time I did this I built a rig but I left that at my parents house a while ago.

Quadrocopter test rig
Quadrocopter test rig, the quad rotates freely around one axis.

I dare not to test the new parameters without having the quadrocopter securely fastened to something heavy. On full throttle the motors produce around 1,2-1,4 kW of power which can do some real damage. I realized that the hard way…

My hand before the doctor stitched it together .
A 3cm long cut in my hand (actually 4 or 5 cuts from the rotating propeller) before the doctor stitched it together.  It was all the way through the skin, I was lucky that no tendons were harmed.

I plan to visit my parents in a couple of weeks, I’ll post an update once i fetched the test rig.

6 thoughts on “Quadrocopter revisited”

  1. Hello!

    Very nice stuff. I am just starting out with quadrocopters and your control-loop drawings were exactly what I was looking for. Finally a clean overview!! Would you mind explaining what the “Saturation” part does though? I’m not sure if I understand this. I would also like to know how you implemented your PID algorithm in C…

    Very nice stuff! Super-happy I found your website.


    1. Hello and thanks for your feedback!

      The saturation is for the I-part of the controller. I don’t want to keep integrating the error if the motors cannot actuate the control signal anymore. Google anti-windup to read more about this.

      Right now I’m in Venezuela for vacation but I can give you some code examples when I get back to Sweden.

    1. Not really, I havn’t worked on the quad for a while now. As soon there are any progress I’ll write about it here. If you have any questions, please write them here and I’ll try to answer.

  2. Hi,

    Very nice work. About the rough sketches you made for the controllers, How did you come up with these? Intuition or is there more to it?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.