We are using a motor to control an arm in a 2-state operation, 0/1. Its initial position is set to 0 by Motor.set_position(), and then Motor.spin_to_position(30, DEGREES) as the state 1. Later on, Motor.spin_to_position(0, DEGREES) is called to go back to the state 0.
However, the it does not really go back all the way to its initial position, but rather just 10 degrees back. If I use the function Motor.position() to check, it is close to 0. Anyone has an idea what is going on? Position is not accurate? Or is it because of backlash?
Thanks!
If you’re using gears on the arm, are any of them skipping when the motor moves? A picture of the arm and a copy of the code would be helpful in finding the issue.
It is quite tightly and skipping teeth does not seem that possible.
I noticed that it is a problem in particular if it repeats spinning forward and backward. Backlash does play a role there.
If you have a rotation sensor, you could try adding that to the arm to more accurately measure the position of the arm.
Yes, that is another solution, although I do not want to make it overly complicated.
Anyway, I have found out why. When a motor is operated without load, Motor.spin_to_position/Motor.position work as expected. If there is friction or resistance, it cannot get to the target position, but Motor.position shows the target value. Not sure if it is because it skips teeth internally.