Old Lab 1 Model Validation
Last updated
Was this helpful?
Last updated
Was this helpful?
In this experiment, you will adjust the model parameters you found in the previous experiments to tune the transfer function. Our goal is to match the simulated system response with the parameters you found as closely as possible to the response of the actual system. To create a step input:
Double-click on the Signal Generator block and ensure the following parameters are set: • Wave form: square • Amplitude: 1.0 • Frequency: 0.4 • Units: Hertz
Set the Amplitude (V)
slider gain to 1.0 V.
Set the Offset (V)
block to 1.5 V.
Set the Simulation stop time to 5 seconds.
Open the load shaft speed scope, Speed (rad/s)
, and the motor input voltage scope, V_m (V)
.
To build the model, click the down arrow on Monitor & Tune under the Hardware tab and then click Build for monitoring . This generates the controller code.
Click Connect button under Monitor & Tune and then run SIMULINK by clicking Start .
The gears on the Rotary Servo Base Unit should be rotating in the same direction and alternating between low and high speeds and the scopes should be as shown in Figure 15 a) and b). Recall that the yellow trace is the measured load shaft rate and the purple trace is the simulated trace. By default, the steady-state gain and the time constant of the transfer function used in simulation are set to: K = 1 rad/s/V and = 0.1s. These model parameters do not accurately represent the system.
Save wl data and name it as modeling_section#_Group#_K1tau01.
Enter the command K = 1.25 in the MATLAB Command Window.
Update the parameters used by the Transfer Function block in the simulation by updating diagram in the q_servo_modeling SIMULINK diagram. To update the diagram, from the Modeling tab, click Update Model. Alternatively, press Ctrl+D. Connect and run the SIMULINK model and observe how the simulation response changes. Remember we have increased K from 1 to 1.25.
Save wl data and name it as modeling_section#_Group#_K125tau01.
Enter the command tau = 0.2
in the MATLAB Command Window.
Update the simulation again by updating diagram. Connect and run the SIMULINK model and observe how the simulation response changes. Remember we have increased from 0.1 to 0.2.
Save wl data and name it as modeling_section#_Group#_K125tau02.
Calculate the nominal values, and , using Eqs. 2.1, 2.26, 2.27, 2.28 and the specifications provided in Table A.1 and Table A.2 for the high-gear configuration. Note: Eq. 2.26 must be converted to the Laplace domain to obtain the transfer function, which should be simplified to resemble Eq. 2.1. This would yield the formulae to determine and . You may also refer to the lecture slides.
Enter the nominal values, and , that were found in Step 16 in the MATALB Command Window. Update the parameters and examine how well the simulated response matches the measured one.
Save wl data and name it as modeling_section#_Group#_K#tau#.
If the calculations of the nominal values were done properly, then the model should represent the actual system quite well. However, there are always some differences between each servo unit and, as a result, the model can always be tuned to match the system better. Try varying the model parameters (different and values) until the simulated trace matches the measured response better. Enter these tuned values under the Model Validation section of Table B.2.
If the model parameters are changed, save the data for the final set of tuned parameters.
Note: Tuning the model parameters can be done by manually changing the Servo Model Transfer Function block parameters OR by changing the K
and tau
parameters in the MATLAB Command Window and going to Simulation | Update Diagram in the SIMULINK model.