View Full Version : Encoder default distance per pulse
Does anyone know what it is? Other members of my teams made changes to the finalized code but i was using the default distance per pulse and i need to fix my values
e/ nvm its just 1.0
2e/ another question: whats the proportinal constant for converting an encoder value to degrees? (i want to turn 45 degrees but i need to know what to scale the encoder to)
BradAMiller
17-02-2013, 14:09
Does anyone know what it is? Other members of my teams made changes to the finalized code but i was using the default distance per pulse and i need to fix my values
e/ nvm its just 1.0
The distancePerPulse tells the Encoder object how far the robot travels in a single pulse so you can call the convenience method getDistance() that would return the robot distance traveled. To set the value you need to know the the wheel diameter, the number of encoder counts per revolution, and any transmission ratios that might apply.
Here's the code in WPILib to getDistance():
public double getDistance() {
return getRaw() * decodingScaleFactor() * m_distancePerPulse;
}
You can see it simply takes the raw number of counts and multiplies it by the distance per pulse that you provide.
2e/ another question: whats the proportinal constant for converting an encoder value to degrees? (i want to turn 45 degrees but i need to know what to scale the encoder to)
Do you mean for the robot to turn 45 degrees or are you looking for 45 degrees of shaft rotation?
Brad
I meant turn the robot 45 degrees :\
the constant i was looknig for is roughly 1727/90 for a 1 DPP
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.