paparazzi-devel
[Top][All Lists]

## Re: [Paparazzi-devel] Proposed update in the fixedwing pitch control loo

 From: Michal Podhradsky Subject: Re: [Paparazzi-devel] Proposed update in the fixedwing pitch control loop Date: Sat, 17 Sep 2016 16:03:36 -0700

Hi Hector,

hmm, if somebody more knowledgeable wants to make such a change then it probably should go in a different pull-request. For now I would only change the derivative term to be consistent with the classical control notation.

Regards
M

On Sat, Sep 17, 2016 at 10:45 AM, Hector Garcia de Marina wrote:
Hi Michal,

the correct _expression_ for the pitch rate is

\dot \theta = q \cos(\phi) + r \sin(phi),

where \theta is the pitch, \phi is the roll and 'pqr' are the three angular rates at the body frame, i.e. the readings of the gyros. One can verify this _expression_
in whatever physics book dealing with rigid bodies :P.

Indeed, if the roll angle is close to zero, then we can approximate the pitch rate to just sensor reading 'q'. On the other hand, in situations such as following
a circular pattern the roll angle is "far" from zero. Furthermore, if we also have an action on the rudder, e.g. a coordinated turn, then 'r' will be also different from zero.

Cheers,

On Sat, Sep 17, 2016 at 7:32 PM, Michal Podhradsky wrote:
Hi Hector,

I am not sure if I understand correctly your question about the non-zero roll angle. Can you elaborate? The pitch controller doesn't take in account the roll angle or the roll rate.

To clarify - the proposed change is only in the derivative error calculation (pitch rate), the pitch error itself is unchanged (see https://github.com/paparazzi/paparazzi/blob/master/sw/airborne/firmwares/fixedwing/stabilization/stabilization_attitude.c#L476 )

The term
float d_err = h_ctl_ref.pitch_rate - stateGetBodyRates_f()->q;

takes care of situations when your reference pitch rate is non-zero (although in most cases it will be zero).

To follow non-zero pitch angle there is this term:
float
err = h_ctl_ref.pitch_angle - stateGetNedToBodyEulers_f()->theta;

it allows you to follow whichever pitch angle you set as a reference.

Regards
Michal

On Fri, Sep 16, 2016 at 11:33 PM, Hector Garcia de Marina wrote:
Hi Michal,

float d_err = h_ctl_ref.pitch_rate - stateGetBodyRates_f()->q;

should not be (pseudocode) the following?

float d_err = h_ctl_ref.pitch_rate - (q * cos(roll) - r * sin(roll) );

Indeed, the first _expression_ is a particular case of the second when the vehicle is flying with roll = 0, e.g. "following a straight line". However, it is also
normal to fly following circles or other cases where the average of the steady-state roll is not zero.

What do you think?

On Sat, Sep 17, 2016 at 3:09 AM, Michal Podhradsky wrote:
Dear paparazzi users,

there is a proposed update in the way the fixedwing pitch control loop handles the derivative term. Currently a pseudo-derivative is used (see here) - the pitch rate error is calculated as a difference in the previous and current pitch error.

The proposed change follows a solution already present in the adaptive stabilization (here).
The difference is that now the pitch rate error is calculated using a pitch rate (measured from the gyro) and a rate setpoint (typically zero).

The benefit of this change is that it unifies the control loops, within paparazzi and also with standard control theory notation.

The drawback is that the D gain currently used would have to be updated using this formula (see here for details): D_new = D_old * P_old (the old D gain wouldn't work).

Since this is a change that affects multiple fixedwing airframes I would like to know your opinion first - would you be strongly opposed to the change or are you OK with updating the gains (and possibly retuning the aiframe) if it means unified and standardized control loops?

Michal

_______________________________________________
Paparazzi-devel mailing list
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel

--

_______________________________________________
Paparazzi-devel mailing list
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel

_______________________________________________
Paparazzi-devel mailing list
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel

--

_______________________________________________
Paparazzi-devel mailing list