Gopigo Encoders and enc_tgt() not working properly[SOLVED]

When I went to program my gopigo, i wanted to use the enc_tgt funtion so I could control how far it goes. The problem is, it doesn’t work. If i do enc_tgt(1, 1, 12) (and then fwd of course) for example, it goes about one and a half rotations, which would seem fine except for the fact that if i did enc_tgt(1, 1, 72) the robot would go the same distance. Same for (1, 1, 100) and (1, 1, 200). I also tried (0, 1, 200) and (1, 0, 200) and they put the same result. The encoders do work, i think as if I put (1, 1, 1) or (1, 1, 2) it doesn’t go very far. Its just when i get to 12 that the problem happends. I need the robot to go pretty far, so can anyone help?
Thanks :smiley:

Hi @ikhouider,

Can you follow this guide, generate a test log and post it here. This will help us to understand the problem better.


I tried to upload the file but I couldn’t and it didn’t let me copy paste either…
I would also like to add that one of the wheels is “weaker” than the other because it is at a slight tilt and(I looked inside) the gears aren’t close enough exactly. This doesn’t stop the robot from going straight although turning on this side has to be done right_rot() instead of just right()
here are screenshots of the code. If you can’t read them or something please tell me how to upload this file. THANKS (encoders starts at screenshot 8)

Some things repeat sorry again and thank you. every picture will be a different replay because only one picture per message

Last one!
Thank you again for everything!

Hi @ikhouider,

Thanks for pasting the images and sorry that you were not able to upload them. Yes it looks like your battery voltage is a little low, it has to be above 9V and also make sure your battery is on the top of the GoPiGo and add rubber bands to motor gear to avoid slips.

After doing these, send us a video of how your robot responds to enc_tgt(1,1,18) and enc_tgt(1,1,100). So that we know how exactly the motor responds to these since at the encoder level the values look good.

Thanks for your patience,

here is the google drive shareable link. Yes, thank you it did work (the first is with 18 and the second with 100) the second part of the video shows the how the gears of the second wheel doesn’t connect with the motor as well as the first. I now have to go right_rot instead because the the friction but it is fine unless you have a tip. The elastic bands helped a lot too! THANKS SO MUCH

Hi @ikhouider,

Glad that we were able to help you and its working for you. Regarding the second wheel not connecting well with the motor, it looks like its a bit a loose, check the washer connected to the motor shaft, make sure its tight.


Thanks again @Shoban
Yes, I’ve already tried that and the gears do get closer but its very hard to do it and it doesn’t change much. I’ve ordered a new motor though, so that should work
Thanks again!

Hi @ikhouider,

Thanks, can you repost the video again, we will have a look into the second wheel not connecting well with the motor.


Consider it done!