Skip to content

Commit

Permalink
Update advanced-controls
Browse files Browse the repository at this point in the history
  • Loading branch information
sciencewhiz committed Nov 24, 2024
1 parent f58061d commit 623b3d2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Roughly speaking: the proportional term drives the position error to zero, the d
Throughout the WPILib documentation, you'll see two ways of writing the tunable constants of the PID controller.

For example, for the proportional gain:

* :math:`K_p` is the standard math-equation-focused way to notate the constant.
* ``kP`` is a common way to see it written as a variable in software.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ In this section, we will tune a simple velocity controller for a flywheel. The

Our "Flywheel" consists of:

* A rotating inertial mass which launches the game piece (the flywheel)
* A motor (and possibly a gearbox) driving the mass.
* A rotating inertial mass which launches the game piece (the flywheel)
* A motor (and possibly a gearbox) driving the mass.

For the purposes of this tutorial, this plant is modeled with the same equation used by WPILib's :ref:`docs/software/advanced-controls/controllers/feedforward:SimpleMotorFeedforward`, with additional adjustment for sensor delay and gearbox inefficiency. The simulation assumes the plant is controlled by feedforward and feedback controllers, composed in this fashion:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ A turret rotates some mechanism side-to-side to position it for scoring gamepiec

Our "turret" consists of:

* A rotating inertial mass (the turret)
* A motor and gearbox driving the mass
* A rotating inertial mass (the turret)
* A motor and gearbox driving the mass

For the purposes of this tutorial, this plant is modeled with the same equation used by WPILib's :ref:`docs/software/advanced-controls/controllers/feedforward:SimpleMotorFeedforward`, with additional adjustment for sensor delay and gearbox inefficiency. The simulation assumes the plant is controlled by feedforward and feedback controllers, composed in this fashion:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Vertical arms are commonly used to lift gamepieces from the ground up to a scori

Our "vertical arm" consists of:

* A mass on a stick, under the force of gravity, pivoting around an axle.
* A motor and gearbox driving the axle to which the mass-on-a-stick is attached
* A mass on a stick, under the force of gravity, pivoting around an axle.
* A motor and gearbox driving the axle to which the mass-on-a-stick is attached

For the purposes of this tutorial, this plant is modeled with the same equation used by WPILib's :ref:`docs/software/advanced-controls/controllers/feedforward:ArmFeedforward`, with additional adjustment for sensor delay and gearbox inefficiency. The simulation assumes the plant is controlled by feedforward and feedback controllers, composed in this fashion:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ For example, a custom constraint can keep the velocity of the trajectory under a
## WPILib-Provided Constraints
WPILib includes a set of predefined constraints that users can utilize when generating trajectories. The list of WPILib-provided constraints is as follows:

- ``CentripetalAccelerationConstraint``: Limits the centripetal acceleration of the robot as it traverses along the trajectory. This can help slow down the robot around tight turns.
- ``DifferentialDriveKinematicsConstraint``: Limits the velocity of the robot around turns such that no wheel of a differential-drive robot goes over a specified maximum velocity.
- ``DifferentialDriveVoltageConstraint``: Limits the acceleration of a differential drive robot such that no commanded voltage goes over a specified maximum.
- ``EllipticalRegionConstraint``: Imposes a constraint only in an elliptical region on the field.
- ``MaxVelocityConstraint``: Imposes a max velocity constraint. This can be composed with the ``EllipticalRegionConstraint`` or ``RectangularRegionConstraint`` to limit the velocity of the robot only in a specific region.
- ``MecanumDriveKinematicsConstraint``: Limits the velocity of the robot around turns such that no wheel of a mecanum-drive robot goes over a specified maximum velocity.
- ``RectangularRegionConstraint``: Imposes a constraint only in a rectangular region on the field.
- ``SwerveDriveKinematicsConstraint``: Limits the velocity of the robot around turns such that no wheel of a swerve-drive robot goes over a specified maximum velocity.
- ``CentripetalAccelerationConstraint``: Limits the centripetal acceleration of the robot as it traverses along the trajectory. This can help slow down the robot around tight turns.
- ``DifferentialDriveKinematicsConstraint``: Limits the velocity of the robot around turns such that no wheel of a differential-drive robot goes over a specified maximum velocity.
- ``DifferentialDriveVoltageConstraint``: Limits the acceleration of a differential drive robot such that no commanded voltage goes over a specified maximum.
- ``EllipticalRegionConstraint``: Imposes a constraint only in an elliptical region on the field.
- ``MaxVelocityConstraint``: Imposes a max velocity constraint. This can be composed with the ``EllipticalRegionConstraint`` or ``RectangularRegionConstraint`` to limit the velocity of the robot only in a specific region.
- ``MecanumDriveKinematicsConstraint``: Limits the velocity of the robot around turns such that no wheel of a mecanum-drive robot goes over a specified maximum velocity.
- ``RectangularRegionConstraint``: Imposes a constraint only in a rectangular region on the field.
- ``SwerveDriveKinematicsConstraint``: Limits the velocity of the robot around turns such that no wheel of a swerve-drive robot goes over a specified maximum velocity.

.. note:: The ``DifferentialDriveVoltageConstraint`` only ensures that theoretical voltage commands do not go over the specified maximum using a :ref:`feedforward model <docs/software/advanced-controls/controllers/feedforward:SimpleMotorFeedforward>`. If the robot were to deviate from the reference while tracking, the commanded voltage may be higher than the specified maximum.

Expand Down

0 comments on commit 623b3d2

Please sign in to comment.