ENGG 1015 Tutorial - University of Hong Kong

Download Report

Transcript ENGG 1015 Tutorial - University of Hong Kong

ENGG 1015 Tutorial



Revision tutorial
11 Dec
Learning Objectives


Prepare for the examination
News

Examination



Closed book; Need to bring calculators
SETL (Online evaluation)
HW2, HW3
1
To Refresh Your Memory

In the semester, you have learnt…






Combinational Logic – Truth table/schematics/Boolean
expression, SOP/POS, DeMorgan’s Theorem, K-Map,
adder structure
Sequential Circuit – Flip flop, Finite State Machine, clock
and timing
Electrical Circuit – Primitives, KCL/KVL, series/parallel
connection, voltage/current divider, loading and buffer
Operational Amplifier – Non-inverting amplifier
Signals, Systems, Control – Signal flow graph, difference
equation, operators, z-transform, feedback control
Computer Systems – Binary representation,
addition/subtraction for integers, 2’s complement
2
Past Papers







(E: Examination; H: Homework)
Systems: 11H1Q1/Q2, 10H1Q1/Q2
Combinational logic: 11EQ5, 10EQ5, 11H2Q5/Q6,
10H2Q5/Q6, 11H3Q1/Q2/Q3, 10H3Q1/Q2/Q3
Sequential logic: New
Electrical circuit: 11EQ3, 10EQ2, 11H1Q3/Q4/Q5/Q6,
11H1Q4/Q5/Q6/Q7
Signals and control: New
Computer system: 11EQ6, 10EQ6, 11H2Q4,
10H2Q3/Q4
3
Lab






(L: Lab; C: Checkoff)
Combinational logic: L1 C1/C2/C3, L2 C1/C2/C3
Sequential logic: L3 C1/C2/C3
Electrical circuit: L4 C1/C2, L5 C1/C2/C3, L6 C1/C2/C3
Signals and control: L7 C1/C2/C3, L8 C1/SC
Computer system: N/A
4
Block Diagrams for Control (1)
𝐶 𝑧
𝑃 𝑧
𝐺 𝑧
𝑘
𝑧 −1
1
1 − 𝑘𝑧 −1
1
𝐻 𝑧 =
𝐶 𝑧 𝑃 𝑧
1+𝐶 𝑧 𝑃 𝑧 𝐺 𝑧
5
Block Diagram for Control (2)

Let the controller C(z) be “A”, the system P(z) be
“C”, and the sensor G(z) be “D”.
k
k
1
k
1

kz
1 k
H  z 


1
k
k 1
1

k

kz


1
1

z
1
1  kz
1 k

First-order system
with one pole at
k
1 k
𝐻 𝑧 =
𝐶 𝑧 𝑃 𝑧
1+𝐶 𝑧 𝑃 𝑧 𝐺 𝑧
𝑘
𝑧 −1
1
1 − 𝑘𝑧 −1
1
6
Block Diagram for Control (3)

Let C(z) be “B”, P(z) be “C”, and G(z) be “B”.
z 1
1
1
z
H  z   1  kz

1
1
z z
1  kz 1  z 2
1
1  kz 1

A second-order system
with two poles at
k  k2  4
2

1  kz 1  z 2  0 
𝐻 𝑧 =
𝐶 𝑧 𝑃 𝑧
1+𝐶 𝑧 𝑃 𝑧 𝐺 𝑧
𝑘
𝑧 −1
1
1 − 𝑘𝑧 −1
1
7
Smart Air-conditioner Control (1)




Let Troom be the current room temperature. Also, define TUTH and
TLTH be two threshold voltages set by the user, where TUTH >TLTH.
When Troom > TUTH, AND compressor is off, then the compressor of
the air-conditioner should turn on to lower the room temperature.
When Troom < TLTH, AND compressor is on,
then compressor of the air-conditioner
should turn on, and the room
temperature rises.
Otherwise, the operation of the
compressor stays unchanged.
8
Smart Air-conditioner Control (2)

Using the digitized information DL and DH about the
room temperature, implement the air-conditioner control
as a state machine.


Your state machine should have 1 single output called ON. The
air-conditioner compressor is turned on only when ON is TRUE.
Construct based on logic
9
Smart Air-conditioner Control (3)



If instead we want to set the temperature to be lower,
with TUTH = 24 and TLTH = 22, suggest a way to achieve
this adjustment.
Upper comparator: 6V to input B
Lower comparator: 2.4V to input B
R1
R2

R1 = R - R2 = 0.6R
10
Bidirectional Motor Driver (1)

Using your knowledge from labs and lectures, complete
the following circuit to drive a motor in both directions
depending on the value of the potentiometer.
11
Bidirectional Motor Driver (2)


Referring to the bidirectional motor driver circuit, let kA
be the gain of the non-inverting amplifier on the left.
Show that within the
operating range of
this circuit (i.e., no
saturation), a change
in Vp by ∆Vp results in a
change of Vmotor by
kA∆V p.
12
Bidirectional Motor Driver (3)

From the property of a non-inverting amplifier,
Vmp  k AVp



Now, Vmotor  Vmp  Vmn  k AVp  Vcc / 2
When Vp becomes 𝑉𝑝 + ∆𝑉𝑝 , the new Vmotor is
V motor  k A V p  V p   Vcc / 2
Therefore,
Vmotor  k A Vp  Vp   Vcc / 2  k AVp  Vcc / 2
 k AVp
13
Circuits and Sensors (1)


In this QTI circuit, we assume that R0 is 500Ω and that Rir is
maximum when it is dark (Rmax = 1k Ω). When it is bright, Rir is
minimum (Rmin = 100 Ω). Note that Vcc is 12V. The datasheet of the
lamp states that it only turns on when the voltage across the lamp
(VL) > 5V. Each lamp has an internal resistance of 1kΩ.
The goal is to turn on a lamp when it is dark.
One of your team members suggests connecting
the terminal red directly to the lamp, terminal
white to Vcc terminal black is grounded. Will this
configuration work?
14
Circuits and Sensors (2)



Let RL be the resistance combining Rir and the
resistance of the lamp, put in a parallel configuration.
When it is dark (Rmax = 1kΩ), the total loading resistance
is RL = 500Ω, and therefore the voltage across the lamp
(VL) is 6V. This is enough to turn on the lamp.
When it is bright, Rmax = 100Ω and
RL = 90.9Ω.
VL  Vcc 
RL
90.9
 12 
 1.85V
R0  RL
500  90.9
Thus, the lamp is off.
15
Circuits and Sensors (3)



Now you have to connect two more lamps in parallel with
the first one (i.e. 3 lamps in total). What is the problem?
The total loading resistance
(when it is dark) will become
RL = 250Ω (Parallel connection
of resistors), and therefore
VL = 4V. Therefore, it is not
enough to turn on the lamps.
Therefore, a buffer should be
used.
16
Circuits and Sensors (4)

How the buffer should be connected?
0
Vp
0
Vp
0
0
17
Difference Equations (1)



Difference equation:
Transfer function:
Poles:
18
Difference Equations (2)

Partial fraction:

Impulse function:
19