Engee documentation

pidtune

Page in progress.

Setting up PID controllers for linear models of control objects.

Library

EngeeControlSystems

Syntax

Function call

  • c, info = pidtune(sys, type, form) adjusts the controller c like type in the form of form for the management object sys .

  • c, info = pidtune(sys, type, form, ωc) adjusts the controller c like type in the form of form for the management object sys, at the same time , the desired cutoff frequency is indicated ωc an open system c*sys.

  • c, info = pidtune(sys, type, form, ωc, φ) adjusts the controller c like type in the form of form for the management object sys, at the same time , the desired cutoff frequency is specified ωc and the phase stability margin φ an open system c*sys

  • c, info = pidtune(sys, type, form, ωc, φ, design_focus) adjusts the controller c like type in the form of form for the management object sys, at the same time , the desired cutoff frequency and the phase stability margin of the open system are indicated c*sys, as well as the task assigned to her design_focus.

The function also returns the value info, which contains additional information about the control system with a configured controller.

Arguments

Input arguments

# sys — control object

+ dynamic system model

Details

A control object described as a linear stationary model, for example, a transfer function or a model in the state space.

The control object must not contain delays.
The control object should represent a system with one input and one output.
Data types

ControlSystemsBase.LTISystem

# type — type of regulator

+ :p | :i | :pi | :pd | :pdf | :pid | :pidf

Details

Type of regulator:

  • :p — P-controller;

  • :i — And-the-regulator;

  • :pi — The PI controller;

  • :pd — PD controller;

  • :pdf — PD controller with a first-order filter;

  • :pid — PID controller;

  • :pidf — A PID controller with a first-order filter.

Data types

Symbol

# form — form of the regulator

+ :standard | :parallel

Details

Regulator shape: standard or parallel.

Data types

Symbol

# w c is the desired cutoff frequency

+ nothing | scalar

Details

The desired cutoff frequency of the open system for which the regulator is being adjusted is in rad/s. If you do not specify this parameter, the algorithm will automatically select the desired cutoff frequency, trying to find a balance between the speed and stability of the control system, taking into account the dynamic characteristics of the control object.

Increasing the cutoff frequency increases the system’s performance, while decreasing the cutoff frequency increases its stability. By the cutoff frequency, you can roughly judge the bandwidth.

Data types

Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64

Support for complex numbers

None

# φ — desired phase margin

+ nothing | scalar

Details

The desired phase margin of the open system for which the regulator is being adjusted is in degrees. The value must be in the range of 0 before 90 hail.

The algorithm tries to adjust the regulator so that the open system has a given desired phase margin. Setting the desired cutoff frequency may hinder this goal.

As a rule, increasing the desired phase margin increases the stability of the system, but negatively affects its performance.

Data types

Nothing, Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64

Support for complex numbers

None

# design_focus — the task of the management system

+ nothing | :balanced | :reference_tracking | :disturbance_rejection

Details

A priority requirement for a closed-loop control system with a configured controller. You specify which control requirement the regulator tuning algorithm should take into account first.:

  • :balanced — finding a balance between control accuracy and disturbance suppression;

  • :reference_tracking — ensuring the accuracy of regulation;

  • :disturbance_rejection — ensuring the suppression of disturbances.

Regardless of the chosen task of the control system, the algorithm will try to select the parameters of the regulator, while maintaining the robustness of the entire system. The achievement of a successful result of this process depends on the type of regulator, i.e. on the number of its parameters, and on the control object. For example, it is more likely that the algorithm will be able to successfully adjust the regulator to the desired phase margin and control system task for the PID controller than for the P or PI controller.

Data types

Nothing, Symbol

Output arguments

# c — PID controller

+ Pid

Details

The configured controller for the control object sys. If the control object is described by a continuous model, then the controller will also be continuous; if the control object is described by a discrete model, then the controller will also be discrete with a sampling period equal to the sampling period of the control object model.

If the tuning algorithm can adjust a regulator that meets the desired desired characteristics and at the same time requires a simpler structure, the function will return such a regulator. For example, if you specified the type of regulator :pidf If the algorithm was able to meet the requirements for speed and robustness using the PI controller, then the function will return the configured PI controller.
Data types

Pid

# info — additional information

Details

The characteristics of a control system that includes a specified control object and a configured PID controller, returned as a tuple. Tuple Elements:

  1. A flag indicating the stability of a closed system; if the element is equal to true, then the closed system is stable, otherwise it is unstable.

  2. The lowest cutoff frequency of the open system in rad/s achieved as a result of the adjustment.

  3. The phase margin achieved as a result of the adjustment is in degrees.

Data types

Tuple{Bool, Float64, Float64}