All,
Let me try to explain how Paparazzi manages throttle.
First off let me say that paparazzi does not manage speed by default for 2 reasons. First we do not have airspeed sensors to do control on that(see Vassilis email) and second groundspeed is a tough reference to track on. Wind and vehicle dynamics can kinda screw with you when dealing with groundspeed. That being said there is some code on the SVN that runs a PID on groundspeed to manage throttle, however its not well tested, and the tuning proceedure is not well known.
OK on to how paparazzi uses throttle.
First we calculate an altitude error.
altitude_error = (desired_altitude - actual_altitude)
Then we apply an arbitrary gain to convert the altitude error to a desired climb rate.
desired_climb = altitude_error * altitude_pgain
Then we go into the inner loop and determine the climb rate error.
climb_error = (desired_climb - actual_climb)
Then we apply a PID control on the climb error to manage the throttle.
desired_throttle = cruise_throttle + climb_throttle_increment * desired_climb + throttle_pgain * (err + throttle_igain * throttle_sum_err + throttle_dgain * d_err);
So a couple of things here. cruise_throttle is simply the "neutral" offset, and allows the Iterm to not have to work as hard. I think that if you had a properly constructed and tuned Iterm you would be ok not to have this term. What it does mean is that this number does not have to be perfect.
The next term may be confusing to some. This is simply a feedforward control. Open loop we "guess" how much throttle we need for a commanded climb rate. This gain climb_throttle_increment could be obtained by graphing throttle vs climb rate on a test flight if you really wanted to tune it well.
Lastly we have the traditional PID terms with there gains. Nothing really special there.
Ok really 1 last thing. The comment that changing the min nominal and max throttle did not lock it. Of course not! Locking the throttle on most small airplanes(especially flying wings) and just using elevator for altitude control can be a little rough. What we did instead of locking the throttle was to adjust the cruise_throttle using these values. So. If you put a dash throttle of 1.0 then the first term in this equation will be 1. If your desired_climb=0 and your err=0 then your desired_throttle will be 1. But if the AP is not able to maintain altitude control with the throttle at 1 then it will lower it enough to keep altitude control. If you would like to allow the elevator to help more, take a look at the pitch_of_vz which will give more elevator control for climb_rate errors.
I think that covers it.
AJ
Subject: [Paparazzi-devel] Reply to "How does throttle management
work?"
From: chris <address@hidden>
Date: Tue, October 13, 2009 9:36 am
To: address@hidden
Hi.
I am searching a way to do this (have a fixed ground speed) but
unfortunately have not found the way yet which might mean that i will
have to write my own code.
Since i posted the easyglider files i have made many corrections i can
safely fly now with 7 Beaufort wind.
Of course you will need a big engine and the plane will have big course
variations
but at least will not crash or get lost.
4 Beaufort wind is like any calm day now.
In order to fly well with high wind you must select a plane that has a
high wing loading
and it is fast.
My best choice would be the twinjet (older), the twister with at least
800W of power (best)
or the funjet which is almost as good as the Twister but less expensive
to fly.
Send me an email and i will reply with the newer files.
_______________________________________________
Paparazzi-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel