Open mrjogo opened 4 months ago
Cranking up the torque immediately broke the calibration, which sent me down the rabbit hole of reading the SM85CL datasheets and experimentation. In doing so, I discovered a related bug: the driver is using servo.max_torque
to change the torque while running, however that is the EPROM address for saving default torque, which is read into servo.torque_limit
on powerup and subsequently ignored. Changes to servo.torque_limit
will dynamically change the max torque of the motor.
Anyway, I did a big refactor to be able to move at full speed (full torque), but then immediately drop down to a lower torque once stall is detected (to avoid crushing things / tearing apart the gripper): https://github.com/mrjogo/ar_gripper/commit/76dc230a2340d5287468dd1d12baaf5663bd84bd
The servo
torque_limit
getter and setter are missing a 10 conversion factor:https://github.com/machinekoder/ar_gripper/blob/59ad095111884504eefb97f22cae3c282b8f8bb1/src/ar_gripper/feetech.py#L706-L717
Should be:
When combined with https://github.com/machinekoder/ar_gripper/blob/59ad095111884504eefb97f22cae3c282b8f8bb1/src/ar_gripper/gripper.py#L174 this means the gripper runs an order of magnitude slower than its maximum speed.
If setting the torque to 1/10th its maximum value is intentional (ie, due to the mechanism or something), please let me know, because I'm now running mine full speed 😄