Encoder Turning Formula

Hey. So I have just switched to using encoders for turning. I was wondering if there was a formula to get the encoder value from the motor into physical degrees turned for the robot. I seem to remember there is one but I can’t find anything on the forum. Thanks!

In theory X amount of wheel rotation should result in Y degrees of turning. Do a few turns and record how much the wheels had to turn to turn the robot. You should be able to make an equation from this data.

In reality it will depend on what type of drive base you have, how many and what type of wheels, and a bunch of other stuff, so expect to have some ‘fudge factor’ in your formula.

In the applications we use the encoder, its to detect how much linear distance the robot has driven. The shaft encoders have 360 pulses per revolution. In our construction, the encoder is not geared, but directly driven by the wheel shaft. so, knowing these items, you can create a formula for distance driven, or by inverting the equation, determine the number of pulses you need to count to drive a desired distance.

After this, you can create formulas of how much distance to drive one side and the other to create an angle, running the left side one direction, and the right side the opposite direction for a calculated number of pulses.

1 Like

Sorry, I mean for the application of turning the robots orientation. So the ratio of pulses in the encoder to degrees of orientation turned.

that depends on the size of your wheels. what I like to do is drive my robot to turn it 90 degrees(use a corner or some stops to make sure it is perfectly 90 degrees), and record how far the encoders went.

1 Like