I'm using a DYNAMIXEL 2XC430-W250-T an controlling it through an Arduino Shield.
When I tell the servo to go to position 1024 (in steps), the sevo reaches the position nicely when I add some delay after the movement.
When I then ask the servo for its position, it returns values deviating from the target position of 1024.
Please see some of my code below (only the relavant stuff).
dxl.setOperatingMode(DXL_ID, OP_EXTENDED_POSITION);// OP_CURRENT_BASED_POSITION OP_POSITION OP_EXTENDED_POSITION);
dxl.setGoalPosition(1, 0, UNIT_RAW); // 0deg position
v = dxl.getPresentPosition(1, UNIT_RAW); // v is -1, 0 or 1 which seems to be ok
dxl.setGoalPosition(1, 1024, UNIT_RAW); // 90deg position
v = dxl.getPresentPosition(1, UNIT_RAW); // v is something between 1019 and 1025 which seems to be a bit unreliable.
I added an agular scale to the servo to check the positions. According the the scale, the servo reaches perfectly the desired positions. Only the feedback from the servo is sometimes a bit inaccurate.
So, my questions are:
How can I check, if the servo has reached the target position?
How can I retieve the accurate position of the servo?
Any help would be appreciated!
Thanks in advance, Dirk