Inav: Change both MC and FW PID controllers to P+I+D+FF

Created on 12 Aug 2018  路  9Comments  路  Source: iNavFlight/inav

Currently MC is PID, FW is PIFF, while both MC and FW could benefit from having a full PIDFF controller.

Enhancement Feature request

Most helpful comment

I have been missing D on FW since it was removed. PIFF is beneficial for a more direct steering compared to PID on FW but not very effective when it comes to stabilization against external influence, like gusts.

All 9 comments

Would be great indeed !

I've been looking into BF FF implementation lately. Indeed, looks interesting and removes the need for dterm setpoint weight. Still, MC FF apparently should be setpoint derivative, not setpoint based like in FF. On the other hand, it might be intersting how setpoint FF would work on MC.

I have been missing D on FW since it was removed. PIFF is beneficial for a more direct steering compared to PID on FW but not very effective when it comes to stabilization against external influence, like gusts.

Awesome idea! I really could do with this feature for my FWs where I use twin motors for yaw. Also it would help getting smoother stab as missing D term does show every now and then.
Best I can get with PIFF on FW looks like that: https://www.youtube.com/watch?v=CeM5jza0vnQ&t=
Notice the tail waggle at few points and occasional 'jerkiness'.

Pid bank and MSP frame will be done in #4326

Is there any chance for D term to be implemented for fixed wings? Stabilization would be much better with D term as it would let higher P gains.

Let's look into this for 2.6

Continuing PID/PIFF discussion - what is the reason for all the P, I, FF coefficients to depend on rate for fixed wings?
Wouldn't it be more straigtforward to decouple rate and PIFFs like in multirotors? I meen the following:

  1. Rates are only used to convert RC command into setpoint (degrees per second).
  2. FF coefficient is basically scale of RC command passed to controller output. A convenient way is expressing it into %. For example, 90% FF rate means 90% controller output ( = servo deflection), no need to guess FF value for any rate.
  3. P, I, Ds (setpoint derivative, gyro derivative) are also scaled internally, not by rates.
    The PID set controls how fast plane gets to desired angular velocity and how stable plane keeps it. The PID controller is naturally independent from the maximum angular velocity of the plane (what actually a rate is). It just tries to keep error at zero.

The benefits are: clear understanding and simplified tuning.
What do you think?

What I notice a lot, that fixed-wing pilots tend to think in percentages of stick deflection (aka RC rate). INAV does not have such a thing at all. Units used by INAV internally are degrees and degrees per second. Parameters on the PID tab relate to that, regardless of the aircraft type.

PID/PIFF translates rate command into actuator commands. This is how it works on both multirotor and fixed-wing crafts. Rule of thumb for tuning airplanes:

  1. Set max rate to max rotation rate your plane is capable of at 100% servo deflection at cruise throttle.
  2. Set FF rate to get full servo deflection when that rotation rate is commanded.
  3. Profit!
Was this page helpful?
0 / 5 - 0 ratings