Cylinder Position Servo Control Based on Fuzzy PID

. The arbitrary position control of cylinder has always been the hard challenge in pneumatic system. We try to develop a cylinder position servo control method by combining fuzzy PID with the theoretical model of the proportional valve-controlled cylinder system. The pressure differential equation of cylinder, pressure-flow equation of proportional valve, and moment equilibrium equation of cylinder are established. And the mathematical models of the cylinder driving system are linearized. Then fuzzy PID control algorithm is designed for the cylinder position control, including the detail analysis of fuzzy variables and domain, fuzzy logic rules, and defuzzification. The stability of the proposed fuzzy PID controller is theoretically proved according to the small gain theorem. Experiments for targets position of 250 mm, 300 mm, and 350 mm were done and the results showed that the absolute error of the position control is less than 0.25 mm. And comparative experiment between fuzzy PID and classical PID verified the advantage of the proposed algorithm.


Introduction
In 1956, Shearer [1] first developed the pneumatic servo control system, using the high temperature and high pressure gas (500 ∘ C, 20∼30 MPa) from the aerospace craft and missile propulsion as the working media.This pneumatic servo control system was successfully applied in the position, orientation, and stable flying control for aerospace crafts and missiles.In the subsequent period of time, efforts are contributed to investigate the pneumatic servo technology parallel with the hydraulic servo technique.But the early study made slow progress and there were few achievements that could be used, because of the difficulty in mathematic system models and lack of powerful analysis and calculating tools.
With the development of computer technology and modern control technique, the pneumatic servo control problem was revisited by scholars.Scavanda et al. [2] and Liu and Bobrow [3] broadened the linear model to several working points adopting the state-space method.But the influence of nonlinear factors such as mechanical friction is neglected.Baoren [4], Yunbo [5], and Guoliang et al. [6,7] identified the system model based on experimental data, which can reflect the pneumatic system characteristics more accurately than the former methods.But it is not suitable for cases such as long cylinder journey, large parametric variation, or heavy friction.Lee et al. [8] established a nonlinear model for pneumatic system and verified the model with experiments.Still, the model is complicated and requires rigid application conditions.
In this paper, we investigated a proportional valvecontrolled cylinder system and developed a position control method.Firstly, nonlinear mathematic model of the cylinder is established in Section 1. Then Section 2 gives the mathematic model of the whole pneumatic cylinder system.In Section 3, we designed a fuzzy PID controller for the proposed pneumatic position system, including all the detailed information.Experiments for different positions and comparison with classical PID were carried out, which are deeply discussed in Section 4. Finally, Section 5 summaries the main contribution and meaning of our work.

NonLinear Mathematic Model of Cylinder
The dynamic characteristics of cylinder are mainly described by three equations: the pressure differential equation of cylinder, pressure-flow equation of proportional valve and moment equilibrium equation of cylinder.
The flowing state of air inside the pneumatic system is extremely complicated.To simplify the system mathematical model, we use the following hypothesis.
(1) The working media (here refers to air) in the system is taken as ideal gas.
(2) The flowing state while the air runs through the valve port or other chokes is taken as the isentropic and adiabatic process.
(3) The lumped parameter model is adopted, ignoring the influences on the system from the distributed resistance in the air tube and flexibility of the pipeline.
(4) The air pressure and temperature inside the same chamber are equal everywhere.
(5) There is no leakage of the cylinder, both inside and outside.
(6) The pressures of air source and atmosphere are constant.

Pressure Differential Equation of the Cylinder.
We suppose that the flowing air inside the thermodynamic system has no energy exchange with the outside and the pressure changes slightly, during the fast inflating process from air source to cylinder chamber.And then, this flowing process can be taken as the isentropic and adiabatic process.According to the energy equation of adiabatic inflating process from constant pressure air source to limited volume, there are four kinds of energy changing processes inside the volume during the movement [9].
(1) The air will bring in or take out the energy    itself during flowing in or out of the volume.Defining the internal energy of unit mass gas as , kinetic energy as V 2 /2 and static energy as , we get (2) The flowing work between the volume and the outside during the air runs in and out of the chamber is Δ  =   V, where  is the air pressure and V denotes the air specific volume.
(3) The thermoexchange between the chamber and the outside is Δ.
(4) The work from the chamber to the outside during the piston movement is Δ = Δ.
If we ignore the leakage of cylinder and valve, according to the energy conservation principle, the total internal energy  of the chamber is Supposing that the gas is ideal air and disregarding the kinetic energy and static energy of the air, we can get where ℎ is the specific enthalpy of air, ℎ =     ,   is the constant-pressure specific heat, and   is the air temperature at the valve port.
As is well known, the internal energy of air is  =  V , where  V is the constant-volume specific heat.According to the ideal air state equations, we have  = V/, where  is the gas constant, with the value of 287.1 j/(kg * k) and  =   −  V .
Substituting the above equations by formula (2), we can get Generally, the rate of heat exchange d/d is determined by the temperature difference between the inside and outside of the cylinder and the coefficient of heat conduction of the cylinder block.

Pressure-Flow Equation of Proportional
Valve.In the proportional valve-controlled cylinder system, the air mass flow running into and out of the cylinder chamber is controlled by the port area of the proportional valve.And the air mass flow   running through the valve port is determined by the effective port area of the valve   and the upstream and downstream air pressure   and   , that is, where   is the effective port area of the valve, m 2 ;   represents the stagnation temperature of the orifice upstream, ;   denotes the air mass flow running through the valve port, Kg/s.

Force Equilibrium Equation of Cylinder.
We can obtain the kinetic equilibrium between the cylinder and load by the force analysis for the system where  1 and  2 are the pressure working areas inside the two chambers of the cylinder, respectively;  means the mass load;  is the viscous damping coefficient between the piston and load;   denotes the external load;   represents the Coulomb friction and  is the displacement deviation.Combining the Coulomb friction and external load as  and linearizing the force equilibrium equation, we can get

Mathematic Model of the Pneumatic Position Servo System
From the above dynamic characteristics basical equations, it is clear that the system is nonlinear.So we linearize the system near the cylinder equilibrium point based on the linear system theory.Generally, the spool opening area of proportional servo valve can be taken as the linear function of the controlling voltage; that is, the spool displacement is directly proportional to the controlling signal: where   is the voltage proportional coefficient.Linearizing the flow equation of the proportional valve and applying the Laplace transform, we can get where  1 and  2 are the flow gains at the working point of the controlling valves for the cylinder chambers,   =   /;  1 and  2 are the flow pressure coefficients of the controlling valves for the cylinder chambers,   =   /.Linearizing the pressure differential equations of the cylinder chambers (2) and applying the Laplace transform, we can get The force equilibrium equation ( 6) can be transformed as From the above analysis, the cylinder position servo control diagram can be drawn as Figure 1.

Fuzzy PID Control Algorithm
PID algorithm is the most used and useful control technique in mechatronics system.But the classical PID algorithm has its inherent shortcomings in practice because of the fixed parameters.For example, the fixed parameters cannot take into account the dynamic features and control requirements in both transient process and stable period.It often fails to achieve the ideal integrated control quality.So, in practice, PID algorithm is usually combined with other parameter adjusting methods, such as fuzzy logic and artificial neuro network.We integrate the classical PID algorithm and fuzzy logic, using fuzzy logic to adjust the PID control parameters according to the deviation and its gradient between the output and target.Thus we can control the cylinder position precisely.The basical control principle is shown in Figure 2.

Fuzzy Variables and Their Domain. The PID control input is
And the output of the control module can be written as The deviation (dis 0 − dis) between the target position dis 0 and the actual displacement dis of the cylinder and its gradient (d/d) are the input variables for fuzzy logic.And the variations Δ  , Δ  , and Δ  of PID control parameters   ,   , and   are the output variables of the fuzzy logic.The cylinder position deviation  and its gradient  are sampled and calculated in real time.And the output variables Δ  , Δ  , and Δ  are extracted from the fuzzy matrix table based on the fuzzy rules and reasoning.The PID control parameters are adjusted using Δ  , Δ  , and Δ  , in order to realize the real-time dynamic control of the cylinder displacement.According to the cylinder position control requirement, the domain of the displacement deviation  is set as (−0.5, 0.5), and the domain of the  is (−0.1, 0.1).The domains of Δ  , Δ  , and Δ  for PID parameters are (−1.2,1.2), (−0.1, 0.1), and (−0.05, 0.05), respectively.

Fuzzy Logic Rules.
The triangle membership function is adopted, and the membership function for Δ  is shown in Figure 3.The fuzzy logic rules are deduced, as listed in Tables 1, 2, and 3.In these tables, NB, NM, NS, ZO, PS, PM, PB represent negative big, negative medium, negative small, zero, positive small, positive medium, and positive big, respectively.Using the above fuzzy logic rules, the PID control parameters can be adjusted as where , ,  = 1, 2, 3, . . ., 25.
Then the fuzzy relations of   ,   , and   are 4.3.Defuzzification.The outputs of the fuzzy logic rules are also fuzzy set.In practical digital control system, the parameters must be defuzzified, that is, converting the fuzzy set into exact values according to an appropriate algorithm.We use conventional gravity center method to realize the defuzzification: where  * is the center of the covered region by membership function   () of fuzzy set .
It is obvious that the calculating process needs certain time, which makes it difficult to be used in real-time control system.So, the calculating process is executed off-line in advance.Then the produced defuzzification decision tables are stored in the memory of the controller.In this way, the instantaneity of the control process can be enhanced.

Stability Analysis.
Chen and Ying [10] theoretically proved the stability of nonlinear fuzzy PI controller, based on their previous work on fuzzy control theory [11].After that, they continued to investigate the stability of nonlinear fuzzy PI +  controller [12].Their work offers a quite convenient and practical method to explore the stability of similar control algorithms.
As described in Section 2, the target cylinder system can be taken as a classical second order system.To interpret the stability of the proposed nonlinear system, we need to reconsider the fuzzy PID control principle shown in Figure 2, which can be rearranged as Figure 4 in discrete-time form, where  is the sampling period,  > 0. This diagram expresses the same meaning as Figure 2 and shows the simplified structure as a figure in [12].
The stability of the fuzzy PI controller and the fuzzy PD controller has been analyzed in [10,13], respectively, according to the small gain theorem [14].In our case, if we disconnect the fuzzy  control component from Figure 4, we have the fuzzy PI control system, whose stability is completely proved in [10].The stability conditions are as follows.

Theorem 1. A sufficient condition for the nonlinear fuzzy PI control system to be globally bounded-input and boundedoutput (BIBO) stable is that
(1) the given nonlinear system has a bounded norm (gain) ‖‖ < ∞; (2) the parameters of the fuzzy PI controller   ,   , and   satisfy where  is the domain boundary of fuzzy logic parameters,  = max{1, } and In the same way, by disconnecting the fuzzy PI controller from Figure 4, we reduce the fuzzy PID control system to a simple fuzzy  controller.This fuzzy  control system is a special or simplified case of the fuzzy PD control system studied in [13], and hence its stability condition can be derived from that obtained in [13] by removing the fuzzy  controller or just setting the output of fuzzy  component as zero.The stability conditions can be derived as follows.Theorem 2. A sufficient condition for the fuzzy  control system to be BIBO stable is that the given process has a bounded norm (gain) ‖‖ < ∞ and the parameters of the fuzzy  controller   and   satisfy where  = max{1, }.
Till now, we are sure that the fuzzy PI controller and fuzzy  controller are stable according to Theorems 1 and 2, respectively.Then, we need to verify that the combined fuzzy PID controller is stable.
Again, the Fuzzy PID controller shown in Figure 2 can be redrawn as Figure 5.The fuzzy PID control systems shown in Figures 2, 4, and 5 are the same thing but in different forms, just for analysis convenience.In Figure 5(a), let the system model be denoted by  1 and the fuzzy PID controller together be denoted by  2 , resulting in the new structure in Figure 5(b).Then, as discussed in [10,13], we can obtain a sufficient condition for the BIBO stability of the overall fuzzy PID equivalent closed-loop control system from the bounds: where  1 ,  2 ,  1 ,  2 are constants, and  1  2 < 1.

Experiments and Analysis
5.1.Experimental System Design.The experimental system is composed of pneumatic servo control actuating mechanism, feedback units, loading module, and controller.The pneumatic servo control actuating mechanism is symmetrical cylinder system controlled by proportional flow valve.The feedback units include displacement transducer and the pressure transducer for the cylinder chambers.The whole controller for the system includes industrial personal computer (shorted as IPC), A/D, and D/A board cards for data acquisition and output.The experimental system schematic diagram is shown in Figure 6 and the experimental platform is shown in Figure 7.The instruments used in the experiment are listed in Table 4.
The control software was developed based on MATLAB and LabVIEW.All the fuzzy logic and PID control algorithms were realized in MATLAB simulink toolbox and then compiled into real-time control program using RTW technique.RTW is an important supplementary functional module for MATLAB graphic modeling and simulation module Simulink.Optimized, portable, and personalized codes can be directly generated from Simulink model with RTW tools.According to the specific target preparation, the generated codes can be compiled into program for a different rapid prototype real-time environment.RTW ensures us to focus on the model establishment and system design and release from the boring programming work.This kind of developing pattern is very suitable for laboratory experimental system design.
RTW technique has the following features: (1) it supports continuous, discrete, and hybrid time system, including conditioned executing system and nonvirtual system; (2) RTW seamlessly integrates the Run-Time Monitor with the realtime target, which provides an excellent signal monitor and parameters adjusting interface.The flow diagram of real-time control program developing using RTW technique is shown in Figure 8.
LabWindows/CVI is adopted to create the control program frame and user interface, shown in Figure 9.

Target Position Control
Experiments.On the experimental platform, we set the target position of the cylinder as 250 mm, 300 mm, and 350 mm, respectively.And the control results are shown in Figures 10,11    does not mean long corresponding time.During the motion, the proposed fuzzy PID controller can adjust the control parameters and change the behavior of the system to achieve the best performance.Also, the overshoots in Figures 10, 11, and 12 are 0.49 mm, 0.04 mm, and 0 mm, respectively.Consulting the stable errors listed in Table 5, we can see that when the displacement becomes longer, the system hysteresis shows greater influence on the final error.To be more frank, long displacement has no overshoot but big negative error, while short displacement has big overshoot and positive error.From the experimental data, three significant features can be drawn as follows.
(1) Dynamic quality: the proposed method has fuzzy logic virtues in the earlier stage of control that can actuate the cylinder to approximate the target position rapidly.And during the late stages of control, it has virtues of PID algorithm, which means that the PID parameters are adjusted to execute the cylinder to quickly reach the target position without overshoot.
(2) Stable quality: the analysis of stable error is listed in Table 5.From the error analysis, it can be seen that the proposed theoretical model, control method, and experimental system can guarantee that the absolute

Figure 5 :
Figure 5: Equivalent closed-loop control system for the fuzzy PID controller.
, and 12.The rising times of the three experiments are 2.65 s, 4.3 s, and 3.2 s, respectively, which indicates that long displacement

Table 5 :
Control errors of cylinder position (mm).
AE represents absolute error and RE denotes relative error.