This is the comment for the Encoder::SetDistancePerPulse() method:
- Set the distance per pulse for this encoder.
- This sets the multiplier used to determine the distance driven based on the count value
- from the encoder.
- Do not include the decoding type in this scale. The library already compensates for the decoding type.
- Set this value based on the encoder’s rated Pulses per Revolution and
- factor in gearing reductions following the encoder shaft.
- This distance can be in any units you like, linear or angular.
From this link:
The encoders provided are 360 CPR. With 4X quadrature decoding, you get 1440 positions per revolution.
I have 8" direct driven wheels on my robot. Because the comment says the library already compenstates for the decoding type I used the 360 number. I wanted my speeds in feet/sec so I set my distance per pulse accordingly:
The problem is I don’t believe the values I am getting from Encoder::GetRate(). I used a tach to measure the max speed of the wheels and it read 517 rpm which is 18fps which is what we design the drive to be capable of. However my encoders are reading 12fps. The only thing I can think to change would be to use 1440 instead of 360 but that would just lower the speed I am reading. Help?