ECET-402         Week 6 Lab – Block Diagram Simplification & Step/Impulse Responses

 
Objectives

 

The objective of this lab is to introduce the student to the block diagram simplification feature of MATLAB and determine the unit step and impulse responses of the overall system. 

 

Parts needed:

 

MATLAB Version 7 or higher available on iLab (Citrix Server)

 

Pre-lab:

 

Almost every physical system whether it is mechanical, electrical, hydraulic, pneumatic, etc., can be represented by a transfer function either in terms of s or z.  Systems such the world population increase, economy, decay of radioactive materials, optimizing space in a facility, and many many more, can also be modeled in the form of a transfer function.  You already have seen the transfer function of analog and digital filters in a previous course. The transfer function of a system is defined as following:

 

The transfer function of a system is the ratio of the Laplace (or z) transform of the output over the Laplace (or z) transform of the input.

 

Figure 1 shows the block diagram of a system with the transfer function of G(s).  X(s) is the input to the system and Y(s) is the output of the system.  The formulas for the transfer function and output of the system are also shown in Figure 1.

 

 

 

Figure 1 – The transfer function of a system

 

Here are some examples of systems and their transfer functions:

 

1.      Figure 2 shows a very simple model of the suspension system in a vehicle.  M, represents the mass of the vehicle; K, is the spring (coil) coefficient; B, is the shocks friction coefficient; f(t) is the force applied to the vehicle when it hits a bumpy road; and y(t) is the vertical displacement of the vehicle when f(t) is applied.  The differential equations governing the system can be written and the transfer function can be determined as:

 

 

Car manufactures can apply test signals such as unit step or impulse functions to determine how the system responds.  By the way, unit step and impulse functions are the worst things that can happen to a system due to their abrupt changes.  That’s why they are used as test signals.  If the response of the system to these signals is satisfactory, it guarantees that it will be satisfactory for any other input.  Depending on the values of M, K, and B, the response of the system can be over-damped, critically-damped (oscillatory), or under-damped (overshoot).

 

 

Figure 2 – A simple model for the suspension system in a vehicle

 

 

2.      A simple electrical circuit is shown in Figure 3.  You have solved many problems like this in the past.  The transfer function G(s) can be determined using the voltage divider rule.

 

 

 

 

Figure 3 – A simple electrical system

 

3.       Below is the transfer function of an FIR filter

 




        Figure 4 shows the block diagram of the filter:

 

Figure 4 – The block diagram of an FIR filter

 

Not all systems are simple!  In fact complex systems such as an automobile, space shuttle, or let’s say DeVry University as a system, may consist of several subsystems that are interconnected in some way.  The question is what would be the transfer function of the overall system?  Here are three basic rules for simplifying the transfer function of a complex system into a single transfer function.  Note that arrows are very important here!

 

1.      Blocks in series:

 

If two or more blocks with transfer functions  are placed in series, the overall transfer function will be the product of the transfer functions.

 



 

2.      Blocks in parallel:

 

If two or more blocks with transfer functions  are placed in parallel, the overall transfer function will be the algebraic sum of the transfer functions.

 

 

 

 

3.      Simple feedback:

 

A simple feedback block is shown below.  Note that the transfer function of a block on the feedback path (the flow is from right to left), traditionally is shown by H(s), instead of G(s).  It can be shown that the overall transfer function of the simple feedback block is:

 





 

 

 

Using the above rules, we can simply the block diagram of a complex system with multiple sub-system blocks.

 

Example: Simplify the block diagram shown below into a single block and determine the overall transfer function.

 

 

At a glance we realize that  are in series.  So, let’s replace them by a block with the transfer function.

 

 

 

 

 

 

 

 

Next we realize that the and  blocks are in parallel.  Let’s replace them by another block, :

 

 

 

 

Next, we realize that the  block and the feedback line above it (Gain is 1 for a line), form a simple feedback block where.

 

 

 

 

 

Next, we realize that two more blocks are in series.  We combine them into one block.

 

 

Finally we realize that this has simplified into a simple feedback block.  The transfer function is:

 

 

 

 

 

Now, let’s assume: .  Substitute these values in the overall transfer function and simplify.

 

 

 

 

Unit step response:

 

This is the response to the system if the input is  or  in Laplace domain.

 

Take the inverse Laplace transform of the above function to determine the output in time domain.

 

Impulse response:

 

This is the response to the system if the input is  or 1 in Laplace domain.

 

Take the inverse Laplace transform of the above function to determine the output in time domain.

 


 

MATLAB

 

We can use MATLAB to simplify a complex block diagram and find the response of the overall system to unit step and impulse inputs.

 

The following MATLAB commands are defined:

 

>> series (G1, G2)                           Determines the transfer function of two cascaded blocks G1 and G2.

 

>>  parallel (G1, G2)                        Determines the transfer function of two parallel blocks G1 and G2.

 

>>  feedback (G, H, sign)                Determines the transfer function of a simple closed loop system with forward block G, feedback block H, and the sign of feedback loop.

sign = -1          For negative feedback

sign = +1         For positive feedback

                                                            For negative feedback, sign is optional.

 

We will now use MATLAB to simplify the block diagram of our previous example, also provided below for convenience:

 

 

 

Since the transfer functions in our sub-blocks are only  and , we define:

,

            >> numg1 = [1 0];                               % Numerator of G1

>> deng1 = [0 1];                                % Denominator of G1

>> G1 = tf(numg1, deng1)                 % Transfer function G1

 

>> numg2 = [0 1];                               % Numerator of G2

>> deng2 = [1 0];                                % Denominator of G2

>> G2 = tf(numg2, deng2)                 % Transfer function G1

 

>> G3 = series (G1, G1)                     % Transfer function of two series blocks of s.

 

>> G4 = parallel (G3, G2)                  % Transfer function of parallel blocks

 

>> G5 = feedback (G4, 1)                  % Transfer function of feedback block with
% unity feedback.

 

>> G6 = series (G5, G2)                     % Transfer function of series blocks

 

>> TF = feedback (G6, G1)                % Overall transfer function

 

 

Transfer function:

     s^3 + 1

-----------------                                      

2 s^4 + s^2 + 2 s

 

 Same answer as before!

 

We now define the numerator and denominator of the overall transfer function in MATLAB:

 

>> n = [1   0   0   1];                           % coefficients of numerator, we enter zeros for the missing terms

>>  d = [2   0   1   2   0];                      % coefficients of denominator

 

Here is MATLAB code for plotting the unit step response:

 

>> step (n, d)                                      % Also step (TF), if the transfer function is defined

 

Here is MATLAB code for plotting the impulse response:

 

>>  impulse (n, d)                                % Also impulse (TF), if the transfer function is defined

 

 

Procedure:

 

1.      From the iLab (Citrix Server)menu, select Matlab 2011a or Matlab v7.

 

2.      Similar to the example above, determine the overall transfer function of the system shown below (on the next page) by hand.  Show your work and the final answer on week-6 worksheet.

 

3.      Similar to the example above, determine the overall transfer function of the system shown below (on the next page) by using MATLAB.  Copy the MATLAB code and the overall transfer function obtained and paste them onto the worksheet.

 

4.      Compare your results from steps 2 and 3.

 

5.      Determine the unit step response of the overall system using the MATLAB command described in the pre-lab.  Copy the unit step response and paste it onto the worksheet.

 

6.      Determine the impulse response of the overall system using the MATLAB command described in the pre-lab.  Copy the impulse response and paste it onto the worksheet.

 

     

 

 

 

 

7.      Complete the worksheet and submit to week-6 iLab.

    • 10 years ago
    ECET 402 Week 6 iLab
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      week6_lab_worksheet_.docx