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

MC position control - Add acceleration/thrust feedforward to velocity PID controller #12052

Closed
wants to merge 6 commits into from

Conversation

bresch
Copy link
Member

@bresch bresch commented May 21, 2019

Describe problem solved by the proposed pull request

Current state:
The model controlled by the velocity PID controller is contains one integrator which removes steady-state error when a constant setpoint is applied. To track a ramp setpoint, an integrator (I term of the PID controller) increases the order of the closed-loop system and remove the steady-state error.

Problems:

  • The controller cannot track a parabolic setpoint
  • To reduce the steady-state error during acceleration, the gain of the integrator has to be quite high, which causes an overshoot at the end of the ramp. This can be attenuated by a jerk-limited setpoint, but isn't enough.
  • The drone does not feel responsive and the setpoints are tweaked as an attempt to hide bad tracking (setpoint resets, increase jerk and acceleration limits). This leads to hazardous behaviors.

Solution proposed by this PR

A feedforward on the controller is commonly used in industry to improve tracking. Since some flight tasks already produce acceleration setpoints, they can easily be fed as feedforwards. With a feedforward, the feedback controller is then only needed to remove the steady-state error and reject disturbances.

Describe possible alternatives

  • Increase the order of the system by 1 (add an other integrator)
  • A different type of controller.

Tests

SITL tests:
Without feedforward (now):
2019-05-21_15-01-08_01_plot
With feedforward (this PR):
2019-05-21_14-55-01_01_plot

FYI @RomanBapst @MaEtUgR

@MaEtUgR
Copy link
Member

MaEtUgR commented May 23, 2019

Nice! Good idea. I was looking into a similar approach but by switching the velocity controller to output a desired acceleration that has a proper unit and then mapping this output and the feed-forward term to the attitude setpoint with a slightly different strategy. But this is a nice first step. Did you test on a real vehicle yet? I can test my draft acceleration stick input flight task with this pr.

@MaEtUgR
Copy link
Member

MaEtUgR commented May 23, 2019

I quickly tried and controlling the drone with that task works but it loses altitude and does weir twitches so I have to check where that's coming from.

@bresch bresch force-pushed the pr-accel-feedforward branch from baa0025 to 48ebbf5 Compare May 24, 2019 12:02
@MaEtUgR MaEtUgR force-pushed the pr-accel-feedforward branch from 48ebbf5 to 81366da Compare May 24, 2019 14:54
@MaEtUgR
Copy link
Member

MaEtUgR commented May 24, 2019

Just rebased to do further tests.

bresch and others added 5 commits June 3, 2019 14:14
The acceleration setpoint had no effect so far and was only logged.
Now that we start to execute it in the controller we need to take care
about the interface working properly to handle NAN setpoints that have
no effect and to get the acceleration setpoint output.
remove the noise on the sticks while not adding any delay during fast
changes.
message. This contains the desired velocity after stick scaling
@stale
Copy link

stale bot commented Sep 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Admin: Wont fix label Sep 2, 2019
@jlecoeur
Copy link
Contributor

jlecoeur commented Sep 2, 2019

@bresch this looks like a good improvement, what is missing to merge?

@bresch
Copy link
Member Author

bresch commented Sep 24, 2019

replaced by #12072

@bresch bresch closed this Sep 24, 2019
@julianoes julianoes deleted the pr-accel-feedforward branch September 25, 2019 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants