Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.

See the recommended documentation of this function

# PID

PID regulator

### Block Screenshot

### Contents

### Description

This block implements a PID (Proportional-Integral-Differential)
controller. It calculates an "error" value *U _{e}*
as the difference between a measured process variable

*U*and a desired setpoint

_{pr}*U*.

_{r}*U _{e} = U_{r} -
U_{pr}*

The purpose is to make the process variable *U _{p}*
follow the setpoint
value

*U*. The PID controller is widely used in feedback control of industrial processes.

_{r}The PID controller calculation (algorithm) involves three separate parameters; the Proportional Kp, the Integral Ki and Derivative Kd values. These terms describe three basic mathematical functions applied to the error signal Ue. Kp determines the reaction to the current error, Ki determines the reaction based on the sum of recent errors and Kd determines the reaction to the rate at which the error has been changing.

The weighted sum of these three actions is used to adjust the process via a control element such as the position of a control valve or the power supply of a heating element. The basic structure of conventional feedback control systems is shown below:

PID law is a linear combination of an input variable
*U _{p}(t)*, its time
integral

*U*and its first derivative

_{i}(t)*U*. The control law

_{d}(t)*U*has the form:

_{con}(t)### Parameters

**Proportional**The value of the gain that multiply the error.

Properties : Type 'vec' of size -1.

**Integral**The value of the integral time of the error.(1/Integral)

Properties : Type 'vec' of size -1.

**Derivation**The value of the derivative time of the error.

Properties : Type 'vec' of size -1.

### Default properties

**always active:**no**direct-feedthrough:**no**zero-crossing:**no**mode:**no**regular inputs:****- port 1 : size [-1,-2] / type 1****regular outputs:****- port 1 : size [-1,-2] / type 1****number/sizes of activation inputs:**0**number/sizes of activation outputs:**0**continuous-time state:**no**discrete-time state:**no**object discrete-time state:**no**name of computational function:***csuper*

### Interfacing function

SCI/modules/scicos_blocks/macros/Linear/PID.sci

### Compiled Super Block content

### Examples

##### Example 1

This example illustrates the usage of PID regulator. It enables you
to fit the output signal *U _{pr}(t)*
to the required signal

*U*easily.

_{r}(t)In this example the control system is a second-order unity-gain low-pass filter with damping ratio ξ=0.5 and cutoff frequency fc= 100 Hz. Its transfer function H(s) is:

To model this filter we use Continuous transfer function block (CLR) from Continuous time systems Palette.

The PID parameters Kp, Ki and Kd are set to 100, 0.1 and 0.

The scope displays the waveforms of system error
*U _{e}* (black),
reference signal

*U*(blue) and process signal

_{r}*U*(red). It shows how initially the process signal

_{pr}*U*does not follow the reference signal

_{pr}(t)*U*.

_{r}(t)##### Example 2

##### Example 3

Report an issue | ||

<< INTEGRAL_m | Continuous time systems palette | TCLSS >> |