Skip to content

Commit

Permalink
Revert "Document IZone (#2257)" (#2262)
Browse files Browse the repository at this point in the history
The corresponding PR has not been merged wpilibsuite/allwpilib#5315, and
stable is still linked to main.

This reverts commit c8a1fb8.
  • Loading branch information
sciencewhiz committed May 27, 2023
1 parent c8a1fb8 commit a69de09
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,29 +126,6 @@ The range limits may be increased or decreased using the ``setIntegratorRange()`
// the total loop output
pid.SetIntegratorRange(-0.5, 0.5);

Disabling Integral Gain if the Error is Too High
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Another way integral "wind-up" can be alleviated is by limiting the error range where integral gain is active. This can be achieved by setting ``IZone``.

By default, ``IZone`` is disabled.

``IZone`` may be increased or decreased using the ``setIZone()`` method. To disable it, set it to infinity.

.. tabs::

.. code-tab:: java

// Integral gain will not be applied if the absolute value of the error is
// more than 2
pid.setIZone(2);

.. code-tab:: c++

// Integral gain will not be applied if the absolute value of the error is
// more than 2
pid.SetIZone(2);

Setting Continuous Input
^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Beware that if :math:`K_i` is too large, integral windup can occur. Following a
There are a few ways to mitigate this:

1. Decrease the value of :math:`K_i`, down to zero if possible.
2. Add logic to reset the integrator term to zero if the :term:`output` is too far from the :term:`setpoint`. Some smart motor controllers and WPILib's ``PIDController`` implement this with a ``setIZone()`` method.
2. Add logic to reset the integrator term to zero if the :term:`output` is too far from the :term:`setpoint`. Some smart motor controllers implement this with a ``setIZone()`` method.
3. Cap the integrator at some maximum value. WPILib's ``PIDController`` implements this with the ``setIntegratorRange()`` method.

.. important:: Most mechanisms in FRC do not require any integral control, and systems that seem to require integral control to respond well probably have an inaccurate feedforward model.
Expand Down

0 comments on commit a69de09

Please sign in to comment.