How to control the RPM of DC motor on Gopigo


how to control the RPM of DC motor on Gopigo? Do you guys already have function to control the RPM of DC motor with feedback loop?
Please help me…Thanks!


Hi yuangao,
I am not really sure if you can control the RPM precisely of the GoPiGo motors especially when its moving, what we do right now is to increase/decrease the voltage on the motors to control the speed. What you can do is to use the encoders to find out the current RPM and use that to increase/decrease the motor speed.

You can use enc_read() function to read the encoder counts: and set_speed(speed) function to set the speed between 0-255.




You should have a look at this awesome tutorial DC Motor Speed Control using Arduino in which they have controlled the speed of Dc Motor using arduino and have also shown how to control its direction.