inav icon indicating copy to clipboard operation
inav copied to clipboard

Throttle scaled trim offsets

Open flyingbandit opened this issue 3 months ago • 2 comments

Current Behavior

Trim is set for a desired speed or speed envelope where it works well enough on some models.

When accelerating beyond the speed you trimmed your plane, you will need to apply corrective roll and or pitch to keep a steady straight trajectory. When you back off, the iterm has been wound up to correct for torque and you need to apply roll in the opposite direction until inav ‘catches up’.

Desired Behavior

On models with powerful motors / high pitch props, the wide speed envelope means that trim is effective for a small window of the speed envelope.

I would like a way of manually or automatically creating a trim offset that is weighted to the throttle input.

This would mean that during acceleration the plane will need less stick input to fly level and less corrective roll would be required when the throttle is removed.

Suggested Solution

Users trim for the middle of their speed envelope, let’s say 60% throttle. This is ‘trim throttle’

You apply a trim offset(s) for dynamically setting the servo midpoint based on a % of trim offset for 0-trim throttle and trim throttle to 100%. These offsets could be different.

Users could have this on a switch for testing, ensuring that they have correctly set the offset for the prop rotation they have. Trim offset would be reversed for opposite prop rotation.

Who does this impact? Who is this for?

Advanced users with fast, high torque power trains. And to some degree all users if it can be automated.

flyingbandit avatar Sep 25 '25 13:09 flyingbandit

Your description talks about the I-term, which is active in all modes other Manual. It's scaled with throttle by the throttle pid attenuation setting (your title says throttle), or you can test airspeed pid attenuation (your description says speed).

But then your description requests changing the servo midpoint, which essentially only affects Manual.

Are you talking about Manual (no piff), or another mode (piff controlled and midpoint doesn't much matter)?

Or if you're thinking about the transition between modes, theoretically midpoint could affect the transition between modes for several milliseconds until the PIFF loop catches up. But since the servos only update every 20ms, it may or may not have any significant affect on any value actually sent to the servo. That is, the loop may well have taken it wherever it's going by the time the first servo pulse is sent. In that case none of the servo pulses would be materially affected by any reasonable change to the midpoint. In other cases maybe it would affect one pulse of the servo, and be gone 50ms later after the loop runs 40 more times.

  • I should acknowledge the FF term does exist

sensei-hacker avatar Sep 27 '25 09:09 sensei-hacker

I would like a way of manually or automatically creating a trim offset that is weighted to the throttle input

Manual mode

You can very easily do that by mixing a little throttle in your ailerons. Maybe 5% or whatever. That will work in Manual mode. You may want to add a layer of indirection by using the Programming tab to set a global variable to the throttle value, then use the global variable in your aileron mix. That is a workaround for the fact that mixes that include throttle are only active when the craft is armed. On the other hand, the programming tab runs at 10 Hz. But the second user PID controller is faster.

Loop-controlled modes

For piff-controlled modes, see the throttle pid attentuation setting.

Or if by "throttle" you really mean airspeed, the airspeed attenuation setting you can test if you'd like to.

sensei-hacker avatar Sep 27 '25 09:09 sensei-hacker