Quote:
Originally Posted by John_1102
this is where my confusion lies.
I thought the getRate function was reading the RPM's
I guess not.
I looked at the method itself and it shows that the equation for getRate is...
setdistanceperpulse/getPeriod or right now for me.
1/the time between each pulse
What my software mentor told me is that what were going to do is probably sample from the getRaw data encoder function.
since we are getting 2.5 revolutions per second @ 35% power based on a test I did. since there are 1440 pulses per revolution.
|
If your encoder is giving you 1440 pulses per second:
1 RPM = 1/60 rev/sec = 1440/60 pulses/sec
= 24 pulses/sec
So
RPM = (delta_pulses/dt)/24
...where delta_pulses is the change in the raw count from the previous cycle, and dt is the cycle time in seconds.
Don't forget: you must scale your setpoint to the same units as your process_variable.