Skip to content

PID Controller

Proportional-integral-derivative (PID) feedback controller for dynamic simulations. At each control step it reads the controlled (process) variable of one flowsheet object, compares it with the setpoint and writes a new value to the manipulated variable of another object. Supports manual override, cascade control, feedforward from a measured disturbance and integral anti-windup.

DWSIM.UnitOperations.SpecialOps.PIDController
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← SpecialOpBaseClass ← PIDController

At a glance

PID Controller in the example flowsheet

This object has no stream connections; it acts on other objects through their properties.

Example

This code runs on every build of this site, and the output below is what it printed.

fs = (Flowsheet.Create("PIDExample")
      .WithCompound("Water")
      .WithPropertyPackage(PropertyPackages.SteamTables))

inlet = (fs.AddMaterialStream("Inlet").At(Q.Celsius(25.0), Q.Pascal(130000.0))
         .WithMassFlow(Q.KgPerSecond(10.0)).AsFlowSpec())
s1 = fs.AddMaterialStream("S-1").AsPressureSpec()
s2 = fs.AddMaterialStream("S-2").AsPressureSpec()
outlet = fs.AddMaterialStream("Outlet").AsPressureSpec()
(fs.AddValve("V-01").WithCalcMode(Valve.CalculationMode.Kv_Liquid).WithKv(100.0)
   .WithOpeningPercent(50.0).ConnectFeed(inlet).ConnectProduct(s1))
(fs.AddTank("T-01").WithVolume(Q.CubicMeters(2.0)).WithHeight(Q.Meters(2.0))
   .ConnectFeed(s1).ConnectProduct(s2))
(fs.AddValve("V-02").WithCalcMode(Valve.CalculationMode.Kv_Liquid).WithKv(400.0)
   .WithOpeningKvRelationship().WithOpeningPercent(50.0)
   .ConnectFeed(s2).ConnectProduct(outlet))
fs.AutoLayout()
fs.Solve()                                              # steady state to start from
outlet.Object.Phases[0].Properties.pressure = 101325.0  # discharge to atmosphere

lic = (fs.AddPIDController("LIC-01")
       .Controls("T-01", "Liquid Level", "m")           # process variable
       .Manipulates("V-02", "PROP_VA_5", "")            # outlet valve opening, %
       .WithSetPoint(1.0)
       .WithTuning(2.0, 0.1, 0.0)
       .WithOutputLimits(0.0, 100.0)
       .WithOffset(29.0)
       .ReverseActing(True))                            # level up -> open the valve more
lic.Object.ManipulatedVariableSpan = 100.0

(fs.Dynamics.DefineIntegrator("Int1")
   .WithIntegrationStep(TimeSpan.FromSeconds(5.0)).WithDuration(TimeSpan.FromMinutes(20.0))
   .Monitor("T-01", "Liquid Level", "m", "level")
   .Monitor("V-02", "PROP_VA_5", "", "opening"))
(fs.Dynamics.DefineEventSet("FeedStep")
   .AddStepChange("Inlet", "PROP_MS_2", 15.0, Q.Seconds(600.0), "kg/s", "feed 10 -> 15 kg/s"))
(fs.Dynamics.DefineSchedule("Run").WithIntegrator("Int1").WithEventSet("FeedStep")
   .UseCurrentStateAsInitial(True).MakeCurrent())
result = fs.RunDynamics("Run").Execute()

level, opening = result.GetSeries("level"), result.GetSeries("opening")
print(f"Level                 = {level.Initial:.3f} m at the start, {level.ValueAt(595.0):.3f} m before the step")
print(f"Peak level after step = {max(v for t, v in zip(level.TimeSeconds, level.Values) if t >= 600.0):.3f} m")
print(f"Final level           = {level.Final:.3f} m")
print(f"Valve opening         = {opening.ValueAt(595.0):.1f} % before, {opening.Final:.1f} % at the end")
print(f"Simulated time        = {result.FinalTimeSeconds / 60.0:.0f} min in {result.Steps} steps")

Output

Level                 = 0.010 m at the start, 1.000 m before the step
Peak level after step = 1.062 m
Final level           = 1.000 m
Valve opening         = 28.8 % before, 43.3 % at the end
Simulated time        = 20 min in 241 steps

DWSIM 10.2.11.0, generated 2026-10-08.

Properties

IDs accepted by GetPropertyValue, SetPropertyValue, the sensitivity analysis, the optimizer, the Adjust block and dynamic events. Units are SI; pass another unit system to GetPropertyValue to get them converted.

ID Name Unit (SI) Input
Active yes
ManualOverride Manual Override yes
LastError Previous Error yes
CurrentError Current Error yes
CumulativeError Integral of the Error yes
SetPointAbs Set Point yes
Kp Proportional Gain (Kp) yes
Ki Integral Gain (Ki) yes
Kd Derivative Gain (Kd) yes
Output Controller Output (normalized) yes
OutputMin Controller Output Minimum yes
OutputMax Controller Output Maximum yes
OutputAbs Manipulated Variable Value yes
Offset Manipulated Variable at Zero Output yes
ManipulatedVariableSpan Manipulated Variable Span yes

Learn more

API members

Public members declared by this class. Inherited members are documented on the base classes.

Constructors

PIDController(): Initializes a new default instance of the PIDController class.

Initializes a new default instance of the PIDController class.

public PIDController()
Public Sub New()

PIDController(string, string): Initializes a new instance of the PIDController class with a name and description.

Initializes a new instance of the PIDController class with a name and description.

Parameter Type Description
name String The name of this controller.
description String A brief description of this controller.
public PIDController(string name, string description)
Public Sub New(name As String, description As String)

Properties

Active: Gets or sets whether the controller acts during a dynamic run.

Gets or sets whether the controller acts during a dynamic run. The integrator skips an inactive controller. Default True.

public bool Active { get; set; }
Public Property Active As Boolean

CascadeMasterID: Name (ID) of the master PID controller of a cascade.

Name (ID) of the master PID controller of a cascade. When set, this controller takes its setpoint from the master's OutputAbs at every step. Empty (default) for no cascade.

public string CascadeMasterID { get; set; }
Public Property CascadeMasterID As String

ControlledObject: The flowsheet object whose property is controlled, linked when the flowsheet or the graphic connects it.

The flowsheet object whose property is controlled, linked when the flowsheet or the graphic connects it. The calculation resolves the object from ControlledObjectData. Not serialized.

public BaseClass ControlledObject { get; set; }
Public Property ControlledObject As BaseClass

ControlledVariable: Name of the controlled property.

Name of the controlled property. The PID calculation does not read it; the property comes from ControlledObjectData.

public string ControlledVariable { get; set; }
Public Property ControlledVariable As String

CumulativeError: Running sum of the absolute normalized error, one term per control step, since the last reset.

Running sum of the absolute normalized error, one term per control step, since the last reset. Reported as the integral of the error.

public double CumulativeError { get; set; }
Public Property CumulativeError As Double

CurrentError: Normalized error of the last control step, (PV - SP) / BaseSP, dimensionless.

Normalized error of the last control step, (PV - SP) / BaseSP, dimensionless.

public double CurrentError { get; set; }
Public Property CurrentError As Double

CvOk: Flag indicating that the controlled variable is defined.

Flag indicating that the controlled variable is defined. The PID calculation does not use it.

public bool CvOk { get; set; }
Public Property CvOk As Boolean

DerivativeFilterCoefficient: Coefficient alpha of the first-order derivative filter, DTerm = alpha * DTerm_previous + (1 - alpha) * DTerm_raw.

Coefficient alpha of the first-order derivative filter, DTerm = alpha * DTerm_previous + (1 - alpha) * DTerm_raw. Values outside the open range (0, 1) disable the filter. Default 0.

public double DerivativeFilterCoefficient { get; set; }
Public Property DerivativeFilterCoefficient As Double

DisturbanceObjectData: Measured disturbance for feedforward control: the object, property and units read at every step.

Measured disturbance for feedforward control: the object, property and units read at every step.

public SpecialOpObjectInfo DisturbanceObjectData { get; set; }
Public Property DisturbanceObjectData As SpecialOpObjectInfo

DTerm: Derivative of the last step, in 1/s: the rate of change of the normalized derivative error (PV -...

Derivative of the last step, in 1/s: the rate of change of the normalized derivative error (PV - SetpointWeightD * SP) / BaseSP, or of the negative normalized process variable when UseDerivativeOnPV is set, after the optional derivative filter.

public double DTerm { get; set; }
Public Property DTerm As Double

ExecutionOrder: Position of this controller in the order the dynamic integrator runs the PID controllers, in ascending order.

Position of this controller in the order the dynamic integrator runs the PID controllers, in ascending order. Default 0.

public int ExecutionOrder { get; set; }
Public Property ExecutionOrder As Integer

FeedforwardGain: Feedforward gain, in manipulated variable units per disturbance unit, applied to the deviation of the disturbance...

Feedforward gain, in manipulated variable units per disturbance unit, applied to the deviation of the disturbance from its first reading after a reset, after the lead-lag of FeedforwardLeadTime and FeedforwardLagTime, and added to the manipulated variable value for as long as the deviation lasts. Zero (default) disables feedforward.

public double FeedforwardGain { get; set; }
Public Property FeedforwardGain As Double

FeedforwardLagTime: Lag time constant, in s, of the feedforward lead-lag applied to the disturbance deviation before the feedforward gain.

Lag time constant, in s, of the feedforward lead-lag applied to the disturbance deviation before the feedforward gain. Zero or less disables the lag. Default 1.

public double FeedforwardLagTime { get; set; }
Public Property FeedforwardLagTime As Double

FeedforwardLeadTime: Lead time constant, in s, of the feedforward lead-lag (FeedforwardLeadTime s + 1) /...

Lead time constant, in s, of the feedforward lead-lag (FeedforwardLeadTime s + 1) / (FeedforwardLagTime s + 1) applied to the disturbance deviation before the feedforward gain. Zero or less (default 0) leaves the plain lag.

public double FeedforwardLeadTime { get; set; }
Public Property FeedforwardLeadTime As Double

InitialEstimate: Optional initial estimate of the manipulated variable.

Optional initial estimate of the manipulated variable. The PID calculation does not use it.

public double? InitialEstimate { get; set; }
Public Property InitialEstimate As Double?

ITerm: Time integral of the normalized error, in seconds, accumulated since the last reset.

Time integral of the normalized error, in seconds, accumulated since the last reset. It is clamped by WindupGuard and held while the output sits at a limit.

public double ITerm { get; set; }
Public Property ITerm As Double

Kd: Derivative gain, in s, applied to the rate of change of the normalized error (or of the process variable when...

Derivative gain, in s, applied to the rate of change of the normalized error (or of the process variable when UseDerivativeOnPV is set). Default 2.

public double Kd { get; set; }
Public Property Kd As Double

Ki: Integral gain, in 1/s, applied to the time integral of the normalized error ITerm.

Integral gain, in 1/s, applied to the time integral of the normalized error ITerm. In the ISA form the integral time is Kp / Ki. Default 2.

public double Ki { get; set; }
Public Property Ki As Double

Kp: Proportional gain, dimensionless, applied to the error normalized by the setpoint magnitude BaseSP.

Proportional gain, dimensionless, applied to the error normalized by the setpoint magnitude BaseSP. Default 10.

public double Kp { get; set; }
Public Property Kp As Double

LastError: Normalized error of the previous control step, dimensionless.

Normalized error of the previous control step, dimensionless.

public double LastError { get; set; }
Public Property LastError As Double

ManipulatedObject: The flowsheet object whose property the controller manipulates.

The flowsheet object whose property the controller manipulates. UpdateVars resolves it from ManipulatedObjectData at every step. Not serialized.

public BaseClass ManipulatedObject { get; set; }
Public Property ManipulatedObject As BaseClass

ManipulatedVariable: Name of the manipulated property.

Name of the manipulated property. The PID calculation does not read it; the property comes from ManipulatedObjectData.

public string ManipulatedVariable { get; set; }
Public Property ManipulatedVariable As String

ManipulatedVariableSpan: Range of the MANIPULATED variable, in its own units.

Range of the MANIPULATED variable, in its own units. Left at zero the controller keeps its original arithmetic, in which the output is scaled by the magnitude of the setpoint: OutputAbs = (1 -/+ Output) * |SP|. That only holds while the manipulated and the controlled variable are of the same order, which is true of a level held by a valve opening and false of, say, a flow held by a pressure setpoint, where the controller ends up with an authority of a few pascals and pins itself against a limit on the first step. Set to a positive value and the output rides on the manipulated variable's own scale: OutputAbs = Offset -/+ Output * Span, with Offset the MV at zero controller output. OutputMax - OutputMin is the natural value for it.

public double ManipulatedVariableSpan { get; set; }
Public Property ManipulatedVariableSpan As Double

ManualOverride: When True the controller is in manual: it writes the operator's value MVValue to the manipulated object...

When True the controller is in manual: it writes the operator's value MVValue to the manipulated object and back-calculates Output from it. Returning to automatic sets the integral term so the output continues from the manual value. Default False.

public bool ManualOverride { get; set; }
Public Property ManualOverride As Boolean

MaximumIterations: Maximum number of iterations inherited from the adjust layout.

Maximum number of iterations inherited from the adjust layout. The PID calculation does not use it. Default 10.

public int MaximumIterations { get; set; }
Public Property MaximumIterations As Integer

MaxVal: Optional upper bound of the manipulated variable.

Optional upper bound of the manipulated variable. The PID calculation does not use it; the output limit is OutputMax.

public double? MaxVal { get; set; }
Public Property MaxVal As Double?

MinVal: Optional lower bound of the manipulated variable.

Optional lower bound of the manipulated variable. The PID calculation does not use it; the output limit is OutputMin.

public double? MinVal { get; set; }
Public Property MinVal As Double?

MobileCompatible: Gets a value indicating whether this controller is compatible with mobile interfaces.

Gets a value indicating whether this controller is compatible with mobile interfaces.

public override bool MobileCompatible { get; }
Public Overrides ReadOnly Property MobileCompatible As Boolean

MVHistory: Normalized controller output recorded at each control step, for the history chart.

Normalized controller output recorded at each control step, for the history chart. Not saved in the XML flowsheet file.

public List<double> MVHistory { get; set; }
Public Property MVHistory As List(Of Double)

MvOk: Flag indicating that the manipulated variable is defined.

Flag indicating that the manipulated variable is defined. The PID calculation does not use it.

public bool MvOk { get; set; }
Public Property MvOk As Boolean

MVValue: Manipulated variable value, always in SI units: the value written to the manipulated object at the end of each step.

Manipulated variable value, always in SI units: the value written to the manipulated object at the end of each step. In manual mode it holds the operator's value. In automatic mode UpdateVars refreshes it from the manipulated object and the calculation replaces it with OutputAbs converted to SI. MVValueDisplay gives it in the manipulated variable's units.

public double MVValue { get; set; }
Public Property MVValue As Double

ObjectClass: Gets or sets the simulation object class, which is always Logical for special operations.

Gets or sets the simulation object class, which is always Logical for special operations.

public override SimulationObjectClass ObjectClass { get; set; }
Public Overrides Property ObjectClass As SimulationObjectClass

Offset: Manipulated variable value at zero controller output, in the manipulated variable's units.

Manipulated variable value at zero controller output, in the manipulated variable's units. With ManipulatedVariableSpan at zero it enters the normalized output as a bias of Offset / |SP|; with a positive span the manipulated variable is Offset -/+ Output * Span. Default 0.

public double Offset { get; set; }
Public Property Offset As Double

Output: Normalized (dimensionless) controller output of the last step.

Normalized (dimensionless) controller output of the last step. It is converted into the manipulated variable value OutputAbs using the setpoint magnitude or ManipulatedVariableSpan.

public double Output { get; set; }
Public Property Output As Double

OutputAbs: Manipulated variable value of the last step, in the manipulated variable's units, clamped to...

Manipulated variable value of the last step, in the manipulated variable's units, clamped to [OutputMin, OutputMax]. Setting it through SetPropertyValue also sets the value held in manual mode.

public double OutputAbs { get; set; }
Public Property OutputAbs As Double

OutputMax: Upper limit of the manipulated variable value OutputAbs, in the manipulated variable's units.

Upper limit of the manipulated variable value OutputAbs, in the manipulated variable's units. Default 1000.

public double OutputMax { get; set; }
Public Property OutputMax As Double

OutputMin: Lower limit of the manipulated variable value OutputAbs, in the manipulated variable's units.

Lower limit of the manipulated variable value OutputAbs, in the manipulated variable's units. Default -1000.

public double OutputMin { get; set; }
Public Property OutputMin As Double

PIDForm: PID algorithm form, with Ti = Kp / Ki and Td = Kd / Kp.

PID algorithm form, with Ti = Kp / Ki and Td = Kd / Kp. 0 = parallel (default): Output = PTerm + Ki * ITerm + Kd * DTerm. 1 = ISA (standard, non-interacting): Output = Kp * (beta * e + ITerm / Ti + Td * DTerm). 2 = series (interacting), Kp * (1 + 1 / (Ti s)) * (1 + Td s): Output = Kp * ((1 + Td / Ti) * beta * e + ITerm / Ti + Td * DTerm), the same as the ISA form with Kp * (1 + Td / Ti), Ti + Td and Ti * Td / (Ti + Td). Any other value is calculated with the ISA form. Since Ti and Td are taken from Ki and Kd, the ISA output equals the parallel one and both are calculated as PTerm + Ki * ITerm + Kd * DTerm, which stays finite at Kp = 0.

public int PIDForm { get; set; }
Public Property PIDForm As Integer

PTerm: Proportional contribution of the last step: Kp * SetpointWeightP * CurrentError.

Proportional contribution of the last step: Kp * SetpointWeightP * CurrentError. In the series form (PIDForm = 2) it carries the interaction factor, Kp * (1 + Td / Ti) * SetpointWeightP * CurrentError.

public double PTerm { get; set; }
Public Property PTerm As Double

PVHistory: Process variable values recorded at each control step, divided by BaseSP, for the history chart.

Process variable values recorded at each control step, divided by BaseSP, for the history chart. Not saved in the XML flowsheet file.

public List<double> PVHistory { get; set; }
Public Property PVHistory As List(Of Double)

PVValue: Process (controlled) variable value read at the last update, in the controlled variable's units.

Process (controlled) variable value read at the last update, in the controlled variable's units.

public double PVValue { get; set; }
Public Property PVValue As Double

ReferenceObject: Reference object, linked from ReferencedObjectData when the flowsheet loads.

Reference object, linked from ReferencedObjectData when the flowsheet loads. The PID calculation does not use it. Not serialized.

public BaseClass ReferenceObject { get; set; }
Public Property ReferenceObject As BaseClass

ReferenceVariable: Name of the reference property.

Name of the reference property. The PID calculation does not use it.

public string ReferenceVariable { get; set; }
Public Property ReferenceVariable As String

ReverseActing: Controller action.

Controller action. False (default): a process variable above the setpoint lowers the manipulated variable. True: a process variable above the setpoint raises it.

public bool ReverseActing { get; set; }
Public Property ReverseActing As Boolean

RvOk: Flag indicating that the reference variable is defined.

Flag indicating that the reference variable is defined. The PID calculation does not use it.

public bool RvOk { get; set; }
Public Property RvOk As Boolean

SetPoint: Gets or sets the controller setpoint, in the controlled variable's units.

Gets or sets the controller setpoint, in the controlled variable's units. Same value as AdjustValue.

public double SetPoint { get; set; }
Public Property SetPoint As Double

SetpointWeightD: Setpoint weight (gamma) of the derivative term on error: the derivative acts on (PV - gamma * SP) / BaseSP.

Setpoint weight (gamma) of the derivative term on error: the derivative acts on (PV - gamma * SP) / BaseSP. At 1 (default) it is the derivative of the error, at 0 the derivative of the process variable alone, with no kick when the setpoint moves. Not used when UseDerivativeOnPV is set.

public double SetpointWeightD { get; set; }
Public Property SetpointWeightD As Double

SetpointWeightP: Setpoint weight (beta) of the proportional term: PTerm = Kp * beta * CurrentError.

Setpoint weight (beta) of the proportional term: PTerm = Kp * beta * CurrentError. Default 1.

public double SetpointWeightP { get; set; }
Public Property SetpointWeightP As Double

SPHistory: Setpoint values recorded at each control step, divided by BaseSP, for the history chart.

Setpoint values recorded at each control step, divided by BaseSP, for the history chart. Not saved in the XML flowsheet file.

public List<double> SPHistory { get; set; }
Public Property SPHistory As List(Of Double)

SPValue: Setpoint value at the last update, in the controlled variable's units.

Setpoint value at the last update, in the controlled variable's units.

public double SPValue { get; set; }
Public Property SPValue As Double

Status: Free-text status string.

Free-text status string. The PID calculation does not set it.

public string Status { get; set; }
Public Property Status As String

StepSize: Step size inherited from the adjust layout.

Step size inherited from the adjust layout. The PID calculation does not use it. Default 0.1.

public double StepSize { get; set; }
Public Property StepSize As Double

SupportsDynamicMode: Gets a value indicating whether this controller runs in dynamic mode.

Gets a value indicating whether this controller runs in dynamic mode. Always True.

public override bool SupportsDynamicMode { get; }
Public Overrides ReadOnly Property SupportsDynamicMode As Boolean

UseDerivativeOnPV: When True the derivative term acts on the rate of change of the process variable (derivative on measurement), which...

When True the derivative term acts on the rate of change of the process variable (derivative on measurement), which avoids a derivative kick when the setpoint changes. Default False (derivative on the error).

public bool UseDerivativeOnPV { get; set; }
Public Property UseDerivativeOnPV As Boolean

WindupGuard: Anti-windup limit: the integral term ITerm is clamped to the range [-WindupGuard, WindupGuard], in...

Anti-windup limit: the integral term ITerm is clamped to the range [-WindupGuard, WindupGuard], in normalized error times seconds. Default 20.

public double WindupGuard { get; set; }
Public Property WindupGuard As Double

Methods

Calculate(object): Calculates the object.

Calculates the object.

Parameter Type Description
args Object
public override void Calculate(object args = null)
Public Overrides Sub Calculate(args As Object = Nothing)

CloneXML(): Creates a deep copy of this object by round-tripping through XML serialization.

Creates a deep copy of this object by round-tripping through XML serialization.

public override object CloneXML()
Public Overrides Function CloneXML() As Object

CloseEditForm(): Closes the editor of this object, if it is open.

Closes the editor of this object, if it is open.

public override void CloseEditForm()
Public Overrides Sub CloseEditForm()

DisplayEditForm(): Opens the editor of this object.

Opens the editor of this object. A host that has no editor for it does nothing.

public override void DisplayEditForm()
Public Overrides Sub DisplayEditForm()

EstimateParameters(): Estimates starting values for the tuning from the current error and the current integrator time step: Kp and Kd are...

Estimates starting values for the tuning from the current error and the current integrator time step: Kp and Kd are set from the mid-point of the output range, and Ki is set to zero.

public void EstimateParameters()
Public Sub EstimateParameters()

GetChartModel(string): Builds the history chart with the normalized setpoint, process variable and controller output per control step.

Builds the history chart with the normalized setpoint, process variable and controller output per control step.

Parameter Type Description
name String The chart name, shown as the subtitle ("History").
public override object GetChartModel(string name)
Public Overrides Function GetChartModel(name As String) As Object

GetChartModelNames(): Returns the names of the charts this controller can embed in the flowsheet.

Returns the names of the charts this controller can embed in the flowsheet.

public override List<string> GetChartModelNames()
Public Overrides Function GetChartModelNames() As List(Of String)

GetDisplayDescription(): Returns the localized description string for this controller type.

Returns the localized description string for this controller type.

public override string GetDisplayDescription()
Public Overrides Function GetDisplayDescription() As String

GetDisplayName(): Returns the localized display name for this controller type.

Returns the localized display name for this controller type.

public override string GetDisplayName()
Public Overrides Function GetDisplayName() As String

GetEditingForm(): The editor window of this object, a window of the host's UI framework.

The editor window of this object, a window of the host's UI framework.

public override object GetEditingForm()
Public Overrides Function GetEditingForm() As Object

GetIconBitmapBytes(): Returns the raw bytes of the icon image for this controller.

Returns the raw bytes of the icon image for this controller.

public override byte[] GetIconBitmapBytes()
Public Overrides Function GetIconBitmapBytes() As Byte()

GetProperties(PropertyType): Get a list of all properties of the object.

Get a list of all properties of the object.

Parameter Type Description
proptype PropertyType Type of the property.
public override string[] GetProperties(PropertyType proptype)
Public Overrides Function GetProperties(proptype As PropertyType) As String()

GetPropertyDescription(string): Readable names for the property identifiers, which are the .NET property names.

Readable names for the property identifiers, which are the .NET property names.

Parameter Type Description
prop String
public override string GetPropertyDescription(string prop)
Public Overrides Function GetPropertyDescription(prop As String) As String

GetPropertyUnit(string, IUnitsOfMeasure): Gets the units of a property.

Gets the units of a property.

Parameter Type Description
prop String Property identifier.
su IUnitsOfMeasure Units system to use. Null to use the default (SI) system.
public override string GetPropertyUnit(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyUnit(prop As String, su As IUnitsOfMeasure = Nothing) As String

GetPropertyValue(string, IUnitsOfMeasure): Gets the value of a property.

Gets the value of a property.

Parameter Type Description
prop String Property identifier.
su IUnitsOfMeasure Units system to use. Null to use the default (SI) system.
public override object GetPropertyValue(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyValue(prop As String, su As IUnitsOfMeasure = Nothing) As Object

LoadData(List<XElement>): Loads object data stored in a collection of XML elements.

Loads object data stored in a collection of XML elements.

Parameter Type Description
data List<XElement>
public override bool LoadData(List<XElement> data)
Public Overrides Function LoadData(data As List(Of XElement)) As Boolean

Reset(): Clears the controller state: the P, I and D terms, the errors, the output, the derivative filter, the histories and...

Clears the controller state: the P, I and D terms, the errors, the output, the derivative filter, the histories and BaseSP. Tuning, limits and the setpoint are kept.

public void Reset()
Public Sub Reset()

SaveData(): Saves object data in a collection of XML elements.

Saves object data in a collection of XML elements.

public override List<XElement> SaveData()
Public Overrides Function SaveData() As List(Of XElement)

SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of a property.

Sets the value of a property.

Parameter Type Description
prop String Property identifier.
propval Object Property value to set at the specified units.
su IUnitsOfMeasure Units system to use. Null to use the default (SI) system.
public override bool SetPropertyValue(string prop, object propval, IUnitsOfMeasure su = null)
Public Overrides Function SetPropertyValue(prop As String, propval As Object, su As IUnitsOfMeasure = Nothing) As Boolean

StartFromManipulatedVariable(): Resets the controller and makes its first step start from the manipulated variable as it is now: the output is read...

Resets the controller and makes its first step start from the manipulated variable as it is now: the output is read back from the valve opening (or whatever the controller moves) and the integral term is set to hold it, the same handover as leaving manual. A run that starts from a stored flowsheet state continues from the opening the state carries, whatever the tuning.

public void StartFromManipulatedVariable()
Public Sub StartFromManipulatedVariable()

UpdateEditForm(): Redraws the editor of this object with the current values, if it is open.

Redraws the editor of this object with the current values, if it is open.

public override void UpdateEditForm()
Public Overrides Sub UpdateEditForm()

UpdateVars(): Reads the setpoint, the process variable and, in automatic mode, the manipulated variable from the flowsheet into...

Reads the setpoint, the process variable and, in automatic mode, the manipulated variable from the flowsheet into SPValue, PVValue (both in display units) and MVValue (in SI), and resolves ManipulatedObject. Leaves the values unchanged when the controller is not fully configured.

public void UpdateVars()
Public Sub UpdateVars()

Fields

BaseSP: Setpoint magnitude |SP| captured at the first control step after a reset, used to normalize the error, the output...

Setpoint magnitude |SP| captured at the first control step after a reset, used to normalize the error, the output and the histories. Nothing until the first step.

public double? BaseSP
Public BaseSP As Double?

f: The classic (WinForms) editor window open for this controller, if any.

The classic (WinForms) editor window open for this controller, if any. Not saved with the flowsheet.

public object f
Public f As Object