Search Results for

    Show / Hide Table of Contents

    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 PidTuning
    Inheritance
    object
    ModelBaseClass
    PidModel
    Implements
    ISimulatableModel
    Inherited Members
    ModelBaseClass.ID
    ModelBaseClass.ModelInputIDs
    ModelBaseClass.additiveInputIDs
    ModelBaseClass.outputID
    ModelBaseClass.outputIdentID
    ModelBaseClass.processModelType
    ModelBaseClass.comment
    ModelBaseClass.x
    ModelBaseClass.y
    ModelBaseClass.color
    ModelBaseClass.GetID()
    ModelBaseClass.SetID(string)
    ModelBaseClass.SetProcessModelType(ModelType)
    ModelBaseClass.GetProcessModelType()
    ModelBaseClass.SetInputIDs(string[], int?)
    ModelBaseClass.AddSignalToOutput(string)
    ModelBaseClass.GetModelInputIDs()
    ModelBaseClass.GetAdditiveInputIDs()
    ModelBaseClass.GetBothKindsOfInputIDs()
    ModelBaseClass.SetOutputID(string)
    ModelBaseClass.GetOutputID()
    ModelBaseClass.GetOutputIdentID()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: TimeSeriesAnalysis.Dynamic
    Assembly: TimeSeriesAnalysis.dll
    Syntax
    public class PidModel : ModelBaseClass, ISimulatableModel

    Constructors

    | Edit this page View Source

    PidModel(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 Source

    pidParameters

    The paramters which define the behavior of the PidModel

    Declaration
    public PidParameters pidParameters
    Field Value
    Type Description
    PidParameters

    Methods

    | Edit this page View Source

    Clone(string)

    Create deep copy/clone

    Declaration
    public ISimulatableModel Clone(string ID = null)
    Parameters
    Type Name Description
    string ID
    Returns
    Type Description
    ISimulatableModel
    | Edit this page View Source

    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
    ModelBaseClass.GetLengthOfInputVector()
    | Edit this page View Source

    GetModelParameters()

    Get the model parameters

    Declaration
    public PidParameters GetModelParameters()
    Returns
    Type Description
    PidParameters

    the parameters object of the model

    | Edit this page View Source

    GetOutputSignalType()

    Return the type of the output signal

    Declaration
    public override SignalType GetOutputSignalType()
    Returns
    Type Description
    SignalType
    Overrides
    ModelBaseClass.GetOutputSignalType()
    | Edit this page View Source

    GetSteadyStateInput(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?
    | Edit this page View Source

    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?
    | Edit this page View Source

    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
    | Edit this page View Source

    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 isy_process_abs, second value is y_set_abs, optional third value is uTrackSignal, optional fourth value is gainSchedulingVariable

    double timeBase_s

    time base in seconds

    double badDataID

    value of inputs that is to be treated as NaN

    Returns
    Type Description
    double[]

    the output u of the pid-controller. If not enough inputs, it returns NaN

    | Edit this page View Source

    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
    | Edit this page View Source

    SetToAutoMode()

    Set controller in auto

    Declaration
    public void SetToAutoMode()
    | Edit this page View Source

    SetToManualMode()

    Set controller in auto

    Declaration
    public void SetToManualMode()
    | Edit this page View Source

    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
    object.ToString()
    | Edit this page View Source

    WarmStart(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
    | Edit this page View Source

    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

    Implements

    ISimulatableModel
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX