You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<trclass="memdesc:a0d23c206d13900df47e009ce56fddfeb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Set controller gains for this joint actuator. <ahref="#a0d23c206d13900df47e009ce56fddfeb">More...</a><br/></td></tr>
<trclass="memdesc:a2ae9bfe9ff9fa92e86c62acc0179d459"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns <code>true</code> if controller gains have been specified with a call to <aclass="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a0d23c206d13900df47e009ce56fddfeb" title="Set controller gains for this joint actuator.">set_controller_gains()</a>. <ahref="#a2ae9bfe9ff9fa92e86c62acc0179d459">More...</a><br/></td></tr>
279
+
<trclass="memdesc:a2ae9bfe9ff9fa92e86c62acc0179d459"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns <code>true</code> if any non-zero controller gains have been specified with a call to <aclass="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a0d23c206d13900df47e009ce56fddfeb" title="Set controller gains for this joint actuator.">set_controller_gains()</a>. <ahref="#a2ae9bfe9ff9fa92e86c62acc0179d459">More...</a><br/></td></tr>
<trclass="memdesc:a70bb0382f762152bb446666338300b6e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns a reference to the controller gains for this actuator. <ahref="#a70bb0382f762152bb446666338300b6e">More...</a><br/></td></tr>
<p>Returns a reference to the controller gains for this actuator. </p>
689
-
<dlclass="section pre"><dt>Precondition</dt><dd><aclass="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a2ae9bfe9ff9fa92e86c62acc0179d459" title="Returns true if controller gains have been specified with a call to set_controller_gains().">has_controller()</a> is <code>true</code>. </dd></dl>
689
+
<dlclass="section pre"><dt>Precondition</dt><dd><aclass="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a2ae9bfe9ff9fa92e86c62acc0179d459" title="Returns true if any non-zero controller gains have been specified with a call to set_controller_gains...">has_controller()</a> is <code>true</code>. </dd></dl>
<p>Returns <code>true</code> if controller gains have been specified with a call to <aclass="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a0d23c206d13900df47e009ce56fddfeb" title="Set controller gains for this joint actuator.">set_controller_gains()</a>. </p>
709
-
<dlclass="section note"><dt>Note</dt><dd>A controller for a given model instance can be <em>disarmed</em> if the desired state input port for its model instance is not connected. When a PD controller is disarmed, it has no effect on the <aclass="el" href="classdrake_1_1multibody_1_1_multibody_plant.html" title="MultibodyPlant is a Drake system framework representation (see systems::System) for the model of a ph...">MultibodyPlant</a>'s dynamics, as if there was no PD controller (still, this method returns <code>true</code> whenever controller gains were set with <aclass="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a0d23c206d13900df47e009ce56fddfeb" title="Set controller gains for this joint actuator.">set_controller_gains()</a>.) See <aclass="el" href="classdrake_1_1multibody_1_1_multibody_plant.html#pd_controllers_and_ports">pd_controllers_and_ports</a> for further details. </dd></dl>
708
+
<p>Returns <code>true</code> if any non-zero controller gains have been specified with a call to <aclass="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a0d23c206d13900df47e009ce56fddfeb" title="Set controller gains for this joint actuator.">set_controller_gains()</a>. </p>
709
+
<dlclass="section note"><dt>Note</dt><dd>A controller for a given model instance can be <em>disarmed</em> if the desired state input port for its model instance is not connected. When a PD controller is disarmed, it has no effect on the <aclass="el" href="classdrake_1_1multibody_1_1_multibody_plant.html" title="MultibodyPlant is a Drake system framework representation (see systems::System) for the model of a ph...">MultibodyPlant</a>'s dynamics, as if there was no PD controller (still, this method returns <code>true</code> whenever non-zero gains were set with <aclass="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a0d23c206d13900df47e009ce56fddfeb" title="Set controller gains for this joint actuator.">set_controller_gains()</a>.) See <aclass="el" href="classdrake_1_1multibody_1_1_multibody_plant.html#pd_controllers_and_ports">pd_controllers_and_ports</a> for further details. </dd></dl>
<p>Set controller gains for this joint actuator. </p>
955
955
<p>This enables the modeling of a simple PD controller of the form: ũ = -Kp⋅(q − qd) - Kd⋅(v − vd) + u_ff u = max(−e, min(e, ũ)) where qd and vd are the desired configuration and velocity for <aclass="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a54bc3724965cc59e714c64cbeb147b86" title="Returns a reference to the joint actuated by this JointActuator.">joint()</a>, Kp and Kd are the proportional and derivative gains specified in <code>gains</code>, u_ff is the feedforward actuation and <code>e</code> corresponds to <aclass="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a5e00d5f4ea204b3bab3d733b8a64b9eb" title="Returns the actuator effort limit.">effort_limit()</a>.</p>
956
+
<p>The gains must be finite and non-negative. Setting both gains to zero will remove the controller (<aclass="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a2ae9bfe9ff9fa92e86c62acc0179d459" title="Returns true if any non-zero controller gains have been specified with a call to set_controller_gains...">has_controller()</a> will return false).</p>
956
957
<p>For simulation, feedforward actuation can be provided through <aclass="el" href="classdrake_1_1multibody_1_1_multibody_plant.html#a1cc1d71e6c2e91fcd215105ae4ed01e4" title="Returns a constant reference to the input port for external actuation for all actuated dofs.">MultibodyPlant::get_actuation_input_port()</a>. Desired configuration and velocity are specified through <aclass="el" href="classdrake_1_1multibody_1_1_multibody_plant.html#a10da7d22fff4db1da5c396eef5780ae2" title="For models with PD controlled joint actuators, returns the port to provide the desired state for the ...">MultibodyPlant::get_desired_state_input_port()</a>.</p>
957
-
<dlclass="section pre"><dt>Precondition</dt><dd>The <aclass="el" href="classdrake_1_1multibody_1_1_multibody_plant.html" title="MultibodyPlant is a Drake system framework representation (see systems::System) for the model of a ph...">MultibodyPlant</a> associated with this actuator has not yet allocated a Context. In other words, although gains can be changed post-Finalize, they cannot be changed during simulation.</dd></dl>
958
-
<dlclass="exception"><dt>Exceptions</dt><dd>
959
-
<tableclass="exception">
960
-
<tr><tdclass="paramname">iff</td><td>the proportional gain is not strictly positive or if the derivative gain is negative. </td></tr>
961
-
<tr><tdclass="paramname">iff</td><td>the owning <aclass="el" href="classdrake_1_1multibody_1_1_multibody_plant.html" title="MultibodyPlant is a Drake system framework representation (see systems::System) for the model of a ph...">MultibodyPlant</a> is finalized and no gains were set pre-finalize. In other words, <em>editing</em> gains post-finalize is fine, but <em>adding</em> gains post-finalize is an error. See <aclass="el" href="classdrake_1_1multibody_1_1_multibody_plant.html#a8fee61d7a783cade1a3d07fe86284d27" title="This method must be called after all elements in the model (joints, bodies, force elements,...">MultibodyPlant::Finalize()</a>. </td></tr>
962
-
</table>
963
-
</dd>
964
-
</dl>
958
+
<p>PD control is currently only supported for a discrete time plant. Attempting to use non-zero gains on a continuous time plant will result in an exception. See <aclass="el" href="classdrake_1_1multibody_1_1_multibody_plant.html#pd_controllers_and_ports">pd_controllers_and_ports</a> for further details. </p>
<p>While PD controllers can be modeled externally and be connected to the MultibodyPlant model via the <a class="el" href="classdrake_1_1multibody_1_1_multibody_plant.html#a1cc1d71e6c2e91fcd215105ae4ed01e4" title="Returns a constant reference to the input port for external actuation for all actuated dofs.">get_actuation_input_port()</a>, simulation stability at discrete-time steps can be compromised for high controller gains. For such cases, simulation stability and robustness can be improved significantly by moving your PD controller into the plant where the discrete solver can strongly couple controller and model dynamics.</p>
298
298
<dl class="section warning"><dt>Warning</dt><dd>Currently, this feature is only supported for discrete models (is_discrete() is true) using the SAP solver (<a class="el" href="classdrake_1_1multibody_1_1_multibody_plant.html#ad7698366750a09e383106a17bf9009a2" title="Returns the contact solver type used for discrete MultibodyPlant models.">get_discrete_contact_solver()</a> returns <a class="el" href="namespacedrake_1_1multibody.html#a902306c5e0120a67c07f80e9219a3e8dad48dc7e3221aee2d9e1af665ebfbeeec" title="SAP solver, see [Castro et al., 2022].">DiscreteContactSolver::kSap</a>.)</dd></dl>
299
-
<p>PD controlled joint actuators can be defined by setting PD gains for each joint actuator, see <a class="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a0d23c206d13900df47e009ce56fddfeb" title="Set controller gains for this joint actuator.">JointActuator::set_controller_gains()</a>. Unless these gains are specified, joint actuators will not be PD controlled and <a class="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a2ae9bfe9ff9fa92e86c62acc0179d459" title="Returns true if controller gains have been specified with a call to set_controller_gains().">JointActuator::has_controller()</a> will return <code>false</code>.</p>
299
+
<p>PD controlled joint actuators can be defined by setting PD gains for each joint actuator, see <a class="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a0d23c206d13900df47e009ce56fddfeb" title="Set controller gains for this joint actuator.">JointActuator::set_controller_gains()</a>. Unless these gains are specified, joint actuators will not be PD controlled and <a class="el" href="classdrake_1_1multibody_1_1_joint_actuator.html#a2ae9bfe9ff9fa92e86c62acc0179d459" title="Returns true if any non-zero controller gains have been specified with a call to set_controller_gains...">JointActuator::has_controller()</a> will return <code>false</code>.</p>
300
300
<p>For models with PD controllers, the actuation torque per actuator is computed according to: </p><pre>
Copy file name to clipboardExpand all lines: doxygen_cxx/classdrake_1_1multibody_1_1_package_map-members.html
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -165,9 +165,13 @@
165
165
166
166
<p>This is the complete list of members for <aclass="el" href="classdrake_1_1multibody_1_1_package_map.html">PackageMap</a>, including all inherited members.</p>
0 commit comments