FB_ALY_StepResponse_1Ch

Step Response 1Ch identifies parameters of the step response of a PT2 track. These include the delay time Te, the compensation time Tb, the settling time Tcs, and the time of maximum tm.

FB_ALY_StepResponse_1Ch 1:

To detect whether the track is steady, a local minimum or maximum is searched for. If this is within the tolerance band (marked in gray), it is assumed that the track is steady. Only then is the settling time set.

The algorithm starts when a new setpoint is outside the previously stored tolerance band.

Syntax

Definition:

FUNCTION_BLOCK FB_ALY_StepResponse_1Ch
VAR_OUTPUT
    ipResultMessage: Tc3_EventLogger.I_TcMessage;
    bError: BOOL;
    bNewResult: BOOL;
    bConfigured: BOOL;
    bExecuting: BOOL;
    fbEquivalentDeadTime: FB_ALY_Timespan;
    fbEquivalentTimeConstant: FB_ALY_Timespan;
    fbSettlingTime: FB_ALY_Timespan;
    fbTimeMax: FB_ALY_DateTime;
    fError: LREAL;
END_VAR

FB_ALY_StepResponse_1Ch 2: Outputs

Name

Type

Description

ipResultMessage

I_TcMessage

Contains more detailed information on the current return value. This special interface pointer is internally secured so that it is always valid/assigned.

bError

BOOL

This output is TRUE if an error occurs.

bNewResult

BOOL

When a new result has been calculated, the output is TRUE.

bConfigured

BOOL

Displays TRUE when the function block is successfully configured.

bExecuting

BOOL

TRUE if the parameter identification is active.

fbEquivalentDeadTime

FB_ALY_Timespan

Delay time of the track. Timespan between the start of the step response and the intersection of the inflectional tangents with the start value.

fbEquivalentTimeConstant

FB_ALY_Timespan

Compensation time of the track. Timespan between the intersection point of the inflectional tangents with the start value and the intersection point of the inflectional tangents with the setpoint.

fbSettlingTime

FB_ALY_Timespan

Settling time of the track.

fbTimeMax

FB_ALY_DateTime

Time of the maximum overshoot.

fError

LREAL

Difference between input value and setpoint.

FB_ALY_StepResponse_1Ch 3: Methods

Name

Definition location

Description

Call()

Local

Method for calculating the outputs for a specific configuration.

Configure()

Local

General configuration of the algorithm with its parameterized conditions.

Reset()

Local

Resets all internal states or the calculations performed so far.

SetChannelValue()

Local

Method for passing values to the algorithm.

Sample

VAR
    fbStepResponse : FB_ALY_StepResponse_1Ch;
    fbSystemTime : FB_ALY_GetSystemTime;
        
    fThresholdReversal : LREAL;
    bUseRelativeTolerance : BOOL;
    fErrorTolerance : LREAL;
    bConfigure : BOOL := TRUE;
    
    fInput : LREAL;
    fSetpoint : LREAL;
END_VAR
// Get current system time
fbSystemTime.Call();

// Configure algorithm
IF bConfigure THEN
    bConfigure := FALSE;

    fbStepResponse.Configure(fThresholdReversal, bUseRelativeTolerance, fErrorTolerance);
END_IF

// Call algorithm
fbStepResponse.SetChannelValue(1, fInput);
fbStepResponse.SetChannelValue(2, fSetpoint);
fbStepResponse.Call(fbSystemTime.tSystemTime)

Requirements

Development environment

Target platform

Plc libraries to include

TwinCAT v3.1.4024.0

PC or CX (x64, x86)

Tc3_Analytics