Pololu Robotics & Electronics
Menu
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

RPM from Encoders

#1

Hello! I want to properly get my RPM data using the 48 CPR encoders on the 75:1 25mm DC motor. I know discussions like this is already on this forum, but I can’t seem to find what is wrong with my code. I suspect my process on how I calculate my RPM is not wrong, but rather the issue lies with sampling time. Do you guys have any advice or pointers on this?

Here is my code so far:
CraftControlsV1.ino (4.3 KB)

#2

Can you post a sample of the RPM data you are calculating? What do you expect to be getting?

Separately, are you able to get reasonable speed data if you replace your code with an example from one of the Arduino encoder libraries?

-Jon