cvra / pid

A PID controller implementation
68 stars 27 forks source link

Add a frequency parameter #4

Closed antoinealb closed 10 years ago

antoinealb commented 10 years ago

So @Stapelzeiger suggested that we should add a frequency or period parameter which would allow us to have frequency - independant behaviour.

I think it is a good idea, but I don't know if it is simply diving Ki and multiplying Kd by the frequency or if it is more complex.

Stapelzeiger commented 10 years ago

Just dividing the derivative and multiplying the integral term by the sampling period should be enough. That way we have a "correct" integral & derivative independent of control frequency. To try to correct for other effects that might appear is IMO overkill.