## Abstract

The ball and Plate (BaP) system is the typical example of the nonlinear dynamic system that is used in a wide range of engineering applications. So, many researchers in the control field are using the Bap system to check robust controllers under several points that challenge it, such as internal and external disturbances. Our manuscript proposed a position control intelligent technique with two directions (2D) for the BaP system by optimized multi Fuzzy Logic Controllers (FLC’s) with Chicken Swarm Optimization (CSO) for each one. The gains and rules of the FLC’s can tune based on the CSO. This proposal utilizes the ability of the FLC’s to observe the position of the ball. At our work, the BaP system that belonged to Control Laboratory/Systems and Control Engineering department is used for real-time proposal implementation. The results have been showing a very good percentage enhancement in settling time, rise time, and overshoot, of the *X*-axis and *Y*-axis, respectively.

## 1 Introduction

BaP are electromechanical devices intended to mimic the behavior of some types of multivariable systems. It is a typical standard for control theory research because it has characteristics of under-actuated, cascaded structure, and strong-coupling [1]. It is composed of a metallic ball that is free to roll on a flat plate due to electromechanical actuators’ two-dimensional deflection. The plate must be placed on a special sort of spherical joint to allow this type of movement which usually approximates the BaP system application in the robotics field. Also, it may be a one-dimensional with ball and beam [2]. The low cost and easy implementation are the main advantages of this type of system [3]. Also, it provides the ability to experimentally test theoretical expertise in simulation, control, and other engineering fields, such as computer vision and robotics.

In the literature, Ali et al. [2] had a new approach to control the position of the ball. They used a nonlinear controller with invasive weed optimization (IWO) which is used to obtain the optimal parameters for the proposed controller. The hybrid learning algorithm which is Genetic Algorithm Fuzzy Logic Neural Network Control (GA-FNNC) was prepared by Dong et al. [4], who designed a controller for the stabilization of the BaP system. In [5], they had designed adaptive dynamic programming (ADP) based on optimal trajectory tracking controller for a BaP system and apply large-scale on it. A type-2 FLC had been designed for the stabilization of the BaP system by Farooq [6] and reference tracking of it. The controller had used plate angles as the premise variables for the scheduling of gains and a collection of linear matrix inequalities ensures its stability. The BaP with the controller was implemented in the virtual laboratory by Fabregas et al. [7]. In their work, they control the position of the ball by manipulating the inclination angles of the plate. In a manuscript published by Cheng et al. [8], their proposal was used as a visual servo control to illustrate the mechanical wrist dexterity from the standpoint of table tennis. At the first stage of their work, A BaP system had been chosen. The robotic wrist with a plate attached had been developed by two degrees of freedom. A video camera provided feedback for the control algorithm with a Linear Quadratic Regulator (LQR).

Most of the researchers use the BaP system in the control field to check the robustness of the control response because its complex dynamics depend on inherent instability and nonlinearity. This paper will be using the FLC, and the chicken swarm optimization (CSO) used to tune the I/O gains to increase the stability of the BaP system. Also, the CSO is used to find the best rules to enhance the stability of the BaP system. Our design aims to create an efficient and reliable controller that can produce signals that always force the BaP system states toward the reference states.

## 2 Modeling structure

In the BaP system, which is the extension of traditional ball and beam system, the mathematical model depends on Euler Lagrange’s equation. Figure 1 shows a simple schematic representation of the BaP system. The motion of the ball will be on the *x*-axis and the *y*-axis of the plane {*x*, *y*}, while the deflection angles of the plate are represented by the rotational variables are *x*-axis when the *θ* is slanted from the horizon. While the *δ* will move the ball on the *y*-axis when it is slanted from the horizon. The oblique of the *θ* and *δ* will be by servo motors. The controller will provide the appropriate signal to the motors that put the ball in the right place.

The parameters and values for equations of the BaP system that use in our proposal are shown in Table 1.

The parameters and values of system

Parameter | Description | Value | Unit |

r | Radius of Ball | 0.038 | m |

m | Mass of Ball | 0.223 | Kg |

g | Acceleration of Gravitational | 9.81 | m s^{−2} |

J | Inertia Moment of Ball | 1.76e−5 | Kg m^{2} |

## 3 Fuzzy logic concept

In 1965, Fuzzy Sets was published by Lotfi A. Zadeh [9]. Zadeh then developed the Fuzzy Logic theory, which has proven to be useful in a variety of applications, ranging from consumer to industrial intelligent goods. Fuzzy Logic is one form of intelligence used that does not require detailed mathematical modeling knowledge such as a decision in the mind of a human [10]. Fuzzy logic assigns numeric values between 0 and 1 to each suggestion to represent uncertainty. Fuzzy logic tries to solve problems using an imprecise range of data that allows for a variety of accurate conclusions to be reached. The general diagram of fuzzy logic is shown in Fig. 2. The following three steps are needed to apply fuzzy logic to a real application [11].

Fuzzification: crisp data or classical data is converted into Membership Functions (MFs) or fuzzy data.

Fuzzy Inference Process: membership functions are combined with the control rules to get the fuzzy output.

Defuzzification: fuzzy control is converted into real control action or real output by using different methods to calculate each associated output that is fuzzy.

General diagram of fuzzy logic

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

General diagram of fuzzy logic

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

General diagram of fuzzy logic

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

FLC is a control system that depends on fuzzy logic. In the last few years, fuzzy logic control has witnessed a lot of interest for robust performance as a controller on the system. The systems which have fuzzy logic control are more stable. A FLC is to provide stable controllers applicable to the BaP system and AQM system [12, 13]. In our proposed method, the FLC provides an action control into the BaP system. The gain of error and change error will tune based on Chicken Swarm Optimization (CSO). The rules of fuzzy logic need more experience to be written, where the CSO will tune the rules of fuzzy logic. Fig. 3 shows the FLC which is designed to provide the stability of the BaP system in our proposal.

The design of FLC

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

The design of FLC

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

The design of FLC

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

The simulation of the BaP system has two inputs that control the movement of the ball toward an *x*-axis and *y*-axis. The FLC has two input variables, which are error and change of error and the output is action control for the *x*-axis or *x*-axis. The values of the error and change of error are in the range of −1 and 1. The input memberships of the FLC for the error and change of error are two, which are Negative (N) and Positive (P). The output memberships of the FLC for the action control are nine, which are Negative Big (NB), Negative Medium (NM), Negative Small (NS), Zero Left (ZL), Zero Center (ZC), Zero Right (ZR), Positive Big (PB), Positive Medium (BM) and Positive Small (PB). A shape of membership of the FLC is the Gaussian membership for input and triangular for output. The number of rules in our work is four, which multiply the number of input memberships. The centroid (center of gravity) and Mamdani type in the inference process are used in the Defuzzification.

## 4 Optimization algorithm

*k*is an index of the rooster which is randomly selected from the group of roosters.

*f*is a fitness value of the matching

*X*which is the position of the rooster.

*r*1 is the index of the rooster who is the hen’s group-mate, while

*r*2 is the index of the rooster or hen who is selected at random from the swarm.

*r*1≠

*r*2.

The CSO is to tune the rules and gain the RLC based on the fitness function which is described in Eq. 9. The fitness function represents the error of the path for the ball on the plate.

## 5 Non linear dynamic modeling: simulation and implementation

At this point, the program Matlab 2018b will be used to simulate the BaP system. Moreover, FLC after tuning by CSO, will be designed. Eqs. 1 and 2 which represent the BaP system, are simulated in Simulink such as shown in Figs 4 –7.

Flowchart of CSO

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Flowchart of CSO

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Flowchart of CSO

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Block diagram of Modeling for the BaP system

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Block diagram of Modeling for the BaP system

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Block diagram of Modeling for the BaP system

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Block diagram of a Fuzzy Logic Controller and the BaP system

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Block diagram of a Fuzzy Logic Controller and the BaP system

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Block diagram of a Fuzzy Logic Controller and the BaP system

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

The BaP system in the Controller Laboratory

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

The BaP system in the Controller Laboratory

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

The BaP system in the Controller Laboratory

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Our proposal is implemented in the Control Laboratory/Control and Systems Engineering Department by using the BaP system. Where the 310 and 230 mm are the width and height of the BaP system in Control Laboratory. The BaP system consists of two servo motors, a touch screen, Arduino mega, and a power supply. The touch screen is used to get coordinates of the ball. The Arduino mega receives a signal from it with noise. So, the low pass filter was used to remove the noise.

## 6 The simulation and experimental results

The CSO uses the fitness function to get the best I/O gains and rules for the multi fuzzy logic of the controller. Figure 8 illustrates the path of the solution. Where iteration is 50 and the best minimum value of the fitness function is (0.06173780).

Best Fitness versus iteration for CSO

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Best Fitness versus iteration for CSO

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Best Fitness versus iteration for CSO

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

The unit step is used as input to the *X*-axis and *Y*-axis of the BaP system to check a characteristics of our proposal. Figure 9 is shown target and actual trajectories for line path responses of the BaP system. The percentage enhancement of our proposal is the best when compared with published work in reference [2] such as shown in Table 2.

Target and actual trajectories for a line path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Target and actual trajectories for a line path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Target and actual trajectories for a line path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Line path characteristic of Proposed controllers and published work in reference [2]

Controller | Proposed controllers | Published work in reference [2]. | Enhancement Efficiency in Y-axis | Proposed controllers | Published work in reference [2]. | Enhancement Efficiency in X-axis |

Characteristic | Y-axis | Y-axis | X-axis | X-axis | ||

Rise Time | 1.3387 | 2.0753 | 35.4937% | 1.2514 | 2.2165 | 43.5416% |

Settling Time | 2.3301 | 6.3936 | 63.5557% | 2.2857 | 6.8587 | 66.6744% |

Overshoot | 0 | 6.4990 | 100% | 0 | 6.2476 | 100% |

Table 3 represents the gain parameters of the proposed controller which was founded by using the optimization technique (CSO).

Optimal gain parameters of proposed controllers

X-axis | K1 | 0.456658699380614 |

K2 | 0.337016262939350 | |

Y-axis | K1 | 0.349028015147271 |

K2 | 0.280045644230414 |

Another experiment is applied on the BaP system with a circular path to demonstrate the effectiveness of the proposed control method. The sine wave form is used as input to the *X*-axis while the cos is used as input to the *Y*-axis of the BaP system. The sine and cos wave form have the same frequency to generate the circular path in which the ball moves it. The path of the ball is exactly on the target trajectory such as shown in Fig. 10.

Target and actual trajectories for circle path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Target and actual trajectories for circle path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Target and actual trajectories for circle path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

When the sine and cos wave form do not have the same frequency, the infinite path had generated in which the ball moves in such a way as shown in Fig. 11.

Target and actual trajectories for infinite path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Target and actual trajectories for infinite path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Target and actual trajectories for infinite path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

The efficiency of our proposal is clear when the square path has been generated in which the ball moves in such a way as shown in Fig. 12.

Target and actual trajectories for square path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Target and actual trajectories for square path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Target and actual trajectories for square path

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Finally, the results of the practical experiment had been collected from Embedded system like Arduino mega and drawn in Fig. 13. The practical results in our proposal demonstrate the controller characteristics robustness with optimized I/O gains and rules for the BaP system which had tuned in the CSO.

Target and actual trajectories obtained practically

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Target and actual trajectories obtained practically

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

Target and actual trajectories obtained practically

Citation: International Review of Applied Sciences and Engineering 2022; 10.1556/1848.2021.00360

## 7 Conclusions

In this work, the MFLC’s have been proposed to control the path of a ball in the (2D) BaP system. The nonlinear dynamics equations of the BaP system have been simulated in Simulink of Matlab to tune the parameter of the MFLC’s by CSO. Many states of targeted trajectory have been simulated and implemented to test and validate the designed controllers. Rise time, settling time, and overshoot, for the results of the simulation were (1.3339 s, 2.3445 s and zero), respectively. The Laboratory BaP system has been used to test/implement MFLC’s design and obtained practical results that are very close to simulation results. The practical part is implemented by using two very robust controllers that lead two servo motors in the *X*-axis and *Y*-axis. The big challenge scenario in future work will be using one central servo DC motor for both axes to control it.

## References

- [1]↑
M. Jie , H. Tao , and J. Huang , “Observer integrated backstepping control for a BaP system,”

, pp. 1–8, 2020.*Int. J. Dyn. Control* - [2]↑
H.I. Ali , H.M. Jassim , and A.F. Hasan , “Optimal nonlinear model reference controller design for BaP system,”

, vol. 44, no. 8, pp. 6757–6768, 2019.*Arabian J. Sci. Eng.* - [3]↑
D. Núñez , G. Acosta , and J. Jiménez , “Control of a ball-and-plate system using a State-feedback controller,”

, vol. 28, no. 1, pp. 6–15, 2020.*Ingeniare: Revista Chilena de Ingenieria* - [4]↑
X. Dong , Z. Zhang , and J. Tao , “Design of fuzzy logic neural network controller optimized by GA for BaP system,” in 2009 Sixth International Conference on Fuzzy logic Systems and Knowledge Discovery, vol. 4, IEEE, 2009.

- [5]↑
F. Köpf , S. Kille , J. Inga , and S. Hohmann , “Adaptive optimal trajectory tracking control applied to a large-scale ball-on-plate system,” arXiv preprint arXiv:2010.13486, 2020.

- [6]↑
U. Farooq , J. Gu , and J. Luo , “On the interval type-2 fuzzy logic logic control of BaP system,” in 2013 IEEE International Conference on Robotics and Biomimetics (ROBIO), IEEE, 2013.

- [7]↑
E. Fabregas , et al., “Virtual laboratory of the BaP system,”

, vol. 48, no. 29, pp. 152–157, 2015.*IFAC-PapersOnLine* - [8]↑
C.-C. Cheng and C.-H. Tsai , “Visual servo control for balancing a ball-plate system,”

, vol. 5, no. 1, p. 28, 2016.*Int. J. Mech. Eng. Robotics Res.* - [9]↑
I. Dzitac , F.G. Filip , and M.-J. Manolescu , “Fuzzy logic is not fuzzy: world-renowned computer scientist Lotfi A. Zadeh,”

, vol. 12, no. 6, pp. 748–789, 2017.*Int. J. Comput. Commun. Control* - [10]↑
R.S. Salman and A.T. Abdulsadda , “Network scheduling by using expert nonlinear controller,” 2020.

- [11]↑
B.P. Ganthia and K. Rout , “Deregulated power system based study of agc using pid and FLC,”

, vol. 4, no. 06, 2016.*Int. J. Adv. Res.* - [12]↑
R. Moezzi , V.T. Minh , and M. Tamre , “Fuzzy logic control for a ball and beam system: fuzzy logic control for a ball and beam system,”

, vol. 1, no. 1, pp. 39–48, 2018.*Int. J. Innovative Technol. Interdiscip. Sci.* - [13]↑
H.M. Kadhim and A.A. Oglah , “Interval type-2 and type-1fuzzy logic controllers for congestion avoidance in internet routers,”

, vol. 881, August 2020, Paper no. 012135.*IOP Conf. Ser. Mater. Sci. Eng.* - [14]↑
S. Deb , et al., “Recent studies on chicken swarm optimization algorithm: a review (2014–2018),”

, pp. 1–29, 2019.*Artif. Intelligence Rev.* - [15]↑
D. Wu , S. Xu , and F. Kong , “Convergence analysis and improvement of the chicken swarm optimization algorithm,”

, vol. 4, pp. 9400–9412, 2016.*IEEE Access* - [16]↑
X. Meng , et al., “A new bio-inspired algorithm: chicken swarm optimization,” in International Conference in Swarm Intelligence, Springer, Cham, 2014.