Skip to content

Commit

Permalink
add notes to docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Jan 14, 2025
1 parent adb24dc commit f5892f0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/ControlSystemsBase/src/pid_design.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ The `form` can be chosen as one of the following (determines how the arguments `
If `state_space` is set to `true`, either `Kd` has to be zero
or a positive `Tf` has to be provided for creating a filter on
the input to allow for a state-space realization.
A balanced state-space realization is returned, unless `balance = false`.
The filter used is either
- `filter_order = 2` (default): ``1 / ((sT_f)^2/(4d^2) + sT_f + 1)`` in series with the controller
## Filter
If `Tf` is supplied, a filter is added, the filter used is either
- `filter_order = 2` (default): ``1 / ((sT_f)^2/(4d^2) + sT_f + 1)`` in series with the controller. Note: this parametrization of the filter differs in behavior from the common parameterizaiton ``1/(s^2 + 2dws + w^2)`` as the parameters vary, the former maintains an almost fixed _bandwidth_ while `d` varies, while the latter maintains a fixed distance of the poles from the origin.
- `filter_order = 1`: ``1 / (1 + sT_f)`` applied to the derivative term only
``T_f`` can typically be chosen as ``T_i/N`` for a PI controller and ``T_d/N`` for a PID controller,
and `N` is commonly in the range 2 to 20. With a second-order filter, `d` controls the damping. `d = 1/√(2)` gives a Butterworth configuration of the poles, and `d=1` gives a critically damped filter (no overshoot).
and `N` is commonly in the range 2 to 20. With a second-order filter, `d` controls the damping. `d = 1/√(2)` gives a Butterworth configuration of the poles, and `d=1` gives a critically damped filter (no overshoot). `d` above one may be used, although `d > 1` yields an increasingly over-damped filter (this parametrization does not send one pole to the origin ``d → ∞`` like the ``(ω,ζ)`` parametrization does).
A balanced state-space realization is returned, unless `balance = false`.
## Discrete-time
For a discrete controller a positive `Ts` can be supplied.
In this case, the continuous-time controller is discretized using the Tustin method.
Expand Down

0 comments on commit f5892f0

Please sign in to comment.