3pi Robot Speed

I had a quick question regarding the speed of the motors. I am aware that you can set the speeds of the motor from -255 to 255. Does anyone know the unit of measurements for these speeds? If i set 50 to both approximately how fast is the robot moving? Thanks


The “speed” argument to set_motors is a measure of how much voltage, on average, is being supplied to the motor. It’s not a measure of the actual speed of your 3pi, since this depends on how much friction there is in the gearbox and with the ground, the weight on the robot if its on a slope, the time since you started accelerating, and so on. For a 3pi driving at a constant speed on a consistent surface, the number will be approximately proportional the speed, so that your 3pi will be going at about 50/255 (20%) of its maximum possible speed, or about 20 cm/s. However, if the argument to set_motors is below about 20, the 3pi won’t move at all, so this way of estimating the speed doesn’t work well for very low values.

Why do you need to know the actual speed corresponding to a value of 50? Usually, it’s a really bad idea to do anything that would depend on that, because you won’t be able to predict the speed reliably enough.

Here’s another thread that discusses the issue of speed: /viewtopic.php?f=15&t=1326

I hope that clears things up for you - please let us know if you have more questions!