Discrete-Inverse Optimal Control Applied to the Ball and Beam Dynamical System: A Passivity-Based Control Approach

: This express brief deals with the problem of the state variables regulation in the ball and beam system by applying the discrete-inverse optimal control approach. The ball and beam system model is deﬁned by a set of four-order nonlinear differential equations that are discretized using the forward difference method. The main advantages of using the discrete-inverse optimal control to regulate state variables in dynamic systems are (i) the control input is an optimal signal as it guarantees the minimum of the Hamiltonian function, (ii) the control signal makes the dynamical system passive, and (iii) the control input ensures asymptotic stability in the sense of Lyapunov. Numerical simulations in the MATLAB environment allow demonstrating the effectiveness and robustness of the studied control design for state variables regulation with a wide gamma of dynamic behaviors as a function of the assigned control gains.


Introduction
The ball and beam dynamical system is a classical and well-known nonlinear dynamical system that attracts much attention in the control area [1]. The main challenge in this plant is to regulate all the state variables at the origin, taking into account that it corresponds to a fourth-order dynamical system (n = 4) with only one control input (m = 1) [2]. Additionally, the system contains strong nonlinearities such as products between variables and trigonometric functions [3]. Analyzing the ball and beam system from the control analysis point of view is interesting as its model can be used to understand transportation systems, communication, or power system dynamics [4]. In the literature, the problem of control in ball and beam systems has been addressed with linear and nonlinear techniques with some of these are presented as follows; proportional-integral control [5], feedback of state variables [6], linear matrix inequalities [7] exact feedback linearization [8], control Lyapunov functions [9,10], adaptive control design [2], passivity-based control [11], fuzzy logic [12,13], and artificial neural networks [14], among others.
The main contributions of our approach, different from previous works, can be summarized as follows [15].
The application of the discrete-inverse optimal control to regulate all the state variables of the ball and beam system guaranteeing passivity, stability, and optimality properties. The numerical validation via simulations by working the discrete equivalent nonlinear model of the system without any special assumption on the open-or closed-loop dynamics. The robustness and effectiveness of the discrete-inverse optimal control design when parametric variations affect the discrete dynamical model.
It is important to mention that after an exhaustive revision of the literature about the ball and beam dynamical system modeling and control, we identify that the discrete-inverse optimal control has not been studied in this system. This indicates that it is a clear opportunity for research that this article tries to fill.
The remainder of this document is organized as follows. Section 2 presents the general dynamical formulation for the ball and beam dynamical system on the continuous and discrete domains. Section 3 presents the general theory about discrete-inverse optimal control applied on nonlinear systems by highlighting its passivity, stability, and optimality properties. Section 4 shows all the numerical simulations and their corresponding analysis and discussion. Section 5 presents the main conclusions derived from this research study.

Dynamical Model and Discretization
The ball and beam system generates a fourth-order nonlinear set of ordinary nonlinear differential equations [2]. The main objective is to regulate all the state variables around the origin of coordinates guaranteeing stability in closed-loop. Figure 1 illustrates the physical form of the ball and beam system.  In this figure the variables and parameters have the following interpretation; θ and r are the beam angle and the ball position, respectively. Moreover, k 1 is the steady-state gain; τ is the time-constant, L beam is the length of the beam; and m and J b are the mass and moment of inertia of the ball, respectively. In addition, R is the radius of the ball, g is the acceleration due to gravity, r arm is the distance between screw and motor gear, and V m is the input of the system [2]. The dynamical formulation of the ball and beam system depicted in Figure 1 is presented below.
To reach the state space representation of the dynamical model (1), let us define k bb = mr arm gR 2 , and [x 1 , x 2 , x 3 , x 4 ] T = r,ṙ, θ,θ T , which allows finding the following fourth-order nonlinear dynamical model,ẋ where u = v m corresponds to the control input. Note that the equilibrium point of the dynamical system (2) is x 1 , x 2 , x 3 , x 4 T = [r 0 , 0, 0, 0] T , being r 0 an arbitrary point between the extremes of the beam; nevertheless, the unique physical solution possible is when r 0 = 0, due to the gravity force in the real system will make any other point unstable as can be seen in Figure 1.
To design the proposed controller it is needed to represent the continuous dynamical system (2) into a discrete equivalent. For doing so, the classical forward difference is applied [16], i.e., where subscript k is the current sample and ∆ k represents the discretization time. If we apply the forward difference in the set of Equations (2), the the following discrete system is reached. l

Inverse Optimal Control Design
In this section three main aspects of the inverse optimal control design will be explored for general nonlinear discrete systems [15,17]. For doing so, let us define the general structure of the system under analysis as follows [18,19]. Definition 1. A nonlinear dynamical system in the discrete domain with the form , fulfills passivity properties, is globally asymptotically stable, and also there is a control law with the form u k = −y k , such that a functional cost function is minimized, i.e., u k is an optimal control law. Note that in (4), y k is the output of the system and h (x k ) and j (x k ) take the followings structures, being Q a symmetry positive definite matrix, i.e., P = P T 0.
To demonstrate each one of the properties presented in Definition 1, let us consider a candidate Lyapunov function with a quadratic form as follows, which is positive definite for all x k = 0 and zero only for x k = 0. In addition, let us define a general form for the control input u k as follows, where v k is the new input and β (x k ) can be defined as presented below, being I an identity matrix with appropriate dimensions.
Definition 2. The dynamical system (4) exhibits passivity properties if there is a matrix P such that the following inequality is held.

Passivity
To demonstrate passivity properties in the the dynamical discrete system consider Lemma 1 as presented below [20][21][22]. Theorem 1. The dynamical system in (4) is a feedback passive system for the outputỹ k . The control input is defined as (7), whereỹ k takes the following form, whereh Proof. To proof the feedback passivity properties of the dynamical system (4), consider the variation of the Lyapunov function for the current and the future states as follows, Note that using (4) and (7) in (12), we have From (13), we can observe that Now, if we consider Definition 2 and expressions in (14) to be replaced in (13), then we have which confirms that the discrete system is passive from the outputỹ k to the new input v k and the proof about passivity is completed.

Stability
To demonstrate passivity properties the stability properties in the sense of Lyapunov for closed-loop operation, let us consider the following Lemma. Theorem 2. The system (4) is asymptotically stable in the sense of Lyapunov with the control input (7) if v k is defined as Proof. To proof stability in the sense of Lyapunov, we can transform the dynamical system (4) with the control input (7) as an equivalent system with the following structure Now, if we consider the difference between the current and the next step of the Lyapunov function defined in (12), we have From (18), we can note that in addition, from Lemma 2, we know that v k = −ỹ k , which implies that in conjunction with (19), the expression (18) takes the following form which allows to conclude that the system (4) is globally asymptotically stable in x k = 0 as the candidate Lyapunov function V (x k ) = 1 2 x T k Px k is radially unbounded. This completes the proof.

Optimality
Theorem 3. The inverse control law (7) is considered optimal since it stabilizes the dynamical system as presented in Section 3.2, and it minimizes the following functional cost where L (x k , β (x k )) is the LaGrangian function of the system that can be written as Note that the optimal solution for the functional cost is F = V (x 0 ), being it x 0 the initial condition for the dynamical system (4).
Proof. To demonstrate the control law β (x k ), that is, an optimal function, let us consider the Hamiltonian of the system as which has the global minimum as To minimize this Hamiltonian function, we can rewrite (23) considering (22) as follows, The solution of the minimization function (25) considering (23) and the variation of the candidate Lyapunov function (12) as presented in [18], it is taken the following form, in addition, if we consider (4b) and (5), then we can simplify (27) as presented below, It is important to mention that the solution of (27) for β (x k ) takes the following structure, which confirms control function initially defined in (8) as an optimal control law as it minimizes the functional cost (21). In order to determine the optimal value for the Lagrangian function (21), let us consider that the interval of analysis [0, N], being N a natural number with the following result, In the case of the optimal control law β (x k ), this is optimal if it makes zero the Hamiltonian function H (x k , β (x k )) demonstrated in [18]; in addition, we know based on the stability properties of the inverse optimal control that when N → ∞ the Lyapunov function V (x N ) → 0 for any initial condition x 0 , which implies that F = V (x 0 ).

General Commentaries
In the application of the studied inverse optimal control it is worthy to mention the following.
To stabilize a nonlinear discrete dynamical system with the form defined in (4) it is used the optimal control law (u k = β (x k )) guaranteeing passivity, stability, and optimallity properties. The application of the inverse optimal control design is subject to the fact that the dynamical system be zero detectable, which can be expressed as presented in Definition 3. (4) is locally zero-state observable (locally zero-state detectable) if there is a neighborhood Z of x k = 0 ∈ R n such that for all x 0 ∈ Z

Definition 3. A system
is the trajectory of the unforced dynamics x k+1 = f (x k ) with initial condition x 0 . If Z = R n , the system is zero-state observable (respectively zero-state detectable).

Numerical Validation
To demonstrate the effectiveness and robustness of the studied discrete-inverse optimal control for regulation variables in the ball and beam dynamical system, we use the parametric information reported in [2] as presented in Table 1. With the parameters in Table 1, the coefficients k bb and h are 0.4183 and 0.7143, respectively. The discretization time ∆ k is assigned as 1 × 10 −3 s. To evaluate the dynamical performance of the proposed approach, the initial condition of the state variables is 15 cm for the ball position, i.e., for x 1 0 , and zero for the rest of state variables.
The parametrization of the control design is based on the structure of the P matrix, which for the ball and beam system can take the following form, note that P is a positive definite matrix, as it can be rewritten as P = R + J, where R is a positive diagonal and J is skew-symmetry, for r > 0 and j i > 0.
From the structure of the P matrix, we can observe that there exist four parameters that need to be adjusted to reach the desired dynamical performance, i.e., r and j 1 to j 4 . Here, they are tuned via a trial and error procedure by running multiple simulations in the MATLAB/OCTAVE programming environments.

Regulation of the State Variables
In this simulation we present the ability of the proposed control to regulate all the state variables using the anti-symmetry nature of the P matrix, where the control gains were assigned as follows, r = 10.37, j 1 = 16, j 2 = 20, and j 3 = 5. Figure 2 presents the numerical behavior of each one of the state variables of the ball and beam system after its numerical simulations in MATLAB/OCTAVE software. From Figure 2 we can observe the following.
All the state variables are regulated when have passed 4000 samples, i.e.,~4 s, which implies that the discrete-inverse optimal control fulfill the control objective when the control input (28) is applied to the discrete equivalent system (3). The ball position exhibits a smooth dynamical behavior from the initial position (like a second-order system), i.e., x 1 0 = 15 cm, to the origin with a minimum overpass, which implies that the selection of the control gains was appropriate. Nevertheless, this behavior can also be improved (smoothing) if an optimization procedure over gains in P is made as recommended in [13]. The control input u k presented in Figure 2c reaches the zero value when all the state variables are in the origin of coordinates, which is a natural behavior as it is a nonlinear function of all these variables working as a proportional controller that reduces its amplitude when the regulated variables are near to the origin of coordinates.
It is worth mentioning that the proposed controller can regulate all the state variables for the ball and beam system even if this system is strong nonlinear with unique control input and four dynamical equations with a basic implementation in the discrete domain. Figure 3 provides the MATLAB/OCTAVE code implementation that generates all the dynamical behaviors reported in Figure 2. Note that the main idea of providing the MATLAB/OCTAVE code in Figure 3 is the possibility of using it for possible comparisons in future works by engineering students and researches related to nonlinear control areas.

Dynamical Performance for Different Control Gains
This subsection explores the effect that has the variations in the control gains in the matrix P regarding the dynamical performance of the ball position. Figure 4 presents some dynamical outputs of the ball position for variations in the control gain j 3 . These variations begin with j 3 = 4 and ends with j 3 = 6. The results in Figure 4 demonstrate that the dynamical behavior of the ball position is strongly related to the control gain j 3 , as values of approximately 4 produce higher oscillations in its position that vanish after 6500 samples, i.e., 6.5 s approximately. When this gain increases until 6, the system has low oscillations, and the settling time is~4.5 s.
It is important to point out that similar behaviors on the ball position can be reached if r or j 2 are also modified because, as aforementioned, the control input (28) is a nonlinear function of the state variables, which implies that these allow governing the closed-loop behavior of the ball and beam system.

Effect of the Parameter Variations
To evaluate the ability of the proposed discrete-inverse optimal control to deal with parametric uncertainties, we consider that parameters h and k bb have a 20 % of error in their calculations. This implies that in the dynamical model, these parameters are different from the user to design the controller. Figure 5 presents the dynamical performance of the ball position for different combinations of the parameters h and k bb . x 1 0 = 0.15 m k bb = 80% and h = 80% k bb = 100% and h = 80% k bb = 120% and h = 80% k bb = 80% and h = 100% k bb = 100% and h = 100% k bb = 120% and h = 100% k bb = 80% and h = 120% k bb = 100% and h = 120% k bb = 120% and h = 120% From Figure 5, we can observe that the variation in the parameters associated with the physical quantities of the ball and beam system, i.e., h and k bb , has effects on the dynamical behavior of the ball position. Nevertheless, this does not compromise the stability properties ensured by the discrete-inverse optimal control law proposed in this research. In addition, from this simulation, it is possible to note that the setting time remains constant at approximately 4.5 s, which is the same time reported when all the parameters are entirely known. This confirms the robustness of the proposed control approach to possible parametric uncertainties.

Conclusions and Future Works
In this paper, the nonlinear discrete-inverse optimal control approach to regulate all the state variables in the discrete version of the ball and beam system was proposed. Numerical results confirm that the proposed controller allows guaranteeing passivity, stability, and optimally properties during closed-loop operation. In addition, numerical simulations show that the dynamical behavior of the system is highly dependent on the control gains contained in the P matrix as one or more of then can produce similar dynamical performances with small oscillations around the origin of coordinates.
The control design robustness was tested by varying the parameters k bb and h from 80 % to 120% of their nominal rates, where simulations demonstrate that in all of these cases the setting time remains constant at approximately 4.5 s with smooth oscillations around the control objective, i.e., the origin of coordinates.
As future works it will be possible to develop the following. (i) The experimental validation of the discrete-inverse optimal control and their comparisons with nonlinear control methodologies, (ii) the application of the interconnection and damping assignment control to regulate all the state variables by taking advantage on the open-loop model of the ball and beam via Hamiltonian functions, and (iii) the extension of the proposed discrete-inverse optimal control to the four-order model of the synchronous machine system to regulate the angular deviation when short-circuit scenarios appear in the power system.