-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Acro: SuperExpo Stick Input #8036
Conversation
…rates without loosing input sensitivity
PARAM_DEFINE_FLOAT(MC_ACRO_Y_MAX, 700.0f); | ||
|
||
/** | ||
* Acro expo factor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you describe that this applies to roll, pitch & yaw? And maybe that a linear combination is used between the 2 extremas?
Other than that, it's ready to be test-flown.
Today while studying my current input rate settings I fly with in a tool I realize there's more to the very good control feel than just expo. Flyduino uses an additional f(x) = 1/(1-abs(x)*g) function to further enhance the input curve. While I totally see why they do this because the resulting curve feels very intuitive to fly I don't like the functions parameter g adjusting the maximal anglular output rate. I have to come up with a good way to parameterize the input function such that maximum and shape can be easily tuned. |
I added a so called SuperExpo function for further stick input curve shaping which makes it in my opinion much more intuitive. Reference implementations
KISS uses exactly the following formula:
The problem with this formula in my eyes is that it's not intuitively clear what maximal setpoint you'll have from the function parameters Adjustments The branch is only tested in jmavsim with an xbox controller yet. The feel enhanced a lot even with this **** quality gamepad. We should consider to also test this for position control input in the future to make manouvering easy but still have a high maximal velocity setpoint. EDIT: I made a plot with PX4 and KISS one on top of the other for direct comparison: https://www.desmos.com/calculator/ugh6vstxkn |
671a7d3
to
d8f8ab2
Compare
d8f8ab2
to
cedd652
Compare
CI fixed, ready for outdoor test. |
…rns per second for roll,pitch/yaw
outdoortest went wrong... the RC curve worked, I did a roll flip and ~10 seconds later the racer dropped out of the sky and crashed... The thrust spike was not commanded by me... and yaw does a strange spike as well. Something goes wrong in the rate controller or the mixer... I have to say I had these mixer changes flashed to test this pr: #7920 |
@MaEtUgR For the spike in the thrust output, it should not be related to the mixer since the spikes comes before it. In rate control, isn't the thrust directly a scaled version of the throttle stick? |
@bresch I assumed the same, the thrust should come directly from the stick and also the yaw did not command such a peek, while I touched yaw in this pr I did not touch thrust at all. I know the torque logging is before the mixer... |
@bresch I agree. That would explain everything and that's why I quickly tried to reproduce in a bench test. What I got is a message in QGC (while turning the other Taranis on and off) that transition from It has most likely noting todo with this pr and as I repaired the vehicle I can test again without risking the same issue. |
Thanks for the update @MaEtUgR. I agree, I don't see a way how this, or the mixer PR could have caused it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can merge this
high rates and (super) expo are necessary for - acrobatic flying - fpv - racing but they are not useful for: - a typical vehicle's rate control tuning - beginners The defaults that I set in #8036 were put with the assumption Acro mode is mainly used on racing drones for acrobatic manouvers but instead users including me use it most of the time to tune any drone. When tuning the rates are lowered and expo disabled. My suggested strategy is to make the beginner friendly rates without expo which are good for tuning the default and document more clearly how this can be raised for acrobatic flying in documentation and later on hopefully also directly in the ground station UI on an Acro mode specific page.
high rates and (super) expo are necessary for - acrobatic flying - fpv - racing but they are not useful for: - a typical vehicle's rate control tuning - beginners The defaults that I set in #8036 were put with the assumption Acro mode is mainly used on racing drones for acrobatic manouvers but instead users including me use it most of the time to tune any drone. When tuning the rates are lowered and expo disabled. My suggested strategy is to make the beginner friendly rates without expo which are good for tuning the default and document more clearly how this can be raised for acrobatic flying in documentation and later on hopefully also directly in the ground station UI on an Acro mode specific page.
To do actual acrobatic moves you need to have high rotation rate inputs available which was until now achieved by setting high
MC_ACRO_X_MAX
parameters (X being R,P,Y). The problem with this is that you very fast loose sensitivity around the stick center to keep the vehicle stable and smooth with your small corrections.That's why people flying model helicopters and race quads like to use a so called exponential curve.
https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/19890199/Expo+setup
It's nothing else than rescaling your stick input depenting on the stick deflection. What it does mathematically is a linear combination of a linear function and a cubic function between your -1 to 1 stick values.
For more details refer to #6440 and #6625 where the expo input curve was already introduced for position controlled flight.
My tests so far are using jmavsim on very low resolution to reduce delay and a ***** xbox controller and it seems to work as far as it's possible to tell with bugging sticks and input delay. Looking forward to test this on the racer build https://dev.px4.io/en/airframes_multicopter/qav-r-5-kiss-esc-racer.html tomorrow.
@bkueng I plan to use this for further FPV performance tests.
mc_att_control: use expo input for acro mode to allow for high input rates without loosing input sensitivity