Tietokoneiden näyttöjä, joissa näkyy kuvaa automaatiolaboratorion laitteistosta. Monitoreiden takana näkyy sama laitteisto kuin kuvissa.

timohei.net / My Courses / Production Automation Project / Siemens S7 How-to /
S7 PID

See also Simulating Input Signals Using Force!

In order to be executed with exact intervals PID function block has to be in a Cyclic interrupt block (not in OB1 block). The default execution interval of 100 ms of S7-1200 PLC's Cyclic interrupt block is suitable for PID control.

See more information on simulation of PID_compact function block as well as different versions of the block!

PID in Step7 Menu

PID_CONT (S7-300)

PID Compact (S7-1200)

Extract from the Manual

The calculation of the values in the control blocks is only correct if the block is called at regular intervals. For this reason, you should call the control blocks in a cyclic interrupt OB (OB30 to OB38). Enter the sampling time in the CYCLE parameter.

The setpoint is entered in floating-point format [REAL] at the SP_INT input.

The process variable [mittaussignaali] can be input in the peripheral (I/O) [INT-tyyppinen PV_PER-tulo analogiakortin tulokanavaan kytkettynä] or floating-point [REAL-tyyppinen tieto esimerkiksi laskennan tuloksena] format. The CRP_IN function converts the PV_PER peripheral value to a floating-point format of -100 to +100 % [4..20 mA -viesti skaalautuu oletusarvoilla PV_FAC = 1 ja PV_OFF = 0 asteikolle 0..100 %].

The difference between the setpoint and process variable is the error signal. To suppress a small constant oscillation due to the manipulated variable quantization, a dead band [kuollut alue] is applied to the error signal DEADBAND. If DEADB_W = 0, the dead band is switched off. [Kuollutta aluetta ei useimmiten käytetä.]

The PID algorithm operates as a position algorithm. The proportional, integral INT, and derivative DIF actions are connected in parallel and can be activated or deactivated individually. This allows P, PI, PD, and PID controllers to be configured. Pure I and D controllers are also possible.

It is possible to switch over between a manual and an automatic mode. In the manual mode, the manipulated variable is corrected to a manually selected value. [In Finnish: Manuaali- eli käsiohjauksessa PID-toimilohkon sisäinen säätölaskenta ohitetaan ja lähtöviestiksi asetetaan tulossa MAN oleva arvo.]

The manipulated value [lähtöviesti] can be limited to a selected value using the LMNLIMIT function. Signaling bits [yläraja/upper limit QLMN_HLM, alaraja/lower limit QLMN_LLM] indicate when a limit is exceeded by the input variable. The LMN_NORM function normalizes the output of LMNLIMIT [in Finnish: oletusarvoilla LMN_FAC = 1, LMN_OFF = 0 lähtö skaalataan alueelle 0..100 %].

The manipulated value is also available in the peripheral format. The CPR_OUT function converts the floating-point value LMN to a peripheral value [in Finnish: 0..100 % -> 0..27648 eli analogiakortin lähtökanavalle sopivalle alueelle].

A disturbance variable can be fed forward at the DISV input [myötäkytkentätulo].

timohei's videos on PID in Youtube (in Finnish)

Other videos on PID in Youtube