FPGA Implementation of Modified Reconfigurable Adaptive Gain Scheduling Controller

Adaptive controller, Dcmotor, FPGA, Gain scheduling, Inverse Neural, Reconfigurable. This article aims to put forward a modified type of adaptive gain scheduling that will be able to deal with the immeasurable and unpredictable variations of system variables by adapting its value at each time instance to follow any change in the input and overcome any disturbance applied to the system without the need to predetermine gains values. In addition, the inverse neural controller will precede the gain scheduling to eliminate the need for complex system linear zing and parameter estimation. Therefore, the problems of needing complex mathematics for system linearization and gains calculations have been solved. The performance of the presented controller was tested by comparing the step response of a DC-motor controlled via the proposed technique and the response of that motor when controlled by the inverse neural controller and PID controller. MATLAB/Simulink has been used for making the simulations and obtaining the results. In addition, the FPGA implementation of the proposed controller has been presented. The results showed a remarkable improvement in the transient response of the system for all of the rising time, delay time, settling time, peak overshoot, and steady-state error. How to cite this article: A. R. Waheed, A. H. Issa, M. Y. Hassan, “FPGA Implementation of Modified Reconfigurable Adaptive Gain Scheduling Controller, “Engineering and Technology Journal, Vol. 39, No. 07, pp. 1105-1116, 2021. DOI: https://doi.org/10.30684/etj.v39i7.1772 This is an open access article under the CC BY 4.0 license (http://creativecommons.org/licenses/by/4.0).


INTRODUCTION
In the early 1950s, when the design of the aircraft autopilot become true the thinking of designing new controllers has been animated. Moreover, the engineers competed to create a new controller that capable of dealing with many uncertainties and handling many variations in the parameters of the system. So a great deal of interest focused on the adaptive controllers for many reasons, unpredictability, unexpected and sudden disturbances and faults, complex nonlinear systems, unknown system parameters [1].
One type of adaptive controller is gain scheduling,which is used for controlling the systems of time-varying. Originally, gain scheduling was firstly used for flight control, and then it witnessed increasing use in process control [2]. Therefore, a large number of gain scheduling techniques were developed, and the following are some of them: Christos M., et al. (2010), proposed two advanced proportional controllers, the first is an integralcontroller, and the second is a deferential-controller used to control the speed and position of a switched-reluctance DC-motor. A filter (low-pass) has been added to the deferential-controller to enhance reference-point tracking [3].
Fernando R., et al. (2011), a combination of the neural model for DC-servomotor and the neuralnetwork controller, has been used to obtain the position control of the servomotor. A precisely defined mathematical model has needed to obtain the neural model that will be in the simulations [4].
Michal B., (2014), presented an LQR gain scheduling controller for a PMSM (Permanent Magnet Synchronous Motor) and replaced the system of PI controllers in the FOC by a feedback controller of multivariable state, and tuned the gain scheduling according to the changes in the operating circumstances. The system synthesized using the optimal control (LQ) method [5]. Kumar P., et al. (2015), investigated the high precision control in SRM (Switched Reluctance Motor) by adopting a gain scheduling PI-controllers for speed control and PD-Controller for position control. In addition, a filter (Low-Pass) is combined with the proportional part of the PD-Controller so that the impulse response created by the Pi-Controller will be suppressed [6].
Josaphat P., et al. (2017), designed a controller using Fuzzy-Gain scheduling to control the DC-Motor speed of a CNC-machine. The controller is used to overcome the load changes that may change the speed-response. The (PI), gain scheduling parameters are changed by the fuzzy controller to follow the load change [7].
Suppachai H., et al. (2018), presented a PSO-PID gain scheduling for control a water level. The authors used a Mitsubishi-PLC and monitoring pressure sensors with the SCADA-Omron package. Communication between the field and the front end is made by a built-in Ethernet module [8].
Lucky P., et al. (2019), submitted a strategy for control the speed of the IM induction motor through an FPGP PID controller (Fuzzy Prediction-Gain Proportional). The gain scheduling parameters (gains values) are modified by the fuzzy controller rule if there is any change in the IM speed to achieve optimal control parameters [9].
As could be seen from the above literature, the gain scheduling values need to be pre-calculated during the design stage, which means complex mathematical steps will be used for system linearization, and then determining the gain values (using fuzzy, ...etc.). This means a well knowing of the operation environment and disturbance prediction must be available.
Our proposed method is an attempt to design a gain scheduling adaptive controller that has the following features: 1) 1. Avoid the need for system linearization and parameter estimation steps using the plantinverse neural network controller (through training the neural network to produce the inverse of the plant). 2) 2. No pre-determined fixed gain values (the gain values will be adapted continually depending on the error and output values). 3) 3. The transient response parameters of the proposed controller should be better than those for the PID controller and Inverse neural controller (for the same controlled plant). In addition to the introduction in section One, the architecture of the paper consists of; Motor modeling in section Two, Methodology in section Three, simulations and results in section Four, the controller implementation to the FPGA in section Five, and the conclusions in section six.

MOTOR MODELING
The DC motor is regarded as a common actuator in systems control. It produces direct rotational motion and could be coupled with drums, wheels, or and cables [10]. The equivalent electric circuit of the armature and the rotor free-body diagram is shown in Figure 1. The mathematical derivation of the DC motor is done according to the back inducedelectromotive force equation and the torque equation, and depending on the fact that 'the produced torque by the motor proportion directly to the current of the armature by a factor Kt (regarding a constant magnetic field). As explained in Eq. (1) [10]: The TF of the speed ω(s) shown in Eq. (2): Where: J is the Inertia in Kilogram. Meter. b is the Damping-ratio in Newton. Meter. Second. L is the rotor Inductance in milli-Henry. R is the Resistance in ohms. V is the Input voltage in volts. The DC-Motor designed according to Eq. (1) and Eq. (2) shown in Figure 2, below: The DC-motor simulation accomplished by the parameters listed in Table I below:

NEURAL NETWORK
Feed-forward multilayer neural network training by the back-propagation method is regarded to have a very general nature. So, it could use to solve different problems in many areas. Such nets are found in several fields that have problems in mapping the given input-set to the target output-set. A multilayer artificial neural network that has one hidden layer (Z-layer) is shown in Figure (3). The bias terms in the hidden layers' output stand for the connection weights of units that constantly output one. Through the back-propagation learning phase, the signals will be sent in the reverse direction [12]. The following equations show the operation of the back-propagation training method [12]: x: is the training vector (input) y: is the target vector (output) For the hidden-layer (Z-layer), the input given by: the output is given by: For the output-layer (Y-layer), the input given by: the output is given by: In our work, the inverse of the plant was obtained by training the neural network using the backpropagation method by given sets of input-output pairs. Therefore, the generated neural network will give the inverse response of the original plant, as will be explained in section 4.

I. Inverse neural controller
The capability of the inverse neural to obtain the linearization of nonlinear systems and the structure simplicity made it easy to implement in engineering. In addition, it is very beneficial to apply the Artificial Neural Networks (ANN) for system-control and identification for the account of the neural: massive parallelism, capable of learning, quick adaptation, and the ability of inherentapproximation [10].
So, by integrating the nonlinear-approximation ability of the neural network with the inverse system approach (generating plant-inverse ( ), by utilizing neural networks), the algorithmic problems of determining inverse systems could be avoided. Hence, the original nonlinear system control exchanged fortwo integrated linear subsystems feed-forward control [13]. Where: U and Y are the input and the output, respectively.
( ) The inverse of the plant (obtained by training the neural network to give the inverse response of the plant) The idea is to obtain a complete system (plant + controller) whose transfer function is as given by Equation (3): This means the output will follow the change of input identically. However, because of technical and mathematical issues, it is not possible to create a system that exactly inverses the original one, so Eq. (7) will not be true and ≠ . That means errors will appear in the system transient response like overshot, slow rising time, and large steady-state error.
To overcome this problem, an adaptive-gain factor acts as adaptive-gain scheduling used in this work.

II. Adaptive Gain Scheduling
The gain scheduling has been chosen because it is a special type of nonlinear feedback. It has a linear controller with changeable parameters that will update according to the conditions of operating. Another advantage of gain scheduling is the fast parameters change responding to the change in the process [14].
The presented idea is to use the inverse-plant neural controller in cascade with a modified adaptive gain scheduling, as explained in Figure 5.  Figure 4, the adaptive gain ( )connected in cascade with the inverse controller ( ( ) ), is a function of error (U-Y). Therefore it will adapt its value continually and let the output tracking the input by clearing the error in the steady-state region. Therefore, no offset between the system response and the input. Equation (8) explains the way of how the gain scheduling value will be adapted: As could be noted, the proposed controller does not include the insertion of an additional system (no poles and no zeros added). Therefore, the characteristic equation of the original system will not change. The only change is the effect of the additional gain and this will be judged using simulation because it is known that for gain scheduling: "The performance and the stability of the system could be evaluated typically by simulation" [14].

SIMULATION AND RESULTS
Simulation designs and results obtaining have done using MATLAB/Simulink. The simulation comprises modeling of the PID controller, modeling the neural controller of the inverse-plant, also the model of the proposed control method, and comparing their results in controlling the same plant (the same DC-motor).

I. Step response comparison between PID and proposed controller
The following is a comparison of DC-motor step response first when controlled by a PID controller and the second when controlled by the proposed control technique. The PID controller parameters were tuned using MATLAB/Simulink auto-tune, and the step response of both controllers obtained for the same plant and the same input (step signal). Figures 6-7, show the PID-controlled system and the proposed method, respectively.   Figure 8, t is evident that the response using the proposed technique is much better than the PID response, for having less rising time, less peaking time, less settling time, but it has a little higher overshoot. Even though for the proposed system response, the peak overshoot is greater than that for the PID response but it is still regarded as a better response because the difference in overshoots is only 0.156, and less: rising, delay, peak, and settling times. This leads to the fact the step response (of the plant) when controlled via conventional PID is much slower than if it is controlled by the proposed controller.

II. . Step response of inverse controller and proposed controller
This comparison is to certify the enhancement achieved by the proposed control method over the conventional inverse-plant neural controller. Figure 9 is the block diagram of the conventional inverse neural controller. The inverse neural controller is composed of one neural network it is a single input-single output with three hidden layers. All of the layers have a purlin activation function. The network training made using the back-propagation method to obtain the plant inverse response. The training process made with MATLAB/M-file, and the instruction genism(net) used to generate the Simulink block diagram of the network. Figure 10 shows the architecture of the neural network. The step response using the two controllers in the control of the same plant is shown in Figure  11, strengthens the results in Figure 8, and proves the superiority of the proposed method because it uses the same inverse neural controller with the addition of only the adaptive gain scheduling.

Figure 11: System response using both Conventional Inverse and Proposed method
The proposed method again has less rising, peak, settling times, and a little higher overshot. Again, it will reach the steady-state condition faster than the conventional inverse neural controller and approximately with no steady-state error, as illustrated in Table III.

FPGA IMPLEMENTATION
To ensure that; the simulated proposed control method is implementable in real processing cards, it is implemented to the FPGA-SPARTAN 3 by using ISE Design suit 14.7 and system generator. The FPGA is meant to work in a loop with MATLAB/Simulink and the results obtained online.
The implementation has been accomplished with 12% of LUT's and 13% of occupied slices available by the FPGA device. In addition, the total supplied power to the FPGA is just 0.329 watt. Figures 12-13, respectively, showing the device utilization summary and the power consideration of the FPGA. The block diagram of the system is shown in Figure 10. Also, the FPGA in the operation state (LED on) is illustrated in Figure 14.

I. VARIABLE INPTU TESTS
The system step-response shown in Figure 16 declares that the controller was implemented successfully, and the results match the simulated controller results that prove the ability to use the proposed control method in controlling real and online systems (It is reliable). For more emphasis on the reliability and robustness of the proposed control method, another input of repeated sequence was used to test the system response. Figure 17 shows that the proposed control method is capable of tracking the repeated sequence input in a fast, reliable, and robust manner with minimum overshoot and minimum response time. Another input is tested that is not stepped and of variable time intervals used to examine the proposed system's response to the continuous change in referenced input, as shown in Figure 18. From Figure 18, it is clear that the output tracked the input change at each time instant. The tracking error of which the output follows the referenced input is approximately zero. There is no overshoot and no rising time because the input is not rapidly changed from 0 to 5 (as in the step input test). In other words, the value of error needed to be handled by the controller is less.

II. . OUTPUT DISTURBANCE TEST
The following Figures 19-20 show the system response to a unity impulse of 2 seconds duration added at the output of the motor to simulate an opposite sudden output disturbance.  Figures 19 -20, it is obvious that the system response does not fall to the entire value of the disturbance, and there are no oscillations during the duration of the disturbances (2 seconds from 5th-7th sec.). Moreover, the system returned to its steady-state value in 0.4 seconds after the disturbance vanishing. Therefore, it will be clear that the system is robust in handling disturbances that may happen suddenly as a load change or as an operating environment variation.

COMPARISONTO PREVIOUS RESEARCHES
The comparison of our work to some of the previous researches listed in Table IV Table IV. Note: the ---sign denotes no enhancement From Table IV, the following observations recorded: 1) Concerning the rising time (Tr), our proposed technique has the advantage above all of the other researches except ref [15], which has more enhancement in (Tr) but it has neither overshot enhancement nor settling time enhancement. 2) Concerning the overshoot, our proposed technique has no overshot enhancement among other researchers, but it overtaking other researches in the rising (Tr) and the settling time (Ts) enhancements, which means our controller provides a faster response.
3) Concerning the settling time (Ts), it is clear that our proposed technique has the lowest settling time (Ts) so, it is better than other researches. From the above records, it is obvious that our proposed control technique provides the operation of controlling the speed of DC-motor faster than other techniques in the other researches with a very small and acceptable overshoot. In addition to that, our proposed technique requires fewer design steps, less design time, and does not require complex math-operations. All of these advantages give the lead to our proposed technique over other techniques listed in the table of comparison.

CONCLUSION
A prove could be concluded from the results is the proposed technique (Inverse-plant neural controller followed by a modified adaptive reconfigurable gain scheduling) has the advantages of the minimum rising, delay, peak, and settling times over the conventional inverse neural controller and the PID controller. In addition, the FPGA implementation results proved that the proposed controller is reliable to implement in real systems, robust in tracking the input changes and handling disturbances that may happen in the output.
Another conclusion is the gain scheduling successfully achieved without the need to pre-calculate the gain values because the gains continually obtained according to Eq. (8) depending on the change in the error and the output signal. This means obtaining high performance from the controlled system and demonstrating that the proposed method is capable of providing the optimal control-parameters successfully. This work performs the control operation in a simple and time-effective way and very efficient response.