Platypus (/platypus/)

Similar documents
ECE 203 LAB 2 PRACTICAL FILTER DESIGN & IMPLEMENTATION

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District DEPARTMENT OF INFORMATION TECHNOLOGY DIGITAL SIGNAL PROCESSING UNIT 3

Lecture 17 z-transforms 2

DIGITAL FILTERS. !! Finite Impulse Response (FIR) !! Infinite Impulse Response (IIR) !! Background. !! Matlab functions AGC DSP AGC DSP

ELEC-C5230 Digitaalisen signaalinkäsittelyn perusteet

Dr Ian R. Manchester

The University of Texas at Austin Dept. of Electrical and Computer Engineering Final Exam

IIR Filter Design Chapter Intended Learning Outcomes: (i) Ability to design analog Butterworth filters

ECE503: Digital Filter Design Lecture 9

Introduction to Signals and Systems Lecture #9 - Frequency Response. Guillaume Drion Academic year

Brief Introduction to Signals & Systems. Phani Chavali

Frequency Response Analysis and Design Tutorial

16.30 Learning Objectives and Practice Problems - - Lectures 16 through 20

Poles and Zeros of H(s), Analog Computers and Active Filters

ECE438 - Laboratory 7a: Digital Filter Design (Week 1) By Prof. Charles Bouman and Prof. Mireille Boutin Fall 2015

ANNA UNIVERSITY :: CHENNAI MODEL QUESTION PAPER(V-SEMESTER) B.E. ELECTRONICS AND COMMUNICATION ENGINEERING EC334 - CONTROL SYSTEMS

Digital Filters IIR (& Their Corresponding Analog Filters) Week Date Lecture Title

BSNL TTA Question Paper Control Systems Specialization 2007

Answers to Problems of Chapter 4

SECTION 7: FREQUENCY DOMAIN ANALYSIS. MAE 3401 Modeling and Simulation

SECTION 6: ROOT LOCUS DESIGN

Module 3 : Sampling and Reconstruction Problem Set 3

ECE 5650/4650 Exam II November 20, 2018 Name:

Electrical & Computer Engineering Technology

GE420 Laboratory Assignment 8 Positioning Control of a Motor Using PD, PID, and Hybrid Control

Infinite Impulse Response (IIR) Filter. Ikhwannul Kholis, ST., MT. Universitas 17 Agustus 1945 Jakarta

Andrea Zanchettin Automatic Control 1 AUTOMATIC CONTROL. Andrea M. Zanchettin, PhD Spring Semester, Linear control systems design

Signals and Systems Lecture 6: Fourier Applications

ijdsp Workshop: Exercise 2012 DSP Exercise Objectives

The University of Texas at Austin Dept. of Electrical and Computer Engineering Midterm #1

Multirate Digital Signal Processing

EE 470 Signals and Systems

Final Exam Practice Questions for Music 421, with Solutions

Digital Filters IIR (& Their Corresponding Analog Filters) 4 April 2017 ELEC 3004: Systems 1. Week Date Lecture Title

UNIT II IIR FILTER DESIGN

1.What is frequency response? A frequency responses the steady state response of a system when the input to the system is a sinusoidal signal.

Andrea Zanchettin Automatic Control 1 AUTOMATIC CONTROL. Andrea M. Zanchettin, PhD Winter Semester, Linear control systems design Part 1

Final Exam. EE313 Signals and Systems. Fall 1999, Prof. Brian L. Evans, Unique No

JUNE 2014 Solved Question Paper

1 PeZ: Introduction. 1.1 Controls for PeZ using pezdemo. Lab 15b: FIR Filter Design and PeZ: The z, n, and O! Domains

Signals and Systems Using MATLAB

y(n)= Aa n u(n)+bu(n) b m sin(2πmt)= b 1 sin(2πt)+b 2 sin(4πt)+b 3 sin(6πt)+ m=1 x(t)= x = 2 ( b b b b

Advanced Digital Signal Processing Part 5: Digital Filters

Design of FIR Filters

Signals and Systems Lecture 6: Fourier Applications

SMS045 - DSP Systems in Practice. Lab 1 - Filter Design and Evaluation in MATLAB Due date: Thursday Nov 13, 2003

Magnetic Levitation System

ME 375 System Modeling and Analysis

Design IIR Filters Using Cascaded Biquads

Discretization of Continuous Controllers

ELEC3104: Digital Signal Processing Session 1, 2013

Signal Processing. Naureen Ghani. December 9, 2017

Reduction of Multiple Subsystems

GEORGIA INSTITUTE OF TECHNOLOGY. SCHOOL of ELECTRICAL and COMPUTER ENGINEERING. ECE 2026 Summer 2018 Lab #8: Filter Design of FIR Filters

Course Outline. Time vs. Freq. Domain Analysis. Frequency Response. Amme 3500 : System Dynamics & Control. Design via Frequency Response

Analog Lowpass Filter Specifications

Electrical Engineering. Control Systems. Comprehensive Theory with Solved Examples and Practice Questions. Publications

Copyright S. K. Mitra

Digital Filters FIR and IIR Systems

LECTURER NOTE SMJE3163 DSP

2.1 BASIC CONCEPTS Basic Operations on Signals Time Shifting. Figure 2.2 Time shifting of a signal. Time Reversal.

Figure z1, Direct Programming Method ... Numerator Denominator... Vo/Vi = N(1+D1) Vo(1+D ) = ViN Vo = ViN-VoD

EE 482 : CONTROL SYSTEMS Lab Manual

DSP First Lab 08: Frequency Response: Bandpass and Nulling Filters

FUNDAMENTALS OF SIGNALS AND SYSTEMS

Chapter 7 Filter Design Techniques. Filter Design Techniques

LECTURE FOUR Time Domain Analysis Transient and Steady-State Response Analysis

Classical Control Design Guidelines & Tools (L10.2) Transfer Functions

Digital Filtering: Realization

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

Team proposals are due tomorrow at 6PM Homework 4 is due next thur. Proposal presentations are next mon in 1311EECS.

Review of Filter Types

Filters. Phani Chavali

CDS 101/110a: Lecture 8-1 Frequency Domain Design

Lecture Schedule: Week Date Lecture Title

UNIT-II MYcsvtu Notes agk

Communication Engineering Prof. Surendra Prasad Department of Electrical Engineering Indian Institute of Technology, Delhi

An Overview of Linear Systems

CHASSIS DYNAMOMETER TORQUE CONTROL SYSTEM DESIGN BY DIRECT INVERSE COMPENSATION. C.Matthews, P.Dickinson, A.T.Shenton

[ á{tå TÄàt. Chapter Four. Time Domain Analysis of control system

ME 5281 Fall Homework 8 Due: Wed. Nov. 4th; start of class.

Signals. Continuous valued or discrete valued Can the signal take any value or only discrete values?

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

Lab 4 Digital Scope and Spectrum Analyzer

EE 422G - Signals and Systems Laboratory

Lecture 18 Stability of Feedback Control Systems


Active Filter Design Techniques

EC CONTROL SYSTEMS ENGINEERING

Signal Processing for Speech Applications - Part 2-1. Signal Processing For Speech Applications - Part 2

CDS 101/110: Lecture 8.2 PID Control

Infinite Impulse Response Filters

LECTURE 2: PD, PID, and Feedback Compensation. ( ) = + We consider various settings for Zc when compensating the system with the following RL:

Implementation of Sallen-Key and Multi-Feedback (MFB) Architecture for Higher Order Butterworth Filters

CONTROLLER DESIGN FOR POWER CONVERSION SYSTEMS

The University of Texas at Austin Dept. of Electrical and Computer Engineering Midterm #2

Positive Feedback and Oscillators

Subtractive Synthesis. Describing a Filter. Filters. CMPT 468: Subtractive Synthesis

PROBLEM SET 6. Note: This version is preliminary in that it does not yet have instructions for uploading the MATLAB problems.

Spring 2018 EE 445S Real-Time Digital Signal Processing Laboratory Prof. Evans. Homework #1 Sinusoids, Transforms and Transfer Functions

Transcription:

Viewing as s4251143 Platypus (/ Page 1 assignments/ studentlist/ markers/ / Problem Set 2 Problem Set 2 Question 10 Question: Q1. Graphical Convolution Consider an LTI system with impulse response h(t given below: (/users/ users/ logout Suppose the input to the system is: Please plot the output of the system, y(t. [Hint: please remember to label your plots] Answer: In order to obtain the output we use the fact that : Graphically this corresponds to flipping one of the functions, shifting it to the right, and integrating the relevant sections to obtain the result of convolution. Since and we can use superposition and find the output for each impulse and then sum the results. This will make the graphical approach more tangible and easier to understand. So let's start with. If we flip it we get the second figure, and then we shift it for different values of t, and at each stage we calculate the integral: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

This procedure produces the shifted version of the impulse response. Which is expected from a time invariant system. Mathematically this can be proven as: Page 2 Simply if is the response to then the response to is. The result of convolution for is therefore: assignments/ studentlist/ markers/ (/users/ users/ logout Repeating the same procedure for the and we obtain and. Therefore overall we have the following individual responses: Now to obtain the overall response we use the superposition principle and sum the responses: Knowing that This will give the following output response The output therefore becomes: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 3 assignments/ studentlist/ markers/ And the output alone without dashed lines of individual responses is: (/users/ users/ logout My estimated grade is: 5 / 5 Complete: Yes Question 20 Question: Q2. More Convolutions Suppose an LTI system has the following impulse response h[n] given below: Suppose the input to the system is: x[n] = u[n+1] + u[n 1] 2 u[n 2] Please plot the output of the system, y[n]. [Hint: please remember to label your plots] http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 4 Answer: First we try to evaluate the input, as this will simplify the solution. assignments/ studentlist/ markers/ (/users/ users/ logout This means that x[n] is simply made of three impulses: The response to this input is simply the sum of the response to the individual inputs. Since we know is the response to, from time invariance and linearity we simply find that the response to and is simply and so the output y[n] is : from the figure in question we can see that therefore the output becomes: Therefore the output will look like below: My estimated grade is: 5 / 5 Complete: Yes Question 30 Question: Q3. A Bilateral Understanding Janus wants to apply the z Transform to a non causal signal. Janus recalls that this can not be handled unilaterally using the unilateral z Transform, but can be done using the bilateral (or two sided z Transform. Using this, help Janus determine the z Transform of: Answer: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 5 If we want to solve this quickly with reference to z transform formula we solve as follows: the first part is a right sided z transform because of u[n] and the second part is a left sided z transform because of u[ n 1]. assignments/ studentlist/ markers/ The transform of both and is but each of this discrete functions will have a different Region of Convergence (ROC. For we are dealing with a right sided transform and its ROC is while is a left sided transform and has ROC. So for x[n] we will have: ROC: Note that the region of convergence is the region for which both transforms exist and based on the above explanation we find that to satisfy convergence for both functions. If we want to prove the results through mathematical formula of z transform we solve as follows: (/users/ users/ logout Note that we used the property of geometric series to prove the results. And we know for a geometric series to be convergent the multiplier ie the ratio between the terms should not be 1 or more than 1. From this requirement we can see that and therefore this will be ROC on z plane (the region enclosed between two circles of radius 0.9 and 1.2 My estimated grade is: 5 / 5 Complete: Yes Question 40 Question: Q4. Ordering a Lowpass Filter Around Determine the order, n, and corresponding cutoff frequency, of a lowpass Butterworth and Inverse Chebyshev filter that satisfies the following specifications: [Hint: When finding values of ωc please find one that meets or over satisfies the passband specification] Answer: Butterworth Lowpass Filter: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

To find the order of the filter we find the relation between passband gain, passband frequency, stopband gain and stopband frequency. To do that we first use the transfer function of the Butterworth Lowpass Filter: Page 6 So we get: assignments/ Similarly we have: (1 studentlist/ (2 markers/ Therefore we get: (/users/ So we find n as: users/ logout Now based on the specification we need and. If we just substitute and and also, we obtain n = 12. But for any the requirements are satisfied. For the purposes of this question we select n = 12. Knowing the order we can go back to either equation (1 and (2 and solve for. Remember that the requirements were: and. We find the required values of for each requirement: Imagea (3 now if we use n= 12 and we find that b Taking similar procedure: (4 Now if we replace n = 12 and we obtain So to satisfy part a and b purposes of this question we choose. for n = 12. Therefore for Inverse Chebyshev Lowpass Filter: We use the transfer function for this: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 7 Note that in normalized form is replaced with. From this equation we can obtain passband gain: Which gives: assignments/ Knowing that studentlist/ markers/ we obtain (5 Similar procedure for stopband gain gives: (6 (/users/ users/ logout Now so far we have established very important equations. Now in order to solve for n and we look at the function. This function has two alternative forms: form A form B this is valid when this is valid when Knowing that and we adopt form B for equation (5 and form A for equation (6. Therefore we will have the following two equations: (7 (8 Rearranging for these equations gives: Although these equations look horrifying, substituting for values of assuming a ripple ratio the equations reduce to: and Therefore the relation between is We know the order n should be less than that of the Butterworth, therefore by inserting various values of n less than 12 we found n = 4 will satisfy this equation. To evaluate the acceptable range of, we go back to specifications: Imagea http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 8 assignments/ studentlist/ using n=4 and the given passband frequency we obtain b Similar approach as above will give us the following inequality: markers/ (/users/ using n = 4 and given stopband frequency we obtain So to satisfy both requirements outlines in part a and b we must have Therefore any value in this range satisfies(or over satisfies the requirements. So we choose a value of 225rad/s as cutoff frequency in this case. users/ logout My estimated grade is: 10 / 10 Complete: Yes Question 50 Question: Q5. Set FIRe to the Reign (of analog filters Design a linear phase FIR filter (using the window design method to meet the specifications of the lowpass filter problem in Q4. Determine the required filter order, N, corresponding cutoff frequency,, and corresponding delay. Then specify the final FIR filter. = 30 Hz ( =188.5 rad/s = 40 Hz ( =251.3 rad/s [Hint: The stopband and passband ripple requirements may be inferred from and. ] Answer: *****NOTE: In this question when a window function is selected since the value of peak magnitude is close to that of rectangular window function (although it is less than 21dB. Since the whole windowing method is an approximation for the sake of this question this approximation is still justified. In order to design the digital filter first we have to find the passband and stopband ripple requirements. This can be found from the passband and stop band gains. We know that: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Now we know that and. Using this information we find the range of expected ripples: bandpass ripple: Page 9 assignments/ studentlist/ markers/ stopband ripple: Since we know in FIR filters the ripples are equal in passband and stopband we conclude that the ripple has to be or Now based on this specification we can refer to table of available window functions, and we find that for ripples of this magnitude we can use rectangular window function. In order to find the length of the filter (M we use the following relation: width of mainlobe = (/users/ users/ logout where are the normalized stopband frequency and passband frequency. In order to normalize the given frequencies we must select a sampling frequency. For purposes of this question we choose Therefore we have: width of mainlobe = Therefore Since N = M 1 we find that the filter is of order N = 31. The resulting delay is equal to: From FIR filter properties the normalized cutoff frequency is : This corresponds to: In order to specify the filter we need to find the coefficients for each delay stage. To do that we first find, the impulse response of the ideal low pass filter with this cutoff frequency up to n = 31. We know that the impulse response of an ideal lowpass filter with normalized cutoff frequency is given by: In order to use the sinc function in this impulse response we have to take samples for n< 0 as well as n=0 and n>0 which is not causal. To make the system causal we shift the impulse response by (M 1/2 = 15.5 so we will use the shifted impulse response: since M 1/2 = 15.5 and is not an integer the middle point does not exist. So we only end up with: for http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 10 The window function is simply Therefore the filter coefficients are simply. Using MATLAB the coefficients were found as: assignments/ studentlist/ markers/ a0 =0.0130, a1= 0.0194, a2= 0.0068, a3= 0.0253, a4= 0.0027, a5= 0.0290, a6= 0.0158 a7= 0.0289, a8= 0.0328, a9 = 0.0231, a10= 0.0554, a11= 0.0069, a12= 0.0905 a13 = 0.0370, a14= 0.1871, a15= 0.4039, a16= 0.4039, a17= 0.1871, a18= 0.0370 a19= 0.0905, a20= 0.0069, a21= 0.0554, a22= 0.0231, a23= 0.0328, a24= 0.0289 a25= 0.0158, a26= 0.0290, a27= 0.0027, a28= 0.0253, a29= 0.0068, a30= 0.0194, a31= 0.0130 And the plot of the impulse response is: (/users/ users/ logout The MATLAB code is as below: n = 0; cof = zeros(1,32; figure(1 while n< 32 cof(n+1 = sin(0.4375*pi*(n 15.5/(pi*(n 15.5; hold on; stem(n,cof(n+1; hold on n = n+1; end cof My estimated grade is: 10 / 10 Complete: No Question 60 Question: Q6. I Hear You Uncle Robert, having escaped electrocution while improving the lights, has set his interests on sound. To get rid of noise he has built a simple second order Butterworth lowpass filter for his stereo. Although the system performs well, http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

the ever entrepreneurial Robert, wants to improve it. He reckons twice the filtering gives twice the performance, and suggests filtering the audio signal not once but twice with a cascade of two identical filters. His idealistic cousin is skeptical and suggests, if you are using identical filters, it makes no difference whether you filter once or twice. Page 11 assignments/ studentlist/ markers/ (/users/ users/ logout Who is correct (both, either, or neither? and why? Answer: Neither are right. Having two stages of the same filter will have a different effect from having only one filter or having a filter with double the order. So the outcome will be different but it will not be twice the performance. Another issue that is important is by putting the same filter in cascade we will produce repeated poles. Now if some of these poles is on jw axis having, then by putting the filters in cascade we get repeated roots on imaginary axis which result in unstable system since they give rise to terms like which won't have bounded input as time goes to infinity. For the case of Uncle Robert we find the poles of the Butterworth filter from for k=1,..., n if it has poles on the imaginary axis then he is actually doing something bad. Uncle Robert is using a second order filter so n = 2, and for k=1,2 Luckily there are no poles on the imaginary axis so the system will not become unstable. Nonetheless the response will not be as good as a filter with twice the order. My estimated grade is: 10 / 10 Complete: Yes Question 70 Question: Q7. Driving a Hard Drive Consider a digital controller for a disk drive system in which the disk spins with a constant speed and the has a time between readings of T. This may be modeled as: Where a. Determine G(za. Determine G(z. Determine G(z b. For T = 1ms, a proportional controller (D(z = K, what is the open loop transfer function?b. For T = 1ms, a proportional controller (D(z = K, what is the open loop transfer function?b. For T = 1ms, a proportional controller (D(z = K, what is the open loop transfer function? [Hint: What happens to G(s (or how can G(s be simplified if the fast pole (s= 20 is neglected?] c. What is the closed loop transfer function? [Hint: Apply the same assumptions as was done in Part b] http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

d. For K = 4000, what is the percent overshoot to a step input and the settling time? Page 12 Answer: a In order to obtain the Z Transform we assume that the delay portion of the transfer function ( is Zero Order Hold therefore we have : assignments/ studentlist/ markers/ In order to evaluate the z transform we first find the partial fraction expansion of : Therefore we can easily convert these continuous time transforms to their discrete time equivalents in z domain with reference to z transform tables: (/users/ Therefore the overall z transform will be: users/ logout b The open loop transfer function is. Since T = 1ms = 0.001s we can substitute T with the given value and write the open loop transfer function as: If we want to find the transfer function neglecting the pole at s = 20 first apply partial fraction expansion and then neglect the term from s+20: Neglecting the pole at s= 20 the transfer function of the plant will become: So the discrete transfer function of the plant in z domain using ZOH will become: and then the open loop transfer function after neglecting s = 20 becomes: c The closed loop transfer function is d for K = 4000 we simply substitute in the closed loop transfer function derived in part c and we obtain: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

The poles of this system is at z = 0 which is inside the unity circle and therefore is stable. The response corresponds to an exponential where goes to infinity. Therefore the response of this system is instantaneous and the Page 13 settling time is zero. From practical perspective however there may be a delay of 1ms due to sampling period, but the settling time in theory and from the z transform is zero. assignments/ studentlist/ markers/ (/users/ users/ logout My estimated grade is: 15 / 15 Complete: Yes Question 80 Question: Q8. Analog vs Digital Filters a Design a 12th order Inverse Chebyshev lowpass filter with a cutoff frequency of 5000 Hz (i.e. =2 (5000 by completing the following: i Locate and plot the filter s poles and zeros in the complex plane. Plot the corresponding magnitude response to verify proper design. ii Setting all resistor values to implement the filter using a cascade of six second order Sallen Key filters (as below. On a single plot, plot the magnitude response of each section as well as the overall magnitude response. Identify the poles that correspond to each section s magnitude response curve. b Design an equivalent 12th order digital lowpass filter with = /3 [Hint: Try Matlab s cheby2 function] Plot the filter s poles and zeros in the complex z plane and the decibel magnitude response. Answer: a i If we want to take the theoretical approach first we design a normalized chebyshev filter of order 8. To do that we use the fact that the transfer function of a normalized chebyshev filter is: Image Image (1 Where: (2 is a polynomial given tables for chebyshev filters of different order, and http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

We have to emphasize that can also be found by identifying the poles of the filter and then forming the denominator as : One of the parameters that we have to choose for design of the chebyshev filter is the ripple in passband and that is controlled by. For purposes of design we choose. Referring to the table of poles for chebyshev filters on page 519 of Signal Processing and Linear Systems by Lathi we find that the poles for a normalized 8th order chebyshev filter are: Page 14 assignments/ studentlist/ markers/ (/users/ users/ logout Using these poles we can construct. Also since n = 8 we find from (1 that where is the last coefficient in as shown in equation (2. After finding we can form the transfer function for a normalized filter whose cutoff frequency is 1 rad/s. Since we are after a filter with cutoff frequency of 5000Hz we scale the transfer function by replacing s with and that gives the transfer function for the 8th order chebyshev filter with cutoff frequency of 5000Hz. Since this theoretical approach is computationally intensive we utilized MATLAB and the following transfer function was obtained for the normalized filter: The filter we are after has cutoff frequency of 5000Hz Therefore we used MATLAB function cheby1 which gives the following transfer function(code is given below: The magnitude response of this filter was then found using the function freqs and following magnitude response was plotted: Using pzmap the pole zero plot was generated as below. The imaginary axis has a multiplier of 10^4 (due to poor formatting tools in platypus I couldn't enlarge the image: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 15 assignments/ studentlist/ markers/ (/users/ users/ logout The MATLAB code is: [b,a] = cheby1(8,0.5, 2*pi*5000, 's'; [h,w] = freqs(b,a,1024; Hdb = 20*log10(abs(h; f = w/(2*pi; figure(1; plot(f, Hdb; %get the transfer function of the filter T = tf(b,a figure(2; pzmap(b,a; [z,p,k] = tf2zp(b,a;%get poles and zeros The above code also gives the poles of the transfer function as below: (3 ii Now that we know the transfer function of the system and its poles, designing a cascade of sallen key filters is easy. Simply we have to design it such that each stage will have one of the four pairs of complex conjugate poles in (3 so that overall we have a system with the 8 poles of the the 8th order chebyshev filter we designed in previous part. We know that the lowpass sallen key filter given in question has the transfer function: Image (4 where and. (5 Now we produce the transfer function for each stage from the poles in (3: stage1 poles: So the transfer function of this stage will be: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 16 Now based on the relations in (5 we have : assignments/ If we choose then we find: and from this: studentlist/ markers/ (/users/ If we take then we can find stage2 poles: So the transfer function of this stage will be: Following the same procedure as above we have: users/ logout Taking we find that: Choosing we find that. stage3 So the transfer function for this stage will be: Again similar to previous stages we have: Again assuming Image Image Image Image again we can find other elements similar to stage 1 and 2: stage4 poles: So the transfer function for this stage is : again similar to previous stages we have: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 17 Again assuming again we can find other elements similar to stage 1, 2 and 3: assignments/ Therefore we design with The responses to each were plotted and the following result was obtained: studentlist/ markers/ (/users/ users/ logout And the overall response of the cascade is: The MATLAB code for this part is attached at the end of the answer in an attempt not to crowd the main part of solution. b http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

To design a digital a digital 8th order chebyshev filter, MATLAB was used in a similar fashion and following magnitude response and pole zero plots were generated: Page 18 assignments/ studentlist/ markers/ (/users/ Pole Zeros plot in z domain is : users/ logout The MATLAB code is: [z,p,k] = cheby1(8,0.5, 1/3; % n = 8, a normalized cutoff frequency of pi/3, 0.5dB ripple [sos, g] = zp2sos(z,p,k; Hd = dfilt.df2tsos(sos,g; freqz(hd; MATLAB Code for Sallen Kay Cascade Solution ii b1 = [998731229]; a1 = [1 2740 998731229]; stage1 = tf(b1,a1; b2 = [731644360]; a2 = [1 7804 731644360]; stage2 = tf(b2,a2; b3 = [353978825]; a3 = [1 11680 353978825]; http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

assignments/ studentlist/ markers/ (/users/ users/ logout stage3 = tf(b3,a3; b4 = [86896721]; a4 = [1 13778 86896721]; stage4 = tf(b4,a4; result = stage1*stage2*stage3*stage4; %cascade the stages [h1,w1] = freqs(b1,a1,1024; Hdb1 = 20*log10(abs(h1; f1 = w1/(2*pi; subplot(2,2,1; plot(f1,hdb1; title('stage 1 magnitude response'; [h2,w2] = freqs(b2,a2,1024; Hdb2 = 20*log10(abs(h2; f2 = w2/(2*pi; subplot(2,2,2; plot(f2,hdb2; title('stage 2 magnitude response'; [h3,w3] = freqs(b3,a3,1024; Hdb3 = 20*log10(abs(h3; f3 = w3/(2*pi; subplot(2,2,3; plot(f3,hdb3; title('stage 3 magnitude response'; [h4,w4] = freqs(b4,a4,1024; Hdb4 = 20*log10(abs(h4; f4 = w4/(2*pi; subplot(2,2,4; plot(f4,hdb4; title('stage 4 magnitude response'; figure(2; [b_result a_result] = tfdata(result; [h_result w_result] = freqs(cell2mat(b_result, cell2mat(a_result,1024; Hdb_result = 20*log10(abs(h_result; f_result = w_result/(2*pi; plot(f,hdb_result; %plot the overall frequency response Page 19 My estimated grade is: 20 / 20 Complete: Yes Question 90 Question: Q9. Digital Control Part I: [10 points] http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Sketch the root locus of the system: in feedback with a 5Hz Page 20 controller implementing: a a lead compensator b a lag compensator Which is more robust to arbitrarily large system gains? assignments/ Part II: [20 points] For what range of proportional feedback gains are the following systems stable? i studentlist/ ii where, 20 Hz (approximate with Tustin s method markers/ iii Image Image Image, 20 Hz (using exact z Transform (/users/ users/ logout Answer: Part I First we take the Laplace transform of the differential equation: In z domain assuming ZOH the transfer function will be: which means there's a zero at z = 1 and two poles at z = 0.9015 + 0.4328i and z=0.9015 0.4328i. Now knowing that fs = 5Hz and Ts = 0.2s we use MATLAB to plot the root locus of the following: a lead compensator For this case we choose an arbitrary zero location in s domain (since we are not given any specification on transient response. For purposes of this problem the following compensator was chosen: which has a zero at 1 and pole at 20. Using MATLAB the transfer function in s domain was then converted to a discrete transfer function in z domain using c2d function assuming matched poles and zeros:. Then the open loop transfer function is simply and we can plot the root locus by rltool as below: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 21 assignments/ studentlist/ markers/ (/users/ users/ logout b lag compensator For case of lag compensator again since no specification is provide an arbitrary pole and zero close to imaginary axis is chosen: Again using MATLAB the transfer function in s domain was then converted to a discrete transfer function in z domain using c2d function assuming matched poles and zeros. The matched poles zeros transfer function will be:. Then the open loop transfer function is and the root locus can be plotted by rltool as below: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

From the plots we can see that the lead compensator seems to provide a wider range of possible gains while maintaining the stability. On the other hand the lag compensator seems to be very unstable and in fact we can see a small gain results in instability in the system. Therefore the lead compensator seems to be more robust for larger gains for this plant. Although at some point we can see even lead compensator becomes unstable for very large gains. Page 22 assignments/ studentlist/ markers/ (/users/ users/ logout MATLAB Code: plant = tf([2],[1 0 5]; % create plant in s domain plantz = c2d(plant, 0.2,'zoh'; %convert to z domain by zoh lead_comp = tf([1 1],[1 20]; %create lead compensator lag_comp = tf([1 0.01],[1 0.001]; %create lag compensator lead_compz = c2d(lead_comp,0.2,'matched'; %get the overall transfer function in z lag_compz = c2d(lag_comp,0.2,'matched'; plant1z = lead_compz*plantz; %convert to discrete transfer function plant2z = lag_compz*plantz; rltool(plant1z; %plot root locus rltool(plant2z; Part II i The closed loop transfer function for gain feedback K is : Therefore the pole will be at: circle so : and for this to be stable the pole has to be in the unity Therefore 0.998< K< 20 is the range for which the system will remain stable. ii With Tustin's method we have : so we simply substitute s with this transformation in the transfer function knowing that T = 0.05 to get the overall system's transfer function in z domain. Instead we use c2d function in MATLAB: plant = tf([2],[1 6 9]; plantz = c2d(plant, 0.05, 'tustin'; rlocus(plantz; [k poles] = rlocfind(plantz; The above code gives the transform of H(s as: and the rootlocus plot of the feedback system Image Image Image is: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 23 assignments/ studentlist/ markers/ (/users/ users/ logout As the root locus shows the system is stable up to very large gain since the root locus is in unity cirlce (we can claim from the plot almost infinity, since the zero is at 1 where it becomes marginally stable. However using rlocfind function a gain equal to 1.8637e+015 is given for z = 1. Nonetheless that's MATLAB computation and from the rootlocus we conclude the system is overall stable for all values of K. iii In this part we will use exact z transform method to obtain the maximum allowable gain K for maintain stability. To do this we use the definition of the Z transform, before doing so we have to use inverse Laplace Transform to obtain time domain function h(t: So the Z transform is: Now we take and therefore we will have: Now using the property and knowing that in the above equation x [n] = u[n] we find that H(z is: where so overall: Since f = 20Hz and T = 0.05 and we obtain the closed loop transfer function as below: Now we can obtain the root locus plot using MATLAB tf function as below: plant = tf([0 0.116],[1.347921 2.322 1 ], 0.05; http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

rlocus(plant; [k poles] = rlocfind(plant Page 24 assignments/ studentlist/ markers/ (/users/ users/ logout Using rlocfind it was found that the system poles will cross the unity circle(and becomes unstable at a gain of 2.9874 with poles: 0.8613 + 0.5071i and 0.8613 0.5071i. My estimated grade is: 30 / 30 Complete: Yes Question 100 Question: Q10. Its Not Easy Being Stable Professor Honeydew has a new machine, Leviathan. Much like a magnetic bearing in turbomachinery, this suspends ferromagnetic material (or a weight to which a magnet has been attached by means of an electromagnet whose current is controlled by the position of the mass. (http://goo.gl/4xwsc The equation of motion is: where the force on the ball due to the electromagnet is given by At equilibrium the magnet force balances the gravity force. Let represent the current at equilibrium, then we can linearize this system about x=0 and = to get:. http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 25 The Professor s assistant, Beaker, has estimated the values of the constants as: m=1 kg, = 50N/m, and = 1 N/A. assignments/ studentlist/ markers/ (/users/ users/ logout a. Continuous transfer function. Compute the transfer function from I to x (i.e., G(s=. b. Continuous to discrete. Assume the input is passed through a zero order hold (ZOH with a sampling frequency of 100 Hz. Compute the equivalent discretetime plant transfer function. c. Digital controller. Design a digital control for the magnetic levitation device so that the closed loop system has a rise time of less than 160 milliseconds ( 0.159s, a settling time of less than 460 milliseconds ( 0.46s, and overshoot ( 20%. d. Root Locus. Plot a root locus with respect to Please discuss the possibility of using your closed loop system to balance frogs of various masses and with more damping (e.g. greater air resistance or if it has wings. e. Step Response. Plot the step response of your design to an initial (unit disturbance. Show this for both the output response ( and the control effort ( f. Noise. Beaker replaces the sensor with a new one that uses mains. This new sensor is very noisy with 50Hz noise of the same amplitude at the signal (SNR=1. Design a filter to process this sensor s output (include the specific type and order of FIR or IIR or analog filter. What will happen if the order is too great? g. Saturation. What would happen if the solenoid has a limit of 1A and a latency of 100 milliseconds. Answer: a First we transform the differential equation to Laplace Transform and then we rearrange to obtain the transfer function: Since m = 1kg and k1 = 50N/m and k2 = 1N/A the transofer function becomes: b Knowing that the sampling rate is f = 100Hz we find that T = 0.01s and therefore we find the discrete transfer function with Zero Order Hold as below: To obtain the Z transform we use partial fraction expansion: Where by cover up rule we have : So now we can find the Z transform of the s domain terms knowing that T = 0.01s: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Therefore the overall discrete transfer function H(z becomes: Page 26 assignments/ studentlist/ markers/ (/users/ users/ logout Alternatively we could also use MATLAB function c2d with 'zoh' to obtain the transfer function. plant = tf([1].[1 0 50]; plantz = c2d(tf,0.01,'zoh' which gives c To design the digital controller first we design in s domain based on the requirements and then we transform the controller to a digital controller through approximation methods: The requirement asks for a settling time of maximum less than 460ms this means that the closes distance to imaginary axis for system poles must be: (1 So the poles real part must be 10 or less(more negative. From the required percent overshoot we can also derive the minimum damping ratio required: This damping ratio corresponds to a radial line of. Note that (1 and (2 together require that rad/s. The design spec further asks for a rising time of less than 0.159s: (2 (3 We can see satisfying (1 and (2 will satisfy (3 as well. Therefore to meet specifications it is sufficient to design a controller whose poles are to the left of the line s = 10 and are between the lines associated with damping ratio 0.456. In other words the closed loop system poles must be in the following region: Therefore we have to design our compensator in such a way that the root locus passes through the region shaded above. To design our compensator first we see that requirements are on transient response and nothing is mentioned about the steady state error. So we will use a lead compensator to satisfy the transient requirements. The lead compensator introduces a zero and pole so that the root locus of the overall system passes through the desired points. For purposes of our design we choose a zero at 18.7 so we can keep the compesator pole far enough from the system poles so that we can use second order approximations appropriately. In order to make the root locus pass through a specific point we can use the angle criteria( to locate the http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

compensator pole or we can use SISO tool in MATLAB to place the pole in such a way that the root locus passes the region shown above. Since the theoretical method still requires verification through simulation we can directly use SISO tool. Using SISO tool we can easily find that if we place the compensator pole at 357 Page 27 the compensator transfer function will become: and root locus of the system will become as shown below: assignments/ studentlist/ markers/ (/users/ users/ logout We can see that the parts of the root locus is in the desired region, therefore we can choose an appropriate gain to have the system poles in this region. The figure above shows the pole locations for a gain of K = 21876. For this value the dominant poles are at and the third pole is at 282. Therefore the percent overshoot, settling time and rising time specification is satisfied with the following controller: Now that the design is completed in s domain we continue the emulation method to create the digital controller. To do that we choose the tustin method to convert the controller in s domain to z domain: d Now that we have obtained the controller from the emulation procedure we can easily find the step response. To do that we simply convert the plant and controller to discrete and then we obtain the closed loop transfer function. Then to get the step output all we have to do is to call step function. To obtain the step output information we can simply call stepinfo function: K = 21786; plant10 = tf([1],[1 0 50]; %plant %Gc = tf([1 20],[1 129.94];%compensator Gc = tf([1 18.7],[1 357]; Gcz = c2d(gc, 0.01, 'tustin'; plant10z = c2d(plant10,0.01,'zoh'; G = Gcz*plant10z; %minor loop transfer function figure(1 rlocus(g; closed_loop = feedback(k*g,1; %closed loop transfer function %dclosed_loop = c2d(closed_loop,0.01,'zoh';%discretization http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

figure(2; step(closed_loop; stepinfo(closed_loop Using this code the step response (step input i was obtained as below: Page 28 assignments/ studentlist/ markers/ (/users/ users/ logout RiseTime: 0.0100 SettlingTime: 0.1400 Overshoot: 26.1981 The step response of the continuous control system from which the digital system was derived is as below. As can be seen this continuous design meets all specifications. However we see that during the process of transforming to digital domain the step response is no more giving the desired overshoot although it satisfies the settling time and rising time. This is due to sampling effect and the approximations made in transforming from continuous to discrete domain. RiseTime: 0.0211 SettlingTime: 0.1498 Overshoot: 15.2126 http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

To solve this larger overshoot in digital domain we could instead design a compensator which gives poles with more damping to compensate for the increased overshoot. For example we could go and make a compensator like : and use it with a gain of 20,000 and that would give real closed loop poles as below: Page 29 assignments/ studentlist/ markers/ (/users/ users/ logout However we will stick to our original compensator for the rest of this question, but the explanation that was just given sheds light on how we could improve the design. The step response for effort i can be obtained easily by rearranging the control block diagram loop to have desired position as input and effort i as output. This will give the following transfer function: This will give the following step response for effort i by calling the step function in MATLAB: By applying stepinfo the final settling value is found to be 55.3922 A. e In order to design filter for the noisy sensor we should first consider the aliasing that can arise from the sampling. Since the sampling frequency is 100Hz from Nyquist and aliasing criteria we find that any frequency from 50Hz or larger will be aliased. Therefore an antialiasing filter has to be applied in the feedback path and before the sampler so that aliasing is avoided. Interestingly in this problem we are also dealing with a 50 Hz noise. Therefore a proper antialiasing(lowpass filter would get rid of the noise as well. Note that it is crucial to put the filter before the sampler so that we can avoid "any" aliasing. This means that we must design an analog filter if we want to maintain the sampling frequency at 100 Hz, and if we want a better and smoother filtering. http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

assignments/ Note however the order of the filter is really dependent on the number of bits in ADC of controller, as the number of bits specifies how sensitive our sampler is in picking up variations. Therefore the amplitude reduction in principle depends on number of bits. Since the number of bits is not provided in this problem we have to assume an amplitude for stopband frequency of 50Hz, and based on that design a filter. First we choose the type of the filter. Since we would like a smooth passband and stopband we go for a Butterworth lowpass filter, and we assume the the amplitude at stopband frequency ( is 20dB. We also choose the passband frequency as ( and passband gain as 0.5dB. From these assumptions we are able to derive the order of the filter and the cutoff frequency: Page 30 studentlist/ markers/ (/users/ users/ logout Therefore an analog Butterworth lowpass filter with order 15 and cutoff of 269.58 rad/s will get rid of the noise and also avoid aliasing. However the large order n = 15 can potentially result in latency (delay and therefore instability and/or large overshoot. Since the system will not be able to compensate fast enough. Also the dynamics of the filter ie the poles of Butterworth filter can change the rootlocus of the overall closed loop system. In this case designing a filter with sharper cutoff region for lower orders can help, for example chebyshev and inverse chebyshev can satisfy the same spec with lower orders but they introduce the ripples in passband and stopband. f The open loop transfer function is: giving this transfer function to rlocus function or rltool we obtain the root locus diagram in z domain below: The s domain root locus was presented during the design process in part c. If we want to plot the root locus with regards to k1 first we derive the open loop transfer function with regards of plant with k1 as unknown. To do that first we derive the transfer function of the plant: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 31 Then the open loop transfer function is where. assignments/ studentlist/ markers/ (/users/ users/ logout Now looking at the equations especially the transfer function of plant which contains exponential terms of k1 and also 1/k1, the root locus will only effected by the exponential terms since they change the pole locations. The 1/k1 only serves as a factor and changes the gain. So the essence of root locus, the location of poles and zeros is controlled by exponential terms. We can put and rewrite the transfer function based on and then plot the root locus. So first we simplify the above equation with : So we can see that Image Imageis only affecting the poles and it does not change the zeros of open loop transfer function. So we can apply simple Root Locus Equation based on the denominator of the open loop transfer function. Note that we have taken into account z+0.2819 from the compensator transfer function: We can clearly see that looks like a gain in root locus equations. So if we make then the root locus can be plotted for values of p. The value of p is then related to k1 through (T = 0.01 so we get a root locus for k1. The root locus equation will be: and root locus with respect with k1 looks like below. Note however care must be taken in mapping the gain with k1: MATLAB code for this rootlocus: tfk1 = tf([ 1 0.2819 0],[1 0.2819 1 0.2819],0.01; rlocus(tfk1 g To see the effect of saturation first we have to look at the response of the effort i to a step input. As plotted above the effort will go to very large values as it is compensating for the errors and then finally settles on 55.392 A. When there's saturation of 100A this means the effort cannot compensate as much as it is required to. In other words the step response of effort i will be clipped at 100A and 100A. This will give rise to larger overshoot, slowed http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

response and steady state error as the controller has not been able to provide the plant with all the necessary compensation input. Implementing the control system in Simulink in s domain approves the results as seen below: Page 32 assignments/ studentlist/ The step response with saturation only is as below: markers/ (/users/ users/ logout The effect of latency is however more drastic especially for latency of 10ms which is equal to one sample time. This will make the control system overshoot a lot more when modeled s domain as tested in Simulink, This can lead to instability when implemented in digital control.. http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

The combination of both the saturation and latency is an even worse mix and the system will become unstable and Simulink one again approves that as below: Page 33 assignments/ studentlist/ markers/ (/users/ users/ logout Therefore the system will be unstable if both saturation and latency are present. NOTE: The y axis of the plots in this part represent the position response in its units for example m. #############################My Own Thinking Zone############################## Therefore the poles will have to be at Therefore we have to design our compensator in such a way that the root locus passes through these poles and note that this is the minimum requirement. We could go and choose poles which are more to the left and are on radial lines of smaller angles to have smaller settling time and smaller overshoot. To design our compensator first we see that requirements are on transient response and nothing is mentioned about the steady state error. So we will use a lead compensator to satisfy the transient requirements. The lead compensator introduces a zero and pole so that the root locus of the overall system passes through the desired points. For purposes of our design we choose a zero at 15 so we can keep the compesator pole far enough from the system poles so that we can use second order approximations appropriately. Choosing z = 20 and knowing that the root locus passes through we are able to find the compensator pole from angle criteria. The angle criteria says Before proceeding to find the angles first we should find all poles and zeros of open loop system: plant poles: compensator pole and zero : http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

So angles will be: Page 34 From this we can find the angle contribution from the pole: degrees Now using the geometry and trigonometry we find the pole of compensator at: assignments/ studentlist/ So the compensator will be: Using MATLAB rlocus function we found the corresponding gain to operate the system at to be K = 2450 where K is the proportional gain of the controller. The position of the compensator pole of the system for this gain is shown in the figure below: markers/ (/users/ users/ logout We clearly see that the compensator pole is more than 5 times the dominant poles and therefore a second order approximation is valid. Therefore it is expected to obtain the desired response with this compensator and a proportional gain of 2450. Note that the system will be unstable for small gains due to the pole in the RHP. Now that we have designed the compensator in s domain we simply take it to z domain and convert it to a digital controller: But we also have the gain K = 2450. So the overall controller transfer function will be: if we are sampling with f = 100Hz then T = 0.01 and using zero order hold we have: if "controller" input (not the whole system is u[n] and output is r[n] then the input output relationship is as below: The discrete representation will be: http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143

Page 35 d To sketch the root locus first we have to find the root locus equation based on k1. e assignments/ studentlist/ markers/ (/users/ users/ logout The step response was plotted using the following code: plant10 = tf([1],[1 0 50]; %plant Gc = tf([1 20],[1 129.94];%compensator G = Gc*plant10; %minor loop transfer function figure(4 rlocus(g; closed_loop = feedback(2450*g,1; %closed loop transfer function dclosed_loop = c2d(closed_loop,0.01,'zoh';%discretization figure(5; step(closed_loop; My estimated grade is: 40 / 40 Complete: Yes Beta - IxD (http://www.itee.uq.edu.au/ixd / RDL (http://robotics.itee.uq.edu.au/ http://robotics.itee.uq.edu.au/pages/viewassessment/8/s4251143