View Full Version : Shoulder / Elbow paired servo calibration

02-06-2017, 08:59 AM
For the shoulder and elbow joints, the PhantomX Reactor Arm has 2 mirrored servos that work together to share the load. In trying to create a Master / Slave control, I read the position of the Master servo and set it as a goal for one servo but then need to compute the inverse goal for the opposite servo of the same joint. This is just a simple 1023 - x calculation. This was working fine for quite a while but I'm not seeing some jittering in the arm that makes it seem like the servos are fighting each other. Using DynamixelWizard, it looks like the Position values are off by 10-15 from what they should be (based on 1023-x). Does this mean that my servos need to be calibrated?

Or is there a better way to recompute the other servo's goal position better?

02-06-2017, 11:52 AM
There are many reasons why this could happen:

1) There may be some mechanical twisting in the frame connecting the servos. Fixing the frame will fix this.

2) There may be some wear on the potentiometer that causes the sensor to report a non-linear value. Calibration may fix this. Software work-arounds specific to the servo will fix this.

3) There may be some inherent tolerance differences between parts in the servos. Calibration may fix this. Software work-arounds specific to the servo will fix this.

What I would do is write some code that reads the servo position, WITHOUT powering the servo motor.
Then, I'd slowly fold the arm through its range of motion, and record the various A / B servo positions.
Then, I'd build that recorded data into a table or formula (depending on how "curved" it is) and apply that table/formula when calculating the positions of servos.
This counts as "software for the specific servos," beacuse if you swap out the servos, you may need to update the table in your software.

02-06-2017, 07:33 PM
Thanks for the quick response and suggestions. I captured the position values of the tandem servos and the actual positions were pretty different from the 1023 - x theoretical position value. Unfortunately, recalibrating the goal position using this didn't fix the jittering problem. When I finally started disassembling the arm to verify each servo, I found that one of the servos was jittering all by itself when moving in a CCW direction so it seems like the problem was with the servo and not the coding or calibration. I was going to swap out the servo for another but it turns out that a Firmware flash was all that was needed to begin moving slowly again.

I did keep the servo table approach though - can't tell if it makes any difference in smoothness but I assume it's better than what I had before.

Thanks for your help!

02-06-2017, 07:45 PM
Glad you have it working!
Post pictures if you have them :-)