-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Rotorcraft guidance fixes/improvements #539
Conversation
give velocity commands in hover is a very nice feature. |
Giving velocity commands in hover is not done yet. I'm also not sure what the best way is to implement that... (give actual velocity commands or rather move the position setpoint)?
I'm not quite sure I understand... how do you tune guidance gains by additionally adding roll/pitch setpoints via RC? While you can probably tune the PID part a bit it is not the same as flying in nave, as your ff and horizontal guidance ref are zero... |
I think we should give velocity commands and use the guidance_h_ref generator with update from speed. About tuning: I use roll/pich setpoint to move the rotorcraft from hover position. Then I release the sticks to see how the rototcraft comes back to hover position. This is equivalent to a wind gust moving the rotorcraft in nav mode, so you can see if the tuning is fast but stable, otherwise P and D term of the guidance_h loop can be tuned. |
The problem with the current simple gh_update_ref_from_speed_sp that if you can't follow the ref (e.g. not well tuned, wind, etc..), the position setpoint will be further and further away from where you are. |
merge to get refactored vert loop with get_vertical_thrust_coeff
- enable/disable via settings - gets a better approximation of vertical thrust using guidance_v_thrust_coeff - vertical thrust is recomputed in guidance_h to take the latest thrust command after guidance_v was run
If the "rc_max_speed" is set to reasonably small speed, 4 m/s for example. |
IHMO just advancing the reference from the speed setpoint does not give satisfatory results (neither for vertical). |
I think resetting a setpoint to the current position when stick released could be useful, but... it can cause other problems. People may think the airframe is tuned well enough (but it isn't), so they switch to nav and have troubles. |
- fix rc_x and rc_y values - still needs to be scaled to max speed using circle instead of box bounding, but while making sure a division by zero can't occur! - only copy pos_ref to pos_sp in hover mode - move GUIDANCE_H_REF_MAX_SPEED|ACCEL to ref header file so it can be used - refactor rc speed setpoint reading into separate function closes #543
- add GUIDANCE_V_CLIMB_RC_DEADBAND (in pprz units, default MAX_PPRZ/10) - GUIDANCE_V_RC_CLIMB_DEAD_BAND is obsolete - GUIDANCE_V_MAX_RC_CLIMB_SPEED defaults to GUIDANCE_V_REF_MIN_ZD - GUIDANCE_V_MAX_RC_DESCENT_SPEED defaults to GUIDANCE_V_REF_MAX_ZD
In case of wind, the -20 to 20 max bank should become -40 deg in the wind direction and +0 in the opposite direction. The i-gain should be sufficiently SLOW but with HIGH authority. This commit suggests to split the max-bank from PD an I with separate saturation and have the I-gain before the integrator so better insight is gained in its authority.
Integrate twice as fast when not only POS but also SPEED are wrong, but do not integrate POS errors when the SPEED is already catching up.
to get updates/fixes from master for testing
Time for a new quadcopter for me.. Then some October wind and my tests can continue... For sure a good development for real flights in real scenarios, nice! |
Can only be removed once pull request #539 is merged
@dewagter, @OpenUAS, @gautierhattenberger, @softsr, @Drumettaz |
THX, will be put to the test again asap |
So now horizontal guidance returns commands in north/east earth frame and doesn't already rotate it to body frame. This allows for better handling of them in different controllers.
New and properly working transformations from earth commands to quaternions added.
No proper fixedpoint implementation so far... no change there compared to current master though. Should still be done for efficiency.
Tested the int_quat stablizitation with this in simulation and it works perfectly as expected.
IMPORTANT: This does currently not have the feature to "add" roll/pitch setpoints via RC in nav/hover anymore.
Is that really used, instead of switching to manual if needed?
Instead you can give velocity commands in hover mode via RC.
Includes max bank improvements proposed in #546