Class PidModel
Simulatable industrial PID-controller
This class is as a wrapper for PidController class, that implements ISimulatableModel.
To simulate minimum or maximum select controllers, combine this class with Select blocks.
The controller paramters belong to different aspects of the controller like, tuning, scaling, gain-scheduling, feedforward and anti-surge are adjusted have been collected into a number of data-classes, linked below:
PidParameters PidAntiSurgeParams PidFeedForward PidGainScheduling PidStatus PidScaling PidTuningImplements
Inherited Members
Namespace: TimeSeriesAnalysis.Dynamic
Assembly: TimeSeriesAnalysis.dll
Syntax
public class PidModel : ModelBaseClass, ISimulatableModel
Constructors
| Edit this page View SourcePidModel(PidParameters, string)
Constructor
Declaration
public PidModel(PidParameters pidParameters, string ID = "not_named")
Parameters
| Type | Name | Description |
|---|---|---|
| PidParameters | pidParameters | object containing the paramters of the controller |
| string | ID | Each controller shoudl be given a unique ID |
Fields
| Edit this page View SourcepidParameters
The paramters which define the behavior of the PidModel
Declaration
public PidParameters pidParameters
Field Value
| Type | Description |
|---|---|
| PidParameters |
Methods
| Edit this page View SourceClone(string)
Create deep copy/clone
Declaration
public ISimulatableModel Clone(string ID = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | ID |
Returns
| Type | Description |
|---|---|
| ISimulatableModel |
Clone(PidParameters)
Create deep copy/clone that replaces the existing paramters with a new paramters object, keeping the id the same
Declaration
public ISimulatableModel Clone(PidParameters newPidParameters)
Parameters
| Type | Name | Description |
|---|---|---|
| PidParameters | newPidParameters |
Returns
| Type | Description |
|---|---|
| ISimulatableModel |
GetLengthOfInputVector()
Get number of inputs (between 2 and 4) first input is always ymeas, second input is y_setpoint, optionally, input 3 is track signal and input 4 is gain scheduling variable
Declaration
public override int GetLengthOfInputVector()
Returns
| Type | Description |
|---|---|
| int |
Overrides
| Edit this page View SourceGetModelParameters()
Get the model parameters
Declaration
public PidParameters GetModelParameters()
Returns
| Type | Description |
|---|---|
| PidParameters | the parameters object of the model |
GetOutputSignalType()
Return the type of the output signal
Declaration
public override SignalType GetOutputSignalType()
Returns
| Type | Description |
|---|---|
| SignalType |
Overrides
| Edit this page View SourceGetSteadyStateInput(double, int, double[])
[Method not currently implemented]
Declaration
public double? GetSteadyStateInput(double y0, int inputIdx = 0, double[] givenInputValues = null)
Parameters
| Type | Name | Description |
|---|---|---|
| double | y0 | |
| int | inputIdx | |
| double[] | givenInputValues |
Returns
| Type | Description |
|---|---|
| double? |
GetSteadyStateOutput(double[], double)
NOT IMPLEMENTED/NOT APPLICABLE
Declaration
public double? GetSteadyStateOutput(double[] u0, double badDataID)
Parameters
| Type | Name | Description |
|---|---|---|
| double[] | u0 | |
| double | badDataID | optional special value that indicates "Nan" |
Returns
| Type | Description |
|---|---|
| double? |
IsModelSimulatable(out string)
Answers if the model with the curret paramters makes sense to simulate
Declaration
public bool IsModelSimulatable(out string explainStr)
Parameters
| Type | Name | Description |
|---|---|---|
| string | explainStr |
Returns
| Type | Description |
|---|---|
| bool |
Iterate(double[], double, double)
Iterate the PID controller one step
Declaration
public double[] Iterate(double[] inputs, double timeBase_s, double badDataID = -9999)
Parameters
| Type | Name | Description |
|---|---|---|
| double[] | inputs | is a vector of length 2, 3 or 4.
First value is |
| double | timeBase_s | time base in seconds |
| double | badDataID | value of inputs that is to be treated as |
Returns
| Type | Description |
|---|---|
| double[] | the output |
SetManualOutput(double)
Set the desired manual output fo controller. This output will only be applied if controller is in MANUAL mode.
Declaration
public void SetManualOutput(double manualOutput_prc)
Parameters
| Type | Name | Description |
|---|---|---|
| double | manualOutput_prc |
SetToAutoMode()
Set controller in auto
Declaration
public void SetToAutoMode()
SetToManualMode()
Set controller in auto
Declaration
public void SetToManualMode()
ToString()
Create a nice human-readable summary of all the important data contained in the model object. This is especially useful for unit-testing and development.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
| Edit this page View SourceWarmStart(double, double, double)
Initalizes the controller internal state(integral term) to be steady at the given process value and output value, useful to avoid bumps when staring controller
Declaration
public void WarmStart(double y_process_abs, double y_set, double u)
Parameters
| Type | Name | Description |
|---|---|---|
| double | y_process_abs | |
| double | y_set | |
| double | u |
WarmStart(double[], double)
Initalizes the controller internal state(integral term) to be steady at the given process value and output value, useful to avoid bumps when staring controller
Declaration
public void WarmStart(double[] inputs, double output)
Parameters
| Type | Name | Description |
|---|---|---|
| double[] | inputs | |
| double | output |