Encoder error on 30:1 Metal Gearmotor 37Dx68L mm with 64 CPR Encoder

I bought recently 2 of these dc motors:

30:1 Metal Gearmotor 37Dx68L mm with 64 CPR Encoder

Im using the motors to build a 2WD robot, and during the tests I notice that when rotating the robot to the right, i need to wait for more pulses than needed to to rotate it left for the same distance.

The distance ratio is 1.007. Sample, for turning 360 degrees the motors need 1000 pulses to turn left and 1007 pulses to turn right.
It is a systematic error, so i can address i on the code, if just do ortogonal movimentation (runs an rotates).

The motors run on 12V and the encoders on 5V.
The encoder is read using the Encoder Library (Encoder Library, for Measuring Quadarature Encoded Position or Rotation Signals)

Any explanation and a way to get it right?


Is the 360 degree turn you mention a turn of your robot chassis, or a turn of the output shaft of the motor? If you are referring to turning the robot chassis, can you post pictures that show your chassis and explain how your two motors move when turning right and left?


Im mention a turn in the robot chassis, but that it is related with the number of pulses per rotation of wheels shaft.
I only notice the diference in the robot rotation. I never measure the backward distance, only measure running front in straight line. So i cannot compare.

My belive is if both motors are running on same direction the encoder give different pulse per rotation, if the motors are running reverse or not.

Unfortunately I dont know how to handle this reading error in more complex chassi moviments than the simple rotation.

Thanks for your reply.

The encoders determine how many revolutions the shaft in the motor has turned, but there are a number things between the rotation of the motor shaft and the turning of the robot that can generate small differences like you mentioned. It is not clear to me if you are moving two motors and wheels when turning or just one, but in general, even a simple case like a single motor and wheel might behave a little inconsistently if the tire slips slightly differently when turning in opposite directions. If you have consistent repeatable results for different conditions, those definitely can be used to produce more precise behavior from the robot.


Im moving the two weels, it happens on robot body rotation. It have nothing to do with that kind of inconsistencies.

The only pattern i found its the direction of motors axis rotation, if it are rotation in same direction (robot body rotation), the total pulses readings take on two different runs, one left and one right) are not equal for the same wheel traveled distance as should be.

The distance ratio is 1.007. For example, for turning the body 360 degrees the encoder need to read 100000 pulses to turn left, and to do the same 360 degrees body rotation to the right need 100700 pulses.

Can i make me understand now?

I belive its some electrical condition. Does the reverse running of dc motors have any specific characteristics?

Thanks for your reply.

It sounds like you have two separate motors that are rotating to turn the robot chassis so you should have two separate encoder counts, one for each motor. However, your post only mentions a single encoder measurement under two different conditions, so it is not clear what that single number is. To help us determine if the behavior you are trying to describe is normal and troubleshoot the issue if not, can you please post pictures of your robot that show where the motors are and how they are connected to your controller? Also, post a video or a detailed description that illustrates the behavior you are trying to describe and how that behavior deviates from the behavior you expect. That should include which motors you are moving to make the turns, what the encoder counts are for each of encoders, how you are deciding when to start and stop the motor’s movement, and how you are measuring the rotation angle of the robot’s chassis. You can find tips about what type of information to include in technical support requests so we can help you efficiently on the Support page of our web site.


Thank you for your reply.

Its 2 motors, and 2 encoders.

I shall do what you suggest. It will take some time.

So. Happy new year!


1 Like