Hello!
We chose to go for the encoder wheels from the encoder kit and have machined away the flange from the encoder wheels included in the kit. Now we are trying to determine whether this was successful and have some questions regarding the expected behavior of the encoder.
We have bonded 2 shafts with different code wheels and tested them both by modifying the example.py script from the master_board repository to spin the motor at a constant velocity and following a sine wave pattern with a pd controller. The script plots reference, actual and error values for both position and velocity. We also connected channel A and B from the encoder to an oscilloscope, using channel I (the revolutions index) as an external trigger.
These are the scripts used to generate the motor motion:
Constant Velocity
Sine wave pattern
These are our results for the two encoder wheels :
-
Encoder 1
-
Encoder 2
We also discovered a problem when testing the encoder. When the motor spins at a constant velocity for a certain amount of time, or a certain amount of revolutions, the motor stops before the script ends, and we need to reconnect power to the driver board in order to get the motor spinning again.
Our questions are as follows:
-
The position tracking looks very good, but the velocity error is very high. Should the velocity error be more stable? If so, do you have any suggestions on how to fix this? We suspected that the âwobbleâ on the first encoder caused this, but the second encoder has a lot less âwobbleâ and still results in the same velocity error.
-
Do you see anything in our results that could be caused by damage to the encoder wheels? The pulses from the encoder, measured on the oscilloscope, are of different lengths, but seem to be consistent in frequency. Again, we suspect âwobbleâ or some other property of the shaft rather than damage to the encoder wheel.
-
Is this an appropriate way of testing whether the encoder wheels has been damaged? If not, do you have any suggestions on how to modify our method to be able to tell if the machining was successful?
-
Regarding the motor stopping after a number of seconds or revolutions. Is this the expected behavior? If not, do you have any suggestions on how to fix it? We suspect some security function limiting the amount of revolutions the motor can do, as it will not do many revolutions during operation in the robot.
Sorry for the long post, we wanted to be thorough. Any help is greatly appreciated.
Best regards,
Kevin