Ben-PH / SimpleFOC-rs

An attempt at re-writing the SimpleFOC library in rust.
MIT License
12 stars 0 forks source link

PID commentary #4

Open Copper280z opened 3 months ago

Copper280z commented 3 months ago

https://github.com/Ben-PH/SimpleFOC-rs/blob/47ea9ed03db2f3749ca7d6a038bf721271c66459/src/common/pid.rs#L110

Similar to the LPF, it'd be useful to support fixed timestep operation.

Additionally, some sensors can return velocity (derivative of position) directly, so if the derivative term is used it may occasionally be useful to pass the value for the derivative in, instead of calculating it here via finite difference. This should be considered relatively low priority though.

Ben-PH commented 3 months ago

I like it.

One thought i have is around the idea of not limiting the order if derivatives. If someone wants to go down to the nth differential, that should only be a matter of setting a type parameter.

By the sfoc spirit, the Library, by default, would be the simple and uncomplicated version, easily digestible for those that are just stepping into this. When they see that deeper differentials are available, that should prompt them to investigate, make discoveries, and learn.

Or in other words: at the surface, this library is a toy to make motors go brrrr in satisfying ways. Just beneath, is a rabit hole of discovery, revealed when you go into the generated documentation