Do stretch stepper motors and dynamixel motors support velocity control? I see MODE_VEL_PID
and MODE_VEL_TRAJ
.
The update rate is 15~25Hz, is this the fastest we could get or it’s downsampled somewhere?
Hi @hehonglu123 . Yes, they do support velocity control. Hopefully it goes without saying but care should be taken when running a joint in velocity control mode to avoid collisions and manage termination conditions well.
MODE_VEL_PID and MODE_VEL_TRAJ are specific to the steppers. Functionally they are similar (though MODE_VEL_TRAJ utilizes an underlying trajectory generator, allowing you to set acceleration limits.
With the Dynamixels you can use the enable_vel and set_vel interface.
The update rate of 15-25Hz is the fastest we can achieve in Python. Note, however, that the actual control of joint velocities is done on the joint microcontrollers.
We have some ongoing work to close a Python control loop around the Dynamixel velocity commands. We’re finding that the actual performance of smooth motion is dependent on the achievable update rates. We are still working on providing more reliable update rates that are not impacted by the user process load.
We’re happy to provide additional guidance if you can tell us more about your application.
Thanks @aedsinger , the information is really helpful. Will stretch robot classes (arm, lift, etc.) at some point later include velocity control helper functions similar to move_to
and move_by
in position control?
Yes, we will add this to our todo. I created an issue on Stretch Body for this and we’ll address it soon.
Even without this it is possible to command velocities by, for example:
robot.lift.motor.set_command(mode=MODE_VEL_TRAJ, v_des=velocity_target, a_des=acceleration_target)
I’d recommend using the MODE_VEL_TRAJ controller as it will respect the hardstops of the joint and also create smoother motion.