I am building a compliant robot with multiple XC330 motors. For this example, I have two XC330-T181-T motors, each with an 8-cm long nylon arm attached (lightweight, approximately 10-15 grams). I am using DynamixelShield for Arduino MKR with an MKR Zero.
The first motor (Lead) is in current-based position mode (
OP_CURRENT_BASED_POSITION) with goal current set to ~200mA (
dxl.setGoalCurrent(DXL_ID_LEAD, 200)) and goal position to horizontal. This makes a compliant arm that can easily be pushed with a finger and returns to the horizontal position when the load is removed. There is no jitter in the first motor (Lead) operation.
The second motor (Follow) is in position mode (
OP_POSITION), with PID roughly tuned for a fast response (
P=3000, I=100, D=1000). Then, I have the second motor follow the first one:
lead_pos = dxl.getPresentPosition(DXL_ID_LEAD, UNIT_DEGREE);
dxl.setGoalPosition(DXL_ID_FOLLOW, lead_pos, UNIT_DEGREE);
This works fine, but the Follow motor has an occasional jitter/dither to it, even when GoalPosition is kept constant. You cannot visually see the jitter, but you can hear it and physically feel it as a vibration when your finger is on the nylon arm.
I tried setting
dxl.setGoalPosition(DXL_ID_FOLLOW, horizontal_pos, UNIT_DEGREE); and the same issue occurs. Resetting PID to default settings (
P=900, I=0, D=0) does not change the jitter.
I can remove the jitter by setting the Follow motor to
OP_CURRENT_BASED_POSITION and setting goal current lower (e.g. 200mA, like the Lead motor). This requires some retuning of the PID (
P=3000, I=100, D=3000, increasing D was required to make it stable), but then the response is not as snappy.
I have two XL330-M288-T motors for prototyping that I set up in a similar configuration. The Follow XL330 motor does NOT exhibit any jitter. However, I’m not sure if this is due to the gearing (181 vs 288) or because of the inherent lower power (the XL330’s are just running off the 5V from Arduino USB).
Therefore, I’m wondering if this is due to the gearing of the motor (181 vs 288), the current supply, or something else I’m missing. I can use the XC330-T288 instead, but I really like the gearing of the T181 for compliance so far (much easier to get movement started).
One solution is to keep the Follow motor in
OP_CURRENT_BASED_POSITION and increase the goal current only when large changes in goal position are detected, but I’m worried I wont be able to find a PID tuning that’s both snappy and stable if the goal current changes dynamically.
Thanks for reading, any suggestions/help are greatly appreciated!
I’ve included a picture of my setup for clarity.