braincore / pid-rs

A PID controller for Rust projects.
Apache License 2.0
92 stars 26 forks source link

Possible enhancements: Feedforward and Limit Bugfix #17

Closed harrisonmg closed 11 months ago

harrisonmg commented 1 year ago

Hello,

I've recently been using this library for some motor control. Thanks for your work!

For my own purposes, I added a simple linear feedforward term to the controller.

I also fixed a small bug with the term and output limits: giving a negative limit causes the term or output to be clamped to the limit value.

Would you be interested in pull requests for one or both of these items?

Owez commented 1 year ago

Yep if you could make a PR for the bug that'd be great. If the feedforward is an optional extra (e.g. .feedforward(x)) on the controller it should be a nice addition, probably best to make that a seperate PR :)

I'm not sure about the intricacies of feedforwards, I'll have to have a look into it