• Commentary
• MCE
##### Citation preview

Solutions Manual

INTRODUCTION TO MECHATRONICS AND MEASUREMENT SYSTEMS 4th edition 2012(c)

SOLUTIONS MANUAL David G. Alciatore and Michael B. Histand

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 third 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 files for examples in the book, and other supplemental material are provided on the Internet at: mechatronics.colostate.edu We have class-tested the textbook for several 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 us via e-mail at [email protected] We will post corrections for reported errors on our Web site. Thank you for choosing our book. We hope it helps you provide your students with an enjoyable and fruitful learning experience in the cross-disciplinary subject of mechatronics.

2

Introduction to Mechatronics and Measurement Systems

Solutions Manual 2.1

D = 0.06408 in = 0.001628 m. 2

–6 A = D ---------- = 2.082  10 4

 = 1.7 x 10-8 m, L = 1000 m R = L ------- = 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 R pMIN = ------------------------------- = 5.43k R 1MIN + R 2 MIN R 1MAX R 2MAX R pMAX = --------------------------------- = 8.14k R 1 MAX + R 2 MAX 2.3

2

R 1 = 10  10 , R 2 = 25  10

1

2 1 R1 R2 1     25  10 10 10 R = ------------------- = --------------------------------------------------- = 20  10 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

From KCL, I s = I 1 + I 2 + I 3 V V V V so from Ohm’s Law -------s- = ------s + ------s + ------s R eq R1 R2 R3 R1 R2 R3 1 - = ----1- + ----1- + ----1- so R = --------------------------------------------------Therefore, ------eq R2 R3 + R1 R3 + R1 R2 R eq R1 R2 R3 Is Is From Ohm’s Law and Question 2.8, V = ------- = ---------------------------------------------------R eq R2 R3 + R1 R3 + R1 R2 ---------------------------------------------------R1 R2 R3

2.9

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.10

R1 R2 R1 R2 lim  ------------------- = ------------ = R2 R1 R1   R 1 + R 2

2.11

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 Therefore, C1 C2 I - = ----I - + ----I1 1 1 ------so -------- = ------ + ------ or C eq = -----------------C eq C1 C2 C eq C1 C2 C1 + C2

4

Introduction to Mechatronics and Measurement Systems

Solutions Manual 2.12

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.13

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.14

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.15

V o = 1V , regardless of the resistance value.

2.16

40 From Voltage Division, V o = ------------------  5 – 15  = – 8V 10 + 40

Introduction to Mechatronics and Measurement Systems

5

Solutions Manual 2.17

Combining R2 and R3 in parallel, R2 R3 2  3 - = 1.2k - = ----------R 23 = -----------------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 = 2.27mA I 1 = ---------= ---------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.18 (a)

From Ohm’s Law, V out – V 1 – 10V = 0.7mA I 4 = ---------------------- = 14.2V ------------------------------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.19

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

6

Introduction to Mechatronics and Measurement Systems

Solutions Manual

(b)

R 345 V A = ----------------------- V s = 4.84V R 2 + R 345

(c)

VA I 345 = ---------= 2.59mA R 345 R3 I 5 = --------------------- I 345 = 0.97mA R 3 + R 45

2.20

This circuit is identical to the circuit in Question 2.19. 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.21

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

Introduction to Mechatronics and Measurement Systems

7

Solutions Manual

2.22

R4 R5 R 45 = ------------------ = 0.5k R4 + R5 V1 – V2 I = ------------------ = – 0.5mA R1 + R2 R 45 V A = ---------------------  V 1 – V 2  = – 0.238 V R 3 + R 45

2.23

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.24

Using loop currents, the KVL equations for each loop are: V 1 – I out R 1 = 0 V2 – I5 R5 – I3 R3 – V 1 = 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.25

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.26

2.27

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.28

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.29

It will depend on the supply; check the specifications before answering.

2.30

With the voltage source shorted, all three resistors are in parallel, so, from Question 2.8: R1 R2 R3 R TH = --------------------------------------------------R2 R3 + R1 R3 + R1 R2

2.31

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

Introduction to Mechatronics and Measurement Systems

9

Solutions Manual 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.32

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.33 (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 -------- j = 10 -------- – 90  Z C = ------  C 5

5

Z LR2 = Z L + R 2 = jL + R 2 =  10 + 20j  = 10 0.036 Z C Z LR2 =  91040 – 28550j  = 95410 – 17.4  Z CLR2 = -----------------------Z C + Z LR2 Z eq = R 1 + Z CLR2 =  191040 – 28550j  = 193200 – 8.50  V I s = -------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

10

Introduction to Mechatronics and Measurement Systems

Solutions Manual

So I  t  = 24.7 cos  t – 0.156  A 2.34 (a)

rad - = 0.5Hz  =  -------- , f = ----sec 2 A pp = 2A = 4.0 , dc offset = 0

(b)

rad - = 1Hz  = 2 -------- , f = ----sec 2 A pp = 2A = 2 , dc offset = 10.0

(c)

rad - = 1Hz  = 2 -------- , f = ----sec 2 A pp = 2A = 6.0 , dc offset = 0 rad - = 0Hz  = 0 -------- , f = ----sec 2

(d)

A pp = 2A = 0 , dc offset = sin    + cos    = – 1 2

2.35

V rms P = ----------= 100W R

2.36

V pp V rms =  ---------   2  = 35.36V  2  2

V rms P = ----------= 12.5W R 2.37

Vm =

2V rms = 169.7V

2.38

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 +  

Introduction to Mechatronics and Measurement Systems

11

Solutions Manual 2.39

From Ohm’s Law, – 2V- = 3V I = 5V -------------------------R R Since 10mA  I  100mA , 3V 10mA  -------  100mA R giving 3V 3V ---------------- R  --------------- or 30  R  300 100mA 10mA 2

------ , so the smallest allowable resistance would need a power rating of For a resistor, P = V R at least: 2

3V  - = 0.3W P = -------------30 so a 1/2 W resistor should be specified. The largest allowable resistance would need a power rating of at least: 2

3V  - = 0.03W P = -------------300 so a 1/4 W resistor would provide more than enough capacity. 2.40

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: V I R1 = ------1 = 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

12

Introduction to Mechatronics and Measurement Systems

Solutions Manual 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.41

(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: V I R1 = ------1 = 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 Solving these equations gives: I 1 = 12.5mA and I 2 = 0mA (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

Introduction to Mechatronics and Measurement Systems

13

Solutions Manual

2.42

P avg

T

T

0

0

Vm Im 1 = ---  V  t I  t  dt = --------------  sin  t +  V  sin  t +  I  dt T T

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.43

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.44

I m  T I ----- --- = ----m  T 2 2

R2 R3 R 23 = ------------------ = 5k R2 + R3 R 23 1 V o = --------------------- V i = --- sin  2t  R 1 + R 23 2 This is a sin wave with half the amplitude of the input with a period of 1s.

2.45

No. A transformer requires a time varying flux to induce a voltage in the secondary coil.

2.46

Np V ------ = ------p = 120V ------------- = 5 Ns Vs 24V

2.47

RL = Ri = 8 for maximum power

14

Introduction to Mechatronics and Measurement Systems

Solutions Manual 2.48

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 (a)

output passes first (positive) hump only

(b)

output passes second (negative) hump only

(c)

output passes first (positive) hump only

(d)

output passes second (negative) hump only

(e)

output passes full first (positive) hump and 1/2-scale second hump

(f)

output passes full wave

3.3

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.

3.4

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.5

Forward bias (Vin > Vout + 0.7V) is required for charging. "Leaking" causes voltage decay (i.e., Vout decreases slowly).

3.6

For Vi > 0, Vo = Vi. For Vi < 0, Vo = -Vi. The resulting waveform is a full wave rectified sin wave where there are two positive "humps" for each period of Vi (0.5 sec).

3.7

16

See the data sheet for a LM7815C voltage regulator.

Introduction to Mechatronics and Measurement Systems

Solutions Manual 3.8 (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.9

Using superposition, Ohm’s Law, and current division, 1V = -----2I 1left = ----------------5R 2R + R ---2 1 1I 2 left = – --- I 1 left = – -----2 5R 1 1- I 1V = -----3I 4left = --- I 1 left = -----= ----------------, 2 5R 4 right 2R 5R R + ------3 2R 2I 2right = ----------------- I 4right = -----R + 2R 5R 1 I 1right = I 4right – I 2right = ------5R 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

Introduction to Mechatronics and Measurement Systems

17

Solutions Manual 3.10

With I2=I3=0, I1 and I4 are equal. The current (I=I1=I4) is: 2+ 1V- = -----I = 1V -------------------V 3R 2R + R 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.11

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.12

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.

3.13

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

18

Introduction to Mechatronics and Measurement Systems

Solutions Manual 3.14

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.15

3.16

(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 The required resistance value is  5V – V LED  R  -------------------------------I max

3.17

(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

Introduction to Mechatronics and Measurement Systems

19

Solutions Manual 3.18 (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 3.8V = 11.5mA I C = --------------------C- = ------------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 V I 1 = I 2 + I B = ------B- + 0.115mA = 1.815mA 1k and V in = V B +  1k I 1 = 3.52V

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 = 1.01I C 100 C 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 

20

Introduction to Mechatronics and Measurement Systems

Solutions Manual Now we can solve for the collector and emitter currents: 4.8V = 2.39mA I C = ------------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

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.22

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.23

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.24

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.

Introduction to Mechatronics and Measurement Systems

21

Solutions Manual 3.25

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.26

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.27

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  f 0 = -----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

A cos  b  = ------n Cn

B – sin  b  = -----nCn

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, B – -----nCn B sin  b  = --------tan   n  = tan  b  = ---------------= – ------n cos  b  An An -----Cn Therefore, –1 B –1 Bn  n = tan  – ------n = – tan  ------  A   A n 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

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.5

1

1 0.5 Vb( t ) 0.5

Va( t ) 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 f o = --1- = 1Hz ,  0 = 2f 0 = 2 -------sec T n

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)

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)

rad 11  c = ------= ------------------------------------------------ = 1000 -------3 –6 sec RC  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)

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

Introduction to Mechatronics and Measurement Systems

27

Solutions Manual 4.9 (a)

rad 11  c = ------= ------------------------------------------------------ = 10 -------3 – 6 sec RC  100  10   1  10 

(b)

T = 1s, f = 1Hz, 0 = 2 

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)

n  1  100

c

 10

n

 ( 2 n  1) 2 

t  0 0.01  2 F ( t) 

 n

4    ( 2 n  1)   

   sin  n t 2    n    1       c   



1

1 0.5 F ( t)

0  0.5 1 0

0.5

1

1.5

t

28

Introduction to Mechatronics and Measurement Systems

2

Solutions Manual

4.10

1 rad rad  L = ------- -------- = 0.707 -------- = 0.113Hz sec 2 sec 1-  rad -------- = 3.44 rad -------- = 0.547Hz  H =  3 + 1.5  1 – -----    sec sec 2  L  bandwidth   H

4.11

4.12

(a)

(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 1R + --------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:  -----c Vo ------ = ---------------------------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

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 2

1

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 K = g --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

The rate of change of internal energy is equal to the rate of heat transfer: d--- E  = Q· in dt in 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

Introduction to Mechatronics and Measurement Systems

33

Solutions Manual

4.21

Plotting the data Xout(t) shows a steady state asymptote of approximately 5 indicating that: KA in = 5 X out  t  - shows a near linear relation indicating that the system Plotting Z  t  = ln  1 – ---------------KA  in

can be modeled as 1st order. The slope of the line is approximately 1/3 indicating a time constant of

 = 3 sec 4.22

The damped natural frequency is always smaller if there is damping in the system.

4.23 (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): dQ 1- = P I ------- + RQ + --V dt C where V =  Q dt

4.24

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   

34

Introduction to Mechatronics and Measurement Systems

Solutions Manual

4.25

rad F 0 = 20N  = 0.75 -------Sec

n =

k  b ---- = 1.095 ,  r = ------ = 0.685 ,  = --------------- = 0.456 m n 2 km

X0 1 = ------------------------------------------------ = 1.219 -----------F0  k 2 2 2  1 – r  + 4  2 r X0 F0 X 0 =  ------------ ----- = 2.032m F0  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.26

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 2  k – m 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

Introduction to Mechatronics and Measurement Systems

35

Solutions Manual

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.27

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: km = ----2 n

4.28

xh  t  = e

–  n t

 A cos   d t  + B sin   d t  

xp  t  = C x  t  = xh  t  + xp  t 

F x    = -----0 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

36

Introduction to Mechatronics and Measurement Systems

Solutions Manual

4.29

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.30

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 14  - V = --P = --------V 2 C D so 2

DC =  --------4 4.31

Q Since F = ma , a = x·· and x· = ---- , A Q· PA =   LA   ----  A L P =  ------- Q· = IQ·  A

4.32

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

Introduction to Mechatronics and Measurement Systems

37

Solutions Manual

The resulting analogous electrical circuit follows:

L +

Vin

R1

C1

C2 4.33

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.34

38

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

Solutions Manual

4.35

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

V C2 = V R2 The resulting analogous electrical circuit follows:

I2

I1

L (I2-I3)

R1 +

(I1-I2)

Vin

I3

C2

R2

C1

4.36

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

39

Solutions Manual

5.1

The power dissipated by each resistor is 2

2

2

2 V in V out   GAIN  V in  ------- = 25 ------ and ---------= -----------------------------------= 25GAIN -----------------------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  ----R  R R 2 2 3 so R2 R3 V out = ------------------- I R1 + R2

40

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 R V 4 =  1 + -----3- V +  R 2

R2 + R3 V I 4 = ------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 V V1 – VA - = ------1 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 V V V B – V out - = ---------------------I 4 = ------B- = ------2 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 V VA – VB - = – ------2 I 3 = -------------------R R

Introduction to Mechatronics and Measurement Systems

41

Solutions Manual

where I3 is the current through the resistor. From KCL, the current out of the first op amp is V V 1 I out 1 = I 3 – I 1 = – ------2 – ------1 = – ----  V 1 + V 2  R R R The negative sign indicates that the current is actually into the op amp. From KCL, V V 2 I 2 = I 3 – I 4 = – ------2 – ------2 =  – ---- V 2 R R R Therefore, 2V V out = V 2 –  – ---------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 V V I 1 = ------1 and I 2 = ------2 R1 R2 From KCL, IF = I1 + I2 Since V o + I F R F = 0 , V V V o = – R F  ------1 + ------2 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

42

Introduction to Mechatronics and Measurement Systems

Solutions Manual

Since V o + I F R F = V 3 , V 1 – V 3 V 2 – V 3 V o = V 3 – R F  ------------------ + ------------------ R R2  1 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 R V outin =  1 + -----F- V in and V outref = –  ------ V ref   R R RF R V out = V out in + V out ref =  1 + -----F- V in –  ------ V ref   R R

Introduction to Mechatronics and Measurement Systems

43

Solutions Manual

5.12

Using superposition, R4 V o1 = – ------ V 3 R3 R5 R V o2 =  1 + -----4- ------------------- V 4  R 3 R 3 + R 5 R4 R5 R V o = V o1 + V o2 = – ------ V 3 +  1 + -----4- ------------------- 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 

210

3

0 3

 210 Vout ( t )

3

 410

3

 610

3

 810

0

0.02

0.04 t

44

Introduction to Mechatronics and Measurement Systems

Solutions Manual

5.14

V+ = V- = 0 dI L 1 V i = L -------- so I L = ---  V i dt dt L Vo = V- + IR R 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: 1- + ----1 1- = --------R1 Rs R2 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

(c)

RF V o = – ------  V 1 + V 2  = – 4V i R

Introduction to Mechatronics and Measurement Systems

45

Solutions Manual

(d)

V - = V + = 0V From Ohm’s Law, V V V V2 - = --------iI 1 = ------1 = ------i 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–V I F = ---------------o 5k so 3 V o = – 5kI F = – V i  1 + 1 --- = – --- V i  2 2

5.17 comparator  +

+

5V

+

330 Vin LED

5.18

330 LED  +

+

5V

+

Vin

46

open collector comparator

Introduction to Mechatronics and Measurement Systems

Solutions Manual

5.19

The limit on the feedback resistor current is: V out 10V I F = ---------= ----------  10mA RF RF Therefore, 10V R F  --------------- = 1k  10mA

5.20

R closed loop gain = -----F- = 10 R so the fall-off frequency is 105Hz.

5.21

The amplifier will saturate (reach the minimum swing voltage limit) as the integrated dc component grows.

Introduction to Mechatronics and Measurement Systems

47

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)

48

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

49

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

50

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

51

Solutions Manual

6.13

Equation 6.19: 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.

Equation 6.20:  A + B   A + B  = AA + AB + BA + BB = A + A  B + B  = A + A = A

6.14

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

52

 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.15

6.16

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.17

Introduction to Mechatronics and Measurement Systems

53

Solutions Manual

6.18 (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)

54

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.19

6.20

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.21

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.22

The simplified Boolean expression is: X = B  C + A 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,

Introduction to Mechatronics and Measurement Systems

55

Solutions Manual

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.23

Y = A  D + A + B  C Y = A + D + A + B + C

A

6.24

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.25

X = ABC +  A + B  C = ABC  A + B  C = ABCABC

6.26

X = AA  C + C  + BC = A1 + BC = A + BC = A + B + C = A + B + C

6.27

The required Boolean expression is: X = C  A + B which can be implemented with the following logic circuit:

A B C

56

Introduction to Mechatronics and Measurement Systems

X

Solutions Manual

The complete truth table (including the sub expression  A + B  ) is:

6.28

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.29

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: 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

Introduction to Mechatronics and Measurement Systems

57

Solutions Manual

6.30

Sum of products circuit:

A

B

S

C Product of sums circuit: A

B

S

C

6.31 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

58

Introduction to Mechatronics and Measurement Systems

Solutions Manual

6.32 preset

clear toggle

set

toggle

set

J reset

reset

K

CK Q

6.33 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

59

Solutions Manual

6.34 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.35

60

Introduction to Mechatronics and Measurement Systems

Solutions Manual

6.36

6.37

6.38

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.39 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

61

Solutions Manual

6.40

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.41

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.42 1

J

Q

CK

1

K

Q

6.43 5V sensor

D

Q

CK CL

Q

5V NC button

62

Introduction to Mechatronics and Measurement Systems

1k

Solutions Manual

6.44 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

63

Solutions Manual

6.45

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.46

5V 1k 74LS00

4011B

6.47

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.48

c = QD QC QB QA e =  QD + QC + QB + QA   QD + QC + QB + QA   QD + QC + QB + QA   QD + QC + QB + QA 

6.49

64

See info in TTL Data Book.

Introduction to Mechatronics and Measurement Systems

Solutions Manual

6.50

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.51

The output goes high when the signal increases through 4V and low when it decreases through 1V. t

6.52

V CAPACITOR

– --   = V cc  1 – e  where  = RC  

But when t = T, VCAPACITOR = 2/3 Vcc, so T

T

– -------- – ------- RC RC 2 --- =  1 – e  so e = 1 --3 3  

and  T = RC ln  3   1.1RC

6.53

See a Linear Circuits data and/or applications book.

6.54

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.55

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

65

Solutions Manual

6.56

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.57

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.58

With the solution in 6.44, 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.59

See "Case Study 2" in Chapter 11.

6.60

See "Case Study 2" in Chapter 11.

66

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 ; 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

67

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

68

; 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

69

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

70

Introduction to Mechatronics and Measurement Systems

Solutions Manual

7.6

’ 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

7.7

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.8

’ 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

Introduction to Mechatronics and Measurement Systems

71

Solutions Manual

’ 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 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

72

Introduction to Mechatronics and Measurement Systems

Solutions Manual

7.9 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

73

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.10

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 digits Var BYTE ’Initialize other variables i Var BYTE display Var BYTE

’ 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

74

Introduction to Mechatronics and Measurement Systems

Solutions Manual

’ Subroutine to display the digits of a number stored in an array of five elements display_digits: For i = 0 To 4 If (display[i] != 10) ’ skip missing digits Lcdout DEC display[i] Endif Next i Return 7.11

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.12

See the figure in the solution of Question 6.44 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.13

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).

Introduction to Mechatronics and Measurement Systems

75

Solutions Manual

7.14

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

inc dec reset

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

Var Var Var

UP DOWN

BYTE BYTE BYTE

’ current count (0 to 99) ’ first digit (tens place) ’ second digit (ones place)

’ 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.15

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.16

See the comments and program flow in the "poweramp.bas" code in Threaded Design Example A.4.

7.17

See the comments and program flow in the "stepper.bas" code in Threaded Design Example B.2.

76

Introduction to Mechatronics and Measurement Systems

Solutions Manual

7.18

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.19

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.20

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.

7.21

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

77

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

78

(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

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

79

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

80

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

–  – 5V - = 2.44mV Q = 5V ---------------------------4096

8.8

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.9

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.10

samples bits 1byte 10sec  5000 -------------------  12 ------------------  ------------- = 75000bytes sec sample 8bits

8.11

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 Also, B1 = G2 G1 G0 + G2 G1 G0 = G1 G0 = G1

Introduction to Mechatronics and Measurement Systems

81

Solutions Manual

8.12 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.13

more memory will be required

8.14

See www.microchip.com resolution: 12 bits architecture: successive approximation

8.15

See www.national.com

8.16

1 1 V out1 = – --- V 1 = – V o = – --- V s 8 2

8.17

1 1 V out2 = – --- V 2 = – 2V o = – --- V s 4 2

8.18

1 1 V out3 = – --- V 3 = – 4V o = – --- V s 2 2

8.19

The low end of the range (at 0000) would be -10V. The increment between states would be: 1 5 1 – ------  10V –  – 10V   = – ------ 20V = – --- V 16 4 16 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

82

Introduction to Mechatronics and Measurement Systems

Solutions Manual

8.20

The standard sampling rate for high-fidelity audio recordings is:  f s = 44kHz   2  20kHz 

The sample interval corresponding to this frequency is: ms 1  t = --- = 0.023 ---------------sampe fs For a total time of T=45min, the total required number of samples is: T- = 118800000samples ---t 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        t sample 8bits 1024bytes 1024kB

Introduction to Mechatronics and Measurement Systems

83

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

84

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