Uploaded by Alexander Nordlund

Ticking session 1 2023 solution guide (1)

advertisement
Johan E. Carlson
johanc@ltu.se
Last revision: April 12, 2023
Measurement Systems – S7013E
Ticking session 1 – Solution guide
1
Introduction
This is the first problem set, consisting of seven problems. For this set the solutions should be
prepared in written form, suitable for marking and feedback from fellow students. Mark your
papers with name, date and email, and number the solutions according to the numbers of the
problems in the next section.
At the ticking session, a sheet will be provided for you to fill out, where you mark which
problems you have solved. The solutions will then be distributed randomly for peer-review. You
will also be given a solution guide to help you mark and provide feedback to other students.
If you are unable to attend the session, your written solutions to all problems must be
uploaded in Canvas prior to the start of the session.
1
2
Exercises
Problem 1.1: A displacement sensor has an input range of x from 0.0 to 3.0 cm and a supply
voltage Vs = 0.5 V. Results from a simple calibration experiment are given in the table below
Displacement x (cm)
Output voltage (mV)
0.0
0.0
0.5
16.5
1.0
32.0
1.5
44.0
2.0
51.5
2.5
55.5
3.0
58.0
(a) Using the data from the table above, calculate the full-scale deflection (f.s.d.)
(b) Fit a straight line model to the data (Hint: you may have to have a sneak peak at Chapter
7 in the book).
(c) What is the maximum error (deviation from the model in (b), expressed as a percentage
of the f.s.d.? Can you think of some improvements to the model in order to reduce this
error?
Solution 1.1:
(a) On p. 6 in the text book, the f.s.d. is defined as the span of the system output, in this case
58.0 − 0.0 = 58.0 mV.
(b) If define the input displacement as x and the output voltage as y, the straight line model
is
y(x) = θ0 + θ1 x.
Given N observations (in our case N = 7), we can write this on matrix form as






y = Xθ = 





0.0
16.5
32.0
44.0
51.5
55.5
58.0


 
 
 
 
 
=
 
 
 
 
 
1
1
1
1
1
1
1
0.0
0.5
1.0
1.5
2.0
2.5
3.0



"
#

 θ0

.
 θ
1




The least-squares solution for θ is (for example from Eq. (7.6) in the text book)
b = (XT X)−1 XT y.
θ
In this particular case, the matrix to invert is only a 2 × 2 matrix, which can easily be
solved by hand. For this case, we get the solution
"
b≈
θ
7.7
19.4
#
.
Hence, the resulting model is
yb(x) = θ0 + θ1 x = 7.7 + 19.4x,
or, on vector form
b
b = Xθ.
y
The figure below shows the result.
2
70
measured data
fitted line
output voltage, y [mV]
60
50
40
30
20
10
0
0
0.5
1
1.5
2
2.5
3
displacement, x [cm]
(c) To find the maximum error, we need to compare the observations y with the modeled
b , i.e. e = y − y
b . The largest error (regardless if the sign) is ≈ −7.875, which is
values, y
approximately 13.6 % of the f.s.d.
Problem 1.2: The file problem2_data.mat contains the vectors t and y, where t represents
time in seconds and y is a measurement corrupted by some noise. The signal model is
y(t) = u(t) + cos(ωI t) + e(t),
where u(t) is the desired signal, the cosine term is an electrical interference of 10 Hz, and e(t)
is some random noise.
(a) Plot the signal y(t) using MATLAB, in order to get an idea of what you are dealing with.
(b) Based on the plot, design a simple filter suitable for suppressing the sinusoidal interference
(you do not need to implement this in MATLAB). Motivate the design choices clearly.
(c) Will the filter you designed also suppress some of the random noise component? Motivate!
Solution 1.2:
(a) The figure below shows both the signal y(t) (left) and the power spectral density of
it (right). What we see is a slowly varying component, u(t) corrupted by the 10 Hz
cosine and a bit of noise. It appears that the signal of interest u(t) can be retrieved by
constructing a low pass filter with a cut-off frequency somewhere below 10 Hz but above
5 Hz.
3
100
12
50
PSD of y [dB]
y(t)
10
8
6
0
-50
4
2
-100
0
2
4
6
8
10
0
10
time, t (s)
20
30
40
50
frequency, f [Hz]
(b) Let’s try a passive low pass filter, as in Fig. 3.12 in the text book. The cut-off frequency
is given by ωc = 1/RC. Based on the PSD in the figure above, we can set the cut-off
frequency of 5 Hz, which means ωc = 2π · 5 = 10π. So, if we pick a capacitance of, say
30 µF, and a resistance of 1 kΩ, we obtain a cut-off frequency of
ωc =
1
≈ 33.3 rad/s ≈ 5.3 Hz.
RC
(c) Yes, a lot of the random noise will also be suppressed. White noise means the PSD of the
noise is flat (equal noise power on all frequencies). Assuming a bandwidth of the signal
of 50 Hz (which happens to be fs /2 in this case, an ideal low pass filter with a cut-off
frequency of 5 Hz would reduce the noise power with a factor of 10. For a first-order
passive analog filter, the improvement is much smaller, but it some of the noise will still
be suppressed.
Problem 1.3: You are given the task to design a system based on a capacitive sensor, for
measuring the thickness of a thin liquid film (such as a lubricant between two metal plates). Assuming the liquid is an oil with relative permittivity, ε = 2.5 and the plates have an overlapping
cross-sectional area of 20 × 20 mm:
(a) What is the capacitance range if the lubricant film thickness is in the range of 0.5 −
−2.0 µm.
(b) Design a reactive deflection bridge for measurement of capacitances in this range. What
is the range of the resulting output voltage (amplitude).
(c) Sine a reactive deflection bridge is driven by an AC supply voltage, the output will also
be AC. Since it is only the amplitude we are interested in, we can add a block to the
circuit which simplifies the data acquisition and processing. How? Discuss!
Solution 1.3:
(a) The capacitance is given by Eq. (2.5) in the book, as
C=
4
Aε0 ε
,
d
where ε0 = 8.85 pF/m. Using the numbers given in the problem, we get a capacitance
range from 17.7 nF for the minimum film thickness to 4.4 nF for the maximum film
thickness.
(b) The bridge is configured as in Fig. 4.3 in the text book, resulting in the model equation
VO = VS
1
1
−
.
1 + C1 /Cu 1 + R3 /R2
Since we normally want the bridge to be balanced and approximately linear, we also
require that
R3
C1 = CMIN
R2
and
R3
≫ 1.
R2
Setting R3 /R2 = 10, for example by letting R3 = 10 kΩ and R2 = 1 kΩ, we get C1 =
44 nF. The final thing to decide is the supply voltage. Since we know nothing about the
power rating of the sensor, or if there are other limitations, there is no unique answer to
this. Setting it to 5 V, we can then check the output voltage range using Eq. (3.19).
(c) Since we are only interested in the amplitude of the bridge output, a rectifier block could
be added between the bridge an the data acquisition hardware (for example the analog
input of an Arduino). The rectifier output may have to be amplified to match the input
of the data acquisition.
Problem 1.4: A measurement system is designed to give an output voltage, yi . Since the
measurements are noisy, we have decided that we will instead report an average of multiple
measurements as the measurement result.
Assuming we obtain a vector y containing 100 repeated measurements of yi , so that
yi = η + e i ,
i.e. the true response η plus a noise contribution. If the noise is white, implying the noise in
one measurement is uncorrelated with the noise in all other measurements
(a) How is the mean and standard deviation of y estimated?
100
1
(b) The average, my = 100
i=1 yi is also a random variable and as such there is an uncertainty associated also with this. Derive an expression for the standard deviation of
the average of the 100 measurement. Assume that the noise in the measurements are
uncorrelated.
P
(c) What happens if the noise is not uncorrelated? What additional information would we
need to estimate the standard deviation?
Solution 1.4:
5
(a) The mean is estimated using Eq. (1.15) in the book, and since the mean is unknown a
priori and estimated like this, the variance is estimated using Eq. (1.18) in the book. The
standard deviation is simply the square root of the variance.
(b) The average is
my =
100
100
100
X
X
1 X
1
yi =
yi =
ai yi ,
100 i=1
100
i=1
i=1
where ai = 1/100. Eq. (1.24) then gives, for uncorrelated random variables
Var {my } = Var
( 100
X
i=1
)
ai yi
=
100 X
1
i=1
1002
Var {yi } =
100 2
1 2
σ yi =
σ .
2
100
100 yi
In other words, the variance of the mean of M uncorrelated random variables is reduced
by a factor M . Consequently, the standard deviation of the mean is
σmy = √
1
1
σyi = σyi .
10
100
(c) If the noise is not uncorrelated, we are back at the general expression in Eq. (1.23). Here
we see that in order to estimate the standard deviation of the mean of a sequence of
correlated random variables, we need to know the covariance of the noise.
Problem 1.5: The circuit in the figure below is used to measure the unknown resistance, Ru .
i
−
+
VS
Ru
R1
VL
Let Vs = 5.0 V and R1 = 1.0 kΩ.
(a) Derive an expression of the output voltage, VL as a function of the unknown resistance.
Plot for the input range of Ru from 100–200 Ω.
(b) Now assume that the voltmeter has an input impedance of RL = 1 kΩ (in parallel with
R1 ). Show how this changes the model equation of the system.
(c) If left unaccounted for, what is the maximum error within the measurement range (i.e.
what is the maximum difference between the true model and the old model)?
6
Solution 1.5:
(a) The circuit is a simple voltage divider, with output
R1
.
R1 + Ru
The resulting output for the input range of 100–200 V is shown in the figure below.
VL = VS
output voltage, V L [V]
4.5
4.45
4.4
4.35
4.3
4.25
4.2
100
120
140
160
180
200
restistance, Ru [ ]
(b) The circuit changes to a circuit with R1 replaced with R, which is R1 in parallel with RL ,
i.e.
R1 RL
R=
R1 + RL
The voltage is now divided over Ru and R instead, which is
VL = VS
R
= VS
R + Ru
R1 RL
R1 +RL
R1 RL
R1 +RL + Ru
= VS
R1 RL
R1 RL + (R1 + RL )Ru
(c) If the two equations above are solved for Ru , they can be compared in terms of the
maximum error. This is left as exercise, but the figure below shows the difference in
output voltage. It is obvious, that if the impedance of the load is similar to that of the
circuit itself, the measurement error will become unacceptable.
with 1 k load
with infinite impedance load
output voltage, V L [V]
4.4
4.2
4
3.8
3.6
100
120
140
160
restistance, Ru [ ]
7
180
200
Problem 1.6: A scale is built using a resistive strain gauge. The mechanical design is such
that a load in the range of 0–3 kg results in a sensor resistance in the range of 120–200 Ω.
Design a resistive deflection bridge suitable for this application. You have many degrees of
freedom, so motivate your choices clearly. Take the following into account:
• The bridge should be balanced.
• The current through the sensor should be in the range 0.2–1 mA.
• The output of the bridge should be reasonably linear.
Solution 1.6: Eq. (3.10) gives an expression of the output voltage from the bridge, given the
resistance of the strain gauge (R1 ), as
VO = VS
1
1
−
.
1 + R4 /R1 1 + R3 /R2
Also given in the problem is that R1 varies linearly with the load, as
R1 = θ0 + θ1 u,
where u is the load in kg. From the numerical values given in the problem, we find θ0 = 120
and θ1 = (200 − 120)/3. To find the load, u, we thus need to solve the bridge equation for R1
and then solve R1 for the load u.
To design the bridge, we have a few conditions to meet. To make the bridge reasonably
linear, let’s set r = R3 /R2 = 10, for example by setting R3 = 10 kΩ and R2 = 1 kΩ. For the
bridge to be balanced, we then require
R3
R4
=
= 10,
R1MIN
R2
which gives
R4
= 10,
120
and hence R4 = 1.2 kΩ. We now need to set the supply voltage, keeping in mind that the
current through the sensor should be kept below 1 mA. The current is given by Eq. (3.2) as
i2 =
VS
R1 + R4
Noting that the current will be at its maximum when R1 is at its minimum, we get
0.001 =
VS
,
120 + 1200
which gives a maximum supply voltage of 1.32 V. Now, we need to check that the lower current
limit is also satisfied, by checking what current we would get when R1 = 200 Ω. This yields a
current of approximately 0.9 mA, which is above the limit, meaning all conditions are met. To
be on the safe side, we could lower the supply voltage a little bit, since the minimum current
would still be well above 0.2 mA.
8
If the current limitations are not met, we need to go back and modify the design, for example
by changing the r value of the bridge.
Problem 1.7: The sensor used in Problem 1.6, turns out to be sensitive to changes in ambient
temperature. We know that the resistance R0 = 120 Ω at zero load and T = 20 ◦ C. We also
know that the temperature sensitivity of the resistance is 1 Ω/◦ C.
(a) Modify the model equation relating load (in kg) to output voltage of the bridge, to include
also the temperature effect.
(b) If the temperature effect is left uncompensated, what is the resulting error at T = 35 ◦ C,
as percentage of the full scale deflection.
Solution 1.7:
(a) First, note that from what is given in the problem, the system appears to give the correct
resistance at zero load (120 Ω) when the temperature is T = 20 ◦ C, and that the error
introduced by temperature is linear with temperature. Let ∆T = T − 20. Then, the
change in sensor resistance ∆R will be
∆R = ∆T,
and the sensor resistance is thus
R1 = θ0 + θ1 u + ∆T,
where θ0 and θ1 are the parameters computed in the previous problem (resistance dependence on the load). To see what error we would get, we need to replace the previous
expression for R1 with this new one, solve for u.
(b) Since the numerical values will differ depending on how we designed the bridge, this is
left as an exercise, but once you made the modifications as in (a), determining the error
is straightforward. Simply solve for u for the uncompensated bridge in Problem 1.6 and
for the compensated bridge in this exercise, and compare the outputs at T = 35 ◦ C.
9
Download