Road Closures

The roads are closed this weekend because of a cycling event, so there’s no flying today. The weather didn’t look too bad either, but then it got very windy later on.

Anyway, I’ve been playing around with my brushed microquad indoors this morning. I’ve finally got around to doing some testing with tuning the PID values. When I first flew this and compared it to the HubSan X4s we fly, the X4 was about 10 times easier to fly, despite the more advanced quad using an Evo 3 flight controller and running Cleanflight. What you’re supposed to do is to set I and D to zero, then increase the P until it starts to oscillate. I actually left the I and D on their default settings, and increased P from 80 up to 240 before I got the tell-tale oscillations that the PID controller was overshooting because I had an over-damped flying machine. That was much more than I anticipated, so it shows you how soft the default setup was. I’m still not there yet as my guess is that the P value wants to be around 200, then I need to set about finding the best I and D, which I find a lot harder to do. The P is the correcting force directly proportional to the error, while the I is the integral and the D is the derivative. It’s mainly the P that gives you the locked in direct feel that you want, but you can get the P a lot higher if the I and D are correct. If you want to see what the oscillation looks like, I’ve tried to video it below, but the camera doesn’t capture it particularly well:

The oscillation is most noticeable in the first few seconds of the flight. Note that the video is slowed down to 40% of normal speed.

That’s the non-scientific approach to PID tuning, which started me thinking about how to calculate a good starting point mathematically. One of the problems is that different flight controller software scale the PID values differently, so they’re not directly compatible with each other. The values aren’t dimensionless, but it’s very difficult to tell how they’re scaled as it’s often down to 10 bit normalised numbers coming back from the respective sensor chips. Also, sometimes they think in degrees and other times in radians. Here they’re big numbers (i.e. 80 to 240), while on my flight simulator I used radians, so they were much smaller. Either way, you should be able to calculate a rough ballpark figure to start from, which would help a lot. It’s just quite difficult to achieve in practice and I’m still thinking about it. In fact, autotune would make a lot more sense, where the flight controller detects how it’s oscillating and adjusts the values itself.

Well, that’s my thought for the week and there are still so many things I haven’t done this weekend. Like fix the head on my autogyro ready for when I can fly again.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s