Response with a Dead Zone
Create and,run a Simulink simulation of a mass-spring-damper model (9.5-1) using the parameter values m = 1, C = 2, and k = 4. The forcing function is the function 1(1) = sin 1.4e. The system has the dead-zone nonlinearity shownin Figure 9.5-1.
To construct the simulation, do the following steps.
1. Start Simulink and open a new model window as described previously.
2. Select and place in the new window the Sine Wave block from the Sources library. Double-click on it, and set the Amplitude to 1, the Frequency to 1.4, the Phase to 0, and the Sample time to O.Click OK.
3. Select and place the Dead Zone block from the Discontinuities library, double-click on it, and set the Start of dead zone to -0.5 and the End of dead zone to 0.5. Oick OK. Select and place the Transfer Fen block from the Continuous library, double-click on it, and set the Numerator to [1) and the Denominator to [1. 2. 4). Click OK.
5. Select and place the Scope block from the Sinks library. ‘” Once the blocks have been placed, connect the input port on each block to the outport port on the preceding block. Your model should now look like Figure 9.5-2.
7. Click on the Simubltion menu, then click the Configuration Parameters item. Click on the Solver tab, and enter 10 for the Stop time. Make sure the Start time is O. Then click OK.
8.. Run the simulation by clicking on the Simulation menu, and then clicking the Start item. You should see an oscillating curve in the Scope display. It is informative to plot both the input and the output of the Transfer Fen block versus time on the same graph. To do this,
I. Delete the arrow connecting the Scope block to the Transfer Fen block. Do this by clicking on the arrow line and then pmssing the Delete key.
2. Select and place the Mux block from the Signal Routing library, double-click on it, and set the Number of inputs to 2. Click OK.
3. Connect the top input port of the Mux block to the output port of the Transfer Fen block. Then use the same technique to connect the bottom input port of the Mux block to the arrow from the outport port of the Dead Zone block. Just remember to start with the input port. Simulink will sense the arrow automatically and make the
connection. Your model should now look like Figure 9.5-3.
4. Set the Stop time to 10, run the simulation as before, and bring up the Scope display. You should see what is shown in Figure 9.5-4. This plot shows the effect of the dead zone on the sine wave
You can bring the simulation results into the MATLAB workspace 1» Workspace block. For example, suppose we want to examine the effeets of the 0::aC.I by comparing the response of the system with and without a dead zone. e with the model shown in Figure 9.5-5. To create this model,
1. Copy the Transfer Fcn block by right-clicking on it, holding down the and dragging the block copy to a new location. Th -n release the hutto Mux block in the same va ‘.
2. Double-click on the first Mux block and change the number of its inputs to 3.
3. In the usual way, select and place the To Workspace block from the Sinks library and the Clock box from the Sources library. Double-click on the To Workspace block. You can specify any variable name you want as the output; the default is simout. Change its name to y. The output variable y will have as many rows as there are
simulation time steps, and as many columns as there are,inputs to the block. The fourth column in our simulation will be time, because of the way we have connected the Clock to the second Mux. Specify the Save format as Matrix. Use the default values for the other parameters (these should be inf, 1,and -1 for Maximum
number of rows, Decimation, and Sample time, respectively). Click on OK.
4. Connect the blocks as shown, and run the simulation.
5. You can use the MATLAB plotting commands from the Command window to plot the columns of y; for example, to plot the response of the two systems and the output of the Dead Zone block versus time, type
»plot (y (:,4) .v (:·,1) .y (:,4) ,y (:,2) ,y (:,4) .v (:,3) )