SC2FA – State controller for 2nd order system with frequency autotuner

Block SymbolLicensing group: AUTOTUNING
Qt SVG Document Exported by REXYGEN Studio dv sp pv tv hv MAN ID TUNE HLD BRK SETC ips MFR mv de SAT TBSY w xre xim epv IDE iIDE p1 p2 p3 p4 p5 p6 SC2FA

Function Description
The SC2FA block implements a state controller for 2nd order system (7.4) with frequency autotuner. It is well suited especially for control (active damping) of lightly damped systems (ξ < 0.1). But it can be used as an autotuning controller for arbitrary system which can be described with sufficient precision by the transfer function

F(s) = b1s + b0 s2 + 2ξΩs + Ω2, (7.4)

where Ω > 0 is the natural (undamped) frequency, ξ, 0 < ξ < 1, is the damping coefficient and b1, b0 are arbitrary real numbers. The block has two operating modes: "Identification and design mode" and "Controller mode".

Identification and design mode
The "Identification and design mode" is activated by the binary input ID = on. Two points of frequency response with given phase delay are measured during the identification experiment. Based on these two points a model of the controlled system is built. The experiment itself is initiated by the rising edge off on of the TUNE input. A harmonic signal with amplitude uamp, frequency ω and bias ubias then appears at the output mv. The frequency runs through the interval wb,wf, it increases gradually. The current frequency is copied to the output w. The rate at which the frequency changes (sweeping) is determined by the cp parameter, which defines the relative shrinking of the initial period Tb = 2π wb of the exciting sine wave in time Tb, thus

cp = wb ω(Tb) = wb wbeγTb = eγTb .

The cp parameter usually lies within the interval cp 0,95;1). The lower the damping coefficient ξ of the controlled system is, the closer to one the cp parameter must be.

At the start of the identification, the exciting signal has a frequency ω = wb. After stime has elapsed, the calculation of the estimate of the current frequency characteristic point begins. Its real and imaginary parts are continuously copied in order to the outputs xre and xim. If the block parameter MANF is set to 0, then the frequency sweep stops twice for stime at the moments when points with phase delays ph1 and ph2 are first reached. The preset values for parameters ph1 and ph2 are respectively 60 and 120, and they can be changed to any values in the interval (360,0), where ph1 > ph2. After stime seconds of stopping at phase ph1, or ph2, the average of the last iavg measured points is calculated (thus obtaining an estimate of the respective frequency characteristic point) for the subsequent calculation of the parametric model in the form (7.4). If MANF = on, it is possible to manually "sample" two points of the frequency characteristic using the input HLD. The input HLD = on stops the frequency sweep, and resetting HLD = off resumes it. Other functions are identical.

It is possible to terminate the identification experiment prematurely in case of necessity by the input BRK = on. If the two points of frequency response are already identified at that moment, the controller parameters are designed in a standard way. Otherwise the controller design cannot be performed and the identification error is indicated by the output signal IDE = on.

During the actual "identification and design" process:

  • the output TBSY is set to 1. After completion, it is reset to 0.
  • If the controller design is error-free, the output IDE = off and the output iIDE indicates the individual phases of the identification experiment:
    • Approaching the first point is iIDE = 1,
    • stopping at the first point iIDE = 1,
    • approaching the second point is iIDE = 2,
    • stopping at the second point iIDE = 2, and
    • the final phase after stopping at the second point is iIDE = 3.
  • If the identification ends with an error, then IDE = on and the number on the output iIDE specifies the corresponding error. See the description of the iIDE parameter below.

The computed state controller parameters are taken over by the control algorithm as soon as the SETC input is set to 1 (i.e. immediately if SETC is constantly set to on). The identified model and controller parameters can be obtained from the p1, p2, …, p6 outputs after setting the ips input to the appropriate value. For individual ips values, the parameters have the following meanings:

  • 0: Two points of frequency response
    • p1 …frequency of the 1st measured point in rad/s
    • p2 …real part of the 1st point
    • p3 …imaginary part of the 1st point
    • p4 …frequency of the 2nd measured point in rad/s
    • p5 …real part of the 2nd point
    • p6 …imaginary part of the 2nd point
  • 1: Second order model in the form (7.5)
    • p1b1 parameter
    • p2b0 parameter
    • p3a1 parameter
    • p4a0 parameter
  • 2: Second order model in the form (7.6)
    • p1K0 parameter
    • p2τ parameter
    • p3Ω parameter in rad/s
    • p4ξ parameter
    • p5Ω parameter in Hz
    • p6 …resonance frequency in Hz
  • 3: State feedback parameters
    • p1f1 parameter
    • p2f2 parameter
    • p3f3 parameter
    • p4f4 parameter
    • p5f5 parameter

After a successful identification it is possible to generate the frequency response of the controlled system model, which is initiated by a rising edge at the MFR input. The frequency response can be read from the w, xre and xim outputs, which allows easy confrontation of the model and the measured data.

Controller
The "Controller mode" (binary input ID = off) has manual (MAN = on) and automatic (MAN = off) submodes. After a cold start of the block with the input ID = off it is assumed that the block parameters mb0, mb1, ma0 and ma1 reflect formerly identified coefficients b0 , b1 , a0 and a1 of the controlled system transfer function and the state controller design is performed automatically. Moreover if the controller is in the automatic mode and SETC = on, then the control law uses the parameters from the very beginning. In this way the identification phase can be skipped when starting the block repeatedly.

image/svg+xmlx1=sinwt x2=coswt z1=b sin(wt+fi) z1=b cos(wt+fi) wb,wf,cp w xre xim ID=1 ID=0 hv MAN=1 MAN=0 uco uamp ubias hilimlolim p1 p2 p3 p4 p5 p6 mv pv=y y^=epv y y^ eps controllerdesign estimateb0,b1,a0,a1 estimateF(jw) RCN_SIN b1.s+b0s +a1.s+a02 PROCESS GEN_SIN Demux Demux e m e m

The diagram above is a simplified inner structure of the frequency autotuning part of the controller. The diagram below shows the state feedback, observer and integrator anti-wind-up. The diagram does not show the fact, that the controller design block automatically adjusts the observer and state feedback parameters f1, f2, …, f5 after identification experiment (and SETC = on).

image/svg+xml-de v1^ v2^ v3 dv tv=mv uco v4 v5 mv pv sp disturb.model observer 1tt 1 s f5 f4 f3 f2 f1 e m e m

The controlled system is assumed in the form of (7.4). Another forms of this transfer function are

F(s) = (b1s + b0) s2 + a1s + a0 (7.5)

and

F(s) = K0Ω2(τs + 1) s2 + 2ξΩs + Ω2. (7.6)

The coefficients of these transfer functions can be found at the outputs p1,…,p6 after the identification experiment (TBSY = off). The output signals meaning is switched when a change occurs at the ips input.

This block propagates the signal quality. More information can be found in the 1.4 section.

Input

dv

Feedforward control variable

Double (F64)

sp

Setpoint variable

Double (F64)

pv

Process variable

Double (F64)

tv

Tracking variable

Double (F64)

hv

Manual value

Double (F64)

MAN

Manual or automatic mode

Bool

off ..

Automatic mode

on ...

Manual mode

ID

Identification or controller operating mode

Bool

off ..

Controller mode

on ...

Identification and design mode

TUNE

Start the tuning experiment

Bool

HLD

Stop frequency sweeping

Bool

BRK

Termination signal

Bool

SETC

Accept and set the controller parameters

Bool

off ..

Parameters are only computed

on ...

Parameters are accepted as soon as computed

off->on 

One-shot confirmation of the computed parameters

ips

Meaning of the output signals

Long (I32)

0 ....

Two points of frequency response

1 ....

Second order model (general)

2 ....

Second order model (frequency)

3 ....

State feedback parameters

MFR

Model frequency response generation

Bool

Parameter

ubias

Static component of the exciting signal

Double (F64)

uamp

Amplitude of the exciting signal  1.0

Double (F64)

wb

Frequency interval lower limit [rad/s]  1.0

Double (F64)

wf

Frequency interval upper limit [rad/s]  10.0

Double (F64)

isweep

Frequency sweeping mode  1

Long (I32)

1 ....

Logarithmic

2 ....

Linear

3 ....

Combined

cp

Sweeping rate   0.5  1.0 0.995

Double (F64)

iavg

Number of values for averaging  10

Long (I32)

alpha

Relative positioning of the observer poles (ident.)  2.0

Double (F64)

xi

Observer damping coefficient (ident.)  0.707

Double (F64)

MANF

Manual frequency response points selection

Bool

off ..

Disabled

on ...

Enabled

ph1

Phase delay of the 1st point [degrees]  -60.0

Double (F64)

ph2

Phase delay of the 2nd point [degrees]  -120.0

Double (F64)

stime

Settling period [s]  10.0

Double (F64)

ralpha

Relative positioning of the observer poles  4.0

Double (F64)

rxi

Observer damping coefficient  0.707

Double (F64)

acl1

Relative positioning of the 1st CL poles couple  1.0

Double (F64)

xicl1

Damping of the 1st closed-loop poles couple  0.707

Double (F64)

INTGF

Integrator flag  on

Bool

off ..

State-space model without integrator

on ...

Integrator included in the state-space model

apcl

Relative position of the real pole  1.0

Double (F64)

DISF

Disturbance flag

Bool

off ..

State space model without disturbance model

on ...

Disturbance model is included in the state space model

dom

Disturbance model natural frequency [rad/s]  1.0

Double (F64)

dxi

Disturbance model damping coefficient

Double (F64)

acl2

Relative positioning of the 2nd CL poles couple  2.0

Double (F64)

xicl2

Damping of the 2nd closed-loop poles couple  0.707

Double (F64)

tt

Tracking time constant  1.0

Double (F64)

hilim

Upper limit of the controller output  1.0

Double (F64)

lolim

Lower limit of the controller output  -1.0

Double (F64)

mb1p

Controlled system transfer function coefficient b1

Double (F64)

mb0p

Controlled system transfer function coefficient b0  1.0

Double (F64)

ma1p

Controlled system transfer function coefficient a1  0.2

Double (F64)

ma0p

Controlled system transfer function coefficient a0  1.0

Double (F64)

Output

mv

Manipulated variable (controller output)

Double (F64)

de

Deviation error

Double (F64)

SAT

Saturation flag

Bool

off ..

The controller implements a linear control law

on ...

The controller output is saturated

TBSY

Tuner busy flag

Bool

off ..

Identification not running

on ...

Identification in progress

w

Frequency response point estimate - frequency [rad/s]

Double (F64)

xre

Frequency response point estimate - real part

Double (F64)

xim

Frequency response point estimate - imaginary part

Double (F64)

epv

Reconstructed pv signal

Double (F64)

IDE

Identification error indicator

Bool

off ..

Identification successful

on ...

Identification error occurred

iIDE

Error code

Long (I32)

101 ..

Sampling period too low

102 ..

Error identifying frequency response point(s)

103 ..

Output saturation occurred during experiment

104 ..

Invalid process model

p1..p6

Results of identification and design phase

Double (F64)

2024 © REX Controls s.r.o., www.rexygen.com