LAB 1 Arduino
LAB 1 Arduino
Marking Scheme
No 1 2 3 4 5 6 7 8 Total
Contents
1.0 INTRODUCTION.............................................................................................................................. 2
1.1 Objectives........................................................................................................................................ 2
1.2 Apparatus ....................................................................................................................................... 3
2.0 THEORY ............................................................................................................................................ 4
3.0 EXPERIMENTAL PROCEDURES ................................................................................................ 6
4.0 DISCUSSION ..................................................................................................................................... 9
5.0 CONCLUSIONS ................................................................................................................................ 9
6.0 REFERENCES ................................................................................................................................. 10
Page | 1
1.0 INTRODUCTION
Systems that utilize feedback are called closed-loop control systems. The feedback is used
to make decisions about changes to the control signal that drives the plant. There are variety of
control systems, including those driving elevators, thermostats, and cruise control. Closed-
loop control systems typically operate at a fixed frequency. The frequency of changes to the
drive signal is usually the same as the sampling rate, and certainly not any faster.
Closed-loop systems are designed to automatically achieve and maintain the desired output
condition by comparing it with the actual condition. It does this by generating an error signal
which is the difference between the output and the reference input. In other words, a “closed-
loop system” is a fully automatic control system in which its control action being dependent
on the output in some way.
Closed-loop systems have many advantages over open-loop systems. The primary advantage
of a closed-loop feedback control system is its ability to reduce a system’s sensitivity to
external disturbances, for example opening of the dryer door, giving the system a more robust
control as any changes in the feedback signal will result in compensation by the controller.
1.1 Objectives
The objective of this experiment as followed:
a) To develop mathematical models and principles of control system for the Angular Position
Control System
b) To propose appropriate solutions and analyze the performance of the PID controller of the
system
Page | 2
1.2 Apparatus
The apparatus is including PC and Control System box:
Controller
(Arduino UNO)
Page | 3
2.0 THEORY
Closed-loop control is a type of control that adjusts the control input U(s) by the feedback of the
output Y(s), as shown in figure above. The closed-loop control is generally used to control the
position, speed, current, or flux in the motor drive systems.
Proportional–integral controller
A widely used controller in motor drive systems is the proportional–integral controller (PI
controller), which is a combination of a proportional controller and an integral controller to
achieve both a fast response and a zero steady-state error. The block diagram of a proportional–
integral controller is shown in Figure.
Figure 3: PI controller
Page | 4
Pulse Width Output,
Desired Angle
+ Controller Actual Angle
Modulation DC Motor
- (Arduino)
(PWM)
Page | 5
3.0 EXPERIMENTAL PROCEDURES
1. First, all the wiring connection of the control system was verified.
2. The PID coding was inserted into Arduino software to compile and upload. And the set
point was determined to 256º.
Figure 7: Coding
6. Step 2 until 5 were repeated and the KD, KP and Ki value were changed to obtain the best
system performance.
Page | 6
RESULTS
1) KP = 0.1
KI = 0.000
KD = 0.0000
Figure 9: Result
2) KP = 0.8
KI = 0.000
KD = 0.0010
Page | 7
3) KP = 0.8
KI = 0.200
KD = 0.020
4) KP = 0.5
KI = 0.001
KD = 0.0100
Page | 8
Shaikhan Nadzemi B Md Zani (2017665818)
DISCUSSION
From the graph that had been obtained from serial plotter of Arduino IDE software, the
graph had different ripple and overshoot at the beginning as the system starts to run. After that
the system stabilizes and achieve the desired step point that had been determined earlier. The
experiment were repeated by changing different set of KD, KP and Ki. Before we changed the
value for each K, we know that in order to decrease or increase the rise time, the value of KP
need to be changed. To gain or reduce the overshoot and setting time, the value of need to be
adjusted. And the last one, Ki need to be adjusted to increase or eliminate the ess.
The first results, we determined that the value of KP to 0.1 and KP and Ki to 0.000. As
results, the graph shows no ripples and no overshoot occurs. However the error still cannot be
eliminated as the red line do not touch zero axis. But yet the systems seems to stabilize with
this set of data. The other 3 graph, we tried to maintain some value and adjusted the other
value, but yet the overshoot and ripple in the graph seems to happen obviously. But the system
faces zero error. The red line touch the zero axis. We had decided to choose the first graph to
be our best results with no overshoot and no ripples. Thus showing the systems stability at the
beginning when it was run.
Some problems occur during the experiment, where the serial plotter does not appear in the
monitor due to the Arduino connection board cable does not connected properly.
CONCLUSIONS
As for conclusion, the objective of the experiment were well achieved and successfully
done. We able to understand how the closed loop system operated with the help of angle
sensor as encoder. Also, we are able to transform the theoretical knowledge learned in classes
into practical during the experiment session.
Page | 9
REFERENCES
[2] Electronic Tutorials, "Electronic Tutorials," April 2018. [Online]. Available: https://www.electronics-
tutorials.ws/systems/closed-loop-system.html.
Page | 10