Documente Academic
Documente Profesional
Documente Cultură
4, April 2017
(shown in Fig. 1). Each servomotor has the ability to measure movement.
the number of turns corresponding to the wheel encoder. The
LegoFeup also has an infrared light sensor, which is mounted Turn left Turn right
at the front of the car and points directly to the ground. The
infrared light sensor can detect nothing but the mat (floor,
ground or tabletop). In this system, the light value getting Black White
28 37 46
through the infrared light sensor is called as Light.
Fig. 3. Light sensor reading.
1 de(t )
e(t )dt T
t
C B u (t ) K P [e(t ) d ] (1)
Ti 0 dt
The goal is to get the mobile robot to follow the left edge of k
the black line. The infrared light sensor is used to collect u(k ) K P e(k ) K I e(i) K D [e(k ) e(k 1)] (2)
i 0
information about the robot’s surrounding, and then the
mobile robot can changes its behavior based on the
KP T T
information. Since the mobile robot follows the line's edge, it KI , KD KP d (3)
can be judged which side the mobile robot is off the edge. The Ti T
infrared light sensor "sees white", which means the mobile
robot locates in the left of the line's edge. When the infrared where K P , K I , K D are the P, I, and D parameter respectively.
light sensor can "sees black", the mobile robot locates in the Implementation of equation (2) on a digital computer is
right of the line's edge. This is called as a "left hand line relatively easy and the calculations are normally done using
tracker" since the robot tracks the line's left edge. In the floating point arithmetic for high accuracy.
experimental environment, the calibrated infrared light sensor In general, P parameter is dependent on the present error,
gives a "white" reading of 46 and a "black" reading of 28 (on i.e. e(t). I parameter accumulates all past errors and gives the
a 0 to 100 scale, shown in Fig. 3). Drawing the values on a accumulated offset which should have been corrected
simple number line can help students visualize how to convert previously. In this experiment, I parameter performs the
light sensor values into changes of the mobile robot’s integration of the mobile robot’s past level of experience and
310
International Journal of Information and Education Technology, Vol. 7, No. 4, April 2017
eliminates the residual steady-state error that occurs with a example, K P 1 (or 0.1) and see what happens.
pure proportional controller. D parameter predicts future 2) If the robot can't track the line and wanders off the line,
errors based on the current rate of change. In this experiment, then K P is increased. If the robot oscillates wildly, then
it predicts the mobile robot’s behavior and thus improves the
K P is decreased. K P is kept changing until one value is
settling time and stability of the PID controller. In other words,
the derivative parameter can look into the future by assuming found to make the mobile robot tracking the line and
that the next change in the error is the same as the last change. giving noticeable oscillation but not really wild ones. The
The weighted sum of three items is used to adjust a process to K P is called as the ultimate gain, Ku , which is needed.
achieve a desired target. Meanwhile, the oscillation period Pu is determined at
Of course, it is not always necessary to use all the the moment.
parameters in a PID controller to manipulate a system. It is 3) A set of K P , K I and K D values can be calculated by
possible to set some of the parameters to zero then the using Table 1. And then the best performance of the line
controller will be called PI,PD,P or just I controller since one
tracking can be gotten by tuning the K P , K I , K D values
or more control actions are not involved [9].
Finally, the actual power levels applied to both motors are all the time.
made up of the static power assigned by users and the 4) K P , K I and K D values should be re-tuned and the
dynamic transferred power. process of tuning should be kept repeating until the
mobile robot's behavior is acceptable.
P(k ) Pz u (k ) (4) In the experiment, Ku was 0.8 and Pu was 0.6.
According to Table I, K P 0.48, K I 1.6, K D 0.036
where P(k ) is the actual power level of both motors, PZ is respectively. After adjusting, K P 0.5, K I 2, K D 0.05 . In
the static power which keep the robot doing straight ahead. this case, the mobile robot moved smoothly along the line and
When the mobile robot doesn’t go straight ahead, u(k) is used kept away the external disturbance. The Simulink diagram
to change the power levels of the two motors. One motor will and the corresponding flow chart of PID controller were
get a power level of P(k ) PZ u (k ) , the other motor will shown in Fig. 5 and Fig. 6. Some particular trajectories were
get a power level of P(k ) PZ u (k ) . Since u(k) can be designed during the experiment (shown in Fig. 7). The
performance of PID controller had been validated at those
either positive or negative, P(k ) turns B and C motors in
designed trajectories. It turns out that measurement of a series
opposite directions. It turns out that P(k) will automatically of parameters for the system in the experiment allows students
set the correct motor as the fast motor and the other one as the to calculate "pretty good" values for K P , K I and K D .
slow motor.
In the Simulink diagram design, students can observe
several classical facts.
IV. EVALUATION AND RESULTS As the system type is Light with respect to the reference
input, a simple proportional control can be realized perfectly
In this section, the PID controller is designed by using the steady tracking.
MATLAB/SIMULINK, in which three parameters 1) As the system type is Light with respect to the reference
( K P , K I , K D ) can be adjusted to see the effect on the robot’s input, a simple proportional control can be realized
movement. Before PID controller implementing, three key perfectly steady tracking.
coefficients should be set appropriately. There are several 2) Large K P improves the steady-state performance, i.e., a
ways to tune the parameters, one of them is the reduction of the steady-state error. However, too large
“Ziegler-Nichols Method” [10] (shown in TABLE I). It is K P makes the closed-loop system become unstable.
important that control engineering students are familiar with
3) Non-zero K I produces a perfect steady-state tracking,
the theory [11] and application of the highly popular PID
tuning method [12]. that is, without steady-state error. However, too large K I
also makes the closed-loop system become unstable.
TABLE I: ZIEGLER-NICHOLS TUNING RULES
4) K D plays a little role in improving tracking performance,
Control type KP KI KD
but allows for the use of a larger P parameter before the
P 0.5Ku 0 0
system becomes unstable. So K D may make the tracking
PI 0.4Ku 1.2Kp/Pu 0
system be sensitive to the curve shape.
PID 0.6Ku 2Kp/Pu 0.125KpPu
Since October 2014, the authors have been engaged in the
experiment of mobile robots education at the School of
The ultimate gain, Ku , is recorded together with the Electrical and Information Engineering, Jiangsu University.
corresponding period of oscillation Pu , known as the The experiment described in this paper can be easily adapted
oscillation period. and used in the courses of other control systems. Therefore,
The PID parameters’ tuning procedure is as follows [13]: this paper can be used as a guide to complete a teaching
1) K I and K D are set as zero, which means that the PID experiment involving the concept of PID control. The goal is
controller is simplified as a proportional controller. to improve undergraduate teaching and help students put
The K P parameter is set as a “reasonable” value. For theories into practice [14].
311
International Journal of Information and Education Technology, Vol. 7, No. 4, April 2017
P(k)>100?
Theoretical Practical
Output the Module Module
Output 100
power
1st 2rd 3th
Fig. 6. Flow chart of line tracking. Lesson Lesson Lesson
3Hours 3Hours 3Hours
312
International Journal of Information and Education Technology, Vol. 7, No. 4, April 2017
313