A Parameter Varying PD Control for Fuzzy Servo Mechanism

This paper presents the formulation of novel implementation method based on parameter varying PD controller for fuzzy servo controllers. This formulation uses the approximation of fuzzy nonlinear function including error and error derivation in operation point. Obtained fuzzy control law has been employed to control angular position of servo using digital control technique applied to a typical microcontroller like AVR. The performance and robustness of modified fuzzy controller in comparison with PID controller evaluated in no load, applied external disturbance with different magnitude conditions has been studied. The simulation results showed that the proposed fuzzy controller has a considerable advantage in rise time, settling time and overshoot respect to PID controller when the servo system encounters with nonlinear features like saturation and friction.


Introduction
All control systems suffer from problems related to undesirable overshoot, longer settling times, vibrations and stability while going from one state to another state.Real-world systems are nonlinear, accurate modeling is difficult, costly and even impossible in most cases.On other side, a servo control system is one of the most important and widely used in control systems.The role of the control system may include: maintaining the position of a motor within certain limits, even when the load on the output of the motor might vary that this is called regula-tion or varying the position of the motor and load according to an externally set program of values that this called set point tracking [1].
Today, applications of servomechanisms include their use in automatic machine tools, satellite-tracking antennas, celestial-tracking systems on telescopes, automatic navigation systems, manufacturing industry, transportation, computers, communication networks and antiaircraft-gun control systems.In many applications, servomechanisms allow high-powered devices to be controlled by signals from devices of much lower power.
The operation of the high-powered device results from a signal (called the error, or difference, signal) generated from a comparison of the desired position of the high-powered device with its actual position.A servomotor is a specific type of motor and rotary encoder combination, usually with a dedicated, that forms a servomechanism.This assembly may in turn form part of another servomechanism.The encoder provides position and usually speed feedback, which by the use of a PID controller allow more precise control of position and thus faster achievement of a stable position (for a given motor power).However, the conventional digital control systems like classic PID solve the above problems approximately and generally do not work well for non-linear systems, and particularly complex and vague systems that have no precise mathematical models [2].Therefore, we need to intelligent and precise control systems to acquiring desired response.Moreover, it has been known that mentioned controllers produce more noise.Therefore, more advanced control techniques need to be used, which will minimize the noise effects [3].To overcome these difficulties, various types of modified conventional PID controllers such as auto-tuning and adaptive controllers have been developed lately [4]- [6] .
Here we suggest intelligent control approach.There are three basic approaches to intelligent control: knowledge-based expert systems, fuzzy logic, and neural networks.All three approaches are interesting and very promising areas of research and development.In this paper, we present only the fuzzy logic approach.Fuzzy logic proposed by Lotfi A. Zadeh in 1973.Zadeh introduced the concept of linguistic variables [7] that can be described simply as "computing with words rather than numbers" or "control with sentences rather than equations" [8].
Fuzzy Logic is a multivalued logic that allows intermediate values to be defined between conventional evaluations like true/false, yes/no, high/low and emerged as a tool to deal with uncertain, imprecise, or qualitative decision-making problems.Fuzzy logic control (FLC) is a control method based on fuzzy logic.Today, fuzzy control applications cover a variety of practical systems, such as the control of cement kilns [9], train operation [10], parking control of a car [11], heat exchanger, robots, and also in many other systems, such as home appliances, video cameras, elevators, aerospace and etc.
Many different approaches are used for fuzzy controller implementation which they can be cited to hybridmethods such as neuro-fuzzy [12] [13], PI-like fuzzy [14], multivariate regression [15], non-linear bond graphs (BG) [16].In neuro-fuzzy approach, controller learns fuzzy rules incrementally or decrementally and the learning algorithm uses a linguistic error measure that is expressed by fuzzy rules.
In PI-like fuzzy approach, first, the proposed fuzzy controller adopts the step response of phase trajectories to derive the corresponding linguistic control rules of such a system, and then applies the relationship between input and output signals in a proportional integral controller to convert the relationship of linguistic control rules to a decision table.Multivariate regression analysis attempts to determine a formula that can describe how elements in a vector of variables respond simultaneously to changes in others.For linear relations, regression analyses here are based on forms of the general linear model.Also, a bond graph is a graphical representation of a physical dynamic system.It is similar to the better-known block diagram and signal-flow graph, with the major difference that the arcs in bond graphs represent the bi-directional exchange of physical energy, while those in block diagrams and signal-flow graphs represent uni-directional flow of information.Furthermore, bond graphs are multi domain and domain neutral.This means a bond graph can incorporate multiple domains seamlessly.
In particular, for servo system, fuzzy logic PID [17], Taguchi-method [18], DSP-based fuzzy logic [19] and neuro-fuzzy controller [20] are used in literatures.In this paper, we proposed a novel method based on parameter varying PD controller for fuzzy servo controllers that uses the approximation of fuzzy nonlinear function including error and its derivation in operation point.
This paper is organized as follows: firstly, the overall framework of the theory of fuzzy control and its defuzzification methods are presented.Then fuzzy control algorithm based on PD controller has been approximated.Then the dynamic modeling of servo motor system and its experimental implementation using the proposed algorithm is done.Finally, simulation results of the proposed controller are compared with PID controller.

Motivation for Fuzzy Control
Classical mathematics and conventional control theory are quite limited in modeling and controlling complex nonlinear dynamical systems, particularly ill-formulated and partially described physical systems.The motivation for using fuzzy logic technology in control systems stems from the fact that it allows designers to build a controller even when their understanding of the system is still in a vague, incomplete, and developing phase.
Moreover, it can be noted that the servo controller design does not require to explicit knowledge of the motor and load characteristics [21].Since the fuzzy controllers are designed directly from the properties of the process, the development time is often shorter than for conventional controllers [22].
The overall procedure for developing a fuzzy control system for a model servo system is shown in Figure 1.The system uses measured variables as inputs to describe the error or derivation of error from the servo.These inputs are then "fuzzified" using membership functions supplied by an expert operator to determine the degree of membership in each input class.The resulting "fuzzy inputs" are evaluated using a linguistic rule base and fuzzy logic operations to yield an appropriate output and an associated degree of membership.This "fuzzy output" is then defuzzified to give a crisp output response that can be applied to the drive servo.
According to real-world requirements, the linguistic variables have to be transformed to crisp output.There are many defuzzification methods (e.g.Center of gravity, bisector of area, mean of area and center of average) that are in following [23] [24].

Center of Gravity (COG)
For discrete sets, COG is called center of gravity for singletons (COGS) where the crisp control value is the abscissa of the center of gravity of the fuzzy set, where ( )  is a point in the universe of the conclusion and ( ) is the membership value of the resulting conclusion set.For continuous sets, summations are replaced by integrals.

Bisector of Area (BOA)
Where ( )  is a point in the universe (U) of the conclusion.There may be several solutions i x , thus this method is a complex method computationally.For discrete sets, BOA u is the abscissa j x that minimizes the presented formula.Here max i is the index of the largest abscissa  , Figure 1.General structure of the fuzzy part.

Mean of Maximum (MOM)
In this method the crisp value is chosen by point with the highest membership.There may be several points in the overall implied fuzzy set which have maximum membership value.Therefore, it is a common practice to calculate the mean value of these points.Here I is the (crisp) set of indices i where ( )

Center of Average (COA)
Where lm u is a single value of the fuzzy set of control output, and ( ) j B e  are membership function for error and derivation of error, respectively.It must be mentioned that in this paper, the chosen defuzzification method for implementation is COA. ,

Fuzzy Controller Based on PD Controller
A fuzzy logic controller has four main components as shown in Figure 1: fuzzification, inference, rule base and defuzzification.Implementation of an FLC requires the choice of four key factors [25]: number of fuzzy sets that constitute linguistic variables, mapping of the measurements onto the support sets, control protocol that determines the controller behavior and shape of membership functions.Thus, FLCs can be tuned not just by adjusting controller parameters but also by changing control rules, membership functions.Rule bases, inference mechanism and defuzzification methods are the sources of nonlinearities in FLCs but it is possible to construct a rule base with linear input-output characteristic for FLC to become a linear controller with a control signal [26].It is constructive to apply a similar analysis to Fuzzy PID control in order to accommodate integral action but the integrator creates problems by increasing the order of the closed loop system.Here, output signal is a function with two variables: error and derivation of error.Control signal U(n) is a nonlinear function of "error" and "derivation of error" as shown in Figure 2.
The simplest membership functions are formed using straight lines.In most literatures, because of the simplicity of the theory and implementation of triangular membership functions in design of fuzzy controller, these functions are used.In this study, the triangular membership function is chosen for each fuzzy linguistic value of the error and the derivation of error as shown in Figure 3 and   ( ) ( ) When discussing it, considering the Equation ( 4) there are eight conditions as mentioned in [24].
For design FPC, we consider to the fifth condition, arbitrary: In later equation, , Z Z u  refers to the mapping of membership function (Z) for error to output and also refers to a mapping of membership function ( ) Z  for derivation of error to output and etc. Substituting ( 5) in ( 6), we have: We denote the input-output relation of the controller u in the following model: For sufficiently small e δ , e δ  and u δ perturbations, the Equation ( 8) can be approximated by the follow- ing linear equation: , .
The operating point (OP) that we consider it for linearization here is ) 3 3 Proportional Gain 3 3 Then after some algebra operations the Equation ( 12  We can see that the above controller behaves like a parameter varying PD controller thus the FLC performs like PID controller when we have not any external load or disturbance.Takagi-Sugeno or Mamdani [27] fuzzy inference system can be used to design the fuzzy controller. In this paper, Mamdani fuzzy inference system is used.The inputs of FPD are "Error (E)" and "Derivate of Error (DE)" while the output is "control".Input and output variables of FPD consist of three fuzzy sets namely N (negative), Z (zero), P (positive) as shown in Figures 5-7, respectively.
The fuzzy rule bases used in design of controller for the servo system are following: Rule 1 If e is N and de is N then control is N.

Rule 2
If e is Z and de is N then control is N.

Rule 3
If e is P and de is N then control is Z.

Rule 4
If e is N and de is Z then control is N.

Rule 5
If e is Z and de is Z then control is Z.

Rule 6
If e is P and de is Z then control is P.

Rule 7
If e is N and de is P then control is Z.

Rule 8
If e is Z and de is P then control is P.

Rule 9
If e is P and de is P then control is P.

Flowchart for Real-Time Implementation of FPC
Figure 8 shows the flow chart for the hierarchical fuzzy control algorithm, where d θ and θ denotes the de- sired position and displacement date that reported from the position sensor like encoder and potentiometer, respectively.

PID Controller
When the digital controller is used, one could replace the derivative term with a backward difference and the integral term may be replaced with a sum.For a small constant sampling time, ( ) u t can be approximated as: e n e n u n K e n e j T T T T PID controllers can be set using the rules of Ziegler Nichols (ZN) or manually.Hand-tuning is generally used by experienced control engineers based on the special rules but these rules are not always valid.In recent years, many studies have been performed for optimization of PID coefficients which can be pointed to an extremum seeking [4], stochastic algorithm [5], genetic algorithm [6] and so on.Then the derivative gain D T and the integral gain i T are adjusted to improve and optimize the response of the system.In this paper, achieved coef- ficients of PID controller using (ZN) tuning method are as follows: 1.43

Modelling and Implementation
The heart of the system that integrates the system components, control operations and defines features functionality using related techniques and methods is software.The total schematic diagram of this system including controller, actuator, process, and position sensor is shown in where a V = armature voltage (v), a R = armature resistance (Ω), a L = armature inductance (H), m J = rotor inertia (kg⋅m 2 ), m B = viscous friction coefficient (N⋅ms/rad), T K = torque constant (N⋅m/A) and b K = backemf constant(V⋅s/rad).
Remark.For applications where the load is to be rapidly accelerated or decelerated frequently, the electrical and mechanical time constants of the motor play an important role.The mechanical time constants in these motors are reduced by reducing the rotor inertia.In this study, a DC motor with these specifications was used: (moment of inertia of the rotor: 1e-3 j, rated motor voltage: 6 v DC, armature inductance: 0.01 H, armature resistance: 0.005 Ω, Electromotive force constant: 0.22, Back E.M.F.Constant: 1.5, Damping ratio: 1.91 N⋅s/m).

Simulation Results
In this paper, first PID classic controller is designed for system control of servo mechanism using Section 3.3.Note that chosen gains for PID controller are given in this section.Then fuzzy controller using nine rules and triangular membership functions designed in Matlab/Simulink environment by Mamdani approach in Section 3.1.
The output response of both the PID and fuzzy logic controllers were presented.Figure 12 shows the result of the comparison between the output response (i.e.Position of servo) for the PID and Fuzzy logic controller under no-load condition.Figure 13 and Figure 14 show the obtained result from comparison between PID controller and FLC for applied external disturbance (η) with different amplitudes η = 0.1 + sin(t) , η = 0.9 + 0.9sin(t), respectively.
Simulation results shows that the FLC performs like PID controller when we have not any load or changed parameters or disturbance [23] but when comparing both controllers under injected load or changed parameters or disturbance, the FLC performs better than PID controller [28].However, the performance of PID controllers depends heavily on the operating parameters of the system.Also, if there is any change in the system, a significant amount of time is required to reset the controllers.
Considering proposed method, output responses using different defuzzification methods such as center of gravity (COG), bisector of area (BOA), mean of maximum (MOM), center of average (COA) under no load condition, load and external disturbance (η) conditions were shown in Figures 15-17, respectively.One can result that center of average (COA) method has an acceptable result than other methods (i.e.COG, BOA and MOM).
PID controller is designed on operating point and when it encountered with uncertainty or unmodeled dynamics in the system, it cannot compensate these changes enough effectively.Besides, fuzzy controller can cover these changes and handles them.

Conclusion
The formulation of a novel implementation method based on parameter varying PD controller for the fuzzy logic servo controller is presented.Then obtained results from the comparison between PID controller and FLC with proposed method are presented.Simulation results show that FLC performs like PID controller for when we have not any load or changed parameters or disturbance but when comparing both controllers with considering injected load or changed parameters or disturbance, the fuzzy logic controller performs better.
of the resulting conclusion set.

Figure 9 .Figure 8 .
Figure 8. Flow chart for the position fuzzy control system.

Figure 9 .
Figure 9. Schematic diagram of control system.

Figure 10 .
Figure 10. Circuit of FLC in ADS environment.

Figure 11 .
Figure 11.A view of the implemented system in lab.

Figure 12 .
Figure 12.Output response in no load condition.

Figure 15 .
Figure 15.Output response in no load condition.

Figure 16 .
Figure 16.Output response with constant load.
t is input control signal and w is external disturbance.System matrix A, vectors B and C of the linearized benchmark problem are given by: u