cl Control Loop

Introduction

A Control Loop is the entire feedback system that regulates a process variable; the PID Controller provides embedded feedback control inside the simulation. The controller adjusts a specified control variable based on the difference between the measured process variable and the defined set point. This allows simulations to represent the way real process loops behave, which is critical for realistic scale-up, control loop tuning, and testing of advanced control strategies. The controller is implemented as a System UDF, so it runs in the same expression engine as other UDF-based elements and can use global variables, global constants, and built-in math functions.

M-Star supports four widely used PID formulations. The first is the Academic or parallel form, in which proportional, integral, and derivative actions all act directly on the error, defined as the difference between the set point and process variable. The user specifies \(K_P\), \(K_I\) (with units of 1/s), and \(K_D\) (with units of s), and the control law follows the classical textbook expression

\[u(t) = K_P e(t) + K_I \int e(t)\,dt + K_D \frac{de(t)}{dt}.\]

The second is the Engineering or reset-time form, which matches many industrial controllers. Here the user specifies \(K_P\), an integral reset time \(T_I\), and a derivative time \(T_D\). The control law is

\[u(t) = K_P \left[ e(t) + \frac{1}{T_I} \int e(t)\,dt + T_D \frac{de(t)}{dt} \right],\]

so that the effective integral gain is \(K_P/T_I\) and the effective derivative gain is \(K_P T_D\). Many plant engineers find \(T_I\) and \(T_D\) more intuitive because they relate directly to loop time constants. Neither the Academic nor the Engineering form uses or displays the min/max set point fields.

The third form is PID on Error, which introduces normalized error. The loop computes

\[e_{norm} = \frac{SP - PV}{SP_{max} - SP_{min}},\]

and applies the same PID structure to this normalized quantity. Normalization allows the same gains to be applied to loops with different engineering units or ranges and is typical of certain DCS implementations. In this form, all three actions—P, I, and D—act on the normalized error.

The fourth form is PI on Error, D on PV, the default in many Emerson DeltaV® controllers. Proportional and integral actions still operate on the normalized error, but the derivative term acts on the process variable signal itself rather than on the error. This means that the derivative contribution responds to the actual dynamics of the process but does not react to a sudden step in set point, avoiding the large derivative “kick” often seen when a set point changes abruptly. This form is frequently preferred for loops such as dissolved oxygen, pH, or temperature because it provides smooth control action while still damping oscillations.

In the Academic and Engineering forms, the error is used in its native engineering units (for example, dissolved oxygen percent, rpm, or pH), so gains are tied to the scale of the variable. In the PID on Error and PI on Error, D on PV forms, the error is normalized by the specified set point range; this makes tuning parameters portable between loops that otherwise have different engineering units or scales.

When replicating plant-controller behavior—especially from Emerson DeltaV®—the PI on Error, D on PV form with normalized error is usually the best match. For theoretical or academic studies, the Academic form is often simpler; and for projects that rely on published tuning correlations, the Engineering form is most convenient.

Multiple PID loops can operate concurrently in a model. They can be combined with statistic filters to smooth noisy sensor signals and with event detectors to trigger transitions between control modes. PID controllers can also be nested within other PID controllers.

Property Grid

General

PID Form

This setting selects which PID algorithm to use. This choice determines both the meaning of the gain parameters and whether the controller uses raw- or scaled-input process variable data. The PID controller implements a basic controller that interfaces with an M-Star simulation using the global variables mechanism.

Academic

This selection provides a textbook parallel PID that applies proportional, integral, and derivative actions directly to the raw error \(e=SP−PV\). Gains are entered as \(K_P\), \(K_I\) (1/s), and \(K_D\) (s) and operate in the native engineering units of the process variable.

Integral Gain

1/s | This setting specifies the integral gain, \(K_I\), directly in units of 1/s. A larger value makes the controller integrate faster and drive the loop toward eliminating steady-state error more aggressively. The effective integral gain in the *Academic form is \(K_P/T_I\).

Engineering

This selection provides an industrial-style form that uses proportional gain \(K_P\), integral reset time \(T_I\) , and derivative time \(T_D\). Integral strength is \(K_P/T_I\) and derivative strength is \(K_P T_D\), matching many plant-controller data sheets

Integral Reset Time

s | This setting specifies the integral reset time, \(T_I\), in seconds. A shorter value makes the controller integrate faster and eliminates steady-state error more aggressively.

PID on Error

This selection provides the normalized-error form that first computes \((SP-PV)/(SP_{max}-SP_{min})\) and applies all three actions to that normalized error. Normalization allows consistent tuning across loops with different scales or engineering units.

Min Set Point

This selection defines the allowable range of set point values, where it is also used to normalize the error.

Max Set Point

This selection defines the allowable range of set point values, where it is also used to normalize the error.

Integral Reset Time

s | This setting specifies the integral reset time, \(T_I\), in seconds. A shorter value makes the controller integrate faster and eliminates steady-state error more aggressively.

PI on Error, D on PV

This selection provides a common Emerson DeltaV®-style form in which proportional and integral actions work on the normalized error, while the derivative term acts on the measured PV. This avoids derivative “kick” during set point changes and gives smoother, more stable loop behavior.

Min Set Point

This selection defines the allowable minimum range of set point values, where it is also used to normalize the error.

Max Set Point

This selection defines the allowable maximum range of set point values, where it is also used to normalize the error.

Integral Reset Time

s | This setting specifies the integral reset time, \(T_I\), in seconds. A shorter value makes the controller integrate faster and eliminates steady-state error more aggressively.

Control Variable

This setting specifies the global variable that the controller writes at each evaluation. This variable represents the actuator, such as sparge gas flow rate, impeller speed, or jacket duty.

Process Variable

This setting specifies the global variable that the controller reads at each step. This variable represents the measured quantity being regulated, such as dissolved oxygen, temperature, or pH.

Process Variable Set Point

This setting specifies the global variable holding the desired set point for the process variable. This can be a constant or a time-varying quantity computed elsewhere in the model.

Min Control Value

This setting defines the lower bounds on the controller output. These limits emulate physical actuator constraints (e.g., minimum gas-flow rates or RPMs) and prevent unrealistic excursions during simulation.

Max Control Value

This setting defines the upper bounds on the controller output. These limits emulate physical actuator constraints (e.g., maximum gas-flow rates or RPMs) and prevent unrealistic excursions during simulation.

Proportional Gain

Dimensionless | This setting sets the proportional gain \(K_P\), which scales the controller output in proportion to the current error.

In the Engineering form, it multiplies both the integral and derivative actions. The proportional gain \(K_P\) multiplies the control-loop error to produce the proportional contribution to the controller output. Its physical units depend on the relationship between the controller’s output and the process variable. When both the process variable and the control variable are expressed in the same normalized scale (such as percentages or fractions of full range), \(K_P\) is dimensionless. If they use different engineering units, \(K_P\) carries the ratio of those units—for example, in a loop where the controller adjusts a sparge gas flow rate (slpm) to regulate dissolved oxygen (%), the proportional gain has units of slpm per %DO.

In the normalized-error PID forms (PID on Error and PI on Error, D on PV), the error is first scaled by the set point range, and is therefore dimensionless, so \(K_P\) effectively has the units of the control variable alone.

Derivative Gain

s | This setting specifies the derivative time, \(T_D\), in seconds. A larger value increases the derivative term, causing the controller to respond more strongly to error rate changes (or of the process variable in PI-on-Error, D-on-PV form). In the Academic form, the equivalent derivative gain is \(K_P T_D\).

Timing

Start Time

s | This setting sets the simulation time at which the controller becomes active. Before this time the control variable is not updated by the loop.

Stop Time Option

This setting determines when the controller stops acting during the simulation.

End of Simulation

With this selection, the controller remains active throughout the simulation.

Specified

With this selection, the controller operates until a specific time defined by Stop Time.

Stop Time

s | This selection marks the moment at which the controller ceases updating its output.

Control Loop Toolbar

Context-Specific Toolbar Options

Description

help Help

The Help command launches the M-Star reference documentation in your web browser.

See also Child Geometry Context Specific Toolbar.

For a full description of each selection on the Context-Specific Toolbar, see Toolbar Selections.