Uploaded by not700

Solutions Manual 5ed

advertisement
Solutions Manual
INTRODUCTION TO
MECHATRONICS AND
MEASUREMENT
SYSTEMS
5th edition
2018
SOLUTIONS MANUAL
David G. Alciatore, PhD, PE
Department of Mechanical Engineering
Colorado State University
Fort Collins, CO 80523
Introduction to Mechatronics and Measurement Systems
1
Solutions Manual
This manual contains solutions to the end-of-chapter problems in the fifth edition of
"Introduction to Mechatronics and Measurement Systems." Only a few of the open-ended
problems that do not have a unique answer are left for your creative solutions. More information,
including an example course outline, a suggested laboratory syllabus, Mathcad/Matlab files for
examples in the book, and other supplemental material are provided on the book website at:
mechatronics.colostate.edu
We have class-tested the textbook for many years, and it should be relatively free from
errors. However, if you notice any errors or have suggestions or advice concerning the textbook's
content or approach, please feel free to contact me via e-mail at David.Alciatore@colostate.edu. I
will post corrections for reported errors on the book website.
Thank you for choosing my book. I hope it helps you provide your students with an
enjoyable and fruitful learning experience in the exciting cross-disciplinary subject of
mechatronics.
2
Introduction to Mechatronics and Measurement Systems
Solutions Manual
2.1
D = 0.06408 in = 0.001628 m.
2
D
–6
A = ---------- = 2.082  10
4
 = 1.7 x 10-8 m, L = 1000 m
L
R = ------- = 8.2
A
2.2
4
(a)
R 1 = 21  10  20% so 168k  R 1  252k
(b)
R 2 = 07  10  20% so 5.6k  R 2  8.4k
(c)
R s = R 1 + R 2 = 217k  20% so 174k  R s  260k
(d)
R1 R2
R p = ------------------R1 + R2
3
R 1MIN R 2MIN
- = 5.43k
R pMIN = ------------------------------R 1MIN + R 2 MIN
R 1MAX R 2MAX
- = 8.14k
R pMAX = --------------------------------R 1 MAX + R 2 MAX
2.3
2
R 1 = 10  10 , R 2 = 25  10
1
2
1
R1 R2
 10  10   25  10 
------------------------------------------------------------------- = 20  10 1
R =
=
2
1
R1 + R2
10  10 + 25  10
a = 2 = red, b = 0 = black, c = 1 = brown, d = gold
2.4
In series, the trim pot will add an adjustable value ranging from 0 to its maximum value to
the original resistor value depending on the trim setting. When in parallel, the trim pot
could be 0 perhaps causing a short. Furthermore, the trim value will not be additive with
the fixed resistor.
2.5
When the last connection is made, a spark occurs at the point of connection as the
completed circuit is formed. This spark could ignite gases produced in the battery. The
negative terminal of the battery is connected to the frame of the car, which serves as a
ground reference throughout the vehicle.
Introduction to Mechatronics and Measurement Systems
3
Solutions Manual
2.6
No, as long as you are consistent in your application, you will obtain correct answers. If
you assume the wrong current direction, the result will be negative.
2.7
Place two 100 resistors in parallel and you immediately have a 50 resistance.
2.8
Put two 50 resistors in series: 5050
2.9
Put a 100 resistor in series with the parallel combination of two 100 resistors:
100100100100100
2.10
From KCL, I s = I 1 + I 2 + I 3
Vs
Vs Vs Vs
so from Ohm’s Law -------- = ------ + ------ + -----R eq
R1 R2 R3
R1 R2 R3
1
1
1
1
Therefore, -------- = ------ + ------ + ------ so R eq = ---------------------------------------------------R eq
R1 R2 R3
R2 R3 + R1 R3 + R1 R2
2.11
Is
Is
From Ohm’s Law and Question 2.10, V = -------- = ---------------------------------------------------R eq
R2 R3 + R1 R3 + R1 R2
---------------------------------------------------R1 R2 R3
and for one resistor, V = I 1 R 1
R2 R3
Therefore, I 1 =  ---------------------------------------------------- I s
 R 2 R 3 + R 1 R 3 + R 1 R 2
2.12
R1 R2
R1 R2
lim  ------------------- = ------------- = R 2
R1
R 1   R 1 + R 2
2.13
dV 1
dV 2
dV
I = C eq ------- = C 1 ---------- = C 2 ---------dt
dt
dt
From KVL,
V = V1 + V2
so
dV
dV
dV
------- = ---------1- + ---------2dt
dt
dt
4
Introduction to Mechatronics and Measurement Systems
Solutions Manual
Therefore,
C1 C2
II
I
1
1
1
------= ------ + ------ so -------- = ------ + ------ or C eq = ------------------C1 + C2
C eq
C1 C2
C eq
C1 C2
2.14
V = V1 = V2
dV 1
dV 2
dV
dV
I 1 = C 1 ---------- = C 1 ------- and I 2 = C 2 ---------- = C 2 ------dt
dt
dt
dt
From KCL,
dV
dV
dV
I = I 1 + I 2 = C 1 ------- + C 2 ------- = -------  C 1 + C 2 
dt
dt
dt
dV
Since I = C eq ------dt
C eq = C 1 + C 2
2.15
I = I1 = I 2
From KVL,
dI
dI
dI
V = V 1 + V 2 = L 1 ----- + L 2 ----- = -----  L 1 + L 2 
dt
dt
dt
dI
Since V = L eq ----dt
L eq = L 1 + L 2
2.16
dI 1
dI 2
dI
V = L ----- = L 1 ------- = L 2 ------dt
dt
dt
From KCL, I = I 1 + I 2
V
V V
Therefore, ---- = ------ + -----L
L1 L2
so
dI
dI
dI
----- = -------1 + -------2
dt
dt
dt
L1 L2
1
1
1
so --- = ------ + ------ or L = -----------------L
L1 L2
L1 + L2
2.17
V o = 1V , regardless of the resistance value.
2.18
40
From Voltage Division, V o = ------------------  5 – 15  = – 8V
10 + 40
Introduction to Mechatronics and Measurement Systems
5
Solutions Manual
2.19
Combining R2 and R3 in parallel,
R2 R3
23
R 23 = ------------------- = ------------ = 1.2k
R2 + R3
2+3
and combining this with R1 in series,
R 123 = R 1 + R 23 = 2.2k
(a)
Using Ohm’s Law,
V in
5V
I 1 = ---------- = ---------- = 2.27mA
R 123
2.2k
(b)
Using current division,
R2
2
I 3 = ------------------- I 1 = --- 2.27mA = 0.909mA
5
R2 + R3
(c)
Since R2 and R3 are in parallel, and since Vin divides between R1 and R23,
R 23
1.2
V 3 = V 23 = --------------------- V in = ------- 5V = 2.73V
R 1 + R 23
2.2
2.20
(a)
From Ohm’s Law,
V out – V 1
14.2V – 10V
I 4 = ----------------------- = ------------------------------- = 0.7mA
R 24
6k
(b)
V 5 = V 6 = V 56 = V out – V 2 = 14.2V – 20V = – 5.8V
(a)
R 45 = R 4 + R 5 = 5k
2.21
R 3 R 45
R 345 = --------------------- = 1.875k
R 3 + R 45
R 2345 = R 2 + R 345 = 3.875k
R 1 R 2345
R eq = -------------------------- = 0.795k
R 1 + R 2345
(b)
6
R 345
V A = ----------------------- V s = 4.84V
R 2 + R 345
Introduction to Mechatronics and Measurement Systems
Solutions Manual
(c)
VA
I 345 = ---------- = 2.59mA
R 345
R3
I 5 = --------------------- I 345 = 0.97mA
R 3 + R 45
2.22
This circuit is identical to the circuit in Question 2.21. Only the resistance values are
different:
(a)
R 45 = R 4 + R 5 = 4k
R 3 R 45
R 345 = --------------------- = 2.222k
R 3 + R 45
R 2345 = R 2 + R 345 = 6.222k
R 1 R 2345
R eq = -------------------------- = 1.514k
R 1 + R 2345
(b)
R 345
V A = ----------------------- V s = 3.57V
R 2 + R 345
(c)
VA
I 345 = ---------- = 1.61mA
R 345
R3
I 5 = --------------------- I 345 = 0.89mA
R 3 + R 45
2.23
Using superposition,
R2
V R21 = ------------------- V 1 = 0.909V
R1 + R2
R1
V R22 = ------------------- i 1 = 9.09V
R1 + R2
V R2 = V R21 + V R22 = 10.0V
2.24
R4 R5
R 45 = ------------------- = 0.5k
R4 + R5
V1 – V2
I = ------------------- = – 0.5mA
R1 + R2
Introduction to Mechatronics and Measurement Systems
7
Solutions Manual
R 45
V A = ---------------------  V 1 – V 2  = – 0.238 V
R 3 + R 45
2.25
R 45 = R 4 + R 5 = 9k
R 3 R 45
R 345 = --------------------- = 2.25k
R 3 + R 45
R 2345 = R 2 + R 345 = 4.25k
R 1 R 2345
R eq = -------------------------- = 0.81k
R 1 + R 2345
2.26
Using loop currents, the KVL equations for each loop are:
V 1 – I out R 1 = 0
V2 – I5 R5 – I3 R3 – V1 = 0
– I6 R6 + I5 R5 = 0
I 3 R 3 – I 24 R 4 – I 24 R 2 = 0
and using selected KCL node equations, the unknown currents are related according to:
I out = I 2 + I 3 + I V1
I V1 = I out –  I 5 + I 6 
I 3 = I 5 + I 6 – I 24
This is now 7 equations in 7 unknowns, which can be solved for Iout and I6. The output
voltage is then given by:
V out = V 2 – I 6 R 6
2.27
Applying Ohm’s Law to resistor combination R24 gives:
V out – V 1
4.2V
I 4 = ----------------------- = ------------ = 0.7mA
R 24
6k
The voltage across R5 is:
V 5 = V 6 = V 56 = V + – V - = V out – V 2 = – 5.8V
2.28
8
It will depend on your instrumentation, but the oscilloscope typically has an input
impedance of 1 M.
Introduction to Mechatronics and Measurement Systems
Solutions Manual
2.29
2.30
Since the input impedance of the oscilloscope is 1 M, the impedance of the source will
be in parallel, and the oscilloscope impedance will affect the measured voltage. Draw a
sketch of the equivalent circuit to convince yourself.
R2 R3
R 23 = ------------------R2 + R3
R 23
V out = --------------------- V in
R 1 + R 23
(a)
R 23 = 9.90k , V out = 0.995V in
(b)
R 23 = 333k , V out = 1.00V in
When the impedance of the load is lower (10k vs. 500k), the accuracy is not as good.
2.31
R2
V out = ------------------- V in
R1 + R2
(a)
10
V out = ------------- V in = 0.995V in
10.05
(b)
500
V out = ---------------- V in = 0.9999V in
500.05
For a larger load impedance, the output impedance of the source less error.
2.32
The theoretical value of the voltage is:
R
1
V theor = -------------- V s = --- V s
R+R
2
The equivalent resistance of the parallel combination of the resistor and the voltmeter input
impedance is:
R  5R5
---------------= --- R
R + 5R
6
And the measured voltage across this resistance is:
V meas
5--R
5
6
= ----------------- V s = ------ V s
11
5
R + --- R
6
Therefore, the percent error in the measurement is:
V meas – V theor
----------------------------------- = – 9%
V theor
Introduction to Mechatronics and Measurement Systems
9
Solutions Manual
2.33
It will depend on the supply; check the specifications before answering.
2.34
With the voltage source shorted, all three resistors are in parallel, so, from Question 2.10:
R1 R2 R3
R TH = ---------------------------------------------------R2 R3 + R1 R3 + R1 R2
2.35
V in = 5  45
Combining R2 and L in series and the result in parallel with C gives:
 R 2 + Z L Z C
Z R2 LC = ------------------------------------- = 1860.52  – 60.25 = 923.22 – 1615.30j
 R2 + ZL  + ZC
Using voltage division,
Z R2 LC
-V
V C = -------------------------R 1 + Z R2 LC in
where
R 1 + Z R2 LC = 1000 + 923.22 – 1615.30j = 2511.57  – 40.02
so
1860.52  – 60.25
V C = -------------------------------------------- 5  45 = 3.70  24.8 = 3.70  0.433rad
2511.57  – 40.02
Therefore,
V C  t  = 3.70 cos  3000t + 0.433 V
2.36
With steady state dc Vs, C is open circuit. So
V C = V s = 10V so V R1 = 0V and V R2 = V s = 10V
2.37
(a)
In steady state dc, C is open circuit and L is short circuit. So
Vs
I = ------------------- = 0.025mA
R1 + R2
(b)
 = 
6
6
–j
– 10
10
Z C = -------- = ----------- j = -------- – 90 
C


5
5
Z LR2 = Z L + R 2 = jL + R 2 =  10 + 20j  = 10 0.036
10
Introduction to Mechatronics and Measurement Systems
Solutions Manual
Z C Z LR2
Z CLR2 = -----------------------=  91040 – 28550j  = 95410 – 17.4 
Z C + Z LR2
Z eq = R 1 + Z CLR2 =  191040 – 28550j  = 193200 – 8.50 
Vs
I s = -------- = 0.0259 8.50 mA
Z eq
ZC
I = ------------------------ I s =  0.954 – 17.44 I s = 0.0247 – 8.94 mA
Z C + Z LR2
So
I  t  = 24.7 cos  t – 0.156  A
2.38
(a)
rad

 =  -------- , f = ------ = 0.5Hz
sec
2
A pp = 2A = 4.0 , dc offset = 0
(b)
rad

 = 2 -------- , f = ------ = 1Hz
sec
2
A pp = 2A = 2 , dc offset = 10.0
(c)
rad

 = 2 -------- , f = ------ = 1Hz
sec
2
A pp = 2A = 6.0 , dc offset = 0
(d)
rad

 = 0 -------- , f = ------ = 0Hz
sec
2
A pp = 2A = 0 , dc offset = sin    + cos    = – 1
2
2.39
V rms
P = ----------- = 100W
R
2.40
V pp
V rms =  ---------   2  = 35.36V
 2 
Introduction to Mechatronics and Measurement Systems
11
Solutions Manual
2
V rms
P = ----------- = 12.5W
R
2.41
Vm =
2V rms = 169.7V
2.42
For V rms = 120V , V m =
2V rms = 169.7V , and f = 60 Hz,
V  t  = V m sin  2f +   = 169.7 sin  120t +  
2.43
From Ohm’s Law,
5V – 2V
3V
I = --------------------- = ------R
R
Since 10mA  I  100mA ,
3V
10mA  -------  100mA
R
giving
3V 3V
---------------- R  --------------- or 30  R  300
100mA
10mA
2
V
For a resistor, P = ------ , so the smallest allowable resistance would need a power rating of
R
at least:
2
 3V 
P = --------------- = 0.3W
30
so a 1/2 W resistor should be specified.
The largest allowable resistance would need a power rating of at least:
2
 3V 
P = --------------- = 0.03W
300
so a 1/4 W resistor would provide more than enough capacity.
2.44
Using KVL and KCL gives:
V 1 = I R1 R 1
V 1 =  I 1 – I R1 R 2 +  I 1 – I R1 – I 2 R 3
V 3 – V 2 =  I 1 – I R1 – I 2 R 3 – I 2 R 4
12
Introduction to Mechatronics and Measurement Systems
Solutions Manual
The first loop equation gives:
V1
I R1 = ------ = 10mA
R1
Using this in the other two loop equations gives:
10 =  I 1 – 10m 2k +  I 1 – 10m – I 2 3k
10 – 5 =  I 1 – 10m – I 2 3k – I 2 4k
or
 5k I 1 –  3k I 2 = 60
 3k I 1 –  7k I 2 = 35
Solving these equations gives:
I 1 = 12.12mA and I 2 = 0.1923mA
2.45
(a)
V out = I 2 R 4 – V 2 = – 4.23V
(b)
P 1 = I 1 V 1 = 121mW , P 2 = I 2 V 2 = 0.962mW , P 3 = – I 2 V 3 = – 1.92mW
Using KVL and KCL gives:
V 1 = I R1 R 1
V 1 =  I 1 – I R1 R 2 +  I 1 – I R1 – I 2 R 3
V 3 – V 2 =  I 1 – I R1 – I 2 R 3 – I 2 R 4
The first loop equation gives:
V1
I R1 = ------ = 10mA
R1
Using this in the other two loop equations gives:
10 =  I 1 – 10m 2k +  I 1 – 10m – I 2 2k
10 – 5 =  I 1 – 10m – I 2 2k – I 2 1k
or
 4k I 1 –  2k I 2 = 50
 2k I 1 –  3k I 2 = 25
Introduction to Mechatronics and Measurement Systems
13
Solutions Manual
Solving these equations gives:
I 1 = 12.5mA and I 2 = 0mA
2.46
(a)
V out = I 2 R 4 – V 2 = – 5V
(b)
P 1 = I 1 V 1 = 125mW , P 2 = I 2 V 2 = 0mW , P 3 = – I 2 V 3 = 0mW
P avg
Vm Im
1
= ---  V  t I  t  dt = --------------  sin  t +  V  sin  t +  I  dt
T
T
T
T
0
0
Using the product formula trigonometric identity,
T
P avg
Vm Im
= --------------   cos   V –  I  – cos  2t +  V +  I   dt
2T
0
Therefore,
Vm Im
Vm Im
P avg = -------------- cos   V –  I  = -------------- cos   
2
2
T
2.47
I rms =
2
--1-  I 2m sin  t +  I  dt
T
0
Using the double angle trigonometric identity,
2T
I rms =
Im  1
-----  --- – cos  2  t +  I   dt

T 2
0
Therefore,
2
I rms =
2.48
I
I m  T
----- --- = ----mT  2
2
R2 R3
R 23 = ------------------- = 5k
R2 + R3
R 23
1
V o = --------------------- V i = --- sin  2t 
2
R 1 + R 23
This is a sin wave with half the amplitude of the input with a period of 1s.
14
Introduction to Mechatronics and Measurement Systems
Solutions Manual
2.49
No. A transformer requires a time varying flux to induce a voltage in the secondary coil.
2.50
V
Np
------ = ------p = 120V
------------- = 5
Ns
Vs
24V
2.51
RL = Ri = 8 for maximum power
2.52
The BNC cable is far more effective in shielding the input signals from electromagnetic
interference since no loops are formed.
Introduction to Mechatronics and Measurement Systems
15
Solutions Manual
3.1
For Vi > 0, Vo = 0
For Vi < 0, Vo = Vi
The resulting waveform consists only of the negative "humps" of the original cosine wave.
Each hump has a duration of 0.5s and there is a 0.5s gap between each hump.
3.2
For Vi > 0.7V, Vo = 0.7V
For Vi < 0.7V, Vo = Vi
The resulting waveform consists only of the negative "humps" (below 0.7V) of the original
cosine wave. The positive "humps" (above 0.7V) are clipped off and held constant at 0.7V.
3.3
(a)
output passes the positive humps only
(b)
output passes the negative humps only
(c)
output passes the positive humps only
(d)
output passes the negative humps only
(e)
output passes the positive humps and scales the negative humps by 1/2
(f)
output passes the full wave
(a)
output passes the positive humps above -0.7V only, with the negative humps clipped
at -0.7V
(b)
output passes the negative humps below 0.7V only, with the positive humps clipped
at 0.7V
(c)
output passes the positive humps above 0.7V only, with the negative humps clipped
at 0.7V
(d)
output passes the negative humps below -0.7V only, with the positive humps clipped
at -0.7V
(e)
output passes the positive humps above -0.7V only, and scales the negative humps
below -0.7V by 1/2
(f)
output passes the full wave
3.4
3.5
16
When the diode is forward biased, the output voltage is -0.7V, so the output signal is
chopped off at -0.7V instead of 0V.
Introduction to Mechatronics and Measurement Systems
Solutions Manual
3.6
When the switch is closed and the circuit is in steady state, the current through the load is
constant, and the diode is reverse biased (i.e., there is no diode current).
When the switch is opened, the inductor generates a forward voltage to oppose a decrease
in current. Now the diode forms a circuit with the load, allowing the current to dissipate
through the resistor.
If there were no diode, and the switched were opened, because the current would attempt
to decrease instantaneously, the inductor would generate a very large voltage which would
create an arc (current through air) across the switch contacts.
3.7
Forward bias (Vin > Vout + 0.7V) is required for charging. "Leaking" causes voltage decay
(i.e., Vout decreases slowly).
3.8
See the data sheet for a LM7815C voltage regulator.
3.9
(a)
For Vi > 0.5V, Vo = 0.5V.
For Vi < 0.5V, Vo = Vi.
The resulting waveform is the original sine wave with the top halves of the positive
"humps" (above 0.5 V) clipped off.
(b)
For Vi < 0.5V, Vo = 0.5V.
For Vi > 0.5V, Vo = Vi.
The resulting waveform is the original sine wave with the bottom of the negative
"humps" (below 0.5 V) clipped off.
3.10
Using superposition, Ohm’s Law, and current division,
1V
2
I 1left = ----------------- = ------R
5R
2R + ---2
1
1
I 2 left = – --- I 1 left = – ------2
5R
1
1
1V
3
I 4left = --- I 1 left = ------- , I 4 right = ----------------- = ------2
5R
2R
5R
R + ------3
2R
2
I 2right = ----------------- I 4right = ------R + 2R
5R
1
I 1right = I 4right – I 2right = ------5R
Introduction to Mechatronics and Measurement Systems
17
Solutions Manual
3
I 1 = I 1left + I 1right = -------  0
5R
1
I 2 = I 2left + I 2right = -------  0
5R
I3 = 0
4
I 4 = I 4left + I 4right = -------  0
5R
1
V diode = 1V – I 4 R = --- V  0
5
3.11
With I2=I3=0, I1 and I4 are equal. The current (I=I1=I4) is:
1V + 1V
2
I = --------------------- = ------- V
2R + R
3R
and the voltage of node A relative to node B is:
1
V AB = 1V – I  2R  = – 1V + I  R  = – --- V
3
Therefore, the voltage polarity on the left diode is incorrect.
3.12
When the left diode is forward biased and the right diode is reverse biased,
V out = V H
and when the right diode is forward biased and the left diode is reverse biased,
V out = V L
When both diodes are reverse biased,
RL
V out = ------------------ V i
Ri + RL
Therefore, the output is a scaled version of the input chopped off below VL and above VH.
3.13
1
For Vin > 0, V out = --- V in = 5 sin  t 
2
For Vin < 0, V out = V in = 10 sin  t 
The positive "bumps" of the resulting waveform are half the amplitude (5 vs. 10) of the
original, and the lower bumps are the same.
18
Introduction to Mechatronics and Measurement Systems
Solutions Manual
3.14
In steady state dc, the capacitor is equivalent to an open circuit. Therefore, the steady state
current through the capacitor is 0 and the steady state voltage across the capacitor is Vout.
(a)
For Vs=10V, the diode is forward biased and is equivalent to a short circuit.
Therefore, the equivalent resistance of the two horizontal resistors is R/2 and from
voltage division,
R
2
V capacitor = V out = -------------- V s = --- V s = 6.66V
R
3
---- + R
2
(b)
For Vs=10V, the diode is reverse biased and is equivalent to an open circuit.
Therefore, the circuit simplifies to two series resistors and
R
1
V capacitor = V out = -------------- V s = --- V s = – 5 V
R+R
2
3.15
There are three possible states of the diodes. When only the left diode is forward biased,
V out = V H . When only the right diode is forward biased, V out = V L . When both diodes
are reverse biased, V L  V out  V H . In this case, the circuit is a voltage divider and
RL
1
V out = ------------------ V in = --- V in
Ri + RL
2
The upper limit of this state is when V out = V H = 5V corresponding to V in = 10V .
Vout remains at 5V when Vin increases above 10V. The lower limit of the double reverse
biased state is when V out = V L = – 5 V corresponding to V in = – 10 V . Vout remains at
5V when Vin decreases below 10V. It is not possible for both diodes to be reverse biased
at the same time in this circuit.
The resulting output signal Vout is a sin wave scaled by 1/2 with the peaks clipped off at
 10V .
3.16
3.17
(a)
output passes first (positive) hump only
(b)
output is 5.1V over the whole input cycle
Use a resistor in series with the LED where:
5V – V LED
I = --------------------------R
Introduction to Mechatronics and Measurement Systems
19
Solutions Manual
The required resistance value is
 5V – V LED 
R  -------------------------------I max
3.18
(a)
5V
R  --------------- = 100
50mA
(b)
 5V – 2V 
R  -------------------------- = 60
50mA
V E = 5V – V LED – V CE = 2.8V
V in  saturation  = V E + V BE = 2.8V + 0.7V = 3.5V
(a)
For the LED to be ON, the transistor must be in saturation and
V B = V LED + V BE = 1V + 0.7V = 1.7V
When the LED is off, IB = 0 and
1
V B = --- V in
2
So for the LED to be ON,
V in  2V B = 3.4V
(b)
When the transistor is fully saturated,
V B = V LED + 0.7V = 1.7V and V C = V LED + 0.2V = 1.2V
and
5V – V C
3.8V
I C = --------------------- = ------------- = 11.5mA
330
330
Assume
1
I B = --------- I C = 0.115mA
100
If I1 is the current through the horizontal 1k resistor and I2 is the current through the
right 1k resistor, then
VB
I 1 = I 2 + I B = ------- + 0.115mA = 1.815mA
1k
and
V in = V B +  1k I 1 = 3.52V
20
Introduction to Mechatronics and Measurement Systems
Solutions Manual
3.19
When the transistor is in full saturation,
V CE = 0.2V and V BE = 0.7V
and
IC
I out = I B + I C = --------- + I C = 1.01I C
100
In the collector-to-emitter circuit,
V out = V s – I C R C – V CE = I out R out
giving
5V – I C  1k  – 0.2V = 1.01I C  1k 
Now we can solve for the collector and emitter currents:
4.8V
I C = ------------- = 2.39mA
2.01k
and
I out = 1.01I C = 2.41mA
Therefore,
V out = I out R out =  2.41mA   1k  = 2.41V
and the minimum required input voltage is:
V in = V out + V BE + I B R B = 2.41V + 0.7V +  0.239mA   1k  = 3.13V
3.20
1: a resistor (e.g., 1k) to limit the base current while ensuring the transistor is in full
saturation
2: 24 Vdc capable of at least 1A of current
3: power diode capable of carrying at least 1A for flyback protection
4: ground
3.21
The transistor begins to saturate at approximate Vin=0.88V, where:
IC
4.869
 = ----- = ------------- = 90.2
IB
0.054
VBE = 0.73V
VCE = 0.16V
We usually assume these values are 100, 0.7V, and 0.2 V at the verge of saturation.
Introduction to Mechatronics and Measurement Systems
21
Solutions Manual
3.22
A voltage source (e.g., 5V) and current limiting series resistor (e.g., 330 ) is required on
the LED side. On the phototransistor side, a pull-up resistor (e.g, 1k) and a voltage source
(e.g., 5V) is required on the collector lead and ground is required on the emitter lead.
3.23
From the figure, the approximate "ON" values for the drain-to-source voltage and current
are:
V ds  0.25V and
I ds  48mA
so the "ON" resistance is:
V ds
R ON = --------  5.2
I ds
3.24
1: nothing required
2: 24 Vdc capable of at least 1A of current
3: power diode capable of carrying at least 1A for flyback protection
4: ground
3.25
The type of BJT required is an npn and an additional resistor must be added in series with
the open collector output to pull up the voltage enough to bias the BE junction of the BJT.
3.26
The upper FET is a p-channel enhancement mode MOSFET and the lower is an n-channel
enhancement mode MOSFET. When Vin = 5V, the upper MOSFET doesn’t conduct but
the bottom one does, so Vout = 0V. When Vin = 0V, the upper MOSFET conducts but the
bottom one doesn’t, so Vout = Vcc.
3.27
The requirements are that
2
I d  cont   10A and P d  max   I on R on = 100R on
IRF530N is a good choice
3.28
22
(a)
cutoff
(b)
ohmic
(c)
saturation
(d)
cutoff
Introduction to Mechatronics and Measurement Systems
Solutions Manual
4.1
4.2
(a)
linear
(b)
nonlinear
(c)
linear
(d)
linear
(e)
nonlinear
(f)
nonlinear
(g)
linear
The Fourier Series is:
F  t  = 5 sin  2t 
and the fundamental frequency is
0
f 0 = ------ = 1Hz
2
4.3
Since Vrms = 120V and f = 60Hz, the Fourier Series is:
Ft =
2V rms sin  2ft  = 169.7 sin  120t 
and the fundamental frequency is 60Hz.
4.4
We need to prove:
A n cos  n 0 t  + B n sin  n 0 t  = C n cos  n 0 t +  n 
We can use the following trig identity:
cos  a + b  = cos  a  cos  b  – sin  a  sin  b 
where:
a = n 0 t
An
cos  b  = -----Cn
Bn
– sin  b  = -----Cn
b = n
Equations 4.8 and 4.9 can now be verified:
Bn 2
An 2
2
2
sin  b  + cos  b  =  ------ +  ------ = 1
 C n
 C n
Therefore,
Cn =
2
2
An + Bn
Introduction to Mechatronics and Measurement Systems
23
Solutions Manual
Also,
Bn
– -----Cn
Bn
sin  b 
tan   n  = tan  b  = ---------------- = --------- = – -----cos  b 
An
An
-----Cn
Therefore,
–1 Bn
–1 Bn
 n = tan  – ------ = – tan  ------
 A n
 A n
T
--2
T
4.5
2
2
A n = ---  F  t  cos  n 0 t  dt = --T
T
0
T
 cos  n0 t  dt –  cos  n0 t  dt
0
T
--2
So
T
--2 
2
T
A n = -------------   sin  n 0 t   0 –  sin  n 0 t   T 
n 0 T 
--- 
2
2
But  0 = ------ , so
T
1
A n = ------  sin  n  – sin  2n  + sin  n  
n
But sine of any multiple of  is 0, so An = 0
24
Introduction to Mechatronics and Measurement Systems
Solutions Manual
4.6
Using MathCAD:
t
0  0.01 3.0
2  4  10
n
m
2  4  50
Va( t )
Vb( t )
Vc( t )
sin ( 2    t )
1

2



sin ( 2  t ) 2 
2

1
sin ( 2    t )

2
1
n
2

m
cos ( 2  n    t )
( n 1) ( n 1)
cos ( 2  m   t )
( m 1) ( m 1)
1
1.5
1
0.5
Va( t )
Vb( t ) 0.5
0
0
0.5
0
1
2
0.5
3
0
1
t
2
3
t
1.5
1
Vc( t ) 0.5
0
0.5
0
1
2
3
t
4.7
(a)
fH
1-
 1 – -----
2
= 6 + ---------------------  10 – 6  = 7.17Hz
1
So the bandwidth is: 0 Hz to 7.17 Hz
Introduction to Mechatronics and Measurement Systems
25
Solutions Manual
(b)
T = 1s
rad
1
f o = --- = 1Hz ,  0 = 2f 0 = 2 -------sec
T
n
 (rad/sec)
f (Hz)
Ain
Aout/Ain
Aout = (Aout/Ain)Ain
1
0
1
4/
1
4/
2
0
3
4/3
1
4/3
3
0
5
4/5
1
4/5
4
0
7
4/7
3/4
3/7
5
0
9
4/9
1/4
1/9
>5
(2n-1)0
(2n-1)
4/f
0
0
4
4
4
3
1
V out = --- sin  2t  + ------ sin  6t  + ------ sin  10t  + ------ sin  14t  + ------ sin  18t 

3
5
7
9
(c)
Using MathCAD:
t
0  0.01 2
Vout( t )
4

4 
sin ( 6    t )
3
sin ( 2    t )
4 
sin ( 10   t )
5
3 
sin ( 14   t )
7
2
2.0
Vout( t )
0
2
0
1
t
4.8
26
(a)
1
1
- = 1000 rad
------- c = -------- = ----------------------------------------------3
–
6
RC
sec
 1  10   1  10 
(b)
T = 1s, f = 1Hz, 0 = 2
Introduction to Mechatronics and Measurement Systems
2
1 
sin ( 18   t )
9
Solutions Manual

A out
 n  sin   n t 
 Ain  n   ---------A in
Ft =
n=1
where
4
A in  n  = ---------------------- 2n – 1 
A out
1
----------  n  = --------------------------A in
2

n
1 +  ------
  c
 n =  2n – 1 2
(c)
Using MathCAD:
n
1  100
c
t
0  0.01  2
1000
n

1
4
F ( t)
( 2 n
1 ) 
n
1
( 2 n
1 ) 2 
 sin   t
n
n
2
c
1
F( t )
0
1
0
1
2
t
4.9
(a)
1
1
- = 10 rad
------- c = -------- = ----------------------------------------------------3
–6
RC
sec
 100  10   1  10 
(b)
T = 1s, f = 1Hz, 0 = 2
Introduction to Mechatronics and Measurement Systems
27
Solutions Manual

A out
 n  sin   n t 
 Ain  n   ---------A in
Ft =
n=1
where
4
A in  n  = ---------------------- 2n – 1 
A out
1
----------  n  = --------------------------A in
2

n
1 +  ------
  c
 n =  2n – 1 2
(c)
Using MathCAD:
n  1  100
c
 10
n
 ( 2 n  1) 2 
t  0 0.01  2
F ( t) 

n
4


 ( 2 n  1) 


 sin  t 
  n 
2


 n  
 1   


 c 



1
1
0.5
F ( t)
0
 0.5
1
0
0.5
1
1.5
2
t
4.10
1 rad
rad
 L = ------- -------- = 0.707 -------- = 0.113Hz
sec
sec
2
1 rad
rad
 H =  3 + 1.5  1 – -------  -------- = 3.44 -------- = 0.547Hz


sec
2  sec
 L  bandwidth   H
28
Introduction to Mechatronics and Measurement Systems
Solutions Manual
4.11
4.12
(a)
rad
rad
1 --------    5 -------sec
sec
(b)
and (c)
n
Ain
Aout
1
1
1
2
2
2
3
3
3
4
4
1.33
5
5
0
R
V o = --------------------- V i
1
R + ---------jC
Vo
jRC ------ = ----------------------Vi
jRC + 1
1
To find the cut-off frequency, set the amplitude ratio magnitude to ------- :
2
Vo
1
RC
------ = --------------------------------- = ------Vi
2
 RC  2 + 1
Solving for the frequency gives
1
 c = -------RC
Using this expression gives:
----
Vo
c
------ = ---------------------------Vi
2
 ----- +1
  c
Introduction to Mechatronics and Measurement Systems
29
Solutions Manual
and now we can plot the frequency response in terms of the dimensionless frequency ratio

 r = ------ :
c
r
0  0.01  5.0
r
Ar  r
r
2
1
1
Ar r
0.5
0
0
2
4
6
r
4.13
Vo
RC
 = arg  ------ =  1  –  1 + RCj  = 0 – atan  ------------ = – atan  RC 
 Vi 
 1 
1

Using  c = -------- and  r = ------ = RC ,
RC
c
 = – atan   r 
0
0
20
  r
40
60
68.199 80
0
0.5
1
0
30
Introduction to Mechatronics and Measurement Systems
1.5
 r
2
2.5
2.5
Solutions Manual
4.14
The answer is in Figure 4.4 (see the "0, 30, 50" curve).
4.15
Using MathCAD:
1  20
n
n
t
0  0.01  2
( 2 n 1 ) 2 
4
F ( t)
( 2 n 1 ) 
 sin   t
n
n
ATTn
1
ATT1
.25
ATT2
4
F low( t )
( 2 n 1 ) 
.25
ATT3
.25
 ATT  sin   t
n
n
n
ATTn
1
ATT17
.25
ATT18
4
F high( t )
( 2 n 1 ) 
.25
ATT20
.25
 ATT  sin   t
n
n
n
1
2
1
F( t )
F low( t )
0
0
1
2
0
1
1
2
0
1
t
2
t
2
1
F high ( t )
0
1
2
0
1
2
t
Introduction to Mechatronics and Measurement Systems
31
Solutions Manual
4.16
Using MathCAD:
n low  1  50
n high  1 1.1 10
low_pass ( n )  e
 0.1 ( 2 n 1)
high_pass ( n )  1  e
 ( 2 n 1)
1
0.8


0.6
low_pass nlow
0.4
0.2
0
10
20
30
40
6
8
50
nlow
1
0.9


high_pass nhigh 0.8
0.7
0.6
2
4
nhigh
4.17
When the mass is in static equilibrium,
M in g = kX out
so
g
X out =  --- M in
k
and the static sensitivity is
g
K = --k
32
Introduction to Mechatronics and Measurement Systems
10
Solutions Manual
4.18
We generally assume that the displayed voltage is the gain times the input voltage. This
assumption will be in error if the oscilloscope is dc coupled and some of the frequencies in
the signal exceed the bandwidth of the oscilloscope.
4.19
KVL gives:
1
IR + ---- q = V in
C
where q is the charge on the capacitor. Putting this in standard form gives:
 RC  q· + q = CV
in
where q is the dependent variable, the time constant () is RC, and the sensitivity (K) is C.
Using the general solution for a 1st order system,
t
– --


q  t  = CA i  1 – e 


Therefore, the step response output voltage (which is the voltage across the capacitor) is
t
– --

1

V out  t  = ---- q  t  = A i  1 – e 
C


4.20
Applying KVL around the flyback loop gives:
L
d
+ IR = 0
dt
Putting this in standard first-order-system form gives:
L- d
--+I = 0
Rdt
so the time constant is:  = L/R. The root of the characteristic equation is s=-1/, so the
equation for current is:
I  t  = Ce
t
–
The current is Iss at t=0, so C=Iss, giving:
I  t  = I ss e
4.21
t
– -
The rate of change of internal energy is equal to the rate of heat transfer:
d·
--- E  = Q in
dt in
Introduction to Mechatronics and Measurement Systems
33
Solutions Manual
so
dT out
 mc  ------------- =  hA   T in – T out 
dt
1
Defining C t = mc (thermal capacitance) and R t = ------- (thermal resistance) and
hA
converting into standard form gives:
dT out
 C t R t  ------------- + T out =  1  T in
dt
mc
where the time constant is  = R t C t = ------- and the sensitivity is K=1.
hA
4.22
Plotting the data Xout(t) shows a steady state asymptote of approximately 5 indicating that:
KA in = 5
X out  t 
Plotting Z  t  = ln  1 – ----------------- shows a near linear relation indicating that the system
KA in
can be modeled as 1st order.
Z
0.5
0
‐0.5 0
0.2
0.4
0.6
0.8
1
1.2
‐1
‐1.5
Z
‐2
Linear (Z)
‐2.5
‐3
‐3.5
‐4
y = ‐3.772x + 0.145
‐4.5
The slope of the line is approximately 3.772, indicating a time constant of
 = 1 / 3.772 = 0.265 sec
4.23
34
The damped natural frequency is always smaller if there is damping in the system.
Introduction to Mechatronics and Measurement Systems
Solutions Manual
4.24
(a)
mechanical rotary (applied torque, torsion spring, rotary damper, and rotary inertia):
··
·
J  + B  + k  =  ext
(b)
electrical (voltage source and series resistor, inductor, and capacitor):
1
1
Lq·· + Rq· + ---- q = V s or LI· + RI + ----  I dt = V s
C
C
(c)
hydraulic (pump with inlet in reservoir, long pipe with friction loss and fluid inertia,
and tank):
1
dQ
I ------- + RQ + ---- V = P
C
dt
where V =  Q dt
4.25
Given the differential equation:
 x· out + x out = Kx in
Applying the procedure results in:
  s + 1  X out  s  = KX in  s 
X out  s 
K
G  s  = ------------------ = ------------------X in  s 
s + 1
K
G  j   = -----------------1 +  j
X out
K
------------ = G  j   = --------------------------X in
2
1 +   
 = arg  G  j    = 0 – atan    = – atan   
4.26
rad
F 0 = 20N  = 0.75 -------Sec
n =
b
k- = 1.095 ,  = ------= 0.685 ,  = --------------- = 0.456
r
n
m
2 km
X0
1
-----------= ------------------------------------------------- = 1.219
F0  k
2 2
2
 1 – r  + 4  2 r
Introduction to Mechatronics and Measurement Systems
35
Solutions Manual
X0 F0
X 0 =  ------------ ----- = 2.032m
 F 0  k k
– 1

 2 
 = – tan  ----------------- = – 49.6  = – 0.866rad
1
 ----–  r
 r

Therefore, the steady state response is:
x  t  = X 0 sin   t +   = 2.032 sin  0.75t – 0.866  m
4.27
The equation of motion is
mx··out + bx· out + kx out = kx in
Taking the Laplace transform of both sides gives the transfer function:
X out  s 
k
G  s  = ------------------ = -----------------------------2
X in  s 
ms + bs + k
Now
k
G  j   = --------------------------------------- k – m2  + bj
X out
k
------------ = G  j   = ---------------------------------------------------X in
 k – m2 2 +  b 2
–1
b
 = – tan  -------------------2-
k – m
So the steady state response is
X out
x out  t  = X in ------------- sin   t +  
X in
36
Introduction to Mechatronics and Measurement Systems
Solutions Manual
Using MathCAD,
m
0.10
k
100000
b
10
k  X in
X out(  )
k
2
m 
2
 ( )
( b  )
X in
0.05
angle k
2
X out( 10 )  0.05
 ( 10 )  0.057 deg
X out( 1000 )  0.5
 ( 1000 )  90 deg
X out( 10000 )  5.05  10
2
m   b  
4
 ( 10000 )  179.421 deg
Only the first input results in an acceptable output.
4.28
The response would be the same since there is no "g" in the equations. The only difference
would be the initial "equilibrium position," which would be at the unstretched length of the
spring. One method to determine the mass is to measure the natural frequency with a spring
of known stiffness and calculate:
k
m = -----2n
4.29
xh  t  = e
–  n t
 A cos   d t  + B sin   d t  
xp  t  = C
x  t  = xh  t  + xp  t 
F0
x    = ----- gives C = 0
k
x(0) = 0 gives A = -C
x·  0  = 0 gives B = 0
Therefore,
F0
–  t
x  t  = -----  1 – e n cos   d t  
k
Introduction to Mechatronics and Measurement Systems
37
Solutions Manual
4.30
The natural frequencies and damping constants can be used to predict the results. To model
the tire, the mass of the wheel, stiffness of the tire, and position of the spindle (new
variable) would also need to be included. The input force or displacement would then be
at the tire-road interface.
4.31
The volume in the tank is
2
D
V = ---------- h
4
The pressure at the bottom of the tank is
P =  gh =  h
Solving the volume expression for h and substituting into the pressure expression gives
1
4
P = ---------2- V = ---- V
C
D
so
2
D
C = ---------4
4.32
Q
Since F = ma , a = x·· and x· = ---- ,
A
Q·
PA =   LA   ----
 A
L
P =  ------- Q· = IQ·
 A
4.33
Element [flow] analogies:
F in  v in   V in  I in 
k 1  v in – v m   C 1  I in – I m 
m  vm   L  Im 
b1  vm   R1  Im 
k2  vm   C2  Im 
Analogous free body diagram equations [KVL]:
V in = V C1
V C1 = V R1 + V C2 + V L
38
Introduction to Mechatronics and Measurement Systems
Solutions Manual
The resulting analogous electrical circuit follows:
L
+
Vin
R1
C1
C2
4.34
Element [flow] analogies:
F1  v1   V1  I1 
m  v1   L  I1 
k1  v1   C1  I1 
b1  v1 – v2   R1  I1 – I2 
k2  v1 – v2   C2  I1 – I2 
F2  –v2   V2  –I2 
Analogous free body diagram equations [KVL]:
V 1 – V C2 – V R1 – V C1 = V L
VR1 + VC – V2 = 0
2
The resulting analogous electrical circuit follows:
R1
C2
C1
+
L
V2
+
V1
4.35
Hydraulic elements are direct analogies to electrical elements. The capacitors are replaced
by tanks, and the resistor and inductor are replaced by a long pipe with flow resistance and
inertance.
Introduction to Mechatronics and Measurement Systems
39
Solutions Manual
4.36
Element [flow] analogies:
V1  I1   F1  v1 
L  I1   m  v1 
C1  I1   k1  v1 
R  I1 – I2   b  v1 – v2 
C2  I1 – I2   k2  v1 – v2 
V2  –I2   F2  –v2 
Analogous KVL [free body diagram] equations:
F 2 + F k1 + F 2 – F 1 = 0
F 1 – F 2 – F k1 + F b – F k2 = 0
F2 – Fb – Fk2 = 0
The resulting analogous mechanical system follows:
k1
F1
m1
F2
b
k2
4.37
Element [flow] analogies:
F in  v 1   V in  I 1 
b1  v1 – v2   R1  I1 – I2 
k1  v1 – v2   C1  I1 – I2 
m  v2   L  I2 
k2  v2 – v3   C2  I2 – I3 
b2  v3   R2  I3 
Analogous free body diagram equations [KVL]:
V in = V R1 + V C
1
V R1 + V C = V L + V C2
1
40
Introduction to Mechatronics and Measurement Systems
Solutions Manual
V C2 = V R2
The resulting analogous electrical circuit follows:
I2
I1
L
(I2-I3)
R1
+
(I1-I2)
Vin
I3
C2
R2
C1
4.38
k  z – x  + b  z· – x·  –  m 1 g sgn  x·  = m 1 x··
k  z – x  + b  z· – x·  – F 1 = – m 2 ··
z
··
– rF 1 = I 2 
where
·
··
z = y – r  , z· = y· – r  , ··
z = y·· – r 
Introduction to Mechatronics and Measurement Systems
41
Solutions Manual
5.1
The power dissipated by each resistor is
2
2
2
2
V in
V out
  GAIN  V in 
25GAIN
------- = 25
------ and ---------= ------------------------------------ = -----------------------R
R
RF
RF
RF
To be able to use 1/4 W resistors, the following must be true:
25
------  0.25 or R  100 
R
2
25GAIN
------------------------  0.25 or R F   GAIN 2  100 
RF
(a)
for GAIN=1, RF > 100
(b)
for GAIN=10, RF > 10k
(a)
R4
V + = V - = ------------------- V out
R3 + R4
5.2
V+
I = ------R2
R2  R3 + R4 
V out = ------------------------------- I
R4
(b)
V + = V - = V out
V out
V+
I 1 = I 2 = ------- = ---------R2
R2
V + + I 1 R 1 = V out + I 3 R 3
so
R1
R1
I 3 = ------ I 1 = ------------- V out
R3
R2 R3
R1
1
I = I 1 + I 3 = V out  ------ + -------------
 R2 R2 R 
3
so
R2 R3
V out = ------------------- I
R1 + R3
42
Introduction to Mechatronics and Measurement Systems
Solutions Manual
5.3
With RF replaced by a short, the op amp circuit becomes a buffer so the gain is 1.
5.4
(a)
R2
V - = V + = ------------------- V 1 = 5V
R1 + R2
V out = V - + V 2 – I 3 R 3
but I3 = 0, so
V out = V - + V 2 = 10V
(b)
5.5
same as (a)
V+ = V- = Vi
R3
V 4 =  1 + ------ V +

R 2
R2 + R3
V4
I 4 = ------ = ------------------- V i
R2 R4
R4
5.6
If VA denotes the voltage at the output of the first op amp,
V A = V - = V + = 0V
and from Ohm’s Law, the current from voltage source V1 is
V1
V1 – VA
I 1 = -------------------- = -----R
R
If VB denotes the voltage at the inverting input of the second op amp,
VB = V- = V+ = V2
and from Ohm’s Law,
V 2 – V out
V2
VB
V B – V out
I 4 = ------- = ------ and I 2 = ------------------------ = ----------------------R
R
R
R
where I4 is the current through the vertical resistor and I2 is the current through the feedback
resistor of the second op amp. From this,
V out = V 2 – I 2 R
Now applying Ohm’s Law to the resistor between the op amps gives
V2
VA – VB
I 3 = --------------------- = – -----R
R
Introduction to Mechatronics and Measurement Systems
43
Solutions Manual
where I3 is the current through the resistor.
From KCL, the current out of the first op amp is
V2 V1
1
I out 1 = I 3 – I 1 = – ------ – ------ = – ----  V 1 + V 2 
R
R
R
The negative sign indicates that the current is actually into the op amp.
From KCL,
V2 V2
2
I 2 = I 3 – I 4 = – ------ – ------ =  – ---- V 2
R
R
R
Therefore,
2V 2
V out = V 2 –  – ---------- R = 3V 2
 R 
5.7
V o  V i because of positive feedback.
5.8
Applying Ohm’s Law to both resistors gives
V1
V2
I 1 = ------ and I 2 = -----R1
R2
From KCL,
IF = I1 + I2
Since V o + I F R F = 0 ,
V1 V2
V o = – R F  ------ + ------
R1 R2
For R1 = R2 = RF = R,
Vo = – V1 + V2 
5.9
Applying Ohm’s Law to both resistors gives
V1 – V3
V2 – V3
I 1 = ------------------- and I 2 = ------------------R1
R2
From KCL,
IF = I1 + I2
44
Introduction to Mechatronics and Measurement Systems
Solutions Manual
Since V o + I F R F = V 3 ,
V1 – V3 V2 – V3
V o = V 3 – R F  ------------------- + -------------------
 R1
R2 
For R1 = R2 = RF = R,
V o = V 3 –  V 1 – V 3 + V 2 – V 3  = 3V 3 –  V 1 + V 2 
5.10
From voltage division,
RF
V - = V + =  ------------------- V 2
 R F + R 2
From Ohm’s Law,
 V1 – V- 
I 1 = -----------------------R1
The output voltage can be found with:
RF  
 V –  -----------------1

 R F + R 2 V 2
R
F
V o = V - – I 1 R F =  ------------------- V 2 – -------------------------------------------------- R F
 R F + R 2
R1
Simplifying gives
R1 V2 –  V1  RF + R2  – RF V2 
V o = ---------------------------------------------------------------------------R1  RF + R2   RF
V2  RF + R1  – V1  RF + R2 
V o = --------------------------------------------------------------------R1  RF + R2   RF
For R1=R2=R,
RF
V o = ------  V 2 – V 1 
R
5.11
RF
RF
V outin =  – ------ V in and V outref =  1 + ------ V
 R

R  ref
RF
RF
V out = V out in + V out ref =  – ------ V in +  1 + ------ V ref
 R

R
Introduction to Mechatronics and Measurement Systems
45
Solutions Manual
5.12
Using superposition,
R4
V o1 = – ------ V 3
R3
R5
R4
V o2 =  1 + ------ ------------------- V 4

R 3 R 3 + R 5
R5
R4
R4
V o = V o1 + V o2 = – ------ V 3 +  1 + ------ ------------------- V 4

R3
R 3 R 3 + R 5
5.13
Using MathCAD:
The input can be expressed as:
T 
  2   100
1
100
Vin( t)  sin (  t)  0.1
Assuming RC=1, the output of the integrator will be:
1
Vout ( t)   cos (  t)  0.1 t

3
210
0
3
 210
Vout ( t )
3
 410
3
 610
3
 810
0
0.02
0.04
t
5.14
V+ = V- = 0
dI L
1
V i = L -------- so I L = ---  V i dt
L
dt
Vo = V- + IR R
46
Introduction to Mechatronics and Measurement Systems
Solutions Manual
R
but IR = IL, so V o = ----  V i dt
L
5.15
From Ohm’s Law, the input currents can be related to the circuit voltages with:
V+
I + = – ------R2
and
V in – V - V I - = -------------------- – -----R1
Rs
If the input voltages and currents are assumed to be equal (I+ = I-), equating these
expressions, setting Vin=0, and dividing through by the voltage (V+ = V-) gives:
11
1
----= ------ + ----R2
R1 Rs
which gives:
R1 Rs
R 2 = -----------------R1 + Rs
5.16
(a)
RF
V o = –  ------ V i = – 2V i
 R
(b)
1
V o = – --------  V i dt = –  V i dt
RC
Introduction to Mechatronics and Measurement Systems
47
Solutions Manual
(c)
RF
V o = – ------  V 1 + V 2  = – 4V i
R
(d)
V - = V + = 0V
From Ohm’s Law,
Vi
Vi
V1
V2
I 1 = ------ = ------ and I 2 = --------- = --------5k
5k
10k
10k
From KCL,
1
1
I F = I 1 + I 2 = V i  ------ + ---------
 5k 10k
but from Ohm’s Law,
0 – Vo
I F = --------------5k
so
1
3
V o = – 5kI F = – V i  1 + --- = – --- V i
2
2
5.17
comparator

+
+
5V
+
330
Vin
LED
48
Introduction to Mechatronics and Measurement Systems
Solutions Manual
5.18
330
LED

+
+
5V
+
Vin
5.19
open collector
comparator
The limit on the feedback resistor current is:
V out
10V
I F = ---------- = ----------  10mA
RF
RF
Therefore,
10V
R F  --------------- = 1k 
10mA
5.20
RF
V outmax = 13.6V and V out = – ------ V in = – 2V in
R
so:
V outmax
- = 6.8V
V inmax = -----------------2
5.21
RF
closed loop gain = ------ = 10
R
so the fall-off frequency is 105Hz.
5.22
The amplifier will saturate (reach the minimum swing voltage limit) as the integrated dc
component grows.
Introduction to Mechatronics and Measurement Systems
49
Solutions Manual
6.1
11111111111111112 = 216  1 = 65,535
6.2
(a)
128 = 100000002 since 27 = 128
(b)
127 = 11111112 since (27  1) = 127
(a)
128 = 8016 since 8(16) = 128
(b)
127 = 7F16 since 7(16) + 15 = 127
6.3
6.4
(a)
1
1
1101
+ 1001
(b)
13
+
9
10110
22
1101
13
- 1001
-
9
0100
(c)
4
1101
x 1001
13
x
9
1101
27
0000
9
0000
117
1101
1110101
(d)
50
111
111
7
+ 111
+ 7
1110
14
Introduction to Mechatronics and Measurement Systems
Solutions Manual
(e)
111
x 111
7
x
7
11
1111
111
49
111
111
110001
6.5
(a)
A
B
C
(b)
A
C
B
6.6
A
AA = A
A
6.7
(a)
The output (C) is high (5V) iff both inputs are low (0V).
C = AB = A + B
A
B
C
0
0
1
0
1
0
1
0
0
1
1
0
Introduction to Mechatronics and Measurement Systems
51
Solutions Manual
(b)
(c)
C =  AB   AB  = AB
A
B
C
0
0
0
0
1
0
1
0
0
1
1
1
C = AABBAB = AAB + BAB = A  A + B  + B  A + B 
C = AB + BA = A  B
(d)
A
B
C
0
0
0
0
1
1
1
0
1
1
1
0
A
B
C
0
0
0
0
1
1
1
0
1
1
1
1
C = AB = A + B
6.8
A
B
C
6.9
A
B
C
52
Introduction to Mechatronics and Measurement Systems
Solutions Manual
6.10
A
B
C
D
E
F
0
0
0
0
1
0
0
0
1
0
0
1
0
1
0
0
1
0
0
1
1
0
0
1
1
0
0
0
1
0
1
0
1
0
0
1
1
1
0
1
1
0
1
1
1
1
1
1
A
B
C
D
E
F
6.11
(a)
1  0 + 1  0 + 1 + 0  1 + 0
11+11+01
1+1+0
1
(b)
A  B + A  A + B
AB + A + B
AA + 1
A1
A
6.12
X = AB + BC + BC + C = ABBC + BC + C = BC  A + 1  + C = C  B + 1  = C
Introduction to Mechatronics and Measurement Systems
53
Solutions Manual
6.13
A + A  B = A + B
Multiplying (ANDing) both sides by A gives:
AA+AAB = AA+AB
Simplifying, gives:
A+0 = A+AB
A = A  1 + B
A = A
Thus, the identity is valid.
6.14
 A + B   A + B  = AA + AB + BA + BB = A + A  B + B  = A + A = A
6.15
Equation 6.21:
A + B  A + C
AA + AC + BA + BC
A1 + C + BA + C
A1 + BA + C
A + BA + BC
A  1 + B  + BC
A  1  + BC
A + BC
54
 A + B    A + C  A + BC
A
B
C
A+B
A+C
BC
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
1
0
1
0
0
0
0
0
1
1
1
1
1
1
1
1
0
0
1
1
0
1
1
1
0
1
1
1
0
1
1
1
1
0
1
1
0
1
1
1
1
1
1
1
1
1
1
Introduction to Mechatronics and Measurement Systems
Solutions Manual
6.16
6.17
Equation 6.22:
A
B
A+B
AB
 A + B  + AB
0
0
0
0
0
1
0
1
1
1
0
1
1
0
1
1
1
1
1
1
Equation 6.23:
A
B
C
AB
BC
BC
AB + BC + BC
AB + C
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
0
1
0
0
0
0
0
0
0
1
1
0
1
0
1
1
1
0
0
0
0
0
0
0
1
0
1
0
0
1
1
1
1
1
0
1
1
0
1
1
1
1
1
1
1
0
1
1
A
B
C
AB
AC
BC
AB + AC + BC
AB + BC
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
0
1
0
0
0
0
0
0
0
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
1
0
1
0
1
1
1
1
1
1
0
1
0
0
1
1
1
1
1
1
1
0
1
1
6.18
Introduction to Mechatronics and Measurement Systems
55
Solutions Manual
6.19
(a)
A
B
C
AB
BC
BC
AB + BC + BC
AB + C
0
0
0
0
0
0
0
1
0
0
1
0
0
1
1
0
0
1
0
0
0
0
0
1
0
1
1
0
1
0
1
0
1
0
0
0
0
0
0
1
1
0
1
0
0
1
1
0
1
1
0
1
0
0
1
1
1
1
1
1
1
0
1
1
(b)
A
B
C
ABC
A+B+C
0
0
0
0
1
0
0
1
0
0
0
1
0
0
0
0
1
1
0
0
1
0
0
0
0
1
0
1
0
0
1
1
0
0
0
1
1
1
1
0
(c)
56
A
B
C
AB
BC
BC
AB + BC + BC
AB + C
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
1
0
1
0
0
0
0
0
0
0
1
1
0
1
0
1
1
1
0
0
0
0
0
0
0
1
0
1
0
0
1
1
1
1
1
0
1
0
0
1
1
1
1
1
1
1
0
1
1
Introduction to Mechatronics and Measurement Systems
Solutions Manual
6.20
6.21
A
B
A
B
A+B
AB
0
0
1
1
1
1
0
1
1
0
0
0
1
0
0
1
0
0
1
1
0
0
0
0
X = AP + BP
P
A
B
X
0
0
0
0
0
0
1
0
0
1
0
1
0
1
1
1
1
0
0
0
1
0
1
1
1
1
0
0
1
1
1
1
The circuit is called a multiplexer because P allows one of two (multiple) inputs to pass
through to the output.
6.22
X = AB + A  A + B 
X = AB + A + B
X = A  A + 1  = AA = A
equivalent circuit: one wire connecting input A to output X!
6.23
Y = AD +  A + B  C
For the unallowed code CD=11, the output (Y) would be:
Y = A + A + B = A + B
In this state, the alarm would go off when windows or doors are disturbed or when motion
is detected. This state is the same as state 2 (CD = 10).
6.24
The simplified Boolean expression is:
X = B  C + A
Introduction to Mechatronics and Measurement Systems
57
Solutions Manual
Using DeMorgan’s Laws, the all-AND representation is:
B  C  A = B  C  A
and the all-OR representation is:
B + C + A
The original expression contains 1 AND operations, 1 OR operation, and one inversion,
requiring 3 ICs. The all-AND version contains 2 ANDs and 2 inversions, requiring 2 ICs.
The all-OR version contains 2 ORs and 4 inversions, also requiring 2 ICs.
6.25
Y = A  D + A + B  C
Y = A + D + A + B + C
A
6.26
B
C
D
Segment c is OFF only for the digit 2, so the output of the logic circuit must be:
X = DCBA or more simply X = CBA
6.27
X = ABC +  A + B  C = ABC  A + B  C = ABCABC
6.28
X = AA  C + C  + BC = A1 + BC = A + BC = A + B + C = A + B + C
6.29
The required Boolean expression is:
X = C  A + B
which can be implemented with the following logic circuit:
A
B
C
58
Introduction to Mechatronics and Measurement Systems
X
Solutions Manual
The complete truth table (including the sub expression  A + B  ) is:
6.30
A
B
C
A + B
X
0
0
0
1
0
0
0
1
1
1
0
1
0
1
0
0
1
1
1
1
1
0
0
1
0
1
0
1
1
1
1
1
0
0
0
1
1
1
0
0
X = PAB + PAB + PAB + PAB
X = PA  B + B  + PB  A + A 
X = PA + PB
6.31
For the two expressions for S:
A
B
AB
AB
AB + AB
A+B
A+B
A + BA + B
0
0
0
0
0
0
1
0
0
1
1
0
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
0
1
0
0
For the two expressions for C:
6.32
A
B
AB
A+B
A+B
A+B
 A + B  A + B  A + B 
0
0
0
0
1
1
0
0
1
0
1
0
1
0
1
0
0
1
1
0
0
1
1
1
1
1
1
1
From the logic circuit:
C = AB
which is the sum-of-products result. And, using DeMorgan’s Law,
S =  A + B  AB =  A + B   A + B 
which is the product-of-sums result.
Introduction to Mechatronics and Measurement Systems
59
Solutions Manual
6.33
Sum of products circuit:
A
B
S
C
Product of sums circuit:
A
B
S
C
6.34
Ci-1
Ai
Bi
Si
Ci
0
0
0
0
0
0
0
1
1
0
0
1
0
1
0
0
1
1
0
1
1
0
0
1
0
1
0
1
0
1
1
1
0
0
1
1
1
1
1
1
Si = Ci – 1 Ai Bi + Ci – 1 Ai Bi + Ci – 1 Ai Bi + Ci – 1 Ai Bi
Ci = Ci – 1 Ai Bi + Ci – 1 Ai Bi + Ci – 1 Ai Bi + Ci – 1 Ai Bi
60
Introduction to Mechatronics and Measurement Systems
Solutions Manual
6.35
preset
clear
toggle
set
toggle
set
J
reset
reset
K
CK
Q
6.36
T
Preset
Clear
Q
Q

1
1
Q0
Q0

1
1
Q0
Q0
0
1
1
Q0
Q0
1
1
1
Q0
Q0
0
0
1
1
0
1
1
0
0
1
Introduction to Mechatronics and Measurement Systems
61
Solutions Manual
6.37
CK
D
Preset
Clear
Q
Q

x
1
1
Q0
Q0


0
1
1
0
1
1
1
1
1
0
0
x
1
1
Q0
Q0
1
x
1
1
Q0
Q0
x
x
0
1
1
0
x
x
1
0
0
1
6.38
62
Introduction to Mechatronics and Measurement Systems
Solutions Manual
6.39
6.40
6.41
There is a delay between the release at contact "B" (which can exhibit bounce) and the
connection at contact "A" (which can exhibit bounce). There are also small but important
switching delays in the NAND gates. See Figure 6.7. The debounce circuit is an RS flipflop with inverters at each input (to effectively eliminate the internal inverters).
6.42
S1
S2
D
Q
CK
D
Q
CK
Q
S4
S3
D
Q
CK
Q
D
Q
CK
Q
Q
E
Introduction to Mechatronics and Measurement Systems
63
Solutions Manual
6.43
The P0P1P2P3 values change on the negative edge of each clock pulse as follows:
0000 (after reset pulsed low), 1000 (after 1st bit clock pulse), 0100 (after 2nd bit clock
pulse), 1010 (after 3rd bit clock pulse), 1101 (after 4th bit clock pulse).
6.44
The Q0Q1Q2Q3 values (where Q3 = Sout) change on the negative edge of each clock pulse
as follows:
0000 (after reset pulsed low), 1011 (after load line pulsed high), 0101 (after 1st bit clock
pulse), 0010 (after 2nd bit clock pulse), 0001 (after 3rd bit clock pulse), 0000 (after 4th bit
clock pulse).
6.45
1
J
Q
CK
1
K
Q
6.46
5V
sensor
D
Q
CK
CL
Q
5V
NC
button
64
Introduction to Mechatronics and Measurement Systems
1k
Solutions Manual
6.47
5V
NO
NC
5V
S
D
Q
CK
Q
C
7474
counter
B
oneshot
O
7409
7490
74124
Note - With this design, the counter could be negative- or positive-edge triggered. If the
counter is negative-edge triggered (as shown), the one-shot is actually not required.
B
S
Q
O
C
Introduction to Mechatronics and Measurement Systems
65
Solutions Manual
6.48
totem
pole
TTL
5V
sinking current with low output
totem
pole
TTL
sourcing current with high output
opencollector
TTL
5V
sinking current with high output
TTL can sink more current than it can source, so the sourcing option wouldn’t be as bright.
6.49
5V
1k
74LS00
4011B
6.50
The CMOS LOW can sink only 1mA per gate which is enough to drive only two LS TTL
inputs (which require 0.36 mA per gate).
6.51
c = QD QC QB QA
e =  QD + QC + QB + QA   QD + QC + QB + QA   QD + QC + QB + QA   QD + QC + QB + QA 
6.52
66
See info in TTL Data Book.
Introduction to Mechatronics and Measurement Systems
Solutions Manual
6.53
The input is the same: some sort of clock signal. Three of the four outputs look the same
(the 3 least significant bits), but in the decade counter the most significant bit resets all the
bits on the count of 10. The binary counter will continue to increment bits until 16 is
reached. In the binary counter the output code provides 16 combinations, but in the decimal
counter the output code provides 10 different output combinations.
6.54
The output goes high when the signal increases through 4V and low when it decreases
through 1V.
t
6.55
V CAPACITOR
– --


= V cc  1 – e  where  = RC


But when t = T, VCAPACITOR = 2/3 Vcc, so
T
T
– --------
– -------
2
--- =  1 – e RC so e RC = 1
--3
3


and
 T = RC ln  3   1.1RC
6.56
See a Linear Circuits data and/or applications book.
6.57
The time to discharge from 2/3Vcc to 1/3Vcc is the same as the time to charge from 1/3Vcc
to 2/3Vcc. From the section, the time to charge to 2/3Vcc is:
1
t b = – R 2 C ln  ---
 3
and the time to charge to 1/3Vcc is:
2
t a = – R 2 C ln  ---
 3
Therefore, the elapsed time would be:
2
1
23
T 2 = t b – t a = R 2 C  ln  --- – ln  ---  = R 2 C ln  ---------- = R 2 C ln  2 
  3
 3 
 1  3
6.58
Ideally, making R1=0 would make T1 = T2, which would result in a perfectly symmetric
square wave. However, with R1 shorted, there would no longer be any resistance in the
transistor collector-emitter circuit which could result in excessive current to be sunk by the
555 when the base goes high, and this could result in damage.
If the capacitor has a partial charge initially, the first square-wave pulse width will be off
slightly, but all subsequent pulses will be consistent.
Introduction to Mechatronics and Measurement Systems
67
Solutions Manual
6.59
If the count is updating immediately during the negative edge of signal L, it is possible that
individual bits are latched either before or after the actual transition, depending on the exact
timing of the counter outputs. This unlikely, but possible, scenario can be prevented by
blocking the input pulses during the latch period, when L is high. This could be done by
ANDing the input pulse line (I) with the inversion of the latch signal (L), and attach this
output to the counter.
6.60
Assume that the digital event is a digital pulse that can be applied to the input of the counter.
Cascade 3 74LS90's and connect the output of the third to an LED. Refer to the IC spec
sheet for the appropriate wiring.
6.61
With the solution in 6.47, bounce with the SPDT switch has no effect. This can be verified
with a timing diagram. If the button were pressed immediately after the switch, while
bounce were still occurring, the stored value would be uncertain, but timing this fast would
not be detectable (or repeatable) by a human anyway.
If the button exhibited bounce, the circuit would have a problem. Positive and negative
edges would occur during the bounce, which would result in premature latching during the
button press, and re-latching during the button release.
6.62
See "Case Study 2" in Chapter 11.
6.63
See "Case Study 2" in Chapter 11.
68
Introduction to Mechatronics and Measurement Systems
Solutions Manual
7.1
With the code provided, when the target LED turns on (after the 1st countdown to zero), it
never goes off.
A more graceful solution would be to reset the counter and LEDs when the button is pressed
again after the decrement to zero. If a "start" label is inserted above the "movlw target"
line, we would just need to replace "goto begin" with "goto start." Then, the target LED
would turn off and the countdown would start over again.
7.2
PIC16F84
1
1k
RA1
2
RA3
RA0
3
RA4
OSC1
MCLR
OSC2
4
5V
RA2
5
6
7
8
9
Vss
Vdd
RB0
RB7
RB1
RB6
RB2
RB5
RB3
RB4
18
330
17
LED
16
15 4 MHz
22 pF
14
22 pF
13
12
11
10
5V
0.1 F
list p=16f84
include <p16F84.inc>
; Define counter variable locations
c1 equ 0x0c
c2 equ 0x0d
c3 equ 0x0e
; Initializes PORTA to output all zeros
bcf STATUS, RP0 ; select bank 0
clrf PORTA
; initialize all pin values to zero
bsf STATUS, RP0
; select bank 1
clrf TRISA
; designate all PORTA pins as outputs
bcf STATUS, RP0 ; select bank 0
Introduction to Mechatronics and Measurement Systems
69
Solutions Manual
; Main program loop
start
bsf PORTA, 0
call pause
bcf PORTA, 0
call pause
; turn on the LED connected to RA0
; pause for 1 second
; turn off the LED connected to RA0
; pause for 1 second
goto start
; Subroutine to pause for approximately 1 second
pause
; Initialize counter variables
movlw 0x00
movwf c1
movlw 0x00
movwf c2
movlw 0xFA
movwf c3
loop
incfsz c1, F
goto loop
incfsz c2, F
goto loop
incfsz c3, F
goto loop
return
; end of subroutine
end
70
; end of instructions
Introduction to Mechatronics and Measurement Systems
Solutions Manual
7.3
PIC16F84
1
1k
RA3
RA0
3
RA4
OSC1
MCLR
OSC2
5
6
7
8
NO
RA1
2
4
5V
RA2
9
Vss
Vdd
RB0
RB7
RB1
RB6
RB2
RB5
RB3
RB4
18
17
LED
330
16
15 4 MHz
22 pF
14
22 pF
13
12
11
10
5V
0.1 F
5V
’ Program to turn an LED on and off at 1 Hz while a pushbutton switch
’ is being held down
’ Define variable names for the I/O pins
my_button
Var
PORTB.0
my_led
Var
PORTA.0
begin:
While (my_button == 1)
’ Turn on the LED
High my_led
’ while the switch is held down
’ Wait for 1/2 sec
Pause 500
’ Turn off the LED
Low my_led
’ Wait for 1/2 sec
Pause 500
Wend
Introduction to Mechatronics and Measurement Systems
71
Solutions Manual
7.4
Goto begin
’ continue
End
’ end of instructions
’ Program to perform the functionality of the Pot statement
’ assumed variables:
’ pin: I/O pin identifier
’ scale: byte variable containing maximum time constant
’ var: byte variable containing measured time constant
’ Charge the capacitor
High pin
Pause scale
’ Discharge the capacitor and measure the discharge time
var = 0
Low pin
Input pin
While (pin == 1)
’ while the capacitor is not discharged
Pause 1
var = var + 1
Wend
7.5
’ Subroutine to perform a software debounce on pin RB0
debounce:
’ Define pin RB0 as an input
pin Var PORTB.0
Input pin
’ Wait for the pushbutton switch to be pressed (1st bounce)
loop:
If (pin == 0) Then loop
’ Wait 10 milliseconds for the switch bounce to settle
Pause 10
’ Wait for the pushbutton switch to be released (1st bounce)
loop2:
If (pin == 1) Then loop2
’ Wait 10 milliseconds for the switch bounce to settle
Pause 10
’ End of subroutine
Return
72
Introduction to Mechatronics and Measurement Systems
Solutions Manual
7.6
’ Using a 20MHz oscillator (PULSIN gives number of 2us increments)
sensor Var PORTA.0
high_width Var WORD
low_width Var WORD
period Var WORD
rpm Var WORD
start:
’ Time entire pulse period
PULSIN sensor, 1, high_width
PULSIN sensor, 0, low_width
period = high_width/2 + low_width/2
’ Convert period to units of 10 mmin (10 milli-minutes)
period = period / 60 / 100
’ Calculate and display rpm (assuming rpm is in the approximate 10 to 10000 range)
If (period > 0) Then
rpm = 10000 / period
Gosub display_rpm
Endif
Goto start
7.7
’ Subroutine to perform a simulated D/A conversion, holding a voltage for approximately
’ 1 second
D_to_A:
’ Define variables:
’ digital_value: predefined byte variable indicating the relative voltage value
pin Var PORTA.0 ’ output pin
i Var BYTE
’ counter variable used in For loop
’ Maintain filtered PWM signal for approximately 1 second
For i = 1 To 1000
’ Hold the pin high for the portion of a second based on the digital value
High pin
’ Pause for the appropriate number of 1/255 (approximately) increments
Pause (4*digital_value)
’ Hold the pin low for the remainder of the second
Low pin
’ Pause for the appropriate number of 1/255 (approximately) increments
Pause (4 * (255  digital_value))
Next i
’ End of subroutine
Return
Introduction to Mechatronics and Measurement Systems
73
Solutions Manual
7.8
The polling loop continues to run after the alarm as been activated, and the if the door and
windows are closed the alarm will go off. An improved design would branch off to another
section of code when the alarm is activated that would wait for some sort of alarm reset
signal before deactivating the alarm.
7.9
’ PicBasic Pro program to perform the control functions of the security system example
’ using interrupts
’ Define variables for I/O port pins
door_or_window
Var
PORTB.0
motion
Var
PORTB.1
c
Var
PORTB.2
d
Var
PORTB.3
alarm
Var
PORTA.0
’ signal A
’ signal B
’ signal C
’ signal D
’ signal Y
’ Define constants for use in IF comparisons
OPEN
Con 1
’ to indicate that a door OR window is open
DETECTED Con 1
’ to indicate that motion is detected
’ Initialize interrupts
OPTION_REG = $7F
On Interrupt Goto myint
INTCON = $88
’ enable PORTB pull-ups
’ enable interrupts on RB4 through RB7
’ Main loop waiting for sensors to change value (i.e., wait for interrupts)
always:
Low alarm
’ keep the alarm low until a sensor changes value
Goto always ’ continue
’ Interrupt service routine that runs until sensors return to inactive states
Disable
’ disable interrupts during the interrupt service routine
myint:
While ((door_or_window == OPEN) Or (motion == DETECTED))
If ((c == 0) And (d == 1)) Then
’ operating state 1 (occupants sleeping)
If (door_or_window == OPEN) Then
High alarm
Else
Low alarm
Endif
Else
If ((c == 1) And (d == 0)) Then ’ operating state 2 (occupants away)
If ((door_or_window == OPEN) Or (motion == DETECTED)) Then
High alarm
Else
Low alarm
Endif
74
Introduction to Mechatronics and Measurement Systems
Solutions Manual
Else
’ operating state 3 or NA (alarm disabled)
Low alarm
Endif
Endif
Wend
INTCON.1 = 0 ’ clear the interrupt flag
Resume
’ end of interrupt service routine
Enable
’ allow interrupts again
End
7.10
// Declare all global variables
const int switch_1=1;
// first combination switch
const int switch_2=2;
// second combination switch
const int switch_3=3;
// third combination switch
const int enter_button=4;
// combination enter key
const int green_led=5;
// green LED indicating a valid combination
const int red_led=6;
// red LED indicating an invalid combination
const int speaker=7;
// speaker signal for sounding an alarm
const int motor=8;
// signal to bias the motor power transistor
const int a=9;
// bit 0 for the 7447 BCD input
const int b=10;
// bit 1 for the 7447 BCD input
const int c=11;
// bit 2 for the 7447 BCD input
const int d=12;
// bit 3 for the 7447 BCD input
byte combination;
// stores the valid combination in the 3 LSBs
byte number_invalid;
// counter used to keep track of the number of bad
// combinations
// Initializations
void setup() {
// Define pin I/O status
pinMode(switch_1, INPUT);
pinMode(switch_2, INPUT);
pinMode(switch_3, INPUT);
pinMode(enter_button, INPUT);
pinMode(green_led, OUTPUT);
pinMode(red_led=6, OUTPUT);
pinMode(speaker=7, OUTPUT);
pinMode(motor=8, OUTPUT);
pinMode(a=9, OUTPUT);
pinMode(b=10, OUTPUT);
pinMode(c=11, OUTPUT);
pinMode(d=12, OUTPUT);
// Initialize the valid combination and turn off all output functions
combination = B101;
// valid combination (switch 3:on, switch
// 2:off, switch 1:on)
// Make sure the LEDs and motor are off and initialize the display
Introduction to Mechatronics and Measurement Systems
75
Solutions Manual
digitalWrite(green_led, LOW);
digitalWrite(red_led, LOW);
digitalWrite(motor, LOW);
digitalWrite(a, LOW);
digitalWrite(b, LOW);
digitalWrite(c, LOW);
digitalWrite(d, LOW);
// Initialize invalid combo counter
number_invalid = 0;
}
// Main polling loop
void loop() {
// Wait for the pushbutton switch to be pressed
while (enter_button == 0);
// Read switches and compare their states to the valid combination
if ( (digitalRead(switch_1) == bitRead(combination, 0) &&
(digitalRead(switch_2) == bitRead(combination, 1) &&
(digitalRead(switch_2) == bitRead(combination, 1)) {
// Turn on the green LED
digitalWrite(green_led, HIGH);
// Turn on the motor
digitalWrite(motor, HIGH);
// Reset the combination attempt counter
number_invalid = 0
}
else {
// Turn on the red LED
digitalWrite(red_led, HIGH);
// Sound the alarm
tone (speaker, 80, 100);
// Increment the combination attempt counter and check for overflow
number_invalid = number_invalid + 1
if (number_invalid > 9)
number_invalid = 0;
}
// Update the invalid combination attempt counter digit display
a = bitRead(number_invalid, 0);
b = bitRead(number_invalid, 1);
c = bitRead(number_invalid, 2);
d = bitRead(number_invalid, 3);
// Wait for the pushbutton switch to be released
76
Introduction to Mechatronics and Measurement Systems
Solutions Manual
while (enter_button == 1);
// Turn off the LEDs and the motor
digitalWrite(green_led, LOW);
digitalWrite(red_led, LOW);
digitalWrite(motor, LOW);
}
7.11
// Displays the scaled resistance value of a potentiometer on an LCD.
#include <LiquidCrystal.h>
// Define variables, pin assignments, and constants
byte value;
// scaled potentiometer value
short percentage;
// displayed potentiometer percentage value
const int pot_pin=1;
// potentiometer pin
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
void setup() {
lcd.begin (16, 2);
}
void loop() {
Pot pot_pin, SCALE, value
’ read the potentiometer value
value = analogRead(pot_pin);
// Scale value from 0-1023 to 0-100 range
percentage = map(value, 0, 1023, 0, 100);
// Display the percentage value on LCD display
lcd.clear();
lcd.print("pot value = ");
lcd.print(percentage);
}
7.12
See 7.14 solution with:
#include <LiquidCrystal.h>
// Initialize arrays of the two 5-digit numbers
byte digits_prev[5];
byte digits[5];
// Initialize other variables
byte i;
// for loop counter
byte display[5];’
//number being displayed
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
Introduction to Mechatronics and Measurement Systems
77
Solutions Manual
void setup() {
lcd.begin (16, 2);
}
void loop() {
// When enter key is pressed, initialize the digits for the next number to be entered
for (i=0; i<=4; i++) {
digits_prev[i] = digits[i];
digits[i] = 10; // to indicate a missing digit (for numbers with < 5 digits)
}
// Display the numbers on the LCD display
lcd.clear();
for (i=0; i<=4; i++)
display[i] = digits_prev[i];
display_digits();
lcd.setCursor(0, 1);
// move to 2nd line of display
for (i=0; i<=4; i++)
display[i] = digits[i];
display_digits();
}
// Function to display the digits of a number stored in an array of five elements
void display_digits(void) {
for (i=0; i<=4; i++)
if (display[i] != 10) // skip missing digits
lcd.print(display[i]);
}
78
Introduction to Mechatronics and Measurement Systems
Solutions Manual
7.13
20x2 LCD character display
Vss Vcc Vee RS
1
2
3
4
R/W
5
E
6
DB4
11
DB5
12
DB6
13
DB7
14
5V
5V
20k
pot
PIC16F84
1
1k
5V
1k
5V
RA2
RA1
2
RA3
RA0
3
RA4
OSC1
MCLR
OSC2
4
5
6
5k pot
7
8
0.1 F
9
Vss
Vdd
RB0
RB7
RB1
RB6
RB2
RB5
RB3
RB4
18
17
16
15 4 MHz
22 pF
14
22 pF
13
12
5V
11
10
0.1 F
’ Displays the scaled resistance value of a potentiometer on an LCD.
’ Define variables, pin assignments, and constants
value
Var
BYTE
’ scaled potentiometer value
percentage Var
WORD
’ displayed potentiometer percentage value
pot_pin Var
PORTB.0 ’ pin to which the potentiometer and series capacitor are
’ attached (RB0)
SCALE Con 200
’ value for Pot statement scale factor
Introduction to Mechatronics and Measurement Systems
79
Solutions Manual
loop:
Pot pot_pin, SCALE, value
’ read the potentiometer value
percentage = (value * 100) / 255
’ convert to percentage value
’ Display the percentage value on LCD display
Lcdout $FE, 1, "pot value = ", DEC percentage, " %"
Goto loop
’ continue to sample and display the potentiometer value
End
7.14
Use a combination of Figures 7.11 and 7.13 along with the associated code. Use byte array
variables called "digits_prev" and "digits" to store the digits of the entered numbers, where
"digits_prev" contains the digits of the previous number entered and "digits" contains the
digits of the current number being entered. Add appropriate processing statements to the
keypad code to keep track of and store the digits of the current number. Here are excerpts
of code needed in the implementation:
’ Initialize arrays of the two 5-digit numbers
digits_prev
Var
BYTE[5]
digits
Var
BYTE[5]
’ Initialize other variables
i
Var
BYTE
display
Var
BYTE[5]
’ For loop counter
’ number being displayed
’ When enter key is pressed, initialize the digits for the next number to be entered
For i = 0 To 4
digits_prev[i] = digits[i]
digits[i] = 10
’ to indicate a missing digit (for numbers with < 5 digits)
Next i
’ Display the numbers on the LCD display
Lcdout $FE, 1
’ clear the display
For i = 0 to 4
display[i] = digits_prev[i]
Next i
Gosub display_digits
Lcdout $FE, $C0
’ go to the next line of the display
For i = 0 to 4
display[i] = digits[i]
Next i
Gosub display_digits
’ Subroutine to display the digits of a number stored in an array of five elements
display_digits:
80
Introduction to Mechatronics and Measurement Systems
Solutions Manual
For i = 0 To 4
If (display[i] != 10) ’ skip missing digits
Lcdout DEC display[i]
Endif
Next i
Return
7.15
Pin RA4 is an open-collector output. The two possible states are open-circuit and ground.
The pull-up resistor results in a logic high signal (5V) at Vee when RA4 is in the opencircuit state. Vee is at logic low (0V) when RA4 is grounded.
7.16
See the figure in the solution of Question 6.47 for the "hardware solution." A "software
solution" would look something like:
B
S
state
count
Var
Var
Var
Var
PORTB.0
PORTB.1
BYTE
BYTE
’ pin attached to the bounce-free, NO button
’ pin attached to the SPDT switch
’ state of the switch when the button is pressed
’ variable used to track the
’ Reset the counter variable
count = 0
’ Main loop
loop:
’ Wait for the button to be pressed, and store the state of the switch
While (B == 0) : Wend
state = S
’ Wait for the button to be released, and increment the count if appropriate
While (B == 1) : Wend
If (state = 1) Then
count = count + 1
Endif
Goto loop
7.17
If the button were not bounce-free, we would just need to add pause statements to allow the
bounce to settle after each while loop (e.g., Pause 10).
7.18
See Design Example 7.1 for driving the display and see Question 7.5 for how to debounce
the inputs (or use the Button statement). Here are some code excerpts that might be useful
in the implementation:
my_count
first
second
Var
Var
Var
BYTE
BYTE
BYTE
’ current count (0 to 99)
’ first digit (tens place)
’ second digit (ones place)
Introduction to Mechatronics and Measurement Systems
81
Solutions Manual
inc
dec
reset
Var
Var
Var
UP
DOWN
PORTB.0
PORTB.1
PORTB.2
’ pin attached to "increment" button
’ pin attached to "decrement" button
’ pin attached to "reset" button
Con
Con
0
1
’ Process the input
If (inc == DOWN) Then
my_count = my_count + 1
If (my_count > 99) Then
my_count = 0
Endif
Endif
If (dec == DOWN) Then
If (my_count > 0) Then
my_count = my_count  1
Endif
Endif
If (reset == DOWN) Then
my_count = 0
Endif
Endif
’ Determine the digits
first = my_count / 10
second = my_count  (10*first)
7.19
Go to www.microchip.com, navigate to the 8-bit, 16-series PIC Microcontrollers, and sort
by "Memory Type" (for "FLASH"), then select the appropriate model from the table.
7.20
See the comments and program flow in the "poweramp.bas" code in Threaded Design
Example A.4.
7.21
See the comments and program flow in the "stepper.bas" code in Threaded Design Example
B.2.
7.22
See the comments and program flow in the "move," "move_steps," and "step_motor"
subroutines in the "stepper.bas" code in Threaded Design Example B.2.
7.23
See the comments and program flow in the "speed" and "get_AD_value" subroutines in the
"stepper.bas" code in Threaded Design Example B.2.
7.24
See the comments and program flow in the "position" and "get_encoder" subroutines in the
"master PIC code" (dc_motor.bas) in Threaded Design Example C.3.
82
Introduction to Mechatronics and Measurement Systems
Solutions Manual
7.25
See the comments and program flow in the "slave PIC code" (dc_enc.bas) in Threaded
Design Example C.3.
Introduction to Mechatronics and Measurement Systems
83
Solutions Manual
8.1
A digital computer or microprocessor uses digital or discrete data, that is, data that are
simply strings of 1's and 0's that have no time correspondence. We have to add some type
of time coding to make sense of the data. Therefore we have to design interfaces that will
change (convert) analog information into a discretized form that will be compatible with a
computer. Again, additional code must be included to provide the time references.
8.2
> 2*(15 kHz) = 30 kHz
8.3
84
(a)
1 sample per minute would probably suffice, so fs = 1/60 Hz
(b)
f s  2  120MHz  = 240MHz
(c)
f s  2  20kHz  = 40MHz
Introduction to Mechatronics and Measurement Systems
Solutions Manual
8.4
Using MathCAD:
 0
f max
 max
1
 max
( 2 )
f max  0.318
T
2
2
 0
T  6.283
V( t )
t 0.33
t
0
 2  T
fs
 t  1.571
sin ( 2  t )
sin ( t )
0
1
t
f s  0.637
t 0.67
0.33
2  f max
fs
t
0.67
 2  T
t2
0
t
 2  T
2
0
t 10
t
 2  T
10
2
1.5
1
V t 0.33
0.5
V t 0.67
V t2
0
V t 10
0.5
1
1.5
2
0
2
4
6
8
10
12
t 0.33  t 0.67  t 2  t 10
Introduction to Mechatronics and Measurement Systems
85
Solutions Manual
8.5
Using MathCAD:
a  2 
t.5  0  0.5 40
b  0.9 a
t1  0  1  40
F( t)  2 cos 

ab
 t   sin 

2
t10  0  10 40

ab
2
 t 

1
 
F t .5
0
1
0
10
20
30
40
t .5
1
 
F t1
0
1
0
10
20
30
40
30
40
t1
1
 
F t 10
0
1
0
10
20
t 10
86
Introduction to Mechatronics and Measurement Systems
Solutions Manual
8.6
From equation 8.2, to prevent aliasing,
f s   2f max = 2a 
For a higher fidelity representation, a much higher sampling rate is required.
8.7
Using MathCAD,
Introduction to Mechatronics and Measurement Systems
87
Solutions Manual
8.8
88
5V –  – 5V 
Q = ----------------------------- = 2.44mV
4096
Introduction to Mechatronics and Measurement Systems
Solutions Manual
8.9
5V –  – 5V 
N = ----------------------------- = 2000
0.005V
An 11 bit A/D converter would suffice since 211 = 2048. A 12-bit converter would be the
minimal acceptable standard size available.
8.10
N = 28 = 256
Q = 10V / N = 0.0391 V
The digital state number for a given voltage V between 0 and 10 is the truncated value of
V/Q. The code is the binary equivalent of the state number.
(a)
0/Q=0 corresponding to state 0: 00000000
(b)
1/Q=25.6 corresponding to state 25: 00011001
(c)
5/Q=127.9 corresponding to state 127: 01111111
(d)
7.5/Q=191.8 corresponding to state 191: 10111111
8.11
1byte
samples
bits
10sec  5000 -------------------  12 ------------------  ------------- = 75000bytes

sec   sample  8bits 
8.12
B0 = G2 G1 G0 + G2 G1 G0
but it is clear in the truth table that G 1 G 0 = G 1 , G 2 G 1 = G 2 , and G 2 G 1 = G 1 , so
B0 = G1 G0 + G2
B1 = G2 G1 G0 + G2 G1 G0 = G1 G0 = G1
Also,
8.13
bit
scale fraction
bit value
cumulative voltage
5
1/2
1
-5V + 1/2(10 V) = 0 V
4
1/4
0
0V
3
1/8
1
1.25 V
2
1/16
1
1.875 V
1
1/32
1
2.1875 V
digital output = 10111
8.14
more memory will be required
Introduction to Mechatronics and Measurement Systems
89
Solutions Manual
8.15
See www.microchip.com
resolution: 12 bits
architecture: successive approximation
8.16
See www.national.com
8.17
1
1
V out1 = – --- V 1 = – V o = – --- V s
2
8
8.18
1
1
V out2 = – --- V 2 = – 2V o = – --- V s
2
4
8.19
1
1
V out3 = – --- V 3 = – 4V o = – --- V s
2
2
8.20
The low end of the range (at 0000) would be -10V. The increment between states would be:
1
1
5
– ------  10V –  – 10V   = – ------ 20V = – --- V
16
16
4
So the value at 0001 would be:
5
1
– 10V – --- V = – 11 --- V
4
4
The value at 1111, would be:
15
3
– 10V – ------  20V  = – 28 --- V
16
4
8.21
The standard sampling rate for high-fidelity audio recordings is:
 f s = 44kHz   2  20kHz 
The sample interval corresponding to this frequency is:
1
ms
 t = --- = 0.023 ---------------fs
sampe
For a total time of T=45min, the total required number of samples is:
T---= 118800000samples
t
90
Introduction to Mechatronics and Measurement Systems
Solutions Manual
Assuming stereo audio without compression, and using the standard high-fidelity
resolution of 16 bits per sample, the total number of memory required is:
bits
T
1byte
1kB
1MB
-----  16 ------------------  2channels   --------------  --------------------------  ------------------- = 453MB
 8bits   1024bytes  1024kB
 t  sample
Introduction to Mechatronics and Measurement Systems
91
Solutions Manual
9.1
SPDT
5V
NO DPST
NO SPST
NC
NO
9.2
5V
NC
NO
digital
signal
9.3
NO
5V
reset
9.4
V1
V2
92
Introduction to Mechatronics and Measurement Systems
circuit 1
circuit 2
Solutions Manual
9.5
AC power
switch 1
switch 2
light
+
9.6
Regardless of the polarity of the voltage in each secondary coil, the current flows through
an upper diode, down through the resistor, then through a lower diode back to the coil.
Therefore, the voltage polarities do change across the resistors, and Vout = Vleft  Vright,
where Vleft and Vright are the secondary coil voltages. When the core is to the left, Vleft is
larger and Vout>0. When the core is to the right, Vright is larger and Vout<0. When the core
is centered, both secondaries have the same voltage and Vout=0.
9.7
The excitation frequency (fex) should be much larger than the maximum core displacement
frequency (fmax) to prevent aliasing and to result in a high-fidelity representation. The lowpass filter cut-off frequency (flow_pass) should be between fex and fmax to filter out the high
frequency of the excitation but pass the lower frequency displacement signal.
9.8
During the transition from 3 (0011) to 4 (0100), any of the following 8 codes could result:
0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111.
9.9
From Table 9.1, the all four bits change value between decimal code 7 (0111) and 8 (1000),
so during this transition, any bit can have either value (0 or 1), so the maximum count
uncertainty is the full range.
9.10
1rev -  ------------------1line -
0.18 
 360
-----------  -----------------------= ------------- rev   1000lines  2pulses
pulse
9.11
’ Declare signal and count variables
A Var PORTB.0
B Var PORTB.1
count Var WORD
’ Store the initial states of signals and initialize count
A_prev = A
B_prev = B
count = 0
Introduction to Mechatronics and Measurement Systems
93
Solutions Manual
’ Polling loop to monitor signal negative edges and update count
loop:
If ((A == 0) And (A_prev == 1) And (B == 1)) Then
count = count + 1
EndIf
A_prev = A
If ((B == 0) And (B_prev ==1) And (A == 1)) Then
count = count - 1
EndIf
B_prev = B
Goto loop
9.12
Checking row 7 (B3B2B1B0=0111, G3G2G1G0=0100) gives:
0=0
1 = 01
1 = 10
1 = 10
Checking row 8 (B3B2B1B0=1000, G3G2G1G0=1100) gives:
1=1
0 = 11
0 = 00
0 = 00
2
9.13
D
A = ---------4
D
dA = 2  ---- dD
4
dD
dL
but ------- = –  ------- , so
D
L
D
dL
2  ----  –  D -------

4
L
dA
------- = ------------------------------------ = – 2  dL
------2
A
L
D--------4
94
Introduction to Mechatronics and Measurement Systems
Solutions Manual
2
9.14
D
2
A = ---------- = 0.0491in
4
P
 = ---- = 10 190psi
A
6
E steel = 30  10 psi

–4
–6
 = --- = 3.40  10 = 340  10 = 340 
E
R  R
0.01  120F = ---------------- = -------------------------= 0.245
–4

3.40  10
9.15
For a metal foil strain gage with F=2 and =0.3, Equation 9.11 gives
2 = 1 + 2(0.3) + PZ
where PZ is the piezoresistive term, which works out to be 0.4. Therefore, the change in
length term (1) provides 50% (1/2) of the effect, the change is area term (0.6) provides 30%
(0.6/2) of the effect, and PZ accounts for the remaining 20% (0.4/2).
9.16
9
E = 200  10 Pa
F G = 2.115
D = 0.010m
3
P = 50  10 N
R = 120 
2
D
–5 2
A = ---------- = 7.854  10 m
4
P
9
 = ---- = 0.637  10 Pa
A
 R =  F G R = 0.808 

 = --- = 0.00318
E
R 1 = R +  R = 120.808 
R 2 = R 3 = R 4 = 120 
R2
R1
V o = V ex  ------------------- – ------------------- = 0.00168V ex
R1 + R4 R2 + R3
9.17
From Equation 9.21, with Vout=0 and R2=R3,
R1
1
0 = V ex  ------------------- – ---
 R 1 + R 4 2
Therefore,
R1
------------------ = 1
--R1 + R4
2
Introduction to Mechatronics and Measurement Systems
95
Solutions Manual
which gives:
R 4 = R1
So the potentiometer must be adjusted to the exact resistance of the strain gage to balance
the bridge.
9.18
9.19
Combination of Figures 9.24b and 9.25.
V ex
10V
I  --------- = ---------------------- = 14.2mA
2  350  
2R
V ex
V  --------- = 5V
2
P = IV = 71.4mW
9.20
0.001
2R'  0.001R G so R'  ------------- R G
2

but R' = L  0.050 ---- , so

m
0.001
L  --------------------- 120m = 1.2m
2  0.050 
96
Introduction to Mechatronics and Measurement Systems
Solutions Manual
9.21
Using MathCAD:
Type J Coefficents:
c0
0.0488683
c3
c1
19873.1
c4
c2
218615
c5
 7
1.1569210
 8
2.6491810
 9
2.0184410
Temperature/Voltage Relationship:
5
ci  V
i
T( V)
i= 0
Approximate Sensitivity:
T( 0 )  0.049
T( 0.03)  546.224
0.03 0
DVDT
T( 0.03)
DVDT  5.492 10
5
T( 0 )
The sensitivity is approximately 0.055 mV / deg C.
9.22
Using MathCAD:
Type J Coefficents:
 7
7.8025610
c0
0.100861
c3
c1
25727.9
c4
 9
9.2474910
c2
767346
c5
 11
6.9768810
c6
c7
 13
2.6619210
 14
3.9407810
Temperature/Voltage Relationship:
7
ci  V
i
T( V)
i= 0
Approximate Sensitivity:
T( 0 )  0.101
DVDT
T( 0.015)  302.478
0.015 0
T( 0.015)
T( 0.010)  213.286
DVDT  4.961 10
5
T( 0 )
The sensitivity is approximately 0.050 mV / deg C.
Introduction to Mechatronics and Measurement Systems
97
Solutions Manual
9.23
Using MathCAD:
Type J Coefficents:
c0
0.0488683
c3
c1
19873.1
c4
c2
218615
c5
 7
1.1569210
 8
2.6491810
 9
2.0184410
Temperature/Voltage Relationship:
5
ci  V
i
T( V)
i= 0
V
0
V 200
root ( T( V)
200 V)
V 200  0.011
T V 200  200
So
V 200  0 = 11mV
9.24
V T  100 = 30mV
2
3
4
5
100 = a 0 + a 1 V 100  0 + a 2 V 100  0 + a 3 V 100  0 + a 4 V 100  0 + a 5 V 100  0
V 100  0 = 5.26mV
V T  0 = V T  100 + V 100  0 = 35.26mV
T  V T  0  = 636.6  C
9.25
V T  11 = 30mV
2
3
4
5
11 = a 0 + a 1 V 11  0 + a 2 V 11  0 + a 3 V 11  0 + a 4 V 11  0 + a 5 V 11  0
V 11  0 = 0.559mV
V T  0 = V T  11 + V 11  0 = 30.559mV
T  V T  0  = 556  C
98
Introduction to Mechatronics and Measurement Systems
Solutions Manual
9.26
Using MathCAD:
Type J Coefficents:
c0
0.0488683
c3
c1
19873.1
c4
c2
218615
c5
 7
1.1569210
 8
2.6491810
 9
2.0184410
Temperature/Voltage Relationship:
5
ci  V
i
T( V)
i= 0
V
0
V 120
root ( T( V)
V 10
root ( T( V)
V
V 120 V 10
120 V)
V 120  6.356 10
V 10  5.084 10
10 V)
 V  5.848 10
4
3
T V 120  120
T V 10  10
3
So the change in voltage would be 5.85 mV.
9.27
From Equation 9.62:
 1 2 2

 1 2
 -----2- s + ------ s + 1 X r  s  =  – -----2- s  X i  s 
n
 n

 n 
so the transfer function is:
1 2
– -----2- s
Xr  s 
n
G  s  = ------------- = ------------------------------------Xi  s 
2
1- 2 --------s + -s + 1
2
n

n
Substituting s=j gives:
- 2
 ----  n
G  j   = -----------------------------------------------2




– ------ + 2  ------ j + 1
  n
n
Introduction to Mechatronics and Measurement Systems
99
Solutions Manual
Therefore, the amplitude magnitude is:
 2
 ----  n
Xr
------ = G  j   = --------------------------------------------------------------Xi
- 2 2  ----- 2
 1 –  ----+
2


  n 
  n
9.28
n =
k- =
--m
N
5000 ---m- = 316.2 rad
---------------------sec
0.05kg

100
------ = ------------- = 0.316
n
316.2
- 2
 ----  n = 0.1
b
30
 = --------------- = ----------------------------------- = 0.949
2 km
2 5000  0.05 
(a)
rad
2
x··in actual = X in  = 5mm  100 -------

sec
2
m
4 mm
= 5  10 ---------2- = 50 ---------2sec
sec
m
m  sec
x··in actual =  50 ---------2-   9.81 ---------------- = 5.1g

 
g 
sec
(b)
1
H a    = ------------------------------------------------------------------ = 1.08
 2 2
2  2
+ 4   ------
1 –  ------
  n
  n
1
1
m
2
X r = -----2- H a     X in   = ----------------------------2-  1.08   50 ---------2-


n
sec
 316.2 rad
-------

sec
–4
X r = 5.4  10 m = 0.54mm
(c)
Since H a    is assumed to be 1 for the accelerometer device for all ’s,
m
2
x··in measured =  n X r  1  = 54 ---------2sec
100
Introduction to Mechatronics and Measurement Systems
Solutions Manual
(d)
 
 2  ----n 
–1 
– 1 2  0.949   0.316 
 = – tan  ----------------------2- = – tan  ---------------------------------------- = – 33.7  = – 0.588rad


1 – 0.1
- 
 1 –  ----

  n
x r  t  = X r sin   t +   = 0.54 sin  100t – 0.588  mm
9.29
m = 1kg
n =
N
k = 2 ---m
k- = 1.414 rad
---------s
m
Ns
b = 2 ------m
rad
 = 1.25 -------s

 r = ------ = 0.884
n
X i = 0.010m
b
 = --------------- = 0.707
2 km
2
Xr
r
------ = -----------------------------------------------= 0.616
Xi
2 2
2 2
 1 – r  + 4  r
– 1 2 

r
 = – tan  --------------2- = – 80.1  = – 1.398 rad
 1 – r 
Xr
X r = X i  ------ = 0.00616m
 X i
Therefore, the steady state output displacement response is:
x o  t  = x i  t  + x r  t  = X i sin   t  + X r sin   t +  
x o  t  =  10 sin  1.25t  + 6.16 sin  1.25t – 1.40   mm
Introduction to Mechatronics and Measurement Systems
101
Solutions Manual
10.1
Use a combination of a power transistor switch circuit and a diode clamp.
10.2
Electric motors and solenoids create changing magnetic fields which induce voltages in
nearby unshielded circuits.
10.3

P    =  T s  1 – ------------
 max
At maximum power,
1
 = ---  max
2
so the maximum power is:
P max
10.4
1
---  max

1
1
1
2



= P  ---  max = ---  max T s  1 – ---------------- = ---  max T s
 max
2
4
2


At the maximum no-load speed, the motor torque is 0 so
V in
10V
rad
 max = -------- = ----------------------------------------------- = 833rpm = 87.3 -------ke
 12V    1000rpm 
sec
V in
I s = -------- = 6.67A
R
V in
T s = k t -------- = 0.8Nm
R
P max
10.5
102
 max

----------- max
 max 
 max
2 

= P  ------------ = ------------ T s  1 – ------------ = ------------ T s = 17.45W
2
2
 max
4



See the documentation on the LMD18200.
Introduction to Mechatronics and Measurement Systems
Solutions Manual
10.6
RESET
STEP
CW/CCW
B0
B1
1



10.7
B1
B0
1
2
3
4
step
2  1
B0  B1
B1  1
0
0
1
0
0
1
2
1
0
1
0
1
0
1
0
1
3
0
1
1
1
0
0
1
1
0
4
0
1
0
1
1
1
0
1
0
1
1
0
0
This checks out with both Table 10.1 and Equation 10.18.
For 2, sum of products (SOP) gives:
2 = B1 B0 + B1 B0
and product of sums gives:
2 =  B1 + B0   B1 + B0  = B1 B0 + B0 B1
which is the same as the SOP result.
10.8
Search the Internet.
Introduction to Mechatronics and Measurement Systems
103
Solutions Manual
x
0.001
d = ------- = ------------- = 0.02rad
r
0.05
10.9
m = 3  d = 0.06rad = 3.44 
Therefore, the minimum required number of steps per revolution is
360 
N = ----------- = 105
 m
To achieve the maximum speed,
cm
0.10 ------v max
s
rad
 d = ----------- = ------------------ = 2 -------r
0.05cm
s
rad
 m = 3  d = 6 -------s
Therefore, the required step rate is
m
steps
---------= 100 ------------ m
s
10.10
104
(a)
servo motor
(b)
ac induction motor
(c)
series dc
(d)
ac induction
(e)
servo motor
(f)
series dc
(g)
stepper motor
(h)
synchronous motor
(i)
dc motor
(j)
ac induction motor
(k)
ac motor
(l)
ac motor
Introduction to Mechatronics and Measurement Systems
Solutions Manual
10.11 The load speed is related to the motor speed with:
l = rg m
where the gear box reduction ratio is:
M
r g = ----N
(a)
J = Jr + Jl rg
2
The maximum acceleration occurs at start-up where:
Ts
Ts
 max = ----- = --------------------2J
Jr + Jl rg
(b)
At steady state,
m
T m = r g T l = r g  k  l  and T m = T s – T s ------------ mmax
l = rg m
Combining these equations gives:
m
2
kr g  m = T s – T s ------------ mmax
so
Ts
Ts
 m = ------------------------------ and  l = r g  m = -------------------------------Ts
Ts
2
kr g + ------------kr g + ----------------- mmax
rg m
max
(c)
Designating the torque on the motor (rotor) side of the gear box as Tgm and the torque
on the load side of the gear box as Tgl, the equations of motion for the motor rotor and
load can be written as:
T m – T gm = J r  m
and
T gl – T l = J l  l
where the gear box torques are related by:
T gm = r g T gl
and the load and motor angular accelerations are related by:
l = rg m
Introduction to Mechatronics and Measurement Systems
105
Solutions Manual
Therefore, the motor equation of motion can be written as:
Tm – rg  Tl + Jl rg m  = Jr m
This can be written as:
T m – r g T l = J eff  m
where Jeff is the total effective inertia seen by the motor, given by:
2
J eff = r g J l + J r
Designating the motor speed m as , the motor and load torques are given by:

T m = T s  1 – ------------
 max
and
T l = k  l = kr g 
and the motor equation can now be written as:

d
T s  1 – ------------ – r g  kr g   = J eff ------
 max
dt
which can be written as:
d
J eff ------- + b  = T s
dt
where:
Ts
2
b = ------------ + kr g
 max
The particular (steady state) solution to the equation of motion is:
Ts
 ss = ----b
and the total general solution for the initial condition (0) = 0 is:
b
– ------- t

J 
  t  =  ss  1 – e eff 


Therefore, when the motor is at 95% of its steady state speed,
b
0.95  ss
106
– ------- t

J 
=  ss  1 – e eff 


Introduction to Mechatronics and Measurement Systems
Solutions Manual
so the time required for to reach this speed is:
2
 rg Jl + Jr 
J eff
t = – -------- ln  1 – 0.95  = 2.996 --------------------------b
Ts
----------- + kr 2g
 max
10.12 If the inner diameter of the cylinder (i.e., the diameter of the piston face) is D, the diameter
of the piston rod is d, and the fluid pressure is P, then the force to extend the cylinder
(pressure on the face of the piston) is:
2
D
F = PA face = ---------4
and the force to retract the cylinder (pressure on rod side of the piston) is:
2
F = PA face – rod
D – d
= -----------------------4
2
d
2
10.13 A = --------- = 0.785in
4
2
F = PA =  1000psi   0.785in  = 785lb
2
2
d
  10mm 
2
10.14 A = --------- = --------------------------- = 78.5mm
4
4
F
2000N
P = ---- = ----------------------2- = 25.5MPa
A
78.5mm
10.15 Search manufacturer catalogs or the Internet.
10.16 Required components: pressure regulator (e.g., 1500 psi), pneumatic cylinder (doubleacting or spring return), valve. The required cylinder area is:
F
100 2
2
A = --- = ------------ in = 0.0667in
p
1500
Therefore, the required cylinder diameter is:
D =
4A- = 0.29in
-----
Introduction to Mechatronics and Measurement Systems
107
Solutions Manual
11.1
Analytically, a running average of the three most recent derivative calculations involves the
following:
ei – 2 – ei – 3
D i – 2 = --------------------------t
ei – 1 – ei – 2
D i – 1 = --------------------------t
ei – ei – 1
D i = --------------------t
ei – ei – 3
Di – 2 + Di – 1 + Di
D avg = ------------------------------------------- = --------------------3
3t
The last equation can be implemented in code based on the either of the expressions.
Here’s the code using the first expression:
’ before loop
Di2 = 0 : Di1 = 0
’ modified derivative calc inside loop
Di = (error - error_previous) / DT
derivative = (Di2 + Di1 + Di) / 3
’ update previous two derivative calcs for next loop cycle
Di2 = Di1 : Di1 = Di
11.2
See Section 1.1 and Internet Link 7.14 for some examples.
11.3
See Section 1.1 and Internet Link 7.14 for some examples.
108
Introduction to Mechatronics and Measurement Systems
Solutions Manual
11.4
penny
nickel
quarter
Shigh
Smiddle
Slow
C
B
L
R
X (quarter)
Y (nickel)
Z (penny)
S_low Var PORTB.0
S_mid Var PORTB.1
S_high Var PORTB.2
X_q Var BIT
Y_n Var BIT
Z_p Var BIT
loop:
’ Clear out coin identifiers
X_q = 0 : Y_n = 0 : Z_p = 0
’ Wait for S_low to go low (i.e. wait for a coin).
While (S_low == 1) : Wend ’ wait for S_low to go low
’ Check for middle and high sensors while low sensor is active
While (S_low == 0)
If (S_mid == 0) Then
While (S_mid == 0)
If (S_high == 0) Then
Introduction to Mechatronics and Measurement Systems
109
Solutions Manual
X_q = 1
Goto done
End If
Wend
Y_n = 1
Goto done
EndIf
Wend
Z_p = 1
done:
’ The correct coin is identified at this point
............ use the coin info ..........
Goto loop ’ process next coin
110
Introduction to Mechatronics and Measurement Systems
Solutions Manual
A.1
a. 100,000,000 kg = 100,000,000,000 g = 100 x 109 g = 100 Gg
b. 0.000000025 m = 25 x 10-9 m = 25 nm
c. 16.9 x 10-10 s = 169 x 10-9 s = 169 ns
A.2
Do Class Discussion Items A.4 and A.5 in class.
A.3
The stress is given by:
 max
h
FL --2
FL
= ---------------- = 6 ---------21
3
wh
------ wh
12
Using MathCAD:
( F Lw h ) 
6 F L
wh
2
ddF ( F Lw h ) 
6 L
d
( F Lw h ) 
2
dF
h w
ddw ( F Lw h ) 
6 F L
d
( F Lw h )  
2 2
dw
h w
ddL ( F Lw h ) 
6 F
d
( F Lw h ) 
2
dL
h w
ddh ( F Lw h ) 
12 F L
d
( F Lw h )  
3
dh
h w
F  12520 N
F  10N
w  11.8cm
w  0.5mm
L  0.95 m
L  0.5mm
h  12.1cm
h  0.5mm
( F Lw h )  41.307MPa
E( F Lw h )  ddF ( F Lw h )  F  ddL ( F Lw h )  L 
 ddw ( F Lw h )  w  ddh ( F Lw h )  h
5
E( F Lw h )  5.711  10 Pa
2
2
Erms( F Lw h )  ( ddF ( F Lw h )  F )  ( ddL ( F Lw h )  L ) 
2
2
 ( ddw ( F Lw h )  w )  ( ddh ( F Lw h )  h )
5
Erms( F Lw h )  3.857  10 Pa
Introduction to Mechatronics and Measurement Systems
111
Download