Since the encoder is square wave not quadrature, do you have to stop first before changing directions for proper measurements?

In other words, if you are commanding along in one direction at some low speed like 50mm/s or less and want to change direction to -50mm/s, would you first need command it to zero and wait for the encoder to read 0 speed, and then command the reverse direction, in order to get as accurate as possible encoder readings?

  • $\begingroup$ Does this answer to the question iRobot Create 2: Encoder Counts help answer your question? $\endgroup$
    – Mark Booth
    May 25 '16 at 9:16
  • $\begingroup$ That post is what made my question. Is there a difference internally with the encoder between being commanded immediately to reverse direction and the wheels being forced backwards by hand? $\endgroup$ May 25 '16 at 12:28
  • 1
    $\begingroup$ I would just like to point out that going slower will typically always increase accuracy. This applies to pretty much all types of robots from differential drive robots like Roomba to industrial robot arms. $\endgroup$
    – Ben
    May 27 '16 at 1:48

From the OI Spec (encoder count sensors):

NOTE: These encoders are square wave, not quadrature, so they rely on the robot’s commanded velocity direction to know when to count up/down. So if the robot is trying to drive forward, and you force the wheels to spin in reverse, the encoders will count up, (and vice-versa). Additionally, the encoders will count up when the commanded velocity is zero and the wheels spin.

If you manually move the wheel while it is at rest, it will always assume it was moved forward.

So when driving forward, you may get slightly more accuracy if you stop briefly and let the robot settle, If you are moving backwards, it may be best to set it to, say -1 mm/s, for a brief time then 0.

  • $\begingroup$ So if I have this correct, command velocity is absolute for encoder accuracy. If you can the sign of the command velocity, if that is 500mm/s to -500mm/s, or 50mm to -50mm or 1mm/s to -1m/s the square wave nature encoder will immediately act like it is counting in the that direction. You have to command it to decelerate to 0 and then switch command signs for good accuracy when changing directions. $\endgroup$ May 27 '16 at 4:38
  • $\begingroup$ Yes, the encoder counts in whatever direction the wheel is commanded. A velocity of '0' also counts as being commanded forward. $\endgroup$
    – Jonathan
    May 31 '16 at 18:03

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.