I am facing a problem regarding our arm with an absolute encoder. We place it, but one of the positions we need to reach is after 0. When we try to reach that position after 0, the encoder tries to rotate the robot twice to reach the position or when we try to use it to leave the position after 0, it also tries make a complete turn to get into position. That’s why I’m trying to reset its 0 point to make it easier.
I tried to use the WPILIB example but it didn’t work
// Resets the encoder to read a distance from zero at the current position
encoder.reset();
// get the position offset from when the encoder was reset
encoder.getPositionOffset();
// set the position offset to half a rotation
encoder.setPositionOffset(0.5);
I don’t know if I did something wrong there or something else. If anyone can help us, thank you in advance
Is the arm capable of making more than a 360° revolution? If not, this will simplify the answer.
Is this issue causing the robot to rotate, or just trying to rotate the arm the wrong direction? If the robot, more than a full resolution (you say twice)?
The Orange and Blue lines are the desired routes, the purple and red lines are how he tries to execute
Is the arm capable of making more than a 360° revolution? Not
Is this issue causing the robot to rotate, or just trying to rotate the arm the wrong direction? If the robot, more than a full resolution (you say twice)?
just turning your arm in the wrong direction
Make sure you didn’t install the encoder backwards. Verify the encoder values against what you expect the controller to do with that range you have verified. And possibly you need to reverse the phase relationship of the encoder and the controller.