- Joined
- Jan 17, 2009
- Messages
- 5,204
- Reaction score
- 1,547
You can reduce oscillation by including an angular velocity term in your control loop. If the rocket is moving away from vertical, the angular velocity term would increase the angle of the canard, and if the rocket is moving toward vertical it would decrease the angle. This introduces a damping factor. So the canard angle would be given by "Angle[canard] = A*Angle[gyro] + B*Velocity[gyro]".
I think you are talking along the lines of P.I.D. (proportional-integral-derivative). Here is a Wiki:
https://en.wikipedia.org/wiki/PID_controller
And this very useful page about tuning PID for multicopters, which are not rockets but use the same kind of Flight controller and PID can be tuned:
https://blog.oscarliang.net/quadcopter-pid-explained-tuning/
This part briefly explains the Derivative:
• Derivative Gain*coefficient -*this coefficient allows the quadcopter to reach more quickly the desired attitude. Some people call it the accelerator parameter because it amplifies the user input. It also decrease control action fast when the error is decreasing fast. In practice it will increase the reaction speed and in certain cases an increase the effect of the P gain.
The bold part may be more like you are talking about, or perhaps all of PID is and the bold part shows how useful it can be to reduce the control action as the model nears zero error so it will not tend to overshoot as much. Kerbal Space Program used to have a pretty poor PID, a lot of overshooting wobble, it was a way too long time before they finally fixed it.
I am working on a project using a NAZE 32 flight controller and Cleanflight. The PID values can be tuned. For now, I am using it as a 2D "horizon mode" NAZE 32 version of the Eagle Tree Guardian. The servos were twitching like crazy when the controller was being rotated in any way, so I reduced the Proportional gain a good bit , and some derivative till the twitching went away. I have not done much else with the PID, still learning.
This afternoon I did complete a very nice test flight of an R/C electric plane, an Easy Star, with the NAZE 32 working like a Guardian in 2D horizon mode. It was to confirm to me that it indeed behaved like the Guardian in 2D mode, and it did. Then I flipped the toggle switch to "angle" mode which I had pre-set it to not "tilt" more than 10 degrees. So flying along horizontally, when I wanted to turn left, I gave full left, but it slowly turned left because it did not let it bank more than 10 degrees. And in level flight, if I gave full up, it would climb gradually, not allowed to pitch up more than 10 degrees. Same for down, it would not pitch nose down more than 10 degrees. If I was in manual mode and put it into a vertical dive, then let go of the stick and flipped to horizon or angle mode, it pulled out immediately into level flight, without zooming up into a stall (this is how the Guardian behaves too, except it does not have an Angle mode, only horizon mode). So, this is like a Guardian, except it can be programmed in so many other ways, including PID rather than a blunt gain adjustment
When I flipped to angle mode and was flying fast, the plane did wobble a bit in yaw. This is because the rudder has a pretty strong response to only a few degrees of banking left or right. I've seen that before with the Guardian, needed to reduce the gain a little bit. I need to study the above linked pages some more and figure out which part of the PID to focus on, or just reduce them all by some percentage. Then fly some more and see the result. But when its not as windy and not as cold. Today was a sanity check to make sure it really did work in the air, ground testing is critical but I'd done what I could and needed to get it in the air to see if it behaved right. Indeed the only way to see the Angle mode do its thing is in the air, on the ground the angle mode and horizon mode test the same.
OK, I'm convinced - more gain on the next flight. And two cameras, one pointing up to see the canards and one pointing down to see spin more easily.
It would most useful if the camera was pointing down to show the canards and the ground at the same time. Otherwise, with the two, if you have them inline with each other, or 180 degrees apart, and can do a time-synced side by side video, that would show the canard movements and the flight path movement of the ground below (might need to do a mirror image flip in the video editing). Of course if video editing is not your thing, and you don't know anyone who could do it that might like to tackle it, then that's not too viable. I could do it in iMovie but i've got too much else going on (couple of projects having problems, dragging out)
- George Gassaway
Last edited: