You are on page 1of 14

Department of Mechanical & Aerospace Engineering

System Dynamics Lab–MECH 450


Spring 2024

Experiment 1: Mechanical System


(DC Motor)
Lab Assignment # 3:
Controlling DC Motor Speed

Section:

Students’ Names IDs Grade


Mahaba Ateneiji 201700430
Shahad Albedwawi 201904439
Sara Alblooshi 201808014
Mouza Alameri 201804597

Submitted to:
Eng. Rihab K. Hamza

Date of Submission: 29/2/2024


MECH 450 Laboratory Assignment 3 2/3

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;

In this lab, proportional P controller will be designed, simulated by Simulink, and


implemented in LabVIEW to control the speed of the DC motor system to satisfy the
following control system requirements; rise time tr  7s, settling time ts  10s, overshoot
PO%  3%, steady state error ess  5%.

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.

PID controllers are used in various applications such as:


1. Temperature control in industrial processes like chemical reactors, furnaces, and ovens.
2. Speed control of motors in robotics and automation systems.
3. Position control in servo systems for robotics and CNC machines.
4. Flow control in pipelines and water treatment plants.
5. Pressure control in pneumatic and hydraulic systems.
6. Level control in tanks and vessels in chemical and food industries.

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.

Prepared by Eng. Rihab Hamza Spring 2024


MECH 450 Laboratory Assignment 3 3/3

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.

3. Percent Overshoot (PO): The maximum percentage by which the system's


response exceeds the desired steady-state value during its transient response,
indicating the level of oscillation or overshoot.

4. Steady-State Error (ESS): The difference between the desired steady-state


value and the actual output value of the system once it has reached a stable
condition, providing insight into the system's accuracy and ability to track the
desired reference signal.

In this task the Ts≤10s, Tr ≤ 7s , PO≤3% and ess≤5%

Prepared by Eng. Rihab Hamza Spring 2024


MECH 450 Laboratory Assignment 3 4/3

3) Complete the Block Diagram below representing the DC motor speed


control.[10%]

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

Prepared by Eng. Rihab Hamza Spring 2024


MECH 450 Laboratory Assignment 3 5/3

𝜔𝑚 𝐾𝑝 𝐺(𝑠) 𝐾𝑝 𝐾𝑜 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%]

Figure 1Simulink to control the Ideal speed for the motor

Figure 2 scope gaph for ideal and kp=0.520

Prepared by Eng. Rihab Hamza Spring 2024


MECH 450 Laboratory Assignment 3 6/3

Figure 3 block diagram with saturation(limits)

Figure 4 scope graph with saturation.

Figure 5 t-s gaph with Kp=2.2

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).

5. Scope Block: Used to visualize the system's response over time.

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

Prepared by Eng. Rihab Hamza Spring 2024


MECH 450 Laboratory Assignment 3 8/3

7) Gives full details of how the controller is implemented in LabVIEW.[10%]

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.

Prepared by Eng. Rihab Hamza Spring 2024


MECH 450 Laboratory Assignment 3 9/3

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.

For trial 1, Kp= 0.52

Desired Measured speed


speed

200−187.2
Steady state error: = ∗ 100 = 7.81 % (should be less than 5%)
200−100

t(0.9)= (0.9*(187.2-92)+92= 177.662 deg/sec , t = 24.517 s

t(0.1)= 0.1(187.2-92)+92= 101.52 deg/sec . t= 22.62 s

Raise time: 𝑇𝑟 = 𝑡0.9 − 𝑡0.1 = 24.517 – 22.62 = 1.897 s

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)

Overshoot %: 𝑂𝑆% = 0 𝑠𝑖𝑛𝑐𝑒 𝑖𝑡 𝑖𝑠 𝑓𝑖𝑟𝑠𝑡 𝑜𝑟𝑑𝑒𝑟 𝑠𝑦𝑠𝑡𝑒𝑚

Prepared by Eng. Rihab Hamza Spring 2024


MECH 450 Laboratory Assignment 3 10
/3

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.

For trial 2, Kp= 3

Desired Measured speed


speed

200−196.96
Steady state error: = ∗ 100 = 3.04%
200−100

𝑡0.9 = 0.9*(195.7-98.2)+98.2= 185.95 deg/sec , t = 18.8 s

𝑡0.1= 0.1∗(195.7−98.2)+98.2= 107.95 deg/sec ,t = 16.9 s

Raise time: 𝑇𝑟 = 𝑡0.9 − 𝑡0.1 = 18.8-16.9 = 1.9 s

Settling time: 𝑇𝑠 = 𝑡0.98 = 22.35 - 16.75 = 5.6 s

Overshoot %: 𝑂𝑆% = 0 𝑠𝑖𝑛𝑐𝑒 𝑖𝑡 𝑖𝑠 𝑓𝑖𝑟𝑠𝑡 𝑜𝑟𝑑𝑒𝑟 𝑠𝑦𝑠𝑡𝑒𝑚.

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.

Prepared by Eng. Rihab Hamza Spring 2024


MECH 450 Laboratory Assignment 3 11
/3

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%]

min to max : Kp=3 , step input (60-240)v

(0.39,161.01) (178.9,11.3)

(4.3,17.84)

(175.3,1.01)

Calculate for min to max : (steady state value = 178.9)


1) 𝑅𝑖𝑠𝑒 𝑇𝑖𝑚𝑒 = 0.1 × 178.9 = 17.89 , 𝑎𝑡 𝑥 = 0.39𝑠
0.9 × 178.9 = 160.01 , 𝑎𝑡 𝑥 = 4.3𝑠
𝑇𝑟 = 4.3 − 0.39 = 3.97𝑠 < 7𝑠 𝑤ℎ𝑖𝑐ℎ 𝑠𝑎𝑡𝑖𝑠𝑓𝑦 𝑜𝑢𝑟 𝑟𝑒𝑞𝑢𝑒𝑖𝑟𝑒𝑚𝑒𝑛𝑡
2) 𝑆𝑒𝑡𝑡𝑙𝑖𝑛𝑔 𝑇𝑖𝑚𝑒 = 0.98 × 178.9 = 175.322, 𝑎𝑡 𝑥 = 1.101
𝑠𝑝𝑒𝑒𝑑 𝑚𝑒𝑎𝑠𝑢𝑟𝑒𝑑−𝑠𝑝𝑒𝑒𝑑 𝑑𝑒𝑠𝑖𝑟𝑒𝑑 180−178.9
3) 𝑒𝑠𝑠% = × 100% = × 100% = 0.0061%
𝑠𝑝𝑒𝑒𝑑 𝐷𝑒𝑠𝑖𝑟𝑒𝑑 𝑑𝑖𝑓𝑓 240−60
4) 𝑂𝑆% = 0 , 𝑤𝑒 𝑑𝑜𝑛′ 𝑡 ℎ𝑎𝑣𝑒 𝑜𝑣𝑒𝑟𝑠ℎ𝑜𝑜𝑡.

Prepared by Eng. Rihab Hamza Spring 2024


MECH 450 Laboratory Assignment 3 12
/3

Max to min : Kp=3 . step input (60-240)v

Calculate for min to max : (steady state value = 178.4)


1) 𝑅𝑖𝑠𝑒 𝑇𝑖𝑚𝑒 = 0.9 × 178.4 = , 𝑎𝑡 𝑥 = 10𝑠
0.1 × 178.4 = 17.84 , 𝑎𝑡 𝑥 = 0.509𝑠
𝑇𝑟 = 10 − 0.509 = 9.4 > 7𝑠 𝑤ℎ𝑖𝑐ℎ 𝑖𝑠 𝑛𝑜𝑡 𝑠𝑎𝑡𝑖𝑠𝑓𝑦 𝑜𝑢𝑟 𝑟𝑒𝑞𝑢𝑒𝑖𝑟𝑒𝑚𝑒𝑛𝑡
2) 𝑆𝑒𝑡𝑡𝑙𝑖𝑛𝑔 𝑇𝑖𝑚𝑒 = 0.98 × 178.4 = 174.832 , 𝑎𝑡 𝑥 = 15.007
𝑠𝑝𝑒𝑒𝑑 𝑚𝑒𝑎𝑠𝑢𝑟𝑒𝑑−𝑠𝑝𝑒𝑒𝑑 𝑑𝑒𝑠𝑖𝑟𝑒𝑑 180−178.4
3) 𝑒𝑠𝑠% = × 100% = × 100% = 1.99%
𝑠𝑝𝑒𝑒𝑑 𝐷𝑒𝑠𝑖𝑟𝑒𝑑 𝑑𝑖𝑓𝑓 180

4) 𝑂𝑆% = 0 , 𝑤𝑒 𝑑𝑜𝑛 𝑡 ℎ𝑎𝑣𝑒 𝑜𝑣𝑒𝑟𝑠ℎ𝑜𝑜𝑡.

Prepared by Eng. Rihab Hamza Spring 2024


MECH 450 Laboratory Assignment 3 13
/3

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.

Prepared by Eng. Rihab Hamza Spring 2024


MECH 450 Laboratory Assignment 3 14
/3
Reference
https://www.omega.co.uk/prodinfo/pid-
controllers.html#:~:text=A%20PID%20controller%20is%20an,most%20accurate%20and%
20stable%20controller.

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/

Prepared by Eng. Rihab Hamza Spring 2024

You might also like