How to make S2 robot move extremely straight
william chan
Posts: 1,326
Hi,
I tried to move S2 over long distances, about 75 feet on thin carpet using the command
s2.set_speed(15)
s2.go_Forward(35000)
but I noticed that over long distances, there is a definite lean to one side.
For about 75 feet movement, the error from the straight line target would be about 12 to 20 inches.
What is the reason for this small error?
Could it be that the wheel encoder missed a few pulses at this speed?
Is it due to the free-play wobble on the wheels?
Is there a way to auto-correct the straightness if the propeller detects that the left and right encoder total pulses are not equal?
I tried to move S2 over long distances, about 75 feet on thin carpet using the command
s2.set_speed(15)
s2.go_Forward(35000)
but I noticed that over long distances, there is a definite lean to one side.
For about 75 feet movement, the error from the straight line target would be about 12 to 20 inches.
What is the reason for this small error?
Could it be that the wheel encoder missed a few pulses at this speed?
Is it due to the free-play wobble on the wheels?
Is there a way to auto-correct the straightness if the propeller detects that the left and right encoder total pulses are not equal?
Comments
I don't own an S2, so I am answering using general principals. I would guess the shaft encoders and propeller are all working fine, and the error is introduced through wheel slip. So ramping the motors may help a bit, as well as going a bit slower.
According to Phil's wheel encoder document as you alternately pulse the right and left motors, the robot tends to slowly creep in the opposite direction of the motor first pulsed. So this might be due to that effect. You might consider measuring the error and every ten feet or so introducing a small error correction step.
"Could it be that the wheel encoder missed a few pulses at this speed?" No.
"Is it due to the free-play wobble on the wheels?" Possibly.
"Is there a way to auto-correct the straightness if the propeller detects that the left and right encoder total pulses are not equal?" It does that now. That's how the motor/encoder software works. If you pick up the S2 with both wheels turning, and hold one wheel to slow it down, the other one will slow down, too.
That small a deviation could also be caused by a minute difference in wheel size or the fact that you're running on carpet instead of a hard, flat surface. Or you may simply not be pointing it as straight as you think. To check the wheel size hypothesis, swap the wheels and see if it deviates the other way.
-Phil
BTW, the document Martin refers to is for the BOE Bot wheel encoders. The S2 wheel encoders are slightly different in this regard.
I then opened the case to try to adjust or tighten the amount of free play but it made no difference.
One side still has definitively more free play than the other.
Is it possible to add washers to reduce the free play?
The wheel wobble issue is just manufacturing tolerances. I improved my blue Scribbler's wobble by CAREFULLY using thick gap-filling superglue and accelerator to build up material inside the square hole on the hub and eliminate play while keeping the wheel true. The superglue won't stick to the nylon/delrin square motor shaft, but it will stick to the ABS hub. You must constantly check the wheel trueness as you methodically build up the material a bit at a time ro achieve a tight but removeable press fit.