Fuzzy PID Control for CNC Machines
Fuzzy PID Control for CNC Machines
3, MARCH 2013
Abstract—The traditional PID control approach is often develops a universal nonlinear PID control model [10].
adopted in CNC machine tool position controller. The [Link] combines the traditional PID and self-adaption
approach is simple and easy to implement, but can’t achieve nonlinear control, and compensates the linear model warp
rapid adjustment and less overshoot at the same time. with nonlinear model [11]. Hu Ligang devises the
Consequently, on the basis of analyzing fuzzy control theory
and design method, the CNC machine tool fuzzy PID
nonline-differential tracker to receive corresponding
position control approach is developed in the paper. The integral and differential signals, and process the signals
approach makes full use of the advantages of fuzzy control properly to build up nonlinear PID controller [12]. For
and PID control. The experiment results show that in another thing, study PID control with intelligence
contrast to traditional PID position controller, the developed approach [13-15]. Ning Wang introduces the nonlinear
approach can achieve better rapidity, shorter adjust time PID control approach based on nerve cell network, which
and satisfied overshoot. It is much significant to high- achieves nonlinear control through nerve cell network
precision CNC machining. parameters online adjustment [16].
Fuzzy control is an intelligence approach, and its
Index Terms—fuzzy PID position control, membership
function, fuzzy control rule, adjust time, overshoot
process flow is as follows. Above all, sample information
with computer; Secondly, transform the information into
fuzzy controlled quantity after fuzzy process; Thirdly,
I. INTRODUCTION compare the fuzzification information with repository
data, and process approximately the fuzzy information
The traditional proportional integral differential (PID) with rule library; Finally, compute clear controlled
control approach is often adopted to compute controlled quantity according to fuzzy conclusion. The inner
quantity in the computer numerical control (CNC) information data are fuzzy quantity, so it is easy to make
machine tool position controller. The strongpoint of the use of human experience with natural language [17]. The
approach is simple and easy to implement [1-2]. However, fuzzy controller framework is shown in Fig.1.
with the increasing requirement of practical manufacture
speed, precision and stability, the traditional PID fuzzy controller
approach shows its disadvantage gradually. For example, input fuzzifi eliminate output
reasoning
the poor adaptability and anti-jamming ability, and the -cation machine
fuzzifi
weakness that can’t achieve rapid adjustment and less -cation
overshoot at the same time [3-5].
Aimed to the weakness of traditional PID approach,
the researchers all over the world study how to enhance rule library database
PID controller performance from two aspects mainly [6- repository
8]. For one thing, improve the classical PID control
arithmetic. [Link] combines nonline-differential tracker
Figure 1. The fuzzy controller framework
and traditional PID controller in series, and process
signals with two nonline-differential trackers in order to
In order to improve the traditional PID controller
improve anti-jamming ability [9]. Guo Yanqing analyzes
performance, the CNC machine tool fuzzy PID position
each PID portion change trend with step input, and
control approach is developed in the paper, on the basis
This project is supported by the National Natural Science of analyzing fuzzy control theory and design method. The
Foundation of China (No.51105236), and the Shandong Province
Promotive research fund for excellent young and middle-aged scientists
approach makes full use of the advantages of fuzzy
of China(No.BS2011ZZ014). control and PID control. In the end, the contrast
Corresponding author: Guoyong Zhao, zgy709@[Link] experiments are done to validate introduced fuzzy PID
position control approach.
II. THE FUZZY CONTROLLER FRAMEWORK DESIGN described with natural language and carried out with
computer [18]. The fuzzy control elementary principle is
Fuzzy control approach is an automatic control
shown in Fig.2.
technology, which is based upon experience summing-up,
Fuzzy controller
input output
fuzzifi fuzzy control fuzzy eliminate
-cation rule reasoning fuzzfication
actuating
sensor control object machanism
Ki
fuzzy controller 1/s
e Kp u(t)
r(t)
fuzzy controller control object
Kd
fuzzy controller du/dt
position feedback
They are clear numerical values, obtained by compute The language variable words amounts is important to
sampling. Define x component span as elementary field. system performance. If the language variable words is
The input signal x component turns to fuzzy quantity more, the input and output variables will be described
after mapping transformation, and sends to fuzzy more detailedly, and the fuzzy reasoning process turns
reasoning module. complicated; On the contrary, if the language variable
Suppose input component x elementary field be words is few, the input and output variables will be
X i = [− x, x]( x > 0) described more roughly and poorly. The language
variable words amounts are selected from five to seven
Suppose fuzzy field be
commonly. For example, the language variable including
N i = [− n, n](n > 0) seven words is:
Define the transformation coefficient ki from X to N be A = {NB, NM , NS , ZO, PS , PM , PB}
quantification factor Where each word is defined as follows
ki = n / x . (1) NB---negative big
When elementary field isn’t symmetrical, such as NM--- negative medium
NS--- negative small
X i = [a, b] ( a ≠ b ), the quantification factor be ZO---zero
ki ' = 2n / b − a . (2) PS--- positive small
PM--- positive medium
(2) Proportional factor PB--- positive big
The clear quantity fuzzy field isn’t consistent with The fuzzy field and language variable are connected
implement machine elementary field sometimes, so the through membership function. The triangle-shape
field transformation is required. Define the function, Gauss-shape function, Bell-shape function, Z-
transformation coefficient from fuzzy field to elementary shape function and S-shape membership function are in
field be proportional factor. common use. Except the field boundary, the membership
Suppose the fuzzy field be function is centrosymmetric. The sharp membership
N ' = [−n, n](n > 0) function curve leads to high distinguishability and
Suppose the elementary field be sensitivity; While the mild membership function curve
U = [−u, u ](u > 0) leads to low sensitivity.
Then the proportional factor ku can be obtained The triangle-shape membership function is adopted to
study fuzzification process in the paper. Suppose the
ku = u / n . (3) input variable fuzzy field after fuzzification process is
Except for field transformation, the quantification Ak ∈ [−6,−5,−4,−3,−2,−1,0,1,2,3,4,5,6] .
factor and proportional factor are important for system
control performance. Suppose the language variable muster is
If quantification factor of error e is on the high side, A = {NB, NM , NS , ZO, PS , PM , PB} .
the rise velocity will turn quick, the overshoot will The language variable value is shown in Fig.5. As
increase, which may lead to unsteadiness. On the contrary, shown in Fig.5, the field is divided into thirteen grades
if quantification factor of error e is on the low side, the corresponding to seven language variables.
rise velocity will turn slow, which may destroy system PB: about +6
steady-state precision. PM: about +4
If quantification factor of error change ec increases, the PS: about +2
restrain force to error change will augment, which will ZO: about 0
improve system stability; On the contrary, if NS: about -2
quantification factor of error change ec decreases, the NM: about -4
overshoot will increase, which will lead to system NB: about -6
instability. Seven words are adopted to describe error e, error
Proportional factor is corresponding to the total system change rate ec, three output coefficient k p , ki and k d .
magnify multiple. If proportional factor increases, the
system respond speed will turn quick; On the contrary, if And the field is
proportional factor decreases, the system transition time {NB, NM , NS , ZO, PS , PM , PB} .
will turn longer. Fuzzy subset NB and PB adopt Z-shape membership
function and S-shape membership function. Fuzzy subset
B. The Fuzzification of Input and Output Variables in
PM, PS, ZO, NS and NM adopt triangle-shape function.
Fuzzy Controller
The input variable membership function is shown in Fig.6,
Quantify the fuzzy controller input signal with output variable membership function is shown in Fig.7,
quantification factor, then do fuzzification process. In
and coefficient k p fuzzy control system is shown inFig.8.
essence, fuzzification process is to confirm the language
variable in the field for a certain x in field X.
μ
NB NM NS ZO PS PM PB
1.0
-6 -5 -4 -3 -2 -1 0 1 x
2 3 4 5 6
rate ec and parameter k d , the k d fuzzy control rule is (32) If (e is PS) and (ec is ZO) then ( k p is NS)( ki is
built up shown in Table 3. PS)( k d is ZO) (1)
TABLE 2
THE ki FUZZY CONTROL RULE (33) If (e is PS) and (ec is PS) then ( k p is NS)( ki is
ec PS)( k d is ZO) (1)
Ki
NB NM NS ZO PS PM PB
e
(39) If (e is PM) and (ec is ZO) then ( k p is NM)( ki is
NB NB NB NM NM NS ZO ZO PS)( k d is PS) (1)
NM NB NB NM NS NS ZO NS
(40) If (e is PM) and (ec is PS) then ( k p is NM)( ki is
NS NM NM NS NS ZO PS PS
ZO NM NM NS ZO PS PM PM PM)( k d is PS) (1)
PS NM NS ZO PS PS PM PM The relevant fuzzy contain connection are as follows:
PM ZO ZO PS PS PM PB PB R32 (k p ) = PS (e) ∧ ZO(ec) ∧ NS (k p )
PB ZO ZO PS PM PM PB PB
R32 (ki ) = PS (e) ∧ ZO (ec) ∧ PS (ki )
TABLE 3 R32 (k d ) = PS (e) ∧ ZO (ec) ∧ ZO (k d )
THE kd FUZZY CONTROL RULE
R33 (k p ) = PS (e) ∧ PS (ec) ∧ NS (k p )
ec
Kd
NB NM NS ZO PS PM PB R33 (ki ) = PS (e) ∧ PS (ec) ∧ PS (ki )
e R33 (k d ) = PS (e) ∧ PS (ec) ∧ ZO(k d )
NB PS NS NB NB NB NM PS
R39 (k p ) = PM (e) ∧ ZO (ec) ∧ NM (k p )
NM PS NS NB NM NM NS ZO
NS ZO NS NM NM NS NS ZO R39 (ki ) = PM (e) ∧ ZO (ec) ∧ PS (ki )
ZO ZO NS NS NS NS NS ZO
R39 (k d ) = PM (e) ∧ ZO (ec) ∧ PS (k d )
PS ZO ZO ZO ZO ZO ZO ZO
PM PB NS PS PS PS PS PB
R40 (k p ) = PM (e) ∧ PS (ec) ∧ NM (k p )
PB PB PM PM PM PS PS PB R40 (ki ) = PM (e) ∧ PS (ec) ∧ PM (ki )
R40 (k d ) = PM (e) ∧ PS (ec) ∧ PS (k d )
D. The Fuzzy Reasoning Process According to the above-mentioned fuzzy rules, the kp ,
The fuzzy approximate reasoning and synthesis
principle is ki and k d fuzzy reasoning output results can be
obtained as follows, which are shown in Fig.9, Fig.10 and
U * = ( A* )T o R . (4)
Fig.11 respectively.
Where fuzzy contain connection R consists of 49 (1) From Fig.6, it can be obtained:
fuzzy condition propositions: PS (e = 1.5) = 0.5
R = R1 U R2 U R3 ... U R49 ZO (ec = 0.75) = 0.25
49
. (5) Consequently, the fuzzy output is
= U Rj
j =1 U 32 (k p ) = ( A* )T o R32
It can be obtained with Mamdani reasoning arithmetic:
= ( PS (e = 1.5) ∧ ZO(ec = 0.75)) o R32 (k p )
U * = ( A* )T o R
= PS (e = 1.5) ∧ ZO(ec = 0.75) ∧ NS (k p ) . (7)
49
= ( A* )T o U R j . (6) = 0.5 ∧ 0.25 ∧ NS (k p )
j =1
= (0.25 NS )k p
49
(( A* )T o R j ) 49
=U = UU j
*
U 32 (ki ) = ( A* )T o R32
j =1 j =1
A. The Feeding Servosystem Structure position controller can achieve shorter adjust time and
The position servo control modes of CNC machine can satisfied overshoot.
be divided into open control, half-closed loop control and (2) If change the input unit step signal to 1.2(t) at t=5s,
closed loop control according to framework. The modes the traditional PID controller step response curve and the
in high precision CNC machine include half-closed loop developed fuzzy PID position controller step response
control and closed loop control mainly. curve are shown in Fig.14.
Three-loop cascade control scheme is adopted on From Fig.14 it can be seen, in contrast to the
modern CNC machine mostly, which consist of position traditional PID controller, the developed fuzzy PID
loop, velocity loop and current loop from outside to position controller has quicker transition process, better
inside. Every control loop has its own feedback signal rapidity and satisfied overshoot.
and connects each other. (3) If add a step disturbance signal at t=5s whose
The screw pair drives are adopted in CNC feeding amplitude is 0.2, the traditional PID controller step
system usually. Neglecting the influence of mechanically- response curve and the developed fuzzy PID position
driven nonlinear factors such as screw pairs, the controller step response curve are shown in Fig.15.
approximate structure model of closed loop feeding From Fig.15 it can be seen, in contrast to the
servosystem is shown in Fig.12. traditional PID controller, the developed fuzzy PID
position controller can spend lesser adjust time to come
instruction output
displacement back to steady-state.
signal speed
position control
controller D/A 1/S
unit
position
measurement
K ud = 0.7395 .
(1) Aimed to the unit step input signal, the traditional
PID controller step response curve and the developed
fuzzy PID position controller step response curve are
shown in Fig.13.
From Fig.13 it can be seen, in contrast to the
traditional PID controller, the rise time with the
developed fuzzy PID position controller increases from
0.33s to 0.40s; The adjust time decreases from 3.69s to
1.59s markedly; And the overshoot decreases from
59.35% to 5.1%. In conclusion, the developed fuzzy PID
Figure 15. The traditional PID controller step response curve and the [9] [Link], Dong Sun, [Link], “Design of an enhanced
developed fuzzy PID position controller step response curve with a step nonlinear PID controller,” Mechatronics, vol. 15, pp. 1005-
disturbance signal 1024, August 2005.
[10] GUO Yanqing, YAO Zhuting, WANG Nan, “The Study on
V. CONCLUSIONS Non-linear PID Controller,” Journal of North University of
China, vol. 27, pp. 423-425, July 2006.
The traditional PID control approach is often adopted [11] [Link], [Link], [Link], [Link], “Combined PID
to compute controlled quantity in the CNC machine tool and adaptive nonlinear control for servo mechanical
position controller. The approach is simple and easy to systems,” Mechatronics, vol.14, pp. 701-714, June 2004.
implement, but can’t achieve rapid adjustment and less [12] Hu Ligang, Xu Weiming, “Study and Design of PID
overshoot at the same time. Controller for Nonlinearity System,” Computer Simulation,
In order to improve the traditional PID controller vol. 27, pp. 195-199, May 2010.
performance, the CNC machine tool fuzzy PID position [13] Gao Wenhua, Su Hongzhi, “Fuzzy self-tuning PID control
control approach is developed in the paper, which makes of NC machine tool feed servo system,” Manufacturing
Automation, vol. 31, pp. 35-37, July 2009.
full use of the advantages of fuzzy control and PID
[14] Zhao Gang, Zhu Wei, “Application of fuzzy -PID control
control. The experiment results show that in contrast to technology in servo system design,” Manufacturing
traditional PID position controller, the developed Automation, vol. 31, pp. 180-181, March 2009.
approach can achieve better rapidity, shorter adjust time [15] Yi Jie, “Application research and design of fuzzy self-
and satisfied overshoot. adjusting controller of PID parameter,” Manufacturing
Automation, vol. 31, pp. 141-143, July 2009.
ACKNOWLEDGMENT [16] Ning Wang, Jinmei Yu, “Neuron Based Nonlinear PID
Control,” Lecture Notes in Computer Science, vol.4099,
The authors are grateful to the Project of the National pp.1089-1093, July 2006.
Natural Science Foundation of China (No.51105236), and [17] Oh Sung-Kwun, Cho Se-Hee, “Analysis of dynamic model
the Shandong Province Promotive research fund for and design of optimized Fuzzy PID controller for constant
excellent young and middle-aged scientists of pressure control,” Transactions of the Korean Institute of
China(No.BS2011ZZ014). Electrical Engineers, vol. 61, pp. 303-311, February 2012.
[18] Wang Hong-Ru, Wang Jianzhong, “A new approach for
multi-objective-optimization-based fuzzy-PID control,”
REFERENCES Lecture Notes in Electrical Engineering, vol. 135, pp. 67-
[1] Ye Hongtao, Luo Fei, Xu Yuge, “Decoupling control of 76, April 2012.
wastewater treatment system based on immune [19] Meza J.L., Santibáñez V., “Fuzzy self-tuning PID
optimization PID neural network,” Application Research semiglobal regulator for robot manipulators,” IEEE
of Computers, vol. 28, pp. 4097-4099, April 2011. Transactions on Industrial Electronics, vol. 59, pp. 2709-
[2] Li Yuxian, “Research on PID Parameters Optimization 2717, June 2012.
Based on Immune Genetic Algorithm,” Computer [20] Navale, Rahul L., Nelson, Ron M., “Use of genetic
Simulation, vol. 28, pp. 215-218, August 2011. algorithms and evolutionary strategies to develop an
[3] Farouk Naeim, Sheng Liu, “Speed control system on adaptive fuzzy logic controller for a cooling coil -
marine diesel engine based on a self-tuning fuzzy PID Comparison of the AFLC with a standard PID controller,”
controller,” Research Journal of Applied Sciences, Energy and Buildings, vol. 45, pp. 169-180, February 2012.
Engineering and Technology, vol. 4, pp. 686-690, July [21] Xiong Xiaojun, “Auto-control theory experiment tutorial
2012. (Hardware simulation and Matlab simulink),” China
[4] Li H.-Z., Li L., He L., “PID plus fuzzy logic method for Machine PRESS, May 2009.
torque control in traction control system,” International
Journal of Automotive Technology, vol. 13, pp. 441-450, Guoyong Zhao was born in Shandong, China in 1976. He has a
April 2012. Ph.D. in Mechanical and Electronic Engineering (2007) from
[5] Bouallègue S., Haggège J., “PID-type fuzzy logic Dalian University of Technology, Dalian, China. His main
controller tuning based on particle swarm optimization,” interest is mechanical manufacturing and automation
Engineering Applications of Artificial Intelligence, vol. 25, technology.
pp. 484-493, April 2012.
[6] Hui-gui Rong, Hui Zheng, Zheng-qiang Li, “Turing of Yong Shen was born in Shandong, China in 1987. He is a
fuzzy PID controller for Smith predictor,” JOURNAL OF master postgraduate majored in mechanical manufacturing and
CENTROL SOUTH UNIVERSITY OF TECHNOLOGY, automation in Shandong University of Technology, Zibo, China.
vol. 17, pp. 566-571, April 2010. His main interest is mechanical manufacturing and automation
[7] Wang Su-qing, Jiang Wei-fu, “PID Turning Based on technology.
MATLAB/Simulink,” Techniques of Automation &
Applications, vol. 28, pp. 24-26, May 2009. Youlin Wang was born in Heilongjiang, China in 1955. He is a
[8] Song Shu, Zhang Ya-Jun, “Modeling and simulation of professor worked in Shandong University of Technology. His
brushless DC motor adaptive fuzzy PID control system for main interest is mechanical manufacturing and automation
pure electric vehicle,” Applied Mechanics and Materials, technology.
vol. 466-467, pp. 1339-1343, July 2012.







