# Ballbeam System Analysis and Design Based on Root Locus Correction and State Space Correction

Authors: Chengjun Guo; Wei Xie; Ning Pei
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

The ballbeam control system is one of the most perfect and classic experimental equipment for the research and analysis of automatic control theory. Other nonlinear and unstable systems have important dynamic performance, but because the ball bar system is nonlinear and unstable, it is necessary to design a controller to correct it. In this paper, the root locus and the state space theory are used for correction. In the root locus correction, the curve of the root locus is changed by adding open-loop zeros and poles to make the system stable; in the state space, a state feedback observer is designed by using the principle of pole assignment, and the state feedback matrixK is obtained to make the system stable. Using the visual tool Simulink in MATLAB to simulate, we can see the specific control effect of the controller intuitively. The real-time control was carried out on gbb2004, and the results were observed.


---

## Body

## 1. Introduction

Ballbeam control system is designed for the basic control courses (such as automatic control principles) of the classroom learning practice is an experimental facility. This ballbeam system involves many principles and methods of automatic control principle. The ballbeam system has a very important characteristic; that is, it is not a closed-loop or a stable system. The problem of controlling unstable systems has become an important problem in most control systems, and it is very necessary to analyze and study this problem in the laboratory [1]. But because of these unstable control systems, there are safety risks and very dangerous. As a result, the ball club system has become the best experimental equipment to solve the unstable system. The ball club system is convenient to operate, has no security risks, and basically has the important dynamic characteristics of the unstable control system. But its critical stability has always been a difficult problem in the field of control. There is still a need for further research and design of some controllers to better the problem of the critical stability of the ballbeam system [2]. The club control system includes many aspects of theory and knowledge: electromechanical, kinematics, mechanics, control theory, etc. It is precisely because the system covers a full range of knowledge; it can meet the requirements of automatic control experiment teaching. Many abstract control concepts such as system stability, reliability, observability, and system defensiveness can be expressed intuitively through the ball club control system. So it has some practical significance in the control research of the ballbeam system [3].Therefore, with the development of modern science and technology and the more and more complicated control objects, the control performance and control precision requirements are more and more strict; these requirements make the traditional control methods and theories have been unable to meet, so it is necessary to research more advanced control methods [4]. Recently, the control methods used in club system mainly include state feedback control, switching control, dynamic surface control, sliding mode control, fuzzy control, predictive control, and so on. But in the actual laboratory study, the ballbeam system is an ideal experimental model and has very many difficulties, so it is important to first basic and theoretical research in the laboratory, while the ballbeam system is a typical lose and multioutput coupling system; the system basically includes all instability of dynamic characteristics [5]. Therefore, the analysis and research of the club control system has become one of the important means to test the control methods and theories in the principle of automatic control. It has a very profound meaning for exploring and studying the control methods of the higher-order system and dealing with and solving the problems such as the robustness and stability of the system encountered in the control process. In the control theory, the ballbeam system is a nonlinear system, which contains a lot of nonlinear characteristics, such as saturation and dead zone characteristics in the input quantity [6]. There are significant differences in the rated speed of DC servo motors. The rotary angle of the motor is converted into the inclination angle of the horizontal bar of the ball club system through the rotary table and connecting rod, so as to control the position of the ball; the measurement is discontinuous. The above nonlinear factors have a huge impact on the control analysis, design, signal measurement, and modeling of the system. Another important problem is how to design a ball position control system based on these nonlinear control systems (on the basis of applying linear system theory and methods) [7].In 1948, W.R. Evans proposed a graphical method to obtain the characteristic roots of closed-loop systems in his Graphic Analysis of Control Systems, which has been widely used in control engineering [8]. This method, which is widely used in control engineering, is called root locus method. By studying the change of one or some control system parameters based on the known distribution of open-loop zeros and poles of the system, the performance of the system can be further analyzed and judged through the change of the distribution of the closed-loop poles [9]. When using the root locus method, it is only necessary to take some simple calculations to get one or some parameter changes of the system, so that the influence trend of the closed-loop poles can be obtained. This qualitative analysis and research can have profound significance in improving system performance, studying system performance, and correcting control system [10]. But it must, in the era when science and technology are not very developed and computers are not popular, usually only the rough shape of the root locus can be obtained, so in the era when the use of computers is very common, especially now that there are supercomputers to draw root locus graphics and get the root locus becomes to a very simple thing. This makes the root locus very common [11]. In the design of the control system, Bode diagram and Nyquist diagram can also be drawn according to Nyquist stability criterion and the transfer function of the system, so as to correct the original system and achieve the desired and satisfactory control effect [12].Under the impetus of aerospace technology and artificial intelligence technology in 1950s, modern control theory began to transition from classical control theory and got rapid development in 1960s. In modern control theory, the concept of state space is introduced into the control method by Kalman system [13]. The state mode method is used to describe the causal relationship between the input and output states and other variables. It not only describes the external attributes of the input and output but also shows the internal structural attributes of the system. Modern control theory can be applied to both univariate and multivariate control systems. It can be applied to linear time-varying systems, linear time-invariant systems, and complex nonlinear systems [14]. The beginning of description of state space marked the beginning of modern control theory. Because of the instability and nonlinearity of the ballbeam control system, it is necessary to design some control actions and controllers to make the ballbeam system in a stable state that meets the design requirements. Some control functions and controllers added to the club system are not only useful to some principles of classical and modern control theories but also some widely popular modern theories, such as intelligent control theory [15]. In recent years, in the aspect of the control system of the ballbeam, the main research directions are as follows: PID control, the control of the design of the state observer using the principle of state feedback, the control of the pole zero of the root trajectory, and modern control methods mainly include robust control, neural network control, and fuzzy control [16]. Peng Jiangang from Harbin University of Science and Technology used the BW500 ballbeam system, designed a fuzzy controller using fuzzy control, using double closed-loop fuzzy control, designed a nonlinear model of the ballbeam system in the MATLAB/Simulink environment clock, and showed in the simulation results of his paper. The design of nonlinear model based on double closed-loop fuzzy control theory has good control effect and fast output response [17].


## 2. Establishment of Mathematical Model of Ballbeam System

For the ball and the bar, the ball is placed on the bar, and the bar is connected to the motor through the connecting rod and through the transmission mechanism to control the connecting rod that can tilt up, according to the change of the rotation angle of the motor to control the height of the connecting rod and the tilt angle of the bar and then control the position of the ball, so that the club system can maintain stability.As shown in Figure1, the mechanical part of the club system includes base, ball, bar, reduction pulley, transmission part, motor, etc. [9]. The ball rolls freely on the horizontal bar. The left end of the bar is fixed on the base by an upright column. The right end can be moved up and down around the fixed point by a rotating shaft to make the ball move. The basic control idea of the club is as follows: the DC servo motor rotates, the belt pulley rotates through the belt, and the inclination angle of the cross bar is controlled through the transmission mechanism, so as to realize the purpose of controlling the position of the small ball by controlling the rotation position of the DC servo motor. The inclination angle of the horizontal bar is controlled by the included angle between the driving rod of the supporting part and the base, which satisfies a certain relationship.Figure 1
Ballbeam device.The ball moves on the bar in the ball club system. From the rigid body kinematics, it can be seen that the ball club system is a classical moving rigid body system, and the dynamic equation of the system can be established by using the classical mechanics theory in the inertial coordinate system. In this paper, Newton-Euler method is used to establish the mathematical model of the ballbeam system which is shown in Figure2.Figure 2
Model of the ballbeam system.Attachment (connecting rod and the rotary intersection point and the center of the rotary attachment) and an angle of theta wheel horizon (theta angle has certain limitation, between the minimum and maximum range), connecting rod and the rotary intersection and the wheel center distanced, rail as its starting point and the node to the end of the cross bar on the left side of the length of L, thus, the approximate mathematical relation between the inclination angles of the bar A and θ is as follows:
(1)α=dLθ.A reduction ratio between angle and the motor shaft synchronous belt [13] (n=4) (i.e., ignore the friction in the system, when the motor is the rotation ϕ radian, the corresponding wheel rotation is the 1/4φ radian, and at this point, the rotary table drive link and the balance beam angle radian and ball movement, the purpose of a controller is designed by adjusting the angle of the wheel) makes the ball stay in the desired position. According to the dynamic analysis of the motion of the small ball, the following relationships exist among its gravity, inertia, rotation angle a, and displacement. Through the application of dynamics to analyze the movement of the ball, its gravity, inertia, rotation angle α, and displacement r exist as follows:
(2)JR2+mr¨+mgsinα−mṙα̇2=0.g_ is the gravity acceleration, -9.8 m/s2;m is the mass of small ball, 0.11 kg; R is the radius of small ball; J_ is the moment of inertia of the ball, two mr2; and R is the position of the ball on the cross bar. M will affect the model parameters. Assuming that the movement of the ball on the bar is not translation but rolling, considering the inertia of the ball and the friction force is negligible, α is very small, then
(3)sinα≈α.Then, equation (3) can be simplified as α̇≈0(4)r¨=mgJ/R2+mα.α Substitute equation (4) to obtain
(5)r¨=−mgdLJ/R2+mθ=gd×5L×7θ=1.853θ,where the system outputr is the position of the ball on the bar and the length of the right end of the bar. The input θ is the angle between the line (the intersection point of the connecting rod and the turntable and the center point of the turntable) and the horizontal line on the turntable. Formula (6) is derived from formulas (2), (3), (4), and (5), and the parameter values are as follows: g_ is the gravity acceleration, -9.8 m/s2; m is the mass of small ball, 0.11 kg; R is the radius of small ball; J_ is the moment of inertia of the ball, two mr2; and R is the position of the ball on the cross bar. The mathematical model of the ballbeam system can be obtained
(6)Gs=rsθs=1.853s2.Since the tilt angle of the bar isα̇≈0 in the calculation process, but α cannot be ignored in the actual process, it will cause a certain error in the modeling process. In the actual operation process, by observing the movement of the bar, it can be seen that the motor has a small rotation speed and a short time, and the turntable stops after turning an almost negligible angle. However, by observing the position of the ball on the bar at this time, it is found that the ball is still at the zero scale position, and the ball does not move. After reference, a large number of relevant literature found that this is because in Simulink simulation step response in the module is a set of performance indicators, at zero initial conditions and simulation in real time, and found that at the time of launch control can observe that the system did not reach zero (that is, the bar do not reach level). A bar is an angle below the horizontal line. In view of the above reasons, we can improve the ballbeam control system: in Simulink at the beginning of the simulation, the angle of the bar below the horizontal position is compensated, and the control of the ballbeam system begins after the bar reaches the horizontal position.The input of the ballbeam system is the tilt angle of the bar, and the zero initial response of the ballbeam system is measured in the simulation experiment.In the beginning, the ball is located at the zero scale position of the bar. Since the angle of the bar is lower than the horizontal position, the inclination angle of the bar is marked as the negative angle.At the beginning of zero setting, the inclined angle of the bar increases. When the inclined angle of the bar slowly passes through the horizontal position, the ball will roll to the other end of the bar under the influence of gravity. At this point, the motor stops rotating, and the tilt angle of the bar stops increasing. The pulse position of the motor at this time is recorded as P1. When the ball comes to rest at the other end (i.e., the position where the scale of the bar is 40), make the motor turn in the opposite direction, that is, slowly reduce the tilt angle of the bar until the ball begins to roll to the zero scale position and record the motor pulse position at this time, which is recorded as P2.For manual zero marking, at the beginning of each Simulink simulation, the position of the ball is detected before the pulse of the step response is input. When the position of the ball is detected at the zero scale, the computer controls the rotation of the motor to make it turn toP2−P1/2 position, to complete dynamic zero marking.Before the experiment of the club system, through repeated measurement of the simulation run of Simulink, in Figure3, the “comangle” module in the figure above is the zero compensation angle input by the system, slowly increase the value of “comangle” and visually check the position of the club to find the compensation angle value of its horizontal position. The compensation value is related to the initial position and visual angle of the stabilizer bar. Visually, when the input compensation angle value is 1.81, the club reaches the horizontal position, i.e., comangle=1.81.Figure 3
Angle compensation.


## 3. Design of Root Locus Controller

For the dynamic parameter change of the system, every time the gain changes, we have to resolve the characteristic equation, which is very troublesome. The root locus is generated to solve this problem. To design the root locus controller, it is usually used to add an open-loop zero to make the root locus shift to the left. Open-loop poles are added to shift the root locus to the right, and the closer the poles or zeros are to the imaginary axis, the greater the influence on the original system will be. Or you can add more dipoles near the origin, which affects the stability of the system as shown in Figure4.Figure 4
Ballbeam of root locus.Increasing the effective open-loop zero will generally make the root locus bend or move to the left of the complex plane, increase the system damping, and increase the relative stability of the system. At the same time, it will also increase dynamic performance and oscillation, that is, reduce rise time, increase overshoot, and reduce adjustment time.(7)CsRs=2Ks2+2s+2K.The open-loop transfer function of the ballbeam system is(8)G0s=1.853S2.The system is a second order integral, and the integral of output and input is directly proportional, so it has the function of memory and obvious function of later. Draw the root trajectory diagram of the ballbeam system as shown in Figure5.Figure 5
Root trajectory diagram.Due to the high order (the third order above), the determination of system dynamic performance index is extremely complex, all in order to facilitate the analysis of the ballbeam control system, when designing the controller should not increase the order time closed-loop control system, through the system to increase the open-loop zero pole move root locus, and transform the original shape of the root locus. The system with controller can meet the requirement of performance index. When an open-loop zero is added at the position -1, namely,s+1, the root locus of the system is shown in Figure 6.Figure 6
Add the root locus curve of the controller.When the open-loop gain of the root locus is 2, the overshoot isσ≈0%, and the adjustment time is ts=2.14 at second, which meets the requirements.In order not to increase the order of the closed-loop system, the shape of the root locus is changed by adding the open-loop zero to make the corrected system meet the performance index requirements. When adding an open-loop zero at -1 and the root locus gain is 2, the overshoot isσ≈0%, and the adjustment time is t=2.14 seconds. The simplified closed-loop transfer function of the system is formula (9). In Figure 7, the closed-loop transfer function of the ballbeam system can be simplified as follows:
(9)ϕ0s=2×1.853s+1.853s2+3.706s+3.706.Figure 7
Structural diagram of ballbeam control system.


## 4. Design of Root Locus Controller

In both the classical control theory and the modern control theory, feedback principle is very important; feedback is the main way of control system design. The existence of feedback link can improve the steady-state and dynamic control performance of the system. In modern control theory, besides the application of output feedback, the application state as feedback is also very important to solve the integrated problem of control system.The purpose of assigning the poles ofA linear system is to make the poles of the closed-loop system (A‐BK, B, C), i.e., the eigenvalues of A‐BK, exactly at the desired set of poles, by selecting an appropriate state feedback gain matrix K. The reference index of pole assignment mainly includes the following two aspects: from the perspective of stability, pole assignment of linear system almost completely dominates the stability of the system, and from the methods and theories that consider response analysis, it can be known that the poles of a linear system almost control the reaction rate of the system.For linear time-invariant systems(10)ẋ=Ax+Bu,y=Cx.Set the control quantityu=−Fx+r and substitute it into the original system
(11)ẋ=A−BFx+Br,y=Cx.It can be seen that through state feedback, the system matrix of the closed-loop system is changed toA‐BF. In order to make the system meet certain design requirements, the feedback matrix F is obtained by selecting the eigenvalues of the matrix A‐BF, so as to realize arbitrary pole assignment of the linear system.Note that not all linear systems are capable of arbitrary pole placement through state feedback or output feedback. Only when the system can be fully controlled, can the arbitrary placement of poles be realized.Forn-order linear time-invariant discrete systems
(12)xk+1T=AxkT+BukT.It is necessary and sufficient for the state to be fully controllable(13)rankBABA2B⋯An−1B=n,whereA is the system matrix and is a nonsingular matrix of order n×n and B is the control matrix, which is a constant matrix of ordern×r.Then×nr matrix BABA2B⋯An−1B is called the controllability matrix of n-order linear time-invariant discrete systems.Select the output displacement of the ballbeam system (the position of the ball on the bar) as the state variablex1 and the rolling speed of the ball as the state variable x2. Write the state equation:
(14)x1s=x2,x2s=1.853R.By simplifying Equation (14), we can get:
(15)ẋ1=x2,ẋ2=1.853R.According to the state equations (14) and (15), the state equation of the ballbeam system can be obtained as follows:
(16)ẋ1ẋ2=0010x1x2+01.853R,x1=10x1x2+0R.To sum up, the closed-loop pole of the ballbeam system is+1.36i‐1.36i.The ballbeam system is a second-order integration system with single input and single output; the input is the rotation angle of the turntable which can change the tilt angle of the bar, and the output is the displacement length of the ball on the bar. The system has two state variables, which are the displacement length of the ball and the rolling speed of the ball. The two closed-loop characteristic roots of the system are+1.36i‐1.36i. Because the characteristic roots move on the imaginary axis, the closed-loop club system is oscillating.The concept of controllability of the system was first put forward by Kalman in the 1960s, which is used to extend the new concept of state space to describe the system. It plays a very important role in modern control theory. A system is said to be fully controllable if all the internal states of the system can be completely controlled by the inputs to the system. According to the method and theory of linear control system, controllability is defined as:For a continuous time linear time-invariant system, its state equation is(17)∑:ẋ=Atx+Btut,where into the state vectorx is n-dimensional (with n independent variables), the control function ut is p-dimensional input vector (with p independent variables), and At and Bt are, respectively, n×n and n×p part coefficient matrices.If, in the complete phase space of the system, for any initial statext0≠0, at least one control action can be found within a limited time, t0≤t≤tf regular ut, such that the state xt can reach any position in the phase space within a certain time; the state of the system is said to be fully controllable. It can simply be called system-controllable. Even if only one state variable in an infinite system is uncontrollable, then the state of the system is not fully controllable, which can be simply called the system uncontrollable. For linear time-invariant discrete systems
(18)xk+1=Gxk+Huk.If there is a controlling action sequenceuk, uk+1,…,ul−1 can transfer the system from any initial state xk≠0 to the final state xl=0, where l is a finite number greater than k; then, the state of the system is said to be fully controllable. Even if only one state variable in an infinite system is uncontrollable, then the state of the system is not fully controllable, which can be simply called the system uncontrollable.The basic criterion of controllability is set as the state equation of a linear time-invariant continuous system of ordern(19)ẋ=Ax+Bu,x0=xp,t≥0,where into the state vectorx is n-dimensional (with n independent variables), the control function ut is p-dimensional input vector (with p independent variables), and At and Bt are, respectively, n×n and n×r part coefficient matrices.For the linear time-invariant continuous system of ordern expressed in the equation above, the matrix to judge controllability can be written:
(20)Qc=BAB⋯An−1B.Then, the necessary and sufficient conditions for the system to be fully controllable are(21)rankQc=rankBAB⋯An−1B=n.IfrankQc<n, then the controllability judgment matrix Qc of the ballbeam control system can be constructed according to the above two state equation (20) and equation (21), and its rank can be known from the above formula as 2; then, the ballbeam control system is fully controllable. It can be seen from Figure 8.Figure 8
System state feedback structure diagram.A good state feedback controller design is to use a series of formulas and calculations to make the system can be implemented at the desired position; that is, the closed-loop poles can be located at the desired position; the eigenvalues can be freely configured to obtain the desired dynamics. In the condition of state feedback, the closed-loop poles and eigenvalues can be arbitrarily configured if the controlled ballbeam system is controllable. In general,x (displacement of the ball on the bar x), the state vector of the ballbeam system, is obtained by encoding, sampling, and quantifying the position sensor and can be obtained through a series of calculations:
(22)ẋk=xk−xk−1ts.Assuming that the state equation expression of the ballbeam system has been obtained by the method described above, the expected closed-loop pole of the ballbeam system is assumed to beλ1,λ2; then, the expected characteristic equation of the ballbeam system can be obtained through the formula and definition as follows:
(23)a∗s=s−λ1s−λ2.Write the characteristic polynomial of the state feedback equation of the ballbeam system:(24)detSI−A+BK.If the corresponding coefficients in (24) and (25) are equal, the feedback control gain K matrix can be solved.Assuming that the expected closed-loop pole of the ballbeam system is−1.5+0.5i−1.5−0.5i, the state feedback control gain matrix of the ballbeam system can be solved by applying the above formula as follows:
(25)K=1.34921.6190.It can be obtained from Figure9 that the overshoot is σ=0.0%, and the adjustment time is ts=3.32 seconds.Figure 9
Curve of simulation of ballbeam system.


## 5. Conclusion

The simulation results are as follows. It can be seen from Figure10.Figure 10
Structural diagram of club system.Build the system simulation block diagram Uncontrolsys in MATLAB Simulink, add step signal, connect four modules according to the following Figure11, and save the file as “Uncontrolsys”; the default format is slx.Figure 11
Ballbeam system model.Double-click on Scope to get the system simulation curve.It can be seen from Figure12, the simulation curve that the uncorrected system is oscillating and unstable. This is because the ballbeam system has two open-loop poles at the origin of the figure, and the root trajectories of the ballbeam system are on its imaginary axis. Therefore, when the open-loop gain K of the ballbeam system changes from 0 to infinity, the two closed-loop poles of the ballbeam system will move up and down on the virtual axis, and the system will always be in an unstable oscillating state. Therefore, the controller must be designed to make the system stable. It can be seen in Figure 13.Figure 12
Curve of simulation of ballbeam system.Figure 13
Root trajectory simulation control model.Connect the modules as shown below and save the file as “RootLocus_Simulation.slx.”Double-click the Scope module to get the system simulation curve.According to Figure14, we can calculate the overshoot of σ=14.47% in the simulation of root trajectory correction; the adjustment time is 2.76 seconds, and the steady-state error is 0. Therefore, it meets the design requirements of the controller of the ballbeam system.Figure 14
Simulation curve of trajectory simulation control.Real-time control model of root trajectory is shown in Figure15.
(1)
Open the power button on the electric control box of the ballbeam system(2)
Open the file “rootlocus_control_modify. MDL” in the MATLAB/current folderFigure 15
Real-time control model of root trajectory.When the ball is stationary, double-click to open the oscilloscope “pos” and observe the response of the system.According to Figure16, we can calculate the overshoot of σ=27.47%, when the root trajectory correction is used for real-time control on the ballbeam system, and the adjustment time is 2.94 seconds. Therefore, it meets the design requirements of the controller of the ballbeam system.Figure 16
Real-time control simulation curve of tracks.However, comparing the overshoot and adjustment time between simulation and real-time control, it is not difficult to find that there are some errors, and there are still differences between simulation and real-time control. For example, when the bar is higher than the horizontal position, the ball will roll. However, if the angle is very small, the ball will not roll. However, when the angle suddenly increases greatly, the ball will roll far away due to gravity and inertia, and other nonlinear factors have a great impact on the accuracy. The state space simulation control model is shown in Figure17.Figure 17
State space simulation control model.According to Figure18, we can calculate the overshoot σ=0% in the state space correction simulation, the adjustment time is 2.23 seconds, and the steady-state error is 0. Therefore, it meets the design requirements of the controller of the ballbeam system.Figure 18
State space simulation control curve.Real-time control model of state space is shown in Figure19.
(1)
Open the power button on the electric control box of the ballbeam system(2)
Open the file “statefb_control_modify. MDL” in the MATLAB/current folderFigure 19
Real-time control model of state space.After the ball is stationary, double-click to open the oscilloscope “POS” and observe the response of the system.According to Figure20, we can calculate the overshoot amount σ=28.17% and the adjustment time 2.96 seconds when the state space correction is used for real-time control on the ballbeam system. Therefore, it meets the design requirements of the controller of the ballbeam system.Figure 20
Simulation curve of real-time control in state space.Compared with the state space method, the simulation results show that the state space method can obtain less overshoot and adjustment time.However, comparing the overshoot and adjustment time between simulation and real-time control, it is not difficult to find that there are some errors, and there are still differences between simulation and real-time control. The main reason affecting the performance of the control system is that the mathematical model of the system is not accurate enough. Many important factors are ignored when modeling the system, which affects the performance of the system.



---

*Source: 2963465-2022-03-04.xml*