EE/ME/AE324: Dynamical Systems Chapter 4: Block Diagrams and Computer Simulation
Block Diagrams A block diagram is an interconnection of: Blocks representing math operations Wires representing signals (info.) and their flow Commonly y used to analyze/simulate systems Common elements include: Summers Gains blocks Integrators Given the simple system: x = Ax+ fa( t)
Diagrams for Input Output Eqns. Assuming a system in I/O Eqn. form with a single output and no input derivatives: 1. Solve eqn. for highest h output t derivative (HOD) 2. Connect integrators in series to generate the output signal from the HOD 3. Generate the HOD from 1. using a summer block and scaled versions (gain blocks) of the integrator outputs and the input. Given the simple MSD system of Ex. 3.1: Mx + Bx + Kx = f () t a
1. Solving for x yields: Ex. 3.1 1 x= a( () M Bx Kx+ f t 2. Create a chain of two integrators, and 3. Use the result of 1. above to complete the diagram:
Ex. 3.2 Revisited EoM with B = 0: M 1x1+ K1x1= K2( x2 x1) M x + K ( x x ) = f ( t ) 2 2 2 2 1 Resulting I/O eqn.: ( 4) f a M Mx + Ax () 2 1 1 1+ KKx 2 1 1 = K 2f a t where A= M ( K + K ) + M K 2 1 2 1 2
1. Solving for the HOD: Ex. 3.2 Revisited ( ) = [ + () ] x Ax K K x K f t 4 1 () 1 1 2 1 1 2 a MM 2 1 2. Create a chain of four integrators, and 3. Use the result of 1. above to complete the diagram:
Diagrams for State Variable Models If the system is written in state-spacespace form: q=aq+bu y=cq+du The block diagram follows naturally: u q q dt q y
Diagrams for State Variable Models (Ex. 4.4) If the system is written in terms of n state eqns., but is not written in Matrix form: 1. Draw an integrator for each state variable 2. Build the terms needed to form the derivative of each state variable (as specified by the EoM) using the states, inputs, gains and summers 3. Build the terms needed to form the outputs
Ex. 4.4 If the state variables ab are defined ed as: x1 x 1 x 1 x1 q= q = = x 2 x 2 x 2 x2 x 1 1 f ( a t ) K ( ) ( ) 1x1 Bx 1 1 B3 x 1 x 2 K3x1 x2 M 1 x 2 1 [ Kx ] 2 2 Bx 2 2 + B3( x 1 x 2) + K3( x1 x2) M 2 [ ]
Ex. 4.4 The block diagram consists of two strings of integrators, i.e., one for x1 and one for x2, with all signals being fed into the summers corresponding to forces acting on the freebody diagrams
Running Simulink with Matlab Simulink is a companion package to Matlab provides a graphical user interface (GUI) based method of programming based on signal flow similar to modeling using block diagrams Matlab can be used to set up Simulink models and Simulink data can be passed to Matlab for further analysis and visualization models can be used for real time, hardware inthe loop system testing using DAQ hardware See recommended text for more details: Steven Karris, Introduction to Simulink with Engineering Applications http://www.orchardpublications.com
Running Simulink with Matlab Simulink provides apre defined library of blocks that can be used to quickly model systems Commonly used libraries/blocks include: Continuous Integrator (click to set ICs) Math Operations Sum (click to change shape and input signs), Gain Sources Clock, Constant, Step, Fun. generator Sinks Scope, (save) To workspace
Running Simulink Simulations Follow these steps to create a Simulink simulation: 1. Start Matlab and type Simulink at prompt 2. Click blank page icon in upper left of Simulink Library Browser to open new model 3. Drag blocks from library folders into the model window, e.g., integrator, sum, gain, step, etc. 4. Arrange blocks so that they represent the system model in an orderly way, connecting them by dragging using wires, etc. 5. Double click on blocks with parameters to change them as needed 6. Setup simulation, e.g., stop time, using Simulation > Configuration Parameters menu in model window
Create the Simulink Model Below Questions: What does this model represent? How does increasing B change the system response?
Associated Matlab Script
In class Design Challenge Our next class will meet in 163 CAMP You will form groups of no more than three students You will simulate Example 4.7 and try to solve a design challenge posed at the start of class Students in groups that successfully solve the challenge and submit printouts of their work will be awarded a 2% bonus toward their project grades You are encouraged to get a head start on the challenge if desired by reviewing Example 4.7, etc.
Questions?
In class Design Challenge Form groups of no more than three students Simulate Example 4.7 and try to solve a design challenge Students in groups that successfully solve the challenge and submit printouts of their work, e.g., Matlab and Simulink files with clearly labeled l plots showing their results, will be awarded a 2% bonus toward their final grades
Ex. 4.7: Problem Statement A skydiver jumps from an airplane. Assume: no wind, the parachute opens at t=0 with the risers fully extended (no stretch ) and provides viscous damping relative to a fixed reference, initial i i speed of the jumper and parachute are 20 m/s Challenge: Find values for B p and K R that ensure a steady state velocity of 5 m/s or less with max. jumper deceleration limited to one g or less using the following parameters: M = 10 kg, M = 60 kg, B = 10 N s/m p j j
Computer Lab Assignment Assume references are selected such that displacement of jumper and parachute are zero when t=0, i.e., system at EQ when x p =x j =0 EoM: 1 x ( ) p = Bpx p + KR xj xp + M pg M p 1 x = B x K x x + M ( ) j j j R j p jg M j Now model this system in Matlab and Simulink
You have approx. 40 minutes to work solve the Challenge Solution on Next Page!
Solution Assume references are selected such that displacement of jumper and parachute are zero when t=0, i.e., system at EQ when x p =x j =0 In steady-state, x = x = 0 x = x = x ( ) p + j p j p j tv (terminal velocity). Sub. into EoM yields: x tv M M g = 5 m/s B + B p ( ) p + j M M g Bp = B x j tv ( 10 + 60) 10 10 = 130 N m/s 5 j
Solution for K R =40, B p =130 Run simulation varying K R until specifications met:
Is this a practical solution (explain your answer)?
% Matlab script to simulate Ex. 4.7 using a state space model clear % Define system parameters g=9.81; Mp= 10; Mj= 60; Bj= 10; xpdot_ss= 5; Bp= (Mp+Mj)*g/xpdot_ss Bj; % Solved from EoM in steady state KR= 40; t_stop= 20;% Selected by trial and error % State matrices A= [0 1 0 0; KR/Mp Bp/Mp KR/Mp 0;0 0 0 1;KR/Mj 0 KR/Mj Bj/Mj]; B= [0;1;0;1]; C= [eye(4);kr/mj 0 KR/Mj Bj/Mj]; % Last row specifies accel. of jumper D= [zeros(4,1);1]; IC=[0;20;0;20]; % Initial conditions as per problem statement sim('ex4 sim(ex4_7) 7') % Calls the Simulink model
figure(); subplot(2,1,1); 1); plot(tout,y(:,1),tout,y(:,3)) tout title('displacement of parachute (blue) and jumper (green)') xlabel('time [s]'); ]); ylabel('displacement [m]') ]) subplot(2,1,2); plot(tout,y(:,3) y(:,1)) title('relative displacement of risers') xlabel('time [s]'); ylabel('displacement [m]') figure();subplot(2,1,1); plot(tout,y(:,2),tout,y(:,4)) title('velocity of parachute (blue) and jumper (green)') ) xlabel('time [s]'); ylabel('velocity [m/s]') subplot(2,1,2); plot(tout,y(:,5)) title('acceleration of jumper') xlabel('time [s]'); ylabel('acceleration [m/s^2]')
Simulink Model of Ex. 4.7
Questions?