Closed ChrisRosser closed 1 year ago
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
AUTOMERGE: (FAIL)
Don't merge
label NOT found -> PASSRN:
label found -> PASSTested
label found -> FAILMore accurate stick tracking in the angle controller due to proper FF More accurate gyro setpoint tracking in angle mode Better response to sudden perturbations (crashes) in angle mode as FF will push the gyro pid loop to better follow the angle controller setpoint. World peace.
So I do have an issue with this statement.
Code issues yet to be solved with this:
Solutions:
Current problems with BF angle mode:
This is a real improvement to the BF angle code. BF would be served well by looking at what EmuFlight has done in this regard as the EmuFlight angle controller works very well.
Some test results for this code.
Without PR:
With PR:
Testing shows the gyro setpoint tracking is improved and the delay between angle rate and heading is reduced. Although we could of course consider further improvements in future as @Quick-Flash suggests this is a suitable fix for now.
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
ok..... so I tried this only my 2s hd whoop with logging... the stock FF gain is WAY to high not usable at all.. we need to test this on more little birds as they the primary users of level Mode
ok..... so I tried this only my 2s hd whoop with logging... the stock FF gain is WAY to high not usable at all.. we need to test this on more little birds as they the primary users of level Mode
Sorry, hadn't got around to setting the defaults sensibly. That's done now. A gain of 50 should be good.
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
ok..... so I tried this only my 2s hd whoop with logging... the stock FF gain is WAY to high not usable at all.. we need to test this on more little birds as they the primary users of level Mode
Sorry, hadn't got around to setting the defaults sensibly. That's done now. A gain of 50 should be good.
ended up with a gain of 15 and 75 angle expo on roll and pitch... 50 is still too high for a whoop
in the end I started with 0 and went up in gain 5 at a time
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
Here is a table of CLI values relevant to angle_mode, with suggested re-naming for consistency.
The intent is that when the user types 'get level_' they will find all these values
Current name | Suggested name | Notes | |
---|---|---|---|
angle_level_strength | level_strength | only angle mode | |
level_limit | level_angle_limit | only angle mode | angle in degrees, want to find with 'angle' text search |
level_gyro_feedforward_adjust | level_gyro_feedforward | only angle mode, adjust seems unnecessary | |
angle_level_feedforward | level_feedforward | only angle mode | |
pitch_level_expo | level_expo_pitch | angle and horizon | |
roll_level_expo | level_expo_roll | angle and horizon | |
level_race_mode | level_race_mode | only angle mode |
Here is a table of CLI values relevant to angle_mode, with suggested re-naming for consistency.
The intent is that when the user types 'get level_' they will find all these values Current name Suggested name Notes angle_level_strength level_strength only angle mode level_limit level_angle_limit only angle mode level_gyro_feedforward_adjust level_gyro_feedforward only angle mode, adjust seems unnecessary angle_level_feedforward level_feedforward only angle mode pitch_level_expo level_expo_pitch angle and horizon roll_level_expo level_expo_roll angle and horizon level_race_mode level_race_mode only angle mode
Really the angle level strength should just be a Pterm and not called strength, its a stupid name.
ok..... so I tried this only my 2s hd whoop with logging... the stock FF gain is WAY to high not usable at all.. we need to test this on more little birds as they the primary users of level Mode
Sorry, hadn't got around to setting the defaults sensibly. That's done now. A gain of 50 should be good.
ended up with a gain of 15 and 75 angle expo on roll and pitch... 50 is still too high for a whoop
Part of what will make this tricky, is that this FF simply creates a greater rate setpoint, which means that this is dependent on how your acro controller is tuned. Not sure it has to do with whoops directly. I also did mention that a D term would be quite useful and it would likely allow for a much higher FF before it became to much.
Here is a table of CLI values relevant to angle_mode, with suggested re-naming for consistency.
The intent is that when the user types 'get level_' they will find all these values
Current name Suggested name Notes angle_level_strength level_strength only angle mode level_limit level_angle_limit only angle mode level_gyro_feedforward_adjust level_gyro_feedforward only angle mode, adjust seems unnecessary angle_level_feedforward level_feedforward only angle mode pitch_level_expo level_expo_pitch angle and horizon roll_level_expo level_expo_roll angle and horizon level_race_mode level_race_mode only angle mode
What is this level mode everyone keeps talking about?! 😉 We have ANGLE HORIZON and ACRO modes. LEVEL mode doesn't exist so why would anyone search for it??!! If it's a legacy term let's kill it or if it has a specific meaning let's be consistent.
ok..... so I tried this only my 2s hd whoop with logging... the stock FF gain is WAY to high not usable at all.. we need to test this on more little birds as they the primary users of level Mode
Sorry, hadn't got around to setting the defaults sensibly. That's done now. A gain of 50 should be good.
ended up with a gain of 15 and 75 angle expo on roll and pitch... 50 is still too high for a whoop
Part of what will make this tricky, is that this FF simply creates a greater rate setpoint, which means that this is dependent on how your acro controller is tuned. Not sure it has to do with whoops directly. I also did mention that a D term would be quite useful and it would likely allow for a much higher FF before it became to much.
I agree it might be interesting to try D term. We are having issues with additive noise right now with extra derivative terms in the angle controller (FF) if we add D to the angle controller we really will have a noise issue and will need to add a ton of filtering which might eliminate any benefit.
Do you want to test this code? Here you have an automated build: Assets WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!
This is a simple addition of an FF term into the angle controller. This PR also changes FF in level modes to respect the unfiltered level mode setpoint rather than acro stick inputs.
Before, stick inputs in angle mode would be passed with acro rate scaling (!) into feedforward instead of the correct setpoint from the angle controller. This causes bad behaviour #12034
This PR correctly adds stick input FF into the angle mode controller. Giving back the sharp response to stick inputs we like in angle mode but without all the bad behaviour associated with the previous implementation.
The benefits of this split approach to FF in angle mode are numerous.
More accurate stick tracking in the angle controller due to proper FF More accurate gyro setpoint tracking in angle mode Better response to sudden perturbations (crashes) in angle mode as FF will push the gyro pid loop to better follow the angle controller setpoint. World peace.