Skip to content
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

Pr rc filtering #6440

Merged
merged 7 commits into from
Feb 2, 2017
Merged

Pr rc filtering #6440

merged 7 commits into from
Feb 2, 2017

Conversation

LorenzMeier
Copy link
Member

No description provided.

@LorenzMeier
Copy link
Member Author

@MaEtUgR @dagar We should bring this in and then remove it with the stick mapper. We need weeks worth of validation for the massive stick mapper change and we need the filtering earlier. We can't fix this one by rewrite easily.

@MaEtUgR MaEtUgR changed the title Pr rc filtering WIP: Pr rc filtering Jan 26, 2017
@MaEtUgR
Copy link
Member

MaEtUgR commented Jan 26, 2017

Not finished yet!

@LorenzMeier
Copy link
Member Author

@MaEtUgR This looks good. If its test flown and ready to go it can be applied.

@MaEtUgR MaEtUgR force-pushed the pr-rc-filtering branch 2 times, most recently from d693385 to 71dda2c Compare January 31, 2017 08:22
@MaEtUgR
Copy link
Member

MaEtUgR commented Jan 31, 2017

Did a successful flight test yesterday. Further testing?
To enable expo in position control set MPC_XY_MAN_EXPO to for example 0.69.
To change filter settings change RC_FLT_SMP_RATE and RC_FLT_CUTOFF to desired values (Cutoff 5Hz made sense for me).

Something I realized:
Slow velocity setpoints get cut out by the deadzone (MPC_HOLD_XY_DZ) and maximum position hold velocity (MPC_HOLD_MAX_XY). I'll report on this when I find a solution.

@dagar
Copy link
Member

dagar commented Jan 31, 2017

Any interest in generalizing expo or do you only want it for MC position?

@MaEtUgR
Copy link
Member

MaEtUgR commented Jan 31, 2017

I'm totally interested! Sorry for putting it there directly, it's urgent now. Would on the long term be nice to have a central point for such input tweaks such that they are available with a joystick and every mode but I would still keep the option to configure them differently dependent on the flight mode.

Here is the first simple formula version: https://github.com/PX4/Firmware/blob/71dda2cf4462b2a15a2c8fdfd3934be1bca6bc5a/src/lib/mathlib/math/Expo.hpp
Negative expo and other features can follow in the future.

@MaEtUgR MaEtUgR changed the title WIP: Pr rc filtering Pr rc filtering Feb 1, 2017
@MaEtUgR MaEtUgR self-assigned this Feb 1, 2017
@MaEtUgR
Copy link
Member

MaEtUgR commented Feb 1, 2017

rebased and did further tests today.

  • with RC_FLT_CUTOFF = 5 I found good filtering of osciallations when just letting the spring loaded stick go in manual or position mode.
  • with MPC_XY_MAN_EXPO = 0.69, MPC_XY_CRUISE ~ 10 and MPC_HOLD_XY_DZ ~ 0.01 (as small as possible) I found very intuitive control over the vehicle velocity in position mode from very gentle small corrections up to full speed. (maybe @Stifael can confirm)

controlled by parameter MPC_XY_MAN_EXPO that is disabled (0) by default
…ilter on change, constrain output

Filter gets unstable if cutoff is above sample rate/2.
Filter initial frequencies do not matter a lot because they get replaced by parameters anyways.
Filter delay values get reset to 0 when the filter is reconfigured otherwise there can be some weird spikes in the output.
Filter output gets constrained to the range again because of possible overshoot.
@LorenzMeier LorenzMeier merged commit 9e80a6c into master Feb 2, 2017
@LorenzMeier LorenzMeier deleted the pr-rc-filtering branch February 2, 2017 20:24
@LorenzMeier
Copy link
Member Author

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants