4 years, 9 months ago.

inputlimits in PID library

Dear All, I am implementing PID control using the library like in this example. (https://developer.mbed.org/users/aberk/code/PID_VelocityExample/file/ac598811dd00/main.cpp)

And I would like to know how to set up input limit (setInputLimits) to my motor. My motor runs at 3000 rpm and my encoder can count 4096 pulses per revolution.

So for the output limit, is it correct if i calculate it based on the Rate - here in this program 0.01 sec?

I calculated like this

For maximum output of the motor - 3000 rpm which is 50 revolutions per sec

One rev is equivalent to 4096 pulses

So for one second - 204800 pulses

Therefore, for 0.01 sec - 2048 pulses

So according to my calculation the maximum output is 2048

Is my calculations correct? Is the inputs limit calculated based on pulses per second or based on 'Rate'?

Thank you for your support.

sincerely, princekham

Be the first to answer this question.