Development of fuzzy-logic-based self tuning PI controller for servomotor

Direct Current (DC) servomotors are widely used in robot manipulator applications. Servomotors use feedback controller to control either the speed or the position or both, and the basic continuous feedback control is PID controller. This paper discusses the modeling and simulation of DC servomotor control built using MATLAB/Simulink, and the analysis of controller performance, namely a PID controller, PI controller, fuzzy-scheduled PID controler, and a fuzzy-logic-based self tuning PI controller on the system. The singleton fuzzification is used as a fuzzifier. The center average is used as a defuzzifier. Two control modes are applied in sequential to the plant: speed control, and then position control. Simulation results show that fuzzy-logic-based self tuning PI controller has the best performance compared to conventional PID controller and fuzzy-scheduled PID controler.


Introduction
Servomotors are used in a variety of applications in industrial electronics and robotics that includes precision positioning as well as speed control.Basically, any motor can be used in a servo system (Kissell, 2002).There are two types of motors: (a) DC motors, and (b) AC motors.DC motors have better starting torque than AC motors although they are more expensive than AC motors.Servomotors use feedback controller to control the speed or the position, or both.The basic continuous feedback control is PID controller.The PID controller posses good performance but is not adaptive enough.This is appealing when the load is changed, where the original controller generally cannot maintain the design performance and thus should be re-designed for the new system conditions (Shieh & Li, 1998).The pioneering work dealing with expert knowledge that can be well applied to the control of systems with uncertained, nonlinear dynamics is credited to Zadeh (Zadeh, 1968) who proposed fuzzy control theory to overcome the weakness of conventional controllers, and investigated by which owns good robustness (Yu et. al., 2004).Fuzzy systems are capable of handling complex, non-linear and sometimes mathematically intangible dynamic systems using simple solutions.Fuzzy logic uses human-like but systematic properties of converting linguistic control rules based on expert knowledge into automatic control strategies.But, the response of a fuzzy logic controller is slower than a PID controller.It has been reported in a number of papers that hybrid of PID or PI, with fuzzy logic in control system can overcome the set-back of fuzzy logic controller, see (Yeh & Tsao, 1994), (He et. al., 1993), (Ga & Feng, 2005) and (Jee & Koren, 2004).In fuzzy systems, the numerical input values should be first converted into the corresponding fuzzy representations by using 'fuzzifiers'.The fuzzy output are then provided by a fuzzy model, which could be a set of fuzzy logic rules, fuzzy relations or even a simple fuzzy table, with or without deep fuzzy reasoning.Finally, the fuzzy output can be converted back into their relevant numerical (crisp) output through 'defuzzifiers' (Lu, 1996).Basic configuration of fuzzy systems with fuzzifier and defuzzifier is shown in Figure 1.Singleton fuzzifier maps a real-valued point * xU ∈ into a fuzzy singleton A' in U, which has membership value 1 at x* and 0 at all other points in U (Wang, 1997).If l y is the center of the l'th fuzzy set and w l is its height, then the center of average defuzzifier determines y* as (Wang, 1997).(1) A study on induction machine speed control proved that PID controller's parameters can be tuned on-line by an adaptive mechanism based on a fuzzy logic (Bousserhanel et. al., 2006).
It is expected that hybrid of PID and fuzzy logic in control system can overcome the problem of fuzzy logic controller.
Servomotor controllers need optimization to give a good performance as desired.Sometimes, it requires time and has big risk in the optimization process.To investigate this issue, a detail study on servomotor control is conducted.A real plant, constituting of a DC motor and its controller has been built and this system is modeled and simulated to allow detail analysis about its control system.The system identification problem is to estimate a model of a system based on the observed input-output data (Takami & Mahmoudi, 2007).
The expected output of identification is an s-domain model of a real system.System identification technique is used to get a transfer function of the plant and is used to build a virtual controller, which is basically the software equivalent of the real controller at the abstraction level.The virtual controller is optimized, and then the optimized parameters are applied to the real controller in the real control system.Therefore, this work discusses the modeling, simulation and hardware implementation of a DC servomotor controller built using MATLAB/Simulink, and the analysis of controller's performance, namely a PID controller, PI controller, fuzzy logic controller, fuzzy-logic-based self tuning PI controller, and a fuzzy-logic-based self tuning PID controller on the system.In this work the aim is to improve the controller's performance using hybrid fuzzy and PID.
Figure 2 outlines the background and purpose of this work.

The experimental DC servomotor system
The experimental rig constituiting the servo speed and position controller system consists of the servomotor and load, measuring and controlling devices.The servo system contains a DC motor driven by an IGBT chopper inverter.The measuring device is the speed sensor (tachogenerator), ADC and a digital filter i.e., finite input response (FIR), while the controlling devices are DAC, differential amplifier, and the IGBT inverter circuit.The measuring devices provide status of the output responses of the speed and position where the information about the speed and position is fed through signal conditioning circuit and anti-aliasing filter for analysis and calculation of the control signal.The speed and position requirements proportional to the manipulated variable of the controller's output are fed to a computer.

Fig. 2. Overview of the study background
The modeling and analysis of the DC servomotor for the speed and position was conducted using Simulink, with the block diagram is as shown in Figure 3.In this arrangement, the speed control loop is in the position control loop (Lacevic et. al., 2007).Basically, the position control loop work until reaching the position set point while the speed is limited to the speed set point.Position control systems with conventional position sensor have wellknown drawbacks.Notably, friction, stiction, backlash, and hysteresis limit the positioning accuracy.This would lead to mechanical wear that introduces impurities in the form of dust particles into the manufacturing environment.The other consequence would be mechanical coupling transmits to the microstepper vibrations from the surrounding environment, (Fulford et. al., 2009).Notably, in this experimental set-up the position control is sensorless.Practically, position control is preferred to be sensorless to reduce cost and size and increase the reliability of overall system (Montanari et. al., 2007).The input, feedback, and output elements for position and speed are implemented in the Simulink diagram with specifications as follows: Hv=0.002 H P =0.005K P =0.005The block diagram of hardware design is shown in Figure 4, and the power amplifier and differential amplifier are presented more detail in Figures 5 and 6.
As an illustration to substantiate the applicability of this approach, the following test parameters have been chosen.The set point for position is 5 rad, and the set point for speed equals 250 rpm.The load is initially at 0 Nm and then abruptly increases to 1 Nm after about 15 sec.The total duration of experiment is 90 sec.The speed of DC motor is detected by a tacho-generator, sampled every 0.01 sec, and filtered by 30-point FIR.

Process I: Open loop analysis
Open loop characteristic of the gray box is tested using Simulink, which is applied to the plant through a data acquisition (DAQ), 30-point FIR, chopper/inverter control unit, and IGBT.The input voltage is varied randomly in the range of 0 to 20 volts for 100 seconds.The output of the gray box model is in rad/sec.There are five variations of input, and the characteristic of one of the input-output is shown in Figure 7.

Process II: Best model selection
There are six process models that can represent the system.To select the most suitable model, these models will be analysed and compared: a.To select the best process model, the fitness value has to be obtained.If i_FIT is the fitness value for identification process, Y is the real (measured) output, Ŷ is the estimated output, and Y is the mean value of real output, then the fitness value can be obtained from the formula below, see (Montanari et. al., 2007): for the PID controller.

Fuzzy logic controllers
In this work, a fuzzifier is a singleton mode with two inputs consisting of error and change of error, each with seven uniform triangular membership functions, and one output with seven triangular membership functions.As an inference engine, the Mamdani product is used and as a defuzzifier, the center of average is used.The controllers use the rules as shown in Table I The fuzzy sets and their corresponding membership functions for input (error, and change of error) are shown in Figure 8, and for output are shown in Figure 9.The fuzzy sets and their corresponding membership functions for input (error, () ek ω and change of error, () ) and output (h) are shown in Figure 11.The rules for FLBPI and FLBPID (K P and K I ) are shown in Table II.The value of K D is constant based on Ziegler-Nichols method in PID tuning.Fig. 11.Fuzzy sets and their corresponding membership functions, (Mannan et. al., 2004).II.Fuzzy Rules Base for K P and K I in Hybrid (Mannan et. al., 2004).

Error
The values of K P , K I , and K D for hybrid controllers are obtained from the following formula: 2 Im .; .; Proportional based controller is used for the position control since the requirement is such that the motor would rotate in one direction.The proportional controller for position (K PP ) is tuned using experimental method with no overshoot criteria.Integral of Absolute value of Error (IAE) is used as a performance index for overall speed control (IAE v ) in which the formula is as follows, see (Marlin, 2000): Integral of Time Absolute value of Error (ITAE) is used as a performance index for position control (ITAE p ), the first 8-second of starting speed control (ITAE vp ), and the 9-second of loading speed control (ITAE vpl ) which the formulas are as follows, see (Marlin, 2000): and the fitness value is obtained from the basic formula as follows, see (Xiu & Ren, 2004): Based on Eq (6), the fitness values for overall speed (f v ), first 8-second starting speed (f vp ), 9second loading speed (f vpl ) and position (f p ) are as follows: ( )

Experimental results
The comparison on the effectiveness of modeling the DC motor based on the fitness value is presented in Table III.
Selecting the best process model in  The relevant parameters were obtained during the simulation (offline optimization) using the transfer function as shown in Eq (8).The comparison on the effectiveness of implementing FLBPI as compared to FLBPID, FLC, PID, and PI controller based on the performance metrics for real time experiment is presented in Table IV.
The ability to understand the influence of the different controllers on the servomotor speed and achieving its target position is one of the important aspects of this study.It is noted that the speed response with the FLBPID-type controller has a relatively good settling time, but the fitness values for the motor during starting and loading is not good enough due to the fact that the noise is a bit larger as compared to FLBPI, albeit the fitness value of the overall speed for the FLBPI and the FLBPID are similar.A closer observation at the starting and loading performances during the real time experimentations, FLBPI performances is relatively better as compared to the PI, PID, FLBPID or FLC for speed control.A similar performance is also observed in the fitness value of position for real time experiment, where the FLBPI is relatively better as compared to the PI, PID, FLBPI or FLC for position control.
NO Comparing the conventional and hybrid controllers based on fitness values in real time experiments, the PID performs better than the PI for speed and position control in the case for conventional controllers.Interestingly, for hybrid controllers, the FLBPI is better than the FLBPID for speed and position control, whilst the FLBPI is better than the PID for speed and position control.This shows that the performance has improved when having the hybrid fuzzy and PI as a controller.In the standalone condition and using default parameters, the FLC is not as good as its competitors for both speed and position controls.Plots for the speed control in response to a set-point specified in both simulation and real time experiment for FLBPI controller are presented in Figure 13 and for the position control are presented in Figure 14.Comparing the simulation and real time experiment results as shown in Figures 13 and 14, the performances are not exactly the same but the output patterns are similar and the results in real time experiments are validly representing the real system's performance.This shows that identification (s-modeling) is an estimation of real hardware plant.Plots for the speed control in response to a set-point specified in the real time experiment for FLBPI compared to PID controller are presented in Figure 15 and for the position control are as presented in Figure 16.A sudden change in load requirements that happens at t=15 seconds causes the speed to fall and then rises and stabilized at the original level within a reasonable range of time.This demonstrates the action of the controllers to regulate the speed.Plots for the speed control in response to a set-point specified in the real time experiment for FLBPI compared to FLC are presented in Figure 17 and for the position control are presented in Figure 18.A sudden change in load requirements that happens at t=15 seconds causes the speed to fall and then rises and stabilized at the original level within a reasonable range of time.Interestingly, it can be seen the delay in speed and position when using FLC alone as the controller.This demonstrates the action of the controllers to regulate the speed, and the effect of the PI in improving the response time of the hybrid controller.

Fig. 3 .
Fig.3.Structure of feedback controller(Lacevic et. al., 2007) These specifications have been based on realistic assumptions.The hardware implementation for the block diagram is as follows: DC motor: 175 W, 1500 rpm, 240 V, 1.1 A Load: Dynamometer load controller Input elements: Tacho-generator with 500 rpm/volt ADC: 1 channel 0 to 10 volts Filtering: FIR with 30 points Output elements: DAC: 2 channels 0 to 4 volts Differential amp: HA-17741 Power amp: Chopper/Inverter and IGBT Controller elements: Computer with Intel Pentium Dual Core T2080 processor, Windows XP SP3, MATLAB/SIMULINK software.

Fig. 6 .
Fig. 6.Differential amplifier circuit diagram Fig. 7. Graphical process of identification In this work the following two conventional controllers, namely the PI and PID are used.Each controller is optimized using Ziegler-Nichols (ultimate cycle) method.If K pu is the minimum value of K P resulting undamped oscillation and T u is the oscillation period,

Fig. 13 .
Fig. 13.Speed control of DC servomotor using FLBPI in real time experiment vs simulation

Fig. 15 .
Fig. 15.Speed control of DC servomotor using FLBPI vs PID in real time experiment

Fig. 17 .
Fig. 17.Speed control of DC servomotor using FLBPI vs FLC in real time experiment

Table I .
. The rules for FLC NB: Negative Big; NM: Negative Medium; NS: Negative Small Z: Zero; PS: Positive Small; PM: Positive Medium; PB: Positive Big

Table III .
Table III, the transfer function (s-domain model) of the plant based on the best model is as follows:

Table IV .
Performance Index Comparison for Real time experiment