With the lego NXT Mindstorm kit I would like to have a rotating carousel that has "perfect" movement. This carousel has baskets and therefore it has quite a bit of inertia. I would like to find a method to calculate the perfect time to slow it down--taking into account motor friction, and momentum etc.

Here is some data I've collected:

enter image description here

The motor power is the power to the motor. The break time was the time it took to stop from the time that the motor power was set to 0. The over-turn dist was amount of rotation in degrees that the motor continued to rotate after the power was set to 0.

Is there a specific method or approach to optimize the motors movement so movement can be precisely rotated to X degrees?


Do you have any feedback from the motor (it's speed or position)? In this case you should consider using a closed loop control here like PID

  • $\begingroup$ On the motor there is a relative encoder. It is the only data available to me. However using it, I can calculate speed (angular) over a period of time. $\endgroup$
    – Klik
    Nov 17 '14 at 20:32
  • $\begingroup$ Actually you can calculate the position as well, relative to a startup position, which might be enough for your application. But as I understand you are more concerned about the speed, so having the feedback you are able to implement the speed control loop. $\endgroup$
    – Eugene Sh.
    Nov 17 '14 at 20:34
  • $\begingroup$ Yes I can find the position. Which is in degrees. The relative encoder gives me 360 counts per full rotation, thus the encoder value mod 360 gives me its position in degrees relative to startup. My end goal is to seamlessly rotate in the fastest, but most precise way, to a specific angle. What is the best way to implement such a speed control loop? $\endgroup$
    – Klik
    Nov 17 '14 at 20:38
  • $\begingroup$ Look into closed loop control and PID $\endgroup$
    – Eugene Sh.
    Nov 17 '14 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.