Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

ECE 411 – Computer Lab 2

Sekar Prasetya
09/21/23

Introduction
The purpose of the lab exercise is to take data and measurements from a closed-loop
control system simulation and understand the data that is produced to find values important to
model a closed-loop system. Once this lab is completed one should be able to analyze data and
compare it to theoretically predicted responses, and use the data to extract a simple open-loop
plant model. This lab will be using MATLAB and the Simulink application to run these
simulations.

Results and Discussion


1. The Motor Gear System Closed-Loop Control Model: This section was opening and
understanding the different clocks of the motor gear system given to us.
2. Running the Closed-Loop Simulation Model:
Figures 1 and 2 are the closed-loop control system and the scope output of the position of the
gear which should be the same results compared to the lab manual.

Figure 1: Simulink Closed-Loop Control System


Figure 2: Closed-Loop Commanded (Yellow) and Actual (Blue) Position

Figure 3: Closed-Loop Velocity


Figure 4: Closed-Loop Voltage

Figure 5: Closed-Loop Control

From the data above we can inspect it and calculate the percent overshoot, time between
successive overshoots, and frequency of the signal. Figures 3,4, and 5 show the scope block of
the velocity, voltage, and the control signal. These signals factor into the position signal, which is
the blue signal, that is seen in Figure 2.
Figure 6:Peak for percent overshoot

Figure 7: Peaks and time of those peaks for calculating time between overshoots
Figure 8: Calculations to find the percent overshoot and frequency of the signal

With the calculations done above the percent overshoot is 66.9%, the time between the
overshoots was calculated taking the time from the second overshoot peak and subtracting it
from the first overshoot peak. Those time values can be seen in figure 7. From the time in
between the successive overshoots, the frequency can be found since the f = 1/T (the time
period). The frequency was found to be 1.48 Hz which is equivalent to 9.3037 rad/s.

3. Taking Data, Analysis, and Identifying the Open-Loop Plant:


Figure 9: Calculations to find ζ, ωn,, Kmot, G(s), and M(s)

To find ζ, we use the equation given in class and in the lab manual and we utilize the percent
overshoot that we calculated in the previous part to calculate the value. Figure 9 shows that
calculation and also the calculation for the natural frequency. In a similar method, from ζ and ωd
we can calculate the natural frequency. With all of those calculated values, we can find the values
of Kmot and a to find the transfer function G(s) and the closed-loop transfer function M(s) which
can be seen in the figure above.
4. Testing New Transfer Function Model for the Motor Gear System:

Figure 10: Motor Gear System with calculated values

Figure 11: Scope block output from closed-loop simulation of motor gear drive system
Figure 12: Scope block output when closed-loop simulation proportional gain equals 1

The output when the proportional gain acts similarly to the simple transfer function model since
the signal oscillates more when the proportional gain increases. There is a clear difference when
the proportional gain is 0.05 in Figure 2 compared to the signal in Figure 12.

Figure 13: Scope block output when closed-loop simulation integral gain equals 0.05
Figure 14: Scope block output when closed-loop simulation integral gain equals 1

When the integral gain is less than zero, there does not seem to be a difference which is a similar
result to the simple transfer function model. When the integral gain is increased to 1 then the
signal is unrecognizable. Overall the changes in the different proportional gain and the integral
gain show similar changes to a simple transfer function model.

Figure 15: Scope block output when closed-loop simulation derivative gain equals 0.05
Figure 16: Scope block output when closed-loop simulation derivative gain equals 1

From Figure 15 and Figure 16, the derivative gain seems to change the damping of the signal or
in general how close it is to the original step signal. In the simple transfer function model, the
derivative gain made the signal closer to the input step signal. When the derivative gain was
adjusted to 1, it also achieved a more step wave but with more oscillation and inaccuracy near
the start of the steps. However, in the closed-loop simulation the derivative gain seems to change
the signal more than that and truly adds that derivative element to the signal which might be the
closed-loop part to account for the error signal.

Figure 17: Scope block output of closed-loop model when all simulation gains equals 1
Figure 18: Scope block output when PID all set to 0.05 from the simple transfer function

The signals in Figure 17 and Figure 18 show the difference of the simple transfer function and
the closed-loop transfer function. Because of the previous figures, it can be deduced this is
because of the derivative gain since that part of the PID acts differently between the simple
transfer function and the closed-loop transfer function. This is assumed because of the feedback
nature of the closed-loop transfer function so there is more of an effect on the error signal.

Conclusion
This laboratory exercise provided me with ideas on how closed-loop control works and a
more in-depth understanding of the closed-loop transfer function and second order control
systems. It was interesting to see how different parameters changed the response of the system
and the similarities and differences of the simple transfer function model compared to the
closed-loop system. They both seem to be very similar except for when it came to the derivative
gain and that might be because of how the signals were looped, but I look forward to exploring
more of that aspect more to understand why there is a significant difference in the derivative
gain.

You might also like