LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control &...

12
HI: 94 AVG: 63 LO: 31 ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 Wednesday 5/10 11:30 a.m. Jonsson-3207 Name ___SOLUTION___________________ Section 1: MR 1:30 (Grades will be posted on SIS when they are available.) This exam is open book, open notes, etc. with calculators, but NO laptops, Internet connections, cell phones, …, and no sharing materials. You need your own copies of everything, including lab reports. If you didn’t bring your own hardcopies, you will be penalized. Answer questions in only 5 out of the 8 sets corresponding to each of the experiments in the lab. You do not need to choose the experiments you performed but you will probably wish to do so. If you answer more than 5 sets, the first 5 will be graded. Each set is worth 20 points (max) with the breakdown shown by the questions. Setting up a solution is more important than finding the actual value if you are running out of time. If you are missing any grades on RPILMS, make sure you bring the reports to me (JEC-6028) before the end of the day today to get your records corrected. I Digital Logic ______ II Voice Processing ______ III Binary Communications ______ IV Digital Filter ______ V Interactive Graphics ______ VI Hybrid Control ______ VII DC Motor ______ VIII Optimal Control ______ TOTAL ______

Transcript of LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control &...

Page 1: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

HI: 94 AVG: 63 LO: 31 ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 Wednesday 5/10 11:30 a.m. Jonsson-3207 Name ___SOLUTION___________________ Section 1: MR 1:30 (Grades will be posted on SIS when they are available.) This exam is open book, open notes, etc. with calculators, but NO laptops, Internet connections, cell phones, …, and no sharing materials. You need your own copies of everything, including lab reports. If you didn’t bring your own hardcopies, you will be penalized. Answer questions in only 5 out of the 8 sets corresponding to each of the experiments in the lab. You do not need to choose the experiments you performed but you will probably wish to do so. If you answer more than 5 sets, the first 5 will be graded. Each set is worth 20 points (max) with the breakdown shown by the questions. Setting up a solution is more important than finding the actual value if you are running out of time. If you are missing any grades on RPILMS, make sure you bring the reports to me (JEC-6028) before the end of the day today to get your records corrected. I Digital Logic ______ II Voice Processing ______ III Binary Communications ______ IV Digital Filter ______ V Interactive Graphics ______ VI Hybrid Control ______ VII DC Motor ______ VIII Optimal Control ______ TOTAL ______

Page 2: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

I Digital Logic 2017 Name _________________________

Create a 3-bit state machine that outputs a Gray Code (only 1 bit changes at a time when going from state to state) and cycles through all the possible states before repeating. The states are the outputs for the machine. 1. (6pt) For states CBA list a sequence that meets this requirement starting with 000.

CBA Other solutions exist 000 001 011 111 101 100 110 010 (000 …)

2. (5pt) A 1-bit input sets the direction for the machine: 0 goes forward and 1 goes backward. Find the Next State Table for this machine. Solution depends on sequence given in 1. 3. (7pt) Find the simplified expression for the input to the B state flip-flop, assuming T-flip-flops are used in the implementation. Output: CBA = states, I = input Solution depends on table given in 2.

AI CB

00

01

11

10

00 0 1 0 1 01 1 0 1 0 11 0 1 0 1 /C/B/AI + /C/BA/I + /CB/A/I + /CBAI 10 1 0 1 0 + CB/A/I + CBA/I + C/B/A/I + C/BAI

4. (2pt) If after developing all the logic functions for a T-flip-flop it is found that none are available. Only D- and JK-flip-flops are in stock. What is the easiest way to finish the design and build the hardware? Use the JK-flip-flops with the J & K inputs tied together to create a T-flip-flop.

Input P.S.

0 1

000 001 010 001 011 000 010 000 110 011 111 001 100 110 101 101 100 111 110 010 100 111 101 011

Page 3: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

II Voice Processing 2017 Name _________________________ 1. (3pt) TRUE or FALSE: By the “rule-of-thumb” for S/N ratio due to bit quantization you would expect an increase of +6dB in the SNR if 2 more bits of resolution were added to the sample.

Would be +12dB higher 2a. (6pt) For an ideal delta modulator with A = 0.25V, B = 1.25V, C = 0.0V, and D = 0.6V, sketch the output for an input 2Vp-p square wave that is sampled 16 times in its period T (no D.C. block and no smoothing LPF on output). Last output before t = 0 was -1.0V.

no deadband, 0.25V & 1.25V steps (other outputs from different rounding are possible) 2b. (2pt) Explain how the output above would change when using the actual DSP hardware in the lab? D.C. block would result in droop on the held voltages and output LPF would smooth out steps. 0.016s => 62Hz < ~100Hz D.C. blocking cutoff 3. (4pt) The signal below has a know crest factor of 3. Sketch a similar waveform with the same amplitude and period that has a higher crest factor.

Same peak, lower RMS

-1

-.5 0 .5 1

Volts

time (msec) 5 10 15 20 25

Page 4: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

II Voice Processing 2017 Name _________________________ 4. (3pt) A modulator below is made by combining 2 deadband modulators. The values W, X, Y, and Z were (inadvertently) set to 0.2, 0.2, 0.2, and 0.5 respectively in modulators whose q(t) vs. e(t) have the characteristics shown below. Draw the resultant q(t) vs. e(t) plot for the combined system.

(Not to scale.) 5. (2pt) Given that the reconstruction of a sampled signal x(t) is Y(f) = X(f) ∏(f), find the expression for continuous y(t) if ∏(f) is the Fourier transform of an ideal LPF with bandwidth fs/2. Express y(t) in terms of the time function of the of the filter and x(t).

y(t) = x(t) * sinc(fst) * is the convolution operation

Z

-Z

-Y Y

W -W

-X

X ADD TO

PREVIOUS

0.2

-0.2

-0.7

0.7

Page 5: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

III Binary Communications 2017 Name _________________________ 1. (4pt) For a code with a minimum Hamming distance of 7, list all the possible combinations of error bits corrected and/or error bits detected simultaneously

o = codeword, C = corrected bit, d = detected bit error o d d d d d d o Correct 0, detect 6 bit errors o C d d d d C o Correct 1, detect 4 more bit errors o C C d d C C o Correct 2, detect 2 more bit errors o C C C C C C o Correct 3, detect 0 more bit errors

2. (3pt) If a (8,7) parity code uses a 1Mbit/s channel, what must the channel bit rate be for a (7,4) Hamming code to achieve the same message rate?

1Mbit/s => 7/8Mbit/s message rate 4/7 x r = 7/8 => r = 49/32 Rate = 49/32Mbit/s = 1.531Mbps 3a. (5 pt) What is the SNR (dB) for a RTZ (50% duty cycle) PCM system with 1V pulses and a channel with 0.2Vrms noise?

50% D.C. => Vrms = !! = 1/√2

20log !/ !!.!

= 10.97𝑑𝐵 3b. (2 pt) What would the new SNR (dB) be if the duty cycle were increased to 75%?

75% D.C. => Vrms = !!

20log!!

!.!= 12.73𝑑𝐵

4. (5pt) In the standard laboratory Hamming code the received codeword is 1 1 1 1 1 0 0. If up to 2 bit errors can be expected, find 2 possible transmitted codewords that can result in this received word and indicate the bits in error.

c1 c2 m1 c3 m2 m3 m4

1 1 1 1 1 0 0 1 c1 = m1 ⊕ m2 ⊕ m3 1 ⊕ 1 ⊕ 0 = 0 (ERROR) 1 c2 = m2 ⊕ m3 ⊕ m4 1 ⊕ 0 ⊕ 0 = 1 (OK) 1 c3 = m1 ⊕ m2 ⊕ m4 1 ⊕ 1 ⊕ 0 = 0 (ERROR)

Other solutions exist: m1 in error => 1 1 0 1 1 0 0, c1 & c3 in error => 0 1 1 0 1 0 0 m2 & c2 in error => 1 0 1 1 0 0 0

1 1 1 1 1 1 1, 0 1 0 1 1 0 0, … 5. (1pt) A channel using only the In-phase component encodes 2 bits into discrete amplitudes. If a 90° Quadrature component is added that maintains the same maximum amplitude and approximate separation, how many bits could be incorporated in each magnitude & phase point? Currently has 4 points on real-axis, with 4 more points on imag-axis = 8 total for 3 bits/point

Page 6: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

IV Digital Filter 2017 Name _________________________ 1. (2pt) Which of the 4 filters designed for the Speedy33 DSP are monotonic in the stop band? Butterworth and Chebyshev I 2a. (4pt) Two BPF filters were designed with the same specifications, one as a Butterworth and one as a Chebyshev. Label the plots to indicate which is which.

Butterworth Chebyshev (poles closer to circle)

2b. (2pt) How many repeated zeros are at z = +1?

2 (4th order, 2 @ z = +1 & 2 at z = -1) 2c. (1pt) If the sampling frequency is 24kHz, what is the center frequency of the passband?

6kHz 3a. (2pt) For the block diagram shown below find the digital filter’s transfer function Y(z)/X(z).

𝐻 𝑧 = 1+ 𝑧!! =𝑧! + 1𝑧!

Page 7: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

3b. (6pt) given that one of the roots in the transfer function in 3a. is at z = -1, find the Pole-Zero diagram.

𝑧! + 1𝑧 + 1 = 𝑧! − 𝑧 + 1 => 𝑧 =

−𝑏 ± 𝑏! − 4𝑎𝑐2𝑎 =

1± 1− 42

𝐻 𝑧 =𝑧! + 1𝑧! =

(𝑧 + 1)(𝑧 − 12+ 𝑗!! 3)(𝑧 − 12− 𝑗

!! 3)

𝑧!

3c. (3pt) Sketch the approximate magnitude plot from 0 to fs = 24kHz, the sampling frequency.

-1 -0.5 0 0.5 1-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1Pole-Zero Map

Real Axis

Imag

inar

y Ax

is

Frequency (Hz)0 6,000 12,000 18,000 24,000

0

0.5

1

1.5

2

Page 8: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

V Interactive Graphics 2017 Name _________________________

1a. (1pt) TRUE or FALSE: For the transfer function of a DC motor G(s) = 5000s2

and a negative feedback

compensator of the form

Gc (s) = K s+ zs+ p

with z and p being the values of the zero and pole respectively, in

general the step response performance was worse as the magnitude of p increased arbitrarily. 1b. (3pt) DC motor compensator 𝐺! 𝑠 = 𝐾 !!!

!!!, if p = 50 what is z for a maximum phase of 10°?

𝐼𝑓 𝑝 = 𝛼𝑧, 𝜃 = 10° = sin!! !!!

!!! ⇒!!!!!!

= 0.1736 𝛼 = 1.4203 z = p/1.4203 = 35.20 2. (3pt) If the continuous phase lead compensator is 𝐺! 𝑠 = 5 !!!

!!!", find the magnitude of the compensator at

its peak phase angle. 𝑝𝑒𝑎𝑘 𝑝ℎ𝑎𝑠𝑒 @ 𝑠 = 𝑗𝜔 = 1 ∙ 20 = 4.472, 𝐺! 𝑗4.472 = 5 !!.!"#!!

!!.!"#!!"= 5 !"

!"#= 1.118

3a. (8pt) Given 3 Gaussian pdfs with partial parameters below and with equal costs and a priori probabilities, find the values of the missing parameters such that the 3 PDFs divide up the x-y plane equally with a ‘Y’ shaped decision boundary. The standard deviation contour lines should be as close as possible to each other without overlapping.

σx σy ρ x0 y0 f1(x,y) 2 2 0 0 √3 f2(x,y) 2 2 0 -2 -√3 f3(x,y) 2 2 0 +2 -√3 Equilateral triangle: (0,√3), (-2,-√3), (+2,-√3) Sides = 4, Height = 2√3 y-coordinates may be different, (0,2√3-2tan30°), (-2,-2tan30°), (+2, -2tan30°)

tan30°=1/√3: (0,4/√3), (-2,-2/√3), (+2,-2/√3) 3b. (5pt) Sketch the approximate decision boundary for these 3 pdfs and show each function’s standard deviation contour.

Page 9: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

VI Hybrid Control 2017 Name _________________________ ANSWER ANY COMBINATION OF COMPLETE QUESTIONS THAT ADD UP TO 20 POINTS. 1a. (7pt) For the system shown with state feedback, find the gains kc1 and kc2 that will result in a controlled system transfer function of !!!!

!!.

-a2 +-kc2 = 0 => kc2 = -a2 -a1 + -kc1 = 0 => kc1 = -a1

1b. (3pt) For the controlled system in 1a. above with gains kc1 and kc2, what is its characteristic equation?

s2 + (a2 + kc2)s + (a1 + kc1) 2a. (3pt) TRUE or FALSE: A full PI controller on any Type II, or III system will guarantee no steady-state error for a ramp input. 2b. (2pt) TRUE or FALSE: A 3rd order Type I system may still need an integral gain in a PID controller to guarantee zero steady-state error to an input R(s) = A/s.

y(t)

r(t)

Page 10: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

VI Hybrid Control 2017 Name _________________________ 3a. (3pt) What is the functional definition of the IAE and what does it mean or do for a controlled system?

Integrated Absolute Error = 𝑒 𝑡 𝑑𝑡!! . The total integrated absolute value of the difference between

the input and the output of a system. It is used to evaluate the performance of a controller. 3b. (2pt) TRUE or FALSE: For Ziegler-Nichols PID controllers the proportional gain of the PID is always larger than the proportional gains on either the PI or the pure P controllers.

4. (5pt) If 𝐺! 𝑠 = 5!"# (!!! )

!!!!"!!!" find the normalized time delay for the Gallier-Otto controller.

5exp (!!! )

𝑠! + 16𝑠 + 60 = 5exp (!!.!"!)

(𝑠 + 6)(𝑠 + 10) = 5 ∙ 6 ∙ 10exp (!!.!"!)

(!!𝑠 + 1)(!!!𝑠 + 1)

𝑡𝐷 =0.25

16+

110+ 0.25

= 0.4839

5a. (6pt) For a given continuous system Ac, Bc, Cc, and Dc, the Ad transformed discrete matrix is

1 1.10520.7408 0.6065 . If the inverse of Ac is known to be −5/3 −1/3

1 0 and Bc is 04 , find transformed discrete matrix Bd.

Bd = (Ad – I)(Ac)-1Bc = 1 1.10520.7408 0.6065 − 𝐼 − !

!− !!

1 004

= 0 1.10520.7408 −0.3935

−!!0

= 0−0.9878

5b. (2pt) From the information given in 5a. set up an equation that can be used to find the original Ac.

Ac = −5/3 −1/31 0

!!= inv −5/3 −1/3

1 0 5c. (2pt) For the uncontrolled plant in 6a. with characteristic equation 𝑠! + 5𝑠 + 3, find the continuous state feedback controller gain that sets the steady-state error to an input r(t) to zero if kc1 = 2 and kc2 = 1.

𝑔 = !!!+ 𝑘!! = !

!+ 2 = 2.75

Page 11: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

VII DC Motor Control 2017 Name _________________________ 1. (5pt) If the continuous phase lead compensator is 𝐺! 𝑠 = 5 !!!

!!!", find the discrete compensator using the

Tustin Approximation with a sampling period of 0.1s.

5 !!!!!!"

=> 𝐷 𝑧 = 5!(!!!)!.!(!!!)!!!(!!!)!.!(!!!)!!"

= !"" !!! !!(!!!)!" !!! !!"(!!!)

= !""!!!""!!!!!!"!!!"!!"!!!"

= !"#!!!"!"!

2. (7pt) Two phase-lead compensators are applied to the lab D.C. motor system with added gain of 25. The compensators are 𝐺!!(𝑠) = 30 !!!

!!!" and 𝐺!!(𝑠) = 30 !!!"

!!!". Below is the step response for each compensator.

Match up each response with its correct compensator.

Gc2(s) Gc1(s) 3a. (6pt) A digital system has 𝐺! 𝑧 = !!!!

!!!!. Sketch the root locus of the closed loop proportional control

system.

Poles: z = ±1 Zeros: z = ±j

3b. (2pt) Find the gain that produces repeated root (poles or zeros).

Double pole at z = 0: Gain = |0-j|x|0+j|/|(0-1)x(0+1)| = (1 x 1)/(1 x 1) = 1 -1.5 -1 -0.5 0 0.5 1 1.5

-1.5

-1

-0.5

0

0.5

1

1.5Root Locus

Real Axis

Imag

inar

y Ax

is

System: HGain: 1Pole: 0.0111 + 7.88e-17iDamping: 1Overshoot (%): 0Frequency (rad/s): 45

Page 12: LO: 31 ECSE-4760 Real-Time Applications in Control ...ECSE-4760 Real-Time Applications in Control & Communications Spring 2017 Exam #2 ... VII DC Motor _____ VIII Optimal Control _____

VIII Optimal Control 2017 Name _________________________ 1. (2pt) Why don’t the values in the C and D matrixes have any affects on the optimal gains?

The performance index is only dependent on the input and state values being reduced. The outputs do depend on the inputs and states through the C & D matrixes but are not included in the calculation of J.

2. (1pt) How many useable solutions exist to the Riccati equation for a 4th order system?

1 3. (4pt) A 3rd order system has a fastest time constant of about 5 seconds. Which of the following pulses can be used to approximate an ideal impulse with energy 2.5V·s using the laboratory National Instruments equipment? Indicate all that may be used. i. 25V for 0.1s ii. 10V for 0.25s iii. 5V for 0.5s iv. 0.75V for 3.333s v. 0.5V for 5s

(25V is above the +10V limit of the NI DAC outputs) 4. (4pt) What is the approximate output of both states for the (noiseless) laboratory system with no feedback (feedback gains are zero) after 5 seconds?

x1(t) = -3V for all time x2(t) = 0V for all time 5. (4 pt) What is the function of the values in the Q matrix and how do they affect the time response of the optimally controlled system?

Allows system states to have different weightings in the penalty function J. Increasing a Q value will force that corresponding state to be reduced quicker.

6. (5pt) For the system !x(t) = x(t)+u(t) with

J = 12

163 x2 (t) + 3u2 (t){ }

0

∫ dt , show whether or not P = 8 is a solution

to the Riccati equation?

A =1, B = 1, Q = 16/3, R = 3 -PA – A’P + PBR-1B’P – Q = 0 -8(1) – (1)8 + 8(1)(1/3)(1)8 – 16/3 ?=? 0 -16 + 64/3 – 16/3 = 0 => P = 8 does check as a solution