drake
drake copied to clipboard
[WIP] Implicit modeling of PD controllers
This PR introduces the ability to introduce simple PD controllers for each JointActuator
in a MultibodyPlant
.
What this accomplishes:
- Ability to model very stiff PD controllers as those used for small gripper fingers, stably.
- PD actuation plus externally supplied feedforward actuation are constrained to satisfy effort limits.
To demonstrate the new capability, here I updated examples/manipulation_station/end_effector_teleop_sliders.py
so that:
- It Uses the SAP solver.
- Only one gripper finger is actuated, and thus there is a single DOF of actuation for the gripper.
- Added coupler constraint between the gripper fingers to make them move in opposition.
- Defined proportional and derivative gains at the
JointActuator
level for both arm and gripper. - As an additional workflow, I show that we can control the arm with gravity compensation + these simple PD controllers.
- Increase time step to 10 ms.
What I'd like to accomplish with this WIP PR:
I need feedback on the proposed APIs or even ideas for better APIs than the ones I put in here. The new APIs here are:
-
JointActuator::set_controller_gains()
, and related methods. -
MultibodyPlant::get_desired_state_input_port()
.
I added docs for those and hopefully the manipulation station example gives you an idea of the workflow.
From a usability standpoint, I am concerned that adding a new API for implicit PD controllers puts us in a position where there are two totally different approaches for creating controllers, one (the existing controllers) that provides complete flexibility and the other (this) that supports a specific basic controller type with better simulation stability, and where we end up with different types of robots that require one or the other (or, worse yet, a mix) to be simulated well.
Some of this can be made up for with a good library of robot controllers for users coming at this via hardware station simulation, but that doesn't help users working on controllers for new robots.
This pull request seems to have served its purpose to collect feedback, and might no longer be actively used? If we expect it to remain idle for a while longer before resuming, please consider closing it to conserve pull request resources.