Professional Documents
Culture Documents
MECH 450 Lab Assignment 3 - Controlling DC Motor Speed1 Last Draft
MECH 450 Lab Assignment 3 - Controlling DC Motor Speed1 Last Draft
Section:
Submitted to:
Eng. Rihab K. Hamza
In the previous lab assignment, the open loop transfer function that relates the input
voltage to DC motor to the output motor speed, measured by the tachometer, is
identified as a first order transfer function;
1) Define PID controller? Give some examples where its used. [5%]
A PID controller is a type of control loop feedback mechanism widely used in industrial control
systems to regulate processes. PID stands for Proportional, Integral, and Derivative, which are the
three terms used to compute the control output.
- *Proportional (P)* term responds to the current error, i.e., the difference between the desired
setpoint and the measured process variable.
- *Integral (I)* term deals with the accumulation of past errors over time, which helps eliminate
any steady-state error that exists.
- *Derivative (D)* term predicts future errors based on the rate of change of the error, which helps
in damping the system's response and improving stability.
These are just a few examples, but PID controllers are incredibly versatile and find application in a
wide range of industries and systems wherever precise control of processes is required.
2) Defining and stating the four control system requirements that correctly
represent the system in reality. [5%]
In control systems, four key performance metrics that accurately represent the
system in reality are:
1. Settling Time (Ts): The time required for the system's response to settle within
a specified tolerance band around the desired steady-state value after a step
input.
2. Rise Time (tr): The time taken for the system's response to rise from a
specified lower threshold to a specified upper threshold for the first time after
a step input, indicating the speed of response.
4) Find the feedback close-loop system transfer function T(s) stating the input and
the output. Include the closed loop block diagram. [10%]
𝐾𝑡 𝜔𝑜 36.52
𝐺 (𝑠) = = =
𝜏𝑠 + 1 𝑉𝑖𝑛 3.86𝑠 + 1
36.52
P 3.86𝑠 + 1
𝜔𝑚 𝐾𝑝 𝐺(𝑠) 𝐾𝑝 𝐾𝑜 36.52𝐾𝑝
𝑇(𝑠) = = = =
𝜔𝑑 1 + 𝐾𝑃 𝐺(𝑠) 1 + 𝜏𝑠 + 𝐾𝑃 𝐾𝑂 1 + 3.86𝑠 + 36.52𝐾𝑃
5) Design P-controller gain Kp to control the DC motor speed that will result in a
steady state error of 5% for a unit step. (show all steps) [10%]
1
𝑒(∞) = lim 𝑠𝐸(𝑠) = lim 𝑠(𝜔𝑑 − 𝜔𝑚 ) = lim 𝑠𝜔𝑑 (1 − 𝑇(𝑠)), 𝜔𝑑 =
𝑠→0 𝑠→0 𝑠→0 𝑠
36.52𝐾𝑝 1
𝑒(∞) = lim 𝑠𝜔𝑑 (1 − )=
𝑠→0 1 + 3.86𝑠 + 36.52𝐾𝑃 1 + 36.52𝐾𝑃
1
0.05 = → 𝐾𝑃 = 0.5203
1 + 36.52𝐾𝑃
6) Explain the blocks used to Simulate the system with the controller gain found above
using Simulink in MATLAB, and verify the response is it satisfying the required
specifications? (show your calculation on the plot). Explain what must do If the
required specification is not achieved? Now state the best P controller found. (show the
plot with the calculation). [10%]
To simulate the system using Simulink in MATLAB with a proportional (P) controller, we'll
typically use the following blocks:
1. Step Input Block: This block generates a step input signal representing a change in the desired
setpoint.
2. Plant Block: Represents the dynamic behavior of the system being controlled. This block
encapsulates the transfer function or state-space representation of the plant. A dead zon was
configured within the range of 3 to 10 in saturation limits were set from -10 to 10.
Prepared by Eng. Rihab Hamza Spring 2024
MECH 450 Laboratory Assignment 3 7/3
3. Controller Block: Implements the control algorithm. For a proportional controller, this block
simply multiplies the error signal (difference between the setpoint and the actual output) by the
controller gain (Kp). Initially, the proportional gain (Kp) was set at 0.520 However, it was observed
that the percentage error was considerably perfect with error less than 5% which is
1.1016e+0.1.figure 2 represent that .
4. Summing Junction Block: Computes the error signal by subtracting the output of the plant from
the reference input (step input).
After setting up the Simulink model, we can simulate the system and analyze the response. We'll
look at parameters like rise time, settling time, percent overshoot, and steady-state error to
determine if the system meets the required specifications.
If the required specifications are not achieved, we may need to adjust the controller gain (Kp)
iteratively to optimize the system's performance. This can involve techniques like manual tuning,
Ziegler-Nichols method, or using optimization algorithms.
In our cease will increase the Kp value to reach 0 precenting of steady-state error
By manual tuning so we reach to 2.2= Kp as showed in figure 5. Moreover, if the Kp is high the
solution to rectify this issue was to reduce the value of Kp
For this assignment, we'll utilize LabVIEW to monitor the system's real-world performance. It will display the
block diagram on the right side and the front panel on the left side. LabVIEW will act as the central controller,
integrating all the system components. We'll provide detailed explanations of the closed-loop system and how
LabVIEW orchestrates the controller's implementation. To begin, we launch the LabVIEW software. On the front
panel, we've included a numeric control to set the target speed (V) and a numeric indicator to show the recorded
speed (deg/s). This setup enables us to monitor both the desired and actual speeds concurrently on the block
diagram.
Next, we incorporate a Data Acquisition (DAQ) assistant to manage the feedback signals from the tachometer. We
set it up to collect analog voltage signals from channel a0 and configure the acquisition mode for continuous
sampling, reading one sample at a frequency of 10 Hz. Additionally, we've calibrated the tachometer value to be
29.559, which is essential for achieving accurate speed measurements. As a result, we utilize a numeric multiplier
to analyze the signal from the DAQ assistant, multiplying it by the tachometer gain of 29.559. This action yields
the measured speed, which is subsequently exhibited on a numeric indicator on the front panel.
Moreover, the system is managed by a sub-routine incorporating a PID controller with predefined PID gains. We
link the set-point to the desired speed and the process variable to the measured speed, establishing a closed-loop
system governed by the PID controller. The PID output is directed to a DC motor through DAQ, utilizing the
output range set for output high range 10 and output low range 3 for control. We configure the PID gains by setting
the proportional gain to 3, integral time to 0.0, and derivative time to 0.00.
Following that, we incorporate two DAQ assist outputs derived from the PID output to drive the motor. We specify
the channel type as analog voltage with channel number a0, configure the acquisition mode for a single sample,
and adjust the time settings to expedite the process as necessary. Additionally, we integrate a "write to
Measurement File" feature to log desired and measured speeds into an Excel sheet for computer-based data
logging.
8) Perform a simple step response to test the controlled system when implement the gain
found in the simulation. Show and discuss the first response by verify if the system
performance parameters (i.e. rise time, settling time, percentage overshoot, and steady
state error) are satisfying the requirements. If not, tune the controller gain to find the
best controller gain for the system. (Show your calculations at the graphs). [10%]
The system has been tested to ensure that the specifications are in line with the requirements. Since the
error rate should be less than 5 percent. in this experiment, the controller was initially configured with
𝑘𝑝 = 0.52. Following analysis of the performance parameters with a step response ranging from 100 V to
200 V, it was confirmed that the requirements were successfully met. However, in pursuit of enhanced
performance, we conducted experimental tests with alternative 𝑘𝑝 values. Eventually, we determined
that 𝑘𝑝 = 3 struck a favorable balance, delivering high performance.
200−187.2
Steady state error: = ∗ 100 = 7.81 % (should be less than 5%)
200−100
Settling time: 𝑇𝑠 = 𝑡0.98 = 28.82-22.4=6.42 sec (the obtained rise time satisfy our requirement condition because it should be less 10s)
The system's error rate has been determined to be slightly higher than five percent through
calculation. As per the specifications, the error rate should not exceed 5 percent. Hence, a 𝐾p value of
3 is deemed satisfactory for the design, and adjustments are unnecessary.
200−196.96
Steady state error: = ∗ 100 = 3.04%
200−100
It is evident that when kp = 0.52 is utilized, the error significantly rises by approximately 7.81%
compared to the desired level of 5%. Consequently, we have opted for Kp = 3, which aligns better
with the specifications and testing requirements across the entire range.
9) Now, use the best controller gain found to perform two tests for your controlled system
by performing step response from min. to max and from max. to min. For each test
result find the system performance parameters (i.e. rise time, settling time, percentage
overshoot, and steady state error) Show your calculations at the graphs. Discuss your
results by comparing the parameters with the stated design requirements. [20%]
(0.39,161.01) (178.9,11.3)
(4.3,17.84)
(175.3,1.01)
10) Does your system satisfy the desired specifications for the 2 cases? Is the proportional
is a good controller for your system? State what is your best Kp for your system.
Discuss the dry friction on the DC motor. [10%]
The findings above illustrate that identical gains may not yield consistent outcomes
across the same range, contingent upon the initial and final values. In this instance,
when a gain value of 3 is applied and a step input ranging from 60 to 240 volts (min to
max) is utilized, all criteria are satisfactorily met. However, intriguingly, this scenario
shifts when the signal is reversed. Transitioning from 240 to 60 volts (max to min) leads
to notable parameter alterations, surpassing acceptable thresholds. For instance, the rise
time (𝑇𝑟) is recorded at 9.4 seconds, exceeding the desired 7-second limit, and the
settling time (𝑇𝑠) is calculated at 15.007 seconds, surpassing the 10-second target.
Nevertheless, error and overshoot percentages remain within acceptable bounds. This
discrepancy could stem from experimental error, possibly due to the lack of a time gap
between the two tests, which may have influenced the subsequent experiment.
Additionally, on the same graph, this discrepancy might also imply an inappropriate
selection of Kp. As observed, increasing the gain elevates both settling and rise times.
Therefore, for such a system, the previous Kp value of 0.52 is deemed suitable based
on deductive reasoning, although no experimentation on its minimum and maximum
extents has been conducted.
https://uk.rs-online.com/web/content/discovery/ideas-and-advice/tachometers-guide
https://www.ni.com/en/shop/data-
acquisition.html#:~:text=Data%20acquisition%20(DAQ)%20is%20the,Learn%20more
https://control.com/technical-articles/an-overview-of-proportional-gain/