Regbot encoder analysis

From Rsewiki
Revision as of 14:48, 28 November 2024 by Jca (talk | contribs) (→‎Regbot encoder issues)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Regbot encoder issues

As shown below, the Regbot motors use a magnetic encoder at the motor axle.

The encoder has 12 magnets and two HAL sensors. The sensors' separation and position should give symmetric A and B signals, as shown. If all magnet dipoles have exactly the same size and strength, then velocity can be estimated using the time between any two flanks. But this is not the reality.

A more stable velocity is obtained using the time between the same flank on the same signal, e.g. the rising flank on the A signal. This gives a velocity estimate at every flank, but the velocity is estimated over a longer time.

The average delay is half the time between two equal flanks on the same signal plus the time since the flank was detected.

The following plot tests this. A fast PI velocity controller obtains stable velocities between 0.05 and 1.3 m/s. The motor gear is 9.6:1, and the wheel radius is 0.03m.

The magnetic encoder is used to calculate motor (and robot) velocity, which is estimated based on the time between encoder ticks.

At a robot velocity of 5 cm/sec, the average delay is often more than 30 ms. The velocity controller is not well designed for this delay.

The velocity is more stable at 10 cm/sec, and the average delay is less than 10 ms.

At 0.5 m/sec and faster, a repeating pattern is visible. This pattern is related to the velocity and is repeated for every motor rotation. This indicates that the magnets in the encoder are not equal or symmetric. In this case, the resulting velocity noise is about 10% of the velocity.

Much of this noise could be eliminated if the different sizes of the 12 magnets were estimated. Such a function is not implemented.