EBSILON®Professional Online Documentation
EBSILON Professional Components / Components - General and Categories / Renewable / Component 130: PID-Controller (with Anti Wind-Up)
In This Topic
    Component 130: PID-Controller (with Anti Wind-Up)
    In This Topic


    Component 130: PID-Controller (with anti-windup)


    Specifications

    Line connections

    1

    Signal in

    2

    PID out

    3

    Set Point

    4

    Control inlet for Kp (as M), TN or Kl (as H) und TV or KD (as P)

    General       User input values       Results       Characteristic lines       Physics used       Display shapes       Example

     

    General

    The task of this controller is to compensate a control difference (caused e.g. by the transfer behaviour of a transient component) in the case of transient processes. It cannot be applied as a data controller (“iteration controller“) like e.g. Component 12! By means of a correction variable, a chronologically variable actual value is calculated until it has reached the specified set point value. This is a matter of a control algorithm with P-, I and D-fractions and not of calculating a target value by means of a steady-state input variable! This type of controller uses the common differential equation to calculate the transfer function of PID-Controllers:

    Eqn. 1-1

    Delivers the output signal y(t) with following parameters:

    The integral part of the output signal y(t) can be obtained from the history of the input signals. The integrator is realized via summing the previous input signals e(t).
    The differential time steps dt are replaced by the intervals of the sampling time Dt, which are given from the time series dialog in EBSILONprofessional.

    Using this kind of discretisation eqn.1-1 changes to the following with regard to time step k:

    Eqn. 1-2

    This type of controller requires a specification of the physical quantity to be controlled as well as of the input quantity. Correcting variable has to be one of the base quantities such as mass flow, enthalpy and pressure. Concerning input value derived ones are also possible, e.g. heat flow and temperature. Attention should be paid to set up the right characteristic of the controller:

    Global Initialization of Transient Components

    All transient components that possess the flag FINIT can be commonly controlled via one global flag.

    For this, the flag FINIT has been expanded by the position GLOBAL: 0.

    If it is set to this value, the control of the transient simulation will be handed over to the global variable “Transient mode“, which can be found under

    Extras \Model Options\Simulation\Transient\ Combo Box "Transient mode"

     

    This will then pass on the desired mode (first iteration or following iteration) to the components. This can be controlled from the time series dialog by means of the expression “@calcoptions.sim.transientmode“.

     

    Additional logic line (Pin 4)

    For the PID controller, there is an additional logic line (Port 4) that can be switched on optionally. With its help, the controller parameters (Kp, KI, and KD) can be set externally. Here the data are taken over into the model in each iteration step. In connection with this, there is another flag FPARAMIN for selecting the source of the parameters.

    Specification value FOUTUS: specification of the outlet signal

    Usually, the actual value of the target variable is unknown before the simulation, and it is only determined in the course of the iteration. On the other hand, the outlet signal of the controller (PIN 2) depends on the actual value and on its difference with respect to the reference variable respectively. This may lead to convergence problems. To alleviate this problem, the specification value FOUTUS has been implemented in Component 130.

    The setting FOUTUS = 0 is the default setting. It is recommended to use the setting FOUTUS = 1 only if convergence cannot be achieved by other means.

     


     

     

    User input values

     FINIT

     Flag: Initializing state

     Like in Parent Profile (Sub profile option only)

     Expression

    =0: Global, which is controlled via global variable "Transient mode" under Model Options:
          "Extras" ->"Model Options" -> "Simulation" -> "Transient" -> Combo Box "Transient mode"

            (See -> General -> Global Initialization of Transient Components )

     =1: First run (TCOUNT set to 0)
     =2: Continuation run 

     FTYPE

     Switch specification of controller parameters 
     Like in Parent Profile (Sub profile option only)

     Expression

     =0: Specification of proportional gain factor and time constants         Kp, Tn und Tv
     =1: Specify gain coefficients                                                                KP, KI, KD

     FSPIN

     Switch source of setpoint/input signal  

     Like in Parent Profile (Sub profile option only)

     Expression          
     =0:  internally given value
     =1:  externally from line 3
     =2:  input only from line 1 (line 3 and internal set point not taken into account)

     FPARAMIN

     Source of controller parameters
    Like in Parent Profile (Sub profile option only)

     Expression

     =0:  Internally Set
     =1:  Eternally by connection point n                   

     FSPTYPE

     Switch for specification of the type of controller parameters

     Like in Parent Profile (Sub profile option only)

     Expression

      =1: Pressure
     =2: Temperature
     =3: Enthalpy
     =4: Mass flow
     =5: Power, Enthalpy flow

     FPIDOUT

     Switch for type of control variable

     Like in Parent Profile (Sub profile option only)

     Expression

     =1: Pressure
     =3: Enthalpy
     =4: Mass flow

     SETPOINT

     Internal set point dependent on FSPSOURCE

     KP

     Proportional gain factor

     <0: Negative characteristic of controller

     >0: Positive characteristic of controller

     KI

     Integral gain factor, dependent on FTYPE, not active in case of FTYPE = 0

     KD

     Differential gain factor, dependent on FTYPE, not active in case of FTYPE = 0

     TN

     Reset time, dependent on FTYPE, not active in case of FTYPE = 1

     TV

     Rate time, dependent on FTYPE, not active in case of FTYPE = 1

     YINI

     Initial Value for output signal

     FPIDMODE

     Switch for controller algorithm

     Like in Parent Profile (Sub profile option only)

     Expression

     =1: Difference equation
     =2: Position algorithm

     FINTEGRAL

     Switch method of integration

     Like in Parent Profile (Sub profile option only)

     Expression

     =1: Backward integration
     =2: Forward integration
     =3: Trapezoidal integration

     FYLIMIT

     Switch for controller limiting

     Like in Parent Profile (Sub profile option only)

     Expression

     =0: no limitation
     =1: Saturation feedback
     =2: Stop integrator
     =3: Limitation of integrator

     YMIN

     Minimal value of output signal

     YMAX

     Maximal value of output signal

     TPRE

     Index of previous time step (if set to 0, all buffers are going to be initialized)

     TIMEINT

     Total integration time

     FOUTUS

     Corrected value usage (see under "General")                  

     Like in Parent Profile (Sub profile option only)

     Expression

     =0: From current time step ( highest accuracy)
     =1: From previous time step ( highest convergence rate)

     CLAG

     indicated value for integrator clamping (no input), active for FYLIMIT =3. If indicated value (CFLAG)= 1, then it indicates, that Clamping was active in the last time step.

     


     

     

    Results

    RKP

    Calculated proportional gain factor

    RKI

    Calculated integral gain factor

    RKD

    Calculated differential gain factor

    RTN

    Calculated reset time 

    RTV

    Calculated rate time

    RPROP

    Actual proportional part  of the controller output signal

    RINT

    Actual integral part  of the controller output signal

    RDIFF

    Actual differential part  of the controller output signal

    RTCURR

    Index of actual time step

    RTIMETOT

    Total time at end of calculation

    RCFLAG

    Status of integrator clamping


    Characteristic curves

    These "characteristic" curves don´t give any specifications or correlations to characterize the component. They are necessary to just as memory for the signals.
    Normally, there´s no need to set any values or give specifications, because the are transferred automatically by the time series calculations.

     

    CCONTROLIN - History of input signal at line 1

    This line stores the course of the input signal at line 1.

    x-axis: Time steps, accumulated in seconds starting at Dt from first step.

    y-axis: Values of input signals.

    COUTPUT       - History of output signal at line 2

    This line stores the course of the output signal at line 2.

    x-axis: Time steps, accumulated in seconds starting at Dt from first step.

    y-axis: Values of output signals.

    CINTEGRATOR - History of integral part of the output signal

    This line stores the course of the integrator values representing the I-Part of the output signal at line 2.

    x-axis: Time steps, accumulated in seconds starting at Dt from first step.

    y-axis: Values of output signals.

    CSETPOINT     - History of set points (line 3 or internal)

    This line stores the course of the set points.

    x-axis: Time steps, accumulated in seconds starting at Dt from first step.

    y-axis: Values of set points

     

    Result curves

    RACONTROLIN  - History of input signals at line 1

    RAOUTPUT        - History of output signals at line 2

    RAINTEGRATOR - History of integral part of the output signal at line 2

    RASETPOINT      - History of set points (line 3 or internal)

    The output curves are correlated to the correspondent characteristic lines, all of them show the values at the end of the time step.
    For calculation of the following time step the values of the result curves are copied to the characteristic lines, what forms a kind of circular buffer.


    Physics used

    Equations 

     With respect to users needs there are two algorithms to determine the numerical treatment of the controller equation eqn. 1-2.:

    • PID difference equation
    • Position algorithm

     Difference equation

     

      

     

     Position algorithm

     

               
     y(k)     = y(k-1) + b0*e(k)+b1*e(k-1)+b2*e(k-2)

     with b0 = KP + KI*DT+KD/DT

           b1 = -KP-2KD/DT

           b2 = KD/DT
            

     

     Relationship of input parameters (based on the model of ideal PID-Controller)

     


     KI  = KP/TN, and TN = KP/KI

     KD = KP*TV, and. TV=KD/KP
                     

     

    Possibilities to control the output signal (Anti Windup)

    All real controllers reach an almost physically determined limit of the quantity to be controlled. Either a lower or an upper limit will cut the range of possible output values governing the controlled system. For example at given conditions the output of a water tap can only vary between zero and max flow.

    Hence, if there´s a remaining control deviation the integrator part can cause problems without being controlled (wind-up effects). In fact that means the integrator can end up with values, which take a long time to be balanced again.

    To control the output signal, especially the integrators part of the signal various methods can be applied:

    Saturation Feedback  (FYLIMIT = 1)

    y(k)    <=  ymax && y(k) >= ymin 

    y(k)    = ymax, resp. ymin

    y(k-1) = (ylim - KP*e(k) - KD/DT*(e(k) -e(k-1)))/KI*DT
              

     

    This method compares the output signal to a given limiting value. While under- or overflow, the limit value will be set to the controller output and the integral part is fixed using feed back of a differential value, which simulates a zero input to the integrator. In this way the stored values remain active, but won´t cause any crossings of the thresholds.   

     Stop Integration (FYLIMIT = 2)

     


     y(k)    <=  ymax && y(k) >= ymin 

     y(k)    = ymax, resp. ymin

     y(k-1) = const. (y(k-2))

     

    This method stops the integration by setting it to a constant value, e.g. the value of the previous time step.

     Clamp Integration (FYLIMIT = 3)

     


     y(k)    <=  ymax && y(k) >= ymin 

     Se(i)  = ymax, resp. ymin

     

    This method clamps the integration to the given limits.


    Integration methods

    For the calculation of the summations in the controller equation three methods can be chosen:

     Forward

     

     Se(i) = e(k)

     

     Backward

     

     Se(i) = e(k-1)      

     

     Trapoidal

     

      Se(i) = 1/2*(e(k)+e(k-1))               

     


     

    Displays

    Form 1


    Example

    Click here >> Component 130 Demo << to load an example.

    See Also