You are on page 1of 22

# Step Response for the Transfer Function of a Sensor

## a) First order transfer function G(s)=k/(1+Ts), k=gain, T = time constant

Example, J thermocouple with gain at 20 0C of =51 V/0C and time constant of approx
0.01 sec. or k=5 [10 V/0C] and T=0.01

MATLAB program
k=5;
T=0.01;
num=[0 k];
den=[T 1];
step(num,den);grid

## Fig. y(t) plot

Step Response
5

4.5

3.5

3
Amplitude

2.5

1.5

0.5

0
0 0.01 0.02 0.03 0.04 0.05 0.06
Time (sec)
Bode diagram
MATLAB program
>> bode(num,den);
grid;

Bode Diagram
20

10
Magnitude (dB)

-10

-20

-30
0
Phase (deg)

-45

-90
0 1 2 3 4
10 10 10 10 10

Bandwidth
Cutoff frequency, b ,defining the bandwidth, is defined as the frequency for which the
Magnitude 20 log|G(j)| drops 3 dB below its zero-frequency value 20 log|G(j0)|
20 log|G(j)| <20 log|G(j0)| - 3 dB for > b
In the above case of a first order transfer function G(s)=k/(1+Ts), k=5, T = 0.01 s
G(s)=5/(1+0.01s)
or
G(j)=5/(1+0.01j)
its zero-frequency value is
G(j0)=5
or
20 log|G(j0)|=14 dB

## Cutoff frequency, b ,defining the bandwidth, is obtained from the equation

20 log|G(jb)|= 20 log|G(j0)| - 3 =14 3 = 11 dB
fb 100/(2) 14 Hz
Static calibration of the sensor
For:
Xn in unknown sensor input to the sensor and
Ym is the measured output from the sensor,
static calibration uses steady state sensor gain Kc for calibration, i.e for estimating the
unknown input
Using limit value theorem for unit step input X(s)=1/s for s tending towards zero
Kc = lim s G(s) /s= lim G(s) = G(j0)=5

## Consequently, unknown sensor input to the sensor is estimated as

Y/ Kc = Y/5

In practice, this is considered acceptable within bandwidth, i.e for input signal
frequencies

< b

## or for X(s)= /(s2+2)

and unit impulse input (s)=1

## (s)=1 /(s2+2) k/(1+Ts) y(t) 1/ Kc xest(t)

k=5;
T=0.01;
Kc=5

MATLAB Simulations

## 1) =10 rad/s f= 1.58 Hz period = 0.63 sec

MATLAB program

num=[0 0 0 50];
den=[0.01 1 1 100];
impulse(num,den);

## Fig. y(t) plot

Impulse Response
5

1
Amplitude

-1

-2

-3

-4

-5
0 10 20 30 40 50 60
Time (sec)

## 2) =100 rad/s f= 15.8 Hz period = 0.063 sec

MATLAB program

num=[0 0 0 500];
den=[0.01 1 100 10000];
impulse(num,den);

Impulse Response
4

1
Amplitude

-1

-2

-3

-4
0 1 2 3 4 5 6
Time (sec)

## 3) =1000 rad/s f= 158 Hz period = 0.0063 sec

MATLAB program

num=[0 0 0 5000];
den=[0.01 1 10000 1000000];
impulse(num,den);

## Fig. y(t) plot

Impulse Response
1

0.5
Amplitude

-0.5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time (sec)

Analytical Solutions (K. Ogata, Modern Control Engineering, 4th edition, Prentice Hall
pp. 268-271), where L{}=Laplace transform

## L{x(t)=sin t } G(s) =k/(1+Ts) L{y(t)} 1/ Kc L{ xest(t)}

where static calibration constant is Kc = G(j0)

## (s)=1 /(s2+2) k/(1+Ts) y(t) 1/ Kc L{ xest(t)}

For
k=5;
T=0.01;
results
|x(t)|=1
x(t)=1 sin t
G(s) =k/(1+Ts)
G(j) =k/(1+T j)=5/(1+0.01 j)= 5(1-j0.01)/(1+0.0122)= 5(1-j0.01)/(1+0.0122)
|G(j)|= 5/(1+0.0122) 1/2
= tan -1 (-0.01)
Kc = G(j0)=k=5
y(t)=1 |G(j)| sin (t+ )
xest(t)= y(t)/ Kc =(|G(j)|/ Kc) sin (t+ )= (|G(j)|/5) sin (t+ )
|xest(t)|/|x(t)|= |G(j)|/5
For = 10
results
|G(j)|= 5/(1+0.0122) 1/2 =5/(1+0.012102) 1/2 5
= tan -1 (-0.01) =-5.710
y(t)=1 |G(j)| sin (t+ ) 5 sin t
xest(t)= y(t)/k 1 sin t=x(t)
|xest(t)|/|x(t)| 1

Summary of results:

## The result for = 100, gives

|xest(t)|/|x(t)| 0.7
20 log |xest(t)|/|x(t)| = - 03 dB, i.e = 100 = b

Consequently, for
> b |xest(t)|/|x(t)| <0.7

## > >b |xest(t)|/|x(t)| <<0.7

= 1000 |xest(t)|/|x(t)| 0.1 i.e the estimation is only 10% of the amplitude of the
sensor input signal

Dynamic estimation (calibration) can use inverse problem solution, increasing gains, in
this case 1/0.7 for = 10 for and 1/0.1=10 for = 1000. (E. Doebelin, Measurement
Systems, McGraw Hill, 1990, Ch. 10.5 Dynamic Compensation, pp. 804-808)
Obviously these gains would increase with and can lead to various difficulties
(overflow in numerical computations, over-amplification of noise high frequency-low
amplitude components in the y(t) signal etc), to be studied as part of inverse problem
theory, a topic of advanced mechatronics.
Bode diagram
G-1(s) = (1+Ts)/ k

## MATLAB program for the dynamic compensator

k=5;
T=0.01;
num=[T 1];
den=[0 k];
bode(num,den);grid;

Bode Diagram
30

20
Magnitude (dB)

10

-10

-20
90
Phase (deg)

45

0
0 1 2 3 4
10 10 10 10 10

## The magnitude of the inverse dynamic compensator |G-1(s)| = |(1+Ts)/ k| shows 20

dB/decade increase beyond bandwidth cutoff frequency, b =100, indicating growing
computational difficulties as >> b .
In general, inverse dynamic compensator for increasing sensors bandwidth is subjet to
various difficulties :
- computational difficulties as >> b due to increasing magnitude of the inverse
dynamic compensator |G-1(s)| = |(1+Ts)/ k| for > b ; digital word length
- high frequency noise in the sensor output is amplified by increasing magnitude of
the inverse dynamic compensator |G-1(s)| = |(1+Ts)/ k| for > b reducing signal
to noise ratio
- unmodelled dynamics and parametric uncertainty result in reduced effect of
inverse dynamics compennsator
- non-minimum phase sytems have unstable inverse dynamics

## Some solutions to the above difficulties are :

- low pass filter for removing high frequency noise in the sensor output

## - Modified Output Approach (MOA) applied to non-minimum phase sytems to

avoid unstable inverse dynamics

## L{x(t)}G(s)k/(1+Ts)L{y(t)}Low Pass FilterG MOA-1(s)=(1+Ts)/ k1/ Kc xest(t)

B) Second order Instruments (E. Doebelin, Measurement Systems, McGraw Hill,
1990, pp. 123-157)

b) Second order transfer function (K. Ogata, Modern Control Engineering, Prentice Hall,
1997, Ch. 4-3, pp. 141-187) for example for a servo system (pp.142-146), or a mass-
spring-damper system (Example 4-7, pp. 174-175).

## f(t) a force measuring spring based instrument d(t) position measurement

potentiometerv(t)

where
f(t) [N] is the input force to measure
d(t) [m] is the output displacement
v(t) [V]is the output voltage of the potentiometer

## Assume the force measuring spring based instrument measured by a mass-spring-damper

M-B-K system moving horizontally (such that gravity effect can be ignored in deriving
motion equation)
F(s)/ D(s)= 1/ (M s2+B s + K)
where
D(s) =L{d(t)}
F(s) =L{f(t)}
Assume the approximate transfer function of the position measurement potentiometer
V(s)/D(s)= Kp
where
V(s)= L{v(t)}
D(s)=L{d(t)}
Kp [V/m] is the calibration constant of the potentiometer

## V(s)/F(s)= Kp / (M s2+B s + K)= (Kp / M)/ (s2+( B / M) s +( K /M) )

or
G(s)=V(s)/F(s)= k /(s2+2 n s + n2)
where
n2 = K /M
2 / n = B / M
k= Kp / M
Time response of such second order instruments are significantly dependent on the value
of = B n / (2 M)

## < 1 underdamped response

= 1 critically damped response
> 1 overdamped response

MATLAB Simulations

## For k =1, n = 10 rad/s fn= 1.58 Hz period = 0.63 sec

1) Step response of
G(s) = k /(s2+2 n s + n2) = k /(s2+b s + c)
where
b=2 n
c= n2
Steady state of v(t) for unit step input f(t) is obtained using limit value theorem for unit
step input F(s)=1/s for s tending towards zero
V = lim s G(s) /s= lim G(s) =lim k /(s2+2 n s + n2)= 1/n2 =0.01

a) for = 0, b=2 n =0
MATLAB program for

k=1;
b=0;
c=100;
num=[ 0 0 k];
den=[1 b c];
step(num,den);grid

Fig. v(t) plot shows an undamped oscillatory response, obviously not usefull in practical
applications. Higher values for are required.
Step Response
0.02

0.018

0.016

0.014

0.012
Amplitude

0.01

0.008

0.006

0.004

0.002

0
0 10 20 30 40 50 60
Time (sec)

b) for = 0.1, b= 2 n =2
MATLAB program

k=1;
b=2;
c=100;
num=[ 0 0 k];
den=[1 b c];
step(num,den);grid

The results show significant maximum overshoot of 70% and long 2% settling time of
4/( n ) = 4/ (0.1 x 10)= 4 sec.
Step Response
0.018

0.016

0.014

0.012

0.01
Amplitude

0.008

0.006

0.004

0.002

0
0 1 2 3 4 5 6
Time (sec)

## c) for = 0.6, b= 2 n =12

MATLAB program

k=1;
b=12;
c=100;
num=[ 0 0 k];
den=[1 b c];
step(num,den);grid

The results show significant reduced overshoot of 5% and reduced 2% settling time of
4/( n ) = 4/ (0.6 x 10)= 1.7 sec.
Step Response
0.012

0.01

0.008
Amplitude

0.006

0.004

0.002

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
Time (sec)

## d) for overdamped case, = 1.2, b= 2 n =24

MATLAB program

k=1;
b=24;
c=100;
num=[ 0 0 k];
den=[1 b c];
step(num,den);grid

## The results show no overshoot but sluggish response.

Step Response
0.01

0.009

0.008

0.007

0.006
Amplitude

0.005

0.004

0.003

0.002

0.001

0
0 0.2 0.4 0.6 0.8 1 1.2
Time (sec)

## Present day practice is to provide underdamped response for = B n / (2 M) in the

range of 0.6-0.7, but selecting a damping coefficient of B = 2 M / n (E. Doebelin,
Measurement Systems, McGraw Hill, 1990, pp. 131).
Bode diagram for such a case
= 0.6, b= 2 n =12
is given by
MATLAB program

k=1;
b=12;
c=100;
num=[ 0 0 k];
den=[1 b c];
bode(num,den);
grid;
Bode Diagram
-20

-40
Magnitude (dB)

-60

-80

-100

-120
0

-45
Phase (deg)

-90

-135

-180
-1 0 1 2 3
10 10 10 10 10

Cutoff frequency, b ,for the above case of a second order transfer function
G(s) = k /(s2+2 n s + n2) = k /(s2+b s + c)
where
k=1;
b=12;
c=100;
gives
G(j)=1/( -2 +12j + 100)
its zero-frequency value is
G(j0)=1/100=0.01
or
20 log|G(j0)|=- 40 dB

## Cutoff frequency, b ,defining the bandwidth, is obtained from the equation

20 log|G(jb)|= 20 log|G(j0)| - 3 =-40 3 = -43 dB
The Magnitude diagram gives

fb 10/(2) 1.4 Hz

Dynamic estimation (calibration) can use inverse problem solution, increasing gains, in
this case Obviously these gains would increase with and can lead to various difficulties
(overflow in numerical computations, over-amplification of noise high frequency-low
amplitude components in the y(t) signal etc).
Bode diagram
G-1(s) = (s2+b s + c) / k

F(s)G(s)D(s) G-1(s)V(s)

MATLAB program
k=1;
b=12;
c=100;
den =[ 0 0 k];
num =[1 b c];
bode(num,den);
grid;

Bode Diagram
120

100
Magnitude (dB)

80

60

40

20
180

135
Phase (deg)

90

45

0
-1 0 1 2 3
10 10 10 10 10

## The magnitude of the inverse dynamic compensator |G-1(s)| = |(1+Ts)/ k| shows 40

dB/decade increase beyond bandwidth cutoff frequency, b =10 , indicating growing
computational difficulties as >> b , even more significant the in the case of first order
instruments. N-order instrument will have 20 N dB/decade increase beyond bandwidth
cutoff frequency.
Some solutions to the above difficulties were outlined for the case of first oreder
instruments:

- low pass filter for removing high frequency noise in the sensor output

## - Modified Output Approach (MOA) applied to non-minimum phase sytems to

avoid unstable inverse dynamics
In practice the increase beyond bandwidth cutoff frequency, b is normally limited up to
a maximum useful frequency component useful which might be achieved by inverse
dynamic compensator approach without reachng unacceptable high magnitudes of the
inverse dynamic compensator, making this approach advantageus in computer based
instrumentation.
Sinusoidal Response of the second order sensor with =0.6

For
F(s) 1/ (M s2+B s + K)D(s) V(s)
the overall transfer function is
V(s)/F(s)= Kp / (M s2+B s + K)= (Kp / M)/ (s2+( B / M) s +( K /M) )
or
G(s)=V(s)/F(s)= k /(s2+2 n s + n2)
where
n2 = K /M
2 n = B / M
k= Kp / M
Time response of such second order instruments are significantly dependent on the value
of
= B n / (2 M)
where
=0.6

MATLAB simulation of

## x(t)=sin t k/( s2+2 n s + n2) y(t) 1/Kc xest(t)

where static calibration constant is Kc = G(j0)
For X(s)= /(s2+2)
and unit impulse input (s)=1

## k /[(s2+2)( s2+2 n s + n2)] = k /(s4+ 2 n s3 +(n2 +2)s2 +2 n 2 s + n22) =

k /( s4 +as3+ (b +2)s2 +a 2s + b2)
where
a= 2 n
b= n2
Let us assume
k =1,
= 0.6
such that
a= 2 n =12
b= n2=100

or
a=12;
b=100;
num=[ 0 0 0 0 ];
den=[1 a b+* a** b**];
impulse(num,den);

MATLAB Simulations

## 1) =1 rad/s f= 0.158 Hz period = 6.3 sec

MATLAB program is

a=12;
b=100;
num=[ 0 0 0 0 1];
den=[1 a b+1 a b];
impulse(num,den);

Impulse Response
0.015

0.01

0.005
Amplitude

-0.005

-0.01

-0.015
0 50 100 150 200 250 300
Time (sec)

The result agrees to Bode diagram amplitude for =1of -40 dB or 0.01

a=12;
b=100;
num=[ 0 0 0 0 5];
den=[1 12 125 300 2500];
impulse(num,den);

Impulse Response
0.015

0.01

0.005
Amplitude

-0.005

-0.01

-0.015
0 10 20 30 40 50 60 70 80 90 100
Time (sec)

The result agrees to Bode diagram amplitude for =5of -40 dB or 0.01

Analytical Solutions (K. Ogata, Modern Control Engineering, 4th edition, Prentice Hall
pp. 268-271), where L{}=Laplace transform
L{x(t)=sin t } G(s)= k/( s2+2 n s + n2) L{y(t)} 1/ Kc L{ xest(t)}
or for X(s)= /(s2+2) and unit impulse input (s)=1
(s)=1 /(s2+2) k/( s2+2 n s + n2) y(t) 1/ Kc L{ xest(t)}
For
|x(t)|=1
x(t)=1 sin t
= 0.6
such that
a= 2 n =12
b= n2=100
G(s) = k/( s2+12 s + 100)
G(j) =1/( -2+100+12 j)= ( -2+100-12 j)/ [( -2+100+12 j) ( -2+100-12 j)]
= (100-2-12 j)/( (100-2)2+1222)
|G(j)|= 1/((100-2)2+1222) 1/2
= tan -1 (-12 /(100-2) )
y(t)=1 |G(j)| sin (t+ )
|G(j0)|= 1/((100)2) 1/2 =1/100
Kc =G(j0)=1/100
xest(t)= y(t)/ Kc =(|G(j)|/ Kc) sin (t+ )= (|G(j)|/(1/100)) sin (t+ )
|xest(t)|/|x(t)|= |G(j)|/ Kc =|G(j)|/|G(j0)|
For = 10
results
|G(j)|= 1/((100-2)2+1222) 1/2 =1/((100-102)2+122102) 1/2 =1/120
= tan -1(-12 /(100-2) )= tan -1 (-120/(100-102) ) = tan -1 (-120/0)=-900
y(t)=1 (|G(j)| / Kc)sin (t+ ) ((1/120)/(1/100)) sin( t-90)
|G(j10)|/ |G(j0)| = (1/120)/(1/100)=100/120 = |xest(t)|/|x(t)| 0.83
For = 10, Bode diagram gives appr -42 dB and -900 which agrees with the above result.
Exact calculation of the cutoff frequency, b ,defining the bandwidth, obtained from the
equation
20 log|G(jb)|= 20 log|G(j0)| - 3
or
log|G(j0)| - log|G(jb)| = log(|G(j0)| / |G(jb)| )=3/20
or
|G(j0)| /|G(jb)| = log-1 3/20 = 1.4125
or
|G(jb)| =|G(j0)| /1.4125 =0.0709 |G(j0)|
which shows that, at cutoff frequency, b , the amplitude |G(jb)| drops to 0.0709 of the
|G(j0)|
For the above second order instrument
|G(j)|= 1/((100-2)2+1222) 1/2
results
|G(j0)|= 1/((100-02)2+12202) 1/2 = 1/100
The cutoff frequency, b can be obtained from
|G(jb)| =|G(j0)| /1.4125 =(1/100)/ 1.4125=1/141.25
For obtaining b the equation to solve is then
1/((100-b2)2+122b2) 1/2 =1/141.25
or
((100-b2)2+122b2) 1/2 =141.25
or
(100-b2)2+122b2 =141.252 =19952.6
or
b4 -200 b2 +10000-19952.6+ 144b2 =0
or
b4 -56 b2 -9952.6 =0
The solution for b2 is
b2 =28(282+9952.6) =28103.6 or 131.6 and 75.6
Only the positive solution gives