Is it possible to set the current position in position control mode to be 0/2048 so that you can rotate 180 degrees in each direction? The homing offset seems to allow only +/- 90 degrees offset. This is not enough if the servo is between 90 and 180 degrees. Why is that?
Can you share about the servo model and the type of software that you are using?
I am using a Dynamixel XL330-288M with the Dynamixel Wizard 2.09 version 188.8.131.52
Well! I hope that I have understood your question correctly with this upcoming long explanation.
At the lowest level of control on its embedded controller, the XL-330’s Goal Position is set by using an integer between 0 and 4095 (so called Raw Position or RP) according this picture (when you are using the XL-330 in single turn mode).
so 0 RP corresponds to the very bottom position of 0.0 degree
and 2048 RP corresponds to the straight up position of 180.0 degree also referred to as Home Position
and 4095 RP corresponds to the position of 359.912 degree,
and so 4096 RP corresponds back to the very bottom position of 0.0 degree.
Next, on the Dynamixel Wizard software, any reference of 0 deg. or +90 degrees or -90 degrees ARE PURELY USER INTERFACING (UI) FEATURES. These UI parameters are converted to the corresponding RP values before they are sent to the XL-330’s embedded controller, for example as shown in the sample code below:
int32_t CalcAngle2Raw(float angle) // where angle can be +/- degrees like between -180.0 to +180.0 degrees as measured from the Home Position
return (int) (round((angle * 4096.0 / 360.0 + 2048.0)));
} // end of CalcAngle2Raw(float angle)
Next, the ROBOTIS e-manual does not give a clear explanation for how to use the Home Offset parameter at this link
The Home Offset parameter is only used when you issue a 2048 RP Goal Position to the servo in software (or so called 0 degree Goal Position inside the Dynamixel Wizard UI), and so “physically” the XL-330 is supposed to go to the very TOP Goal Position. But out in the real physical world, and somehow due to mechanical issues, the little “notch” on the servo’s horn does not line up with the “very top” servo’s position - i.e. it could be on the left or on the right of this top position. This is why the Home Offset value can be positive or negative values (between -1024 RP and +1024 RP - as shown on the Robotis emanual and in the Dynamixel Wizard UI). But I do not think that you have this situation with your new XL-330, right?
Furthermore, let’s say that you are using Arduino and you want to issue Goal Position as positive or negative degrees with respect to the Home Position. Then, you will have to create your own code for this feature. The ROBOTIS Dynamixel2Arduino library does let you input your Goal Position as Degrees, but as only positive values between 0 and 359.912 degrees. If you use negative degree values, the horn will just get stuck at the 0 degree position with no runtime error message.
Or perhaps your needs are more about setting the Min/Max Position Limits as shown here?
Thank you for the detailed answer. I understand now what the home offset is actually meant for. However, it does not solve my problem.
So I have mounted the Dynamixel in a robot arm. Now I want to rotate +/- 90 degrees or 1024 RP from the initial position. However, if the joint is assembled at close to 0 or 4096 RP, this does not work. Is there a way to fix this in software without having to reassemble the robot arm?
First your range of motion is only 180 degrees and the XL-330 total range is 360 degrees when it is in single turn mode, so there is still a chance to make it work for you and without dismantling everything.
Can you post a picture of the “problem joint”? I need to see the XL-330 at issue and the frame part attached to it. And I need to see how the horn is fastened to the frame part.
Do you want to stay with the single turn mode? Or you can look into the extended or multi turn mode also.
I would recommend your reading of all Robotis information about the XL-330 before proceeding to work on your project further.
I don’t think a picture of the robot arm is necessary. I have attached a video of the Dynamixel Wizard GUI with a XL330 attached. The XL330 is not attached to anything. Assuming the position of the servo motor at the beginning of the screen recording is the robot arm joint in the middle of the range of motion for that joint, I would not be able to rotate it over 20 degrees in one direction. It just rotates almost 360 degrees in the other direction. This is obviously terrible for a robot arm.
In that case, try to set it into the Multi Turn mode and read up about the new range of goal position values that you can use.