A Novel Online Self-Structuring Fuzzy Control Algorithm and Its Application

This paper proposes a novel self-structuring algorithm for the online adaptive fuzzy controller (SA-OAFC).The SA-OAFC capable of adding and deleting inference rules autonomously can start operatingwith an empty set of fuzzy rules based on the desired output and actual output of the system to avoid conventional differential operation. It also takes advantage of the auxiliary fuzzy system to evaluate the approximated results with little information of the plant. The SA-OAFC is characterized by its good engineering approachability, robustness for all kinds of perturbations of the plant, and the ability to perform variable selection among a group of candidate input variables. Moreover, it manages to remarkably reduce the amount of computation and decrease the complexity of the system.This paper demonstrates the capabilities of SA-OAFC by a simulation example and then hardware-in-the-loop (HIL) experiment.


Introduction
With the popularization of artificial intelligence in control field, the fuzzy control has been widely used in recent years [1][2][3].However, according to thorough investigation of state of the art of current fuzzy control methods, most of the fuzzy controllers are of fixed structures, except that a few of them have real-time adaptive parameters [4][5][6].Under these circumstances, one needs to not only define the rule base and membership functions (MFs) for these fuzzy controllers in advance but also redesign the whole system in case of the changes of the plant or the working condition.
Aiming at this shortcoming, some researchers have proposed the self-structuring fuzzy controller [7][8][9][10][11][12] where the MFs and rules of the fuzzy system can be increased and adjusted to improve the system structure based on some methods.Park et al. [7] used a method with a fixed width triangular MF, whose MFs and rules increase based on the extended input space.So the input space is divided evenly by the MFs, and there are the issues of the irrational distribution of MFs and the unlimited growth of rules.Cara et al. [11] used the auxiliary fuzzy system to determine the approximate effect of controllers and the positions where there is a need to increase the MFs to achieve a reasonable distribution.But for a complex plant, the unlimited growth of rules still remains, and it is prone to oscillate while the new rules are initializing.To overcome this drawback, Chen et al. [12] adopted the "pseudo fuzzy output" method to determine the initial consequents of the new rules, successfully resolving the oscillation problem and according to the contribution of the rules, they deleted rules to limit the number of rules, but they only removed the redundant rules, ignoring the redundant MFs.
Based on the characteristics of the methods described above, this paper proposes a novel self-structuring algorithm for the online adaptive fuzzy controller (SA-OAFC).In the case of the mathematical model of the plant unknown, this controller starts working online with empty rules and expands the coverage of MFs dynamically depending on the desired output and the actual output of the system, which has the advantages of a small amount of computation, good robustness, and a reasonable distribution of MFs.The main contribution made in this work is designing the SA-OAFC for intelligent control system and testing and analyzing this algorithm by a simulation example and a HIL experiment under disturbance condition.
The rest of this paper is organized as follows.Section 2 presents the control problem to be solved and the structure of the fuzzy controller employed.In Section 3, the proposed SA-OAFC is described in detail.Then, Section 4 shows the simulation results illustrating the main features of the SA-OAFC.Finally, several conclusions are drawn in Section 5.

Problem Description
Without loss of generality, we consider the following dynamic plant [13]: where  is an unknown continuously differentiable function, () is the output of the plant at time ,  is the control input, and  and  are unknown constants related to the plant.The purpose of the controller is to ensure that the output of the plant is able to track a desired signal ().As for the general controllers, the structure shown in Figure 1 often requires the differential operation for taking the error  and the rate of error   as the inputs.But in practical engineering applications, the differential signal is often susceptible to noise which might cause large errors and that is the reason why the proportional-integral (PI) control is applied more widespread than the proportional-derivative (PD) control.Thus, it is assumed that there exists a function  such that the control input  is given by where ⃗ () = ((), (), . . ., ( − ), ( − 1), . . ., ( − )) is employed to avoid differential input signal and make the output of the plant in the next time satisfy ( + 1) = ().To approximate the function , this paper employs the Takagi-Sugeno (T-S) fuzzy system.The th fuzzy rule is as follows [14]: where  = ( 1 ,  2 , . . .,   )  and  are the crisp input and output of the fuzzy system,   V V ∈ { 1 V ,  2 V , . . .,   V V } are the MFs of the input  V ,  V is the number of the MFs for that input, and   is the consequent of the th rule.Thus, the output of the fuzzy controller is given by [14] where Θ represents the parameters of the fuzzy controller,  rules is the number of the fuzzy rules, and   is the activation degree of the th rule.

Online Self-Structuring Fuzzy Controller
A novel online self-structuring fuzzy controller employing triangular MFs is designed to approximate the function .Its main operational processes are divided into the following three stages.
(a) Parameter adaption stage: in this stage, the controller expands the input range dynamically and adopts the reward or punishment policy to adjust the consequents of fuzzy rules based on the system error.
(b) Self-structuring stage: when the performance of the controller fails to be improved by the adjustment of the consequents, the proposed SA-OAFC will get this stage involved.Then there will be a new MF added to one of the input variables of the controller and a new corresponding rule will be generated to perfect the structure of the system.
(c) Deletion stage: in order to reduce the amount of computation, it is of necessity to delete the redundant rules and ineffective MFs according to the contribution rate of the rules.
The detailed description of each stage will be introduced in the following sections.

Parameter Adaption Stage.
Since the characteristics of the plant are unknown, the inputs of the system are likely to exceed the coverage of the existing MFs with the operation of the controller.To solve this problem, we propose a method of expanding the input range dynamically.As shown in Figure 2, when the input   () exceeds the coverage of the current MFs, the endpoint of the MF closest to   () will be chosen as   () +  to expand the existing coverage, but no MF or rule is added in at the moment. is a predefined value and, in practice,  is chosen based on the designer's prediction of the lowest degree of nonlinearity.
Based on the reward or punishment policy, the consequent of the th rule is modified according to the following expression [11]: where   (−1) and (−1) are the activation degree of the th rule and the desired output of the system at instant  − 1, () is the current output of the system, and  is a constant with the same sign as the monotonicity of the plant with respect to .Since the SA-OAFC is to give priority to the modification of the consequents, the value of  is of particular importance to affect the speed of adjustment directly.The greater the value of , the shorter the adjustment time of the controller, but it is also more likely to cause oscillation at the same time.In [11], the absolute value of  can be set as || = Δ/Δ, where Δ is the drive range of the controller and Δ is the range in which the desired signal varies.
Figure 2: Extension of the input range.

Self-Structuring Stage.
Once the modification of the parameters of rules no longer improves the quality of the control, we consider that it is of necessity to make a structural change.In this paper, the mean square error (MSE), given by ( 6), is used to judge whether the performance of the controller is improved or not where   is the number of the data used to calculate the MSE.However, when the plant is already under control, the MSE stops improving, and the decreasing of the improvement rate of the MSE does not always mean that the controller should make a structural change.To avoid this situation, we define a critical threshold MSE min to represent the minimum value of the control error.When the MSE stops improving and its value is larger than MSE min , it is indicating that the system error no longer meets the accuracy requirements and needs adding in more MFs.Therefore, if the value of MSE min is too large, it will be difficult for the controller to make structural changes and will lead to the increase of the adaptive time for the system.In [15,16], each new set of input data will impact on the structure of the controller.For the same data, the different sequences will lead to different structures of the controller.To avoid this phenomenon, we store all the data in the memory  with equal weight in which the   data are made use of to judge the performance of the fuzzy controller so that the controller can be more robust.The selection of   depends on how variable the signal is.If the variation is relatively small, a smaller value will be selected, and on the contrary a larger value will be chosen.
Besides, it is of necessity to determine an input variable to add in a new MF at first, which has been a problem in the field of online control.Some researchers suggested adding in MFs for all the input variables [17], but it will cause a substantial growth in the number of rules.Gao and Er [18] proposed to add MFs in the input variable which corresponds to the maximum membership degree in the rule with the largest weight.The purpose of this approach is essentially to find out the input variable which causes the system error mostly, but it will make the controller become sensitive to noise and reduce the robustness.This paper utilizes the auxiliary fuzzy system [11] to evaluate the situation on the approximation of the input variables of the fuzzy controller and to find out the one with the worst approximation results to add in a new MF.
To illustrate the principle of the auxiliary fuzzy system, a plant with mathematical model in [13] is taken as an example The fuzzy system is used to approximate this plant which is a double-input single-output system, and the surface of the function is shown in Figure 3.
When the input  is going to be approximated, the range of the input  will be divided into infinitesimal intervals with width , and each of them will be taken into account individually.Therefore, the situation in each of the interval  is equivalent to make a fuzzy approximation on function  1 () in the one-dimensional input space, as shown in Figure 4(a).Then we synthesize the effect of approximations in each  to get the full input  approximation.Similarly, when the input  is going to be approximated, the range of the input  will be divided into infinitesimal intervals with width , and the situation in each of the interval  is equivalent to make a fuzzy approximation on function  2 () in the onedimensional input space, as shown in Figure 4(b).In the auxiliary fuzzy system, we adopt the cover of MFs instead of the infinitesimal intervals.But if the number of the MFs is too small, the approximation accuracy will be affected.In contrast, if the number of the MFs is too large, the amount of computation will be increased greatly.Hence, the number of the MFs is given by [11] where  is the number of input variables and  is the number of data stored in the memory .
For each input  V , specific procedures are as follows.
(1) Each of the input variables except  V is covered by  Δ MFs to avoid the influence of the approximation errors of these input variables, and the input  V is covered by the same MFs as it does in the fuzzy controller.
(2) At this time, the th rule of the auxiliary fuzzy system has changed into Rule : so that the approximation function  V  Δ can be obtained.
(3) Compute the sum of squared errors (SSE V ) [11] for input  V as where ⃗   is the th input vector data stored in the memory  and û( ⃗   ) is the actual output of the fuzzy controller produced by that input.
(4) Find the maximum value of the SSE; then the input variable corresponding to that value is the one selected to add in new MFs.
Additionally, the use of the auxiliary fuzzy system, whose essence is the universal approximation properties of fuzzy systems [19], is the key to the SA-OAFC.However, it does not have a direct effect on the controller.In fact, it merely evaluates the approximation effect and chooses the input variable to add in new MFs.
In order to enhance the robustness of the system and consider all of the error distribution, this paper first divides the input variable range into many small intervals Δ  , then calculates the mean square error in each interval, and finally locates the new MF at the center of gravity  *  of the system mean square error distribution given by where  *  is the midpoint in the interval Δ  .For the new MF, the center point is the value of the current input, and the left point and the right point are located at the centre of the adjacent MFs, respectively.Meanwhile, the left point and the right point of the adjacent MFs are modified to the center of the new MF to form a continuous distribution of MFs.When a new MF is added to the input  V , ∏  =1, ̸ =V   new rules will subsequently be produced.
In order to avoid system oscillation, the "pseudo fuzzy output" method [12] is adopted to initialize the consequents of the new added rules to make the output of the system remain consistent whether the rules are increased or not at that time.Assume that, at some time , there are  rules in the fuzzy system and the last ℎ ones are just newly generated.We define   as follows, which acts as the "pseudo fuzzy output" of the original output of the fuzzy system with  − ℎ rules on the occasion that the ℎ new rules were not generated at that time: where    =   ( ⃗ ())/ ∑ −ℎ =1   ( ⃗ ()).
After the generation of the new rules, the real output () is given by where  new is the initial value for the consequents of the new added rules and  −ℎ+1 =  −ℎ+2 = ⋅ ⋅ ⋅ =   =  new .So the  new can be obtained directly from the following expression:

Deletion Stage.
If a self-structuring fuzzy system can only add in rules, the growth of the rule number will lead to the increase of computational load and the decline of parameter learning efficiency.Therefore, it is of necessity to delete those rules with little effect on the system to keep compact.We define the contribution   made by the th rule on the output  and the significance index   representing a measurement of the importance of the th rule as follows [12]: where   =     ,    is the previous value of   ,  ∈ (0, 1) is a decay factor, and  ∈ (0, 1) is a threshold used to update   .  is initialized to 1, and if   is less than , then   decreases; otherwise   keeps constant.An invariable   implies that the th rule is still important for the system and should be remained.On the other hand, a decaying   implies that the th rule is becoming less and less important and thus should be deleted.Therefore, the selection of  and  will affect the rate of deleting the fuzzy rules.The smaller the  is or the larger the  is, the faster the   decays, and thus the faster the ineffective fuzzy rules will be deleted.When   is below the delete threshold Ω ∈ (0, 1), the th rule will be removed as a result.In practical applications, if computational load is given a higher priority, the delete threshold Ω can be selected as a larger value so that more fuzzy rules will be deleted and the amount of computation will be significantly reduced at the expense of less favorable system performance.
After the deletion of some rules, some MFs will no longer play a role in the system.So it is also of necessity to delete the MFs included in no rules and modify the endpoints of the adjacent MFs to maintain a continuous MF distribution.
Finally, the flow chart of the online self-structuring fuzzy controller is shown in Figure 5.For the reason that the mathematical model of the plant is unknown, it is difficult to give the strict formulaic proof of stability, but a qualitative analysis of this issue is provided in [11,12].

Simulation and Experiment
4.1.Simulation.The plant is given by  ( + 1) = −0.075sin ( ()) cos ( ()) + 0.25 ( +  3 ) +  () (16) which shows a nonlinear behavior with respect to both the control signal  and the output .In order to make an analysis of the robustness of the system, a disturbance signal (), shown in Figure 6, is added to the output to simulate the abrupt changes in the plant.
We regard the desired signal (), which is a stepwise function with the range of [−1.5, 1.5], and the system output () as the input of the controller.The drive range of  the controller is [−2, 2], so  is set to 1.3.The simulation step is 0.01 s.The extended width for the endpoint of the MF is selected as  = 0.2.The number of the data used to calculate the MSE is chosen as   = 100 and the threshold for the minimum control error is chosen as MSE min = 0.1.The decay factor is chosen as  = 0.95.The thresholds for updating and deleting criteria are selected as  = 0.01 and Ω = 0.01, respectively.These parameters are chosen through some trials to achieve favorable performance.
The initial fuzzy controller has no rules and the simulated results are shown in Figures 7 and 8.It can be observed that the controller successfully makes the plant track the desired signal () at first in Figure 7.When the disturbance signal () starts intervening after the moment 11 s, a clear deterioration in the performance of the control takes place immediately.Nevertheless, the SA-OAFC also starts counteracting this deterioration at the same time and soon the performance of the control is as good as it was, which reflects the good robustness of the system.Figure 8 shows the distribution curve of the MFs of inputs  and  at the moments 5.5 s and 30 s, reflecting the dynamic expansion of the input range and the deletion process of MFs.
For comparison, Table 1 shows the performance of the SA-OAFC and other self-structuring algorithms mentioned earlier after 3000 online time steps.Since only RASFC [12] and SA-OAFC contain the rules of deletion mechanisms, the number of rules and the computation time in RASFC [12] and SA-OAFC are much less than other algorithms.Performance is evaluated using the root mean square error (RMSE) and the results show that the error of the SA-OAFC is smaller than other self-structuring algorithms.However, the SA-OAFC has more design parameters for the reason that its structure is more complex.

Experiment.
In this section, the plant is the Industrial Mechatronic Drives Unit (IMDU) of the Quanser Company in Canada, whose mathematical model is unknown for us, as shown in Figure 9.This device can be used to illustrate fundamentals of servo control as well as advanced topics, such as haptics and teleoperation, web winding control, backlash compensation, friction compensation, and high order coupling of complex industrial processes.The unit is equipped with four axes, two of which are the motor drive shafts and the other two shafts are free to rotate.All of the four axes contain optical encoders.Each motor is driven by a linear control amplifier with 100 Watts.
For the reason that the C-MEX file has a fast execution speed and what is more important is its ability to manipulate hardware devices in real time, we adopt the Simulink function in C-MEX file to achieve the SA-OAFC.
The fuzzy controller is used to control one motor drive shaft of the IMDU to track a sinusoidal signal under different load conditions.Therefore, we regard the desired signal (), which is a sinusoidal function with the range of [−1, 1], and the position output () of the shaft to be controlled as the inputs of the controller.For the reason that the position output () is measured in degrees, its unit needs to be converted to radians before () is sent to the controller.We set the driving interval as [−1.35, 1.35], so  is set to 1.35.The extended width for the endpoint of the MF is selected as  = 0.1.The sampling frequency is set to 100 samples per second.The number of the data used to calculate the MSE is chosen as   = 50 and the threshold for the minimum control error is chosen as MSE min = 0.1.The decay factor is chosen as  = 0.95.The thresholds for updating and deleting criteria are selected as  = 0.01 and Ω = 0.01, respectively.In order to test the adaption performance of the controller, the initial parameters remain unchanged whether under the load shown in Figure 10 or not.The position tracking curve is shown in Figure 11, and the number of rules is shown in Figure 12, which are both drawn based on the data collected from the real system.
For the reason that the fuzzy controller starts from empty rule, the tracking curve  has a few oscillations at first and then almost coincides with the desired signal .It is indicated that the controller for the plant with the mathematical model unknown still can achieve an ideal performance with the parameters unchanged in different load conditions.Table 2 depicts the evolution of the self-structuring process in the inception phase when the IMDU is under load.For each    structural change, it shows the MSE obtained after the parameter adaption stage and the values of SSE for both inputs to decide the next variable to add in new MFs.At first, the SA-OAFC always assigns new MFs to the input y, which means that the input  is more important for the system to control.When the MSE decreases and its value is less than MSE min , there is no need to add more MFs so that the selfstructuring stage is skipped directly.At the same time, the rules of deletion mechanisms are on all the time and some redundant rules and MFs will be removed to keep compact when the delete condition is reached.

Conclusion
This paper presents a new fuzzy control algorithm, the SA-OAFC, which can adjust the structure and parameters autonomously in real time according to the desired output and the actual output data of the system, in the case of absence of the mathematical model of the plant.Its main features are as follows.
(1) Avoid introducing differential operation to improve the approachability in engineering.(2) Adopt the auxiliary fuzzy system to select the input variable to add in MFs effectively.
(3) Take advantage of the "pseudo fuzzy output" method to avoid the oscillation during initializing the rule consequents.
(4) Delete the redundant rules and MFs in real time to reduce the amount of computation to a considerable extent.
In recent years, studies on the type-2 fuzzy theory which is the extension of type-1 fuzzy theory have drawn much attention.Therefore, as the future works, the proposed control algorithm should be combined with the type-2 fuzzy theory and applied to some more complex systems in practice.

Figure 1 :
Figure 1: Structure of the common controller.

Figure 3 :
Figure 3: Surface of the plant function.

Figure 5 :
Figure 5: Flow chart of the controller.

Figure 11 :
Figure 11: Position tracking curve with the same initial parameters.

Table 1 :
Performance comparison of different self-structuring algorithms.

Table 2 :
Evolution of the structural change under load.