Fuzzy Self Tuning Of Dc Position Control Based On Labview

This paper investigates the effect of quantization gain factors, at the input side, and the scaling gain, at the output side, of a fuzzy controller. A fuzzy control system is designed with two main parts: a basic fuzzy controller (BFC) which produces the output control signal and supervisor fuzzy controllers (SFCs) to continuously adjust, on-line, the I/O scaling or gain factors of the (BFC) in order to improve its performance against different dynamic operating conditions. The designed self tuning controller is used to position control of a DC motor with un known parameters according to the feed back inputs, a tracking error (e) and change of error ( e), based on the proposed fuzzy rules. The system implementation and tests are carried out using LabVIEW software ( V8.2 ) with a data acquisition card type (NI PCI6251) from National Semiconductors to achieve real time measurements.


1-Introduction
Fuzzy control is becoming one of the brightness and most rapidly ascending stars in the galaxy of intelligent control [1]. This is because it offers a simpler , quicker and more reliable solution that is clear advantages over conventional technique. One of its main advantages is that no mathematical modeling is required since the controller rules are especially based on the knowledge of system behavior and experience of the control engineer [2] . Although fuzzy logic allows for the creation of simple control algorithms , the tuning of fuzzy controllers is relatively difficult and a sophisticated procedure is required to overcome plant parameter variations or changes in operating condition. This is due to the large number of parameters that can be altered off-line or on-line to improve its performance and robustness. These include membership functions, rule base and scaling factors. Each scaling factor is responsible for mapping an input or output to the UOD (Universe Of Discourse). Selection of these factors and\or tuning them are crucial which in many cases are set based on some training data or through trial and error procedure [3] . They have large effects on the performance, therefore adjustment of these parameters is the most commonly adopted method for tuning fuzzy controllers [4][5] [6]. However, there is no systematic method to find the proper factors yet. Many researchers used different techniques to tune them. In [6] neural networks are used for tuning the output factor only and genetic algorithms are utilized in [7] to tune I/O factors, but these techniques need a number of iterations to achieve the desired performance and this is not applicable in real time implementation. In the present work a fuzzy technique is used for automatic tuning of the input and output factors.
In general, drives do not need a fuzzy chip (like microcontrollers, FPGA) to control them, but, instead a moderate PC , data acquisition card (DAQ) with a well tuned algorithm are sufficient enough to control many drive systems [8]. Also the major obstacle in using text based programming languages as a tool to implement the intelligent control algorithms, is the difficulty to modify the control algorithm even for a slight change in the drive system. On the other hand, a graphical programming language has the flexibility, reusability and user friendly interfacing.
LabVIEW Virtual Instruments (or VI) software can be used with a wide range of applications especially in control field [9]. The LabVIEW combined with built in tools being designed specifically for test, measurement, and control, together with a facility for interfacing with real world signals is adopted for implementing the current system. Therefore variations in the control system can be observed in real time and the user commands can also be accepted during the process.

2-Control system structure
The structure of the DC servo motor control system with fixed factors fuzzy controller is shown in Fig.1. This controller have been designed with two inputs, position error between desired angle and actual angle E(k) , and change of position error E(k), Where : The output u(k) of the fuzzy controller is the control signal to the motor that is sent via DAQ card ( analogue output channel 21), and the current position is continuously read in real time by the designed VI-program via the DAQ's analogue input (channel 36) as a feedback The LabVIEW software is used to develop the VI-invironment which has two main parts , a front panel and a block diagram. The front panel is used for user interactions and display of results. The block diagram is the source code constructed using LabVIEW's graphical programming language. LabVIEW has a Fuzzy Logic Toolkit that enables users to integrate fuzzy logic control into virtual instruments. This toolkit is utilized in this current work to design and implement rule-based fuzzy logic system for process control or expert decision making. Any fuzzy logic controller (FLC) comprises four principal components fuzzification, inference engine, knowledge base, and defuzzification [10]. This is shown in Fig.2.

3-Effect of I/O factors on the response of the controller
Before the design of a self tuning controller, a study is necessary of the effect of these factors on the time domain characteristics of its response that reveals its performance. This step is considered the basis for the design of the supervisor fuzzy controllers.

Effect of the input factors
Input factors can be interpreted as the change of the UOD for input variables [4] which basically reduce the number of operating membership functions (and rules) because it pushes the marginal membership functions outside the firing zone therefore the adjusting of these factors is equivalent to reconstruction of the membership functions in the rule base since it will cause the antecedents of the fuzzy inference rules change after the fuzzification and this is why these factors can influence the overall performance of the FLC [12].
From the result shown in Fig.5 and Fig.6, it can be concluded that the effect of increasing the factor Ge is opposite to that of Gec. If Ge is increased the control of error is enhanced, as a result, the rise time is decreased and the settling time is decreased. However, a too large Ge will increase the overshoot and cause the convergence to slow down with even oscillation sometimes. These results are demonstrated in Fig.5 which shows the response of a DC Motor where Gec and Gu remain constant but Ge is varied from 0.25 to 1. On the other hand, the adjustment of Gec affects the control of error's change, so when Gec is decreased the rise time decreases which will speed the transient but a too small Gec will cause overshoot as demonstrated in Fig.6. Table (2) contains the parameters measured from these responses.

Effect of the output factor
On the contrary of the case with Ge and Gec, the output factor Gu is the gain used to transfer u(k) to the actual output value which can directly be applied to the plant. Therefore the tuning of the output factor Gu is more important because of its direct influence on the performance and stability of the system. Actually, the change of the scaling factor Gu expands or contracts the membership functions similar to how an accordion operates [7]. If the Gu increases, the UOD of Gu will extend and the actual value of the output of the controller will increase too, and thus the controller will execute stronger actions to the plant making it respond more quickly as shown in Fig.7. A too large Gu may cause overshoot and oscillation. On the other hand decreasing Gu is beneficial to the stability of the system but it makes the transient response slower. Table(   From the previous analysis we can conclude that the I/O factors do have strong effects on the performance of the controller, especially the output scaling factor Gu. It must also be mentioned that the results above are taken for one state when moving from position 100 to 300 but on other positions the best values of these factors could be altered. On the other hand, the optimum set values of the three factors dose not necessitate the optimum value of each individual one. This is why this problem needs adaptive mechanism, the fuzzy control systems with fixed parameters are non-adaptive. Therefore tuning of these factors according to actual error E and change of error E on-line and in different periods of transient response is necessary to make the BFC adaptive controller. The proposed scheme, to accomplish this goal, is demonstrated in the next section.

Design of a self-tuning FLC
Since the variables and their state are linguistic values (like: IF Gec decreases, the overshoot increases), they can only be interpreted qualitatively and inexactly.Therefore a technique is needed to describe these vague values. Fuzzy set is one of the perfect tools to process the linguistic information. So another level of fuzzy controllers is added to adjust the I/O factors on-line. The structure of the proposed controller is shown in Fig. 8. The supervisor fuzzy controllers represent three controllers each for one of the three gains Ge, Gec, and Gu for adjusting these factors according to the position error and change of position error, at each sample, according to the following equations: U(k) =F(Ge(k) e(k),Gec(k) e(k))Gu(k)   (7) it is clear that the three factors of fuzzy controllers have effect on the output characteristics of the system. However the value of each factor is computed in real time according to the control rules that are extracted directly from the experiences mentioned before and the control knowledge outcome from different response periods. These rules are listed in Tables 2, 3, and 4 for Ge, Gec, and Gu respectively. The VI-pictorial block diagram of the system is shown in Fig. 9.

Test results
The proposed controller has been successfully applied to control a DC Motor. To evaluate the controller performance, several position tracks are applied and the controller is tested and the results are presented in Fig.10, 11, and 12 for the performance comparison between self tuning factors and fixed factors fuzzy control actions.
. Figure 10: Control tracking response for a step from 100 to 300  Figure 11: Control tracking response for a step from 30 0 to 340 The first fixed factors group is set to Ge=0.5 from Fig. (5), Gec = 1 from Fig. (6), and Gu= 10 from Fig. (7). The other fixed factors are set by selecting the best group values obtained by hand tuning. The parameters computed from these three figures are tabulated in tables 5, 6, and 7 respectively.

Conclusions
In this paper, a self-tuning fuzzy logic controller with on-line variable I/O factors using fuzzy inference rules is implemented based on LabVIEW. The test results on a real plant DC motor, with unknown parameters, show that the proposed controller has an improved performance compared with fixed factors fuzzy controller. On-line self tuning of all factors at the same time proved to be necessary to achieve the best parameters set-values of over shoot, transient response time, and steady state error. This is justified by both the response figures (10,11,12) and the response parameters tables ( 5,6,7). Since the step response tests of the proposed control scheme are carried out in real time, it is proved to be practical and adaptive.