Intelligent Swing-Up and Robust Stabilization via Tube-based Nonlinear Model Predictive Control for A Rotational Inverted-Pendulum System

Resumen: El propósito de este trabajo es presentar un nuevo esquema de control robusto basado en un modelo no-lineal aplicado a un sistema de péndulo invertido rotacional. El péndulo rotacional está compuesto por un brazo mecánico unido a un péndulo de movimiento libre (ortogonal al brazo), conocido como el péndulo Furuta. En principio, un controlador Fuzzy permite que la barra del brazo robótico levante el péndulo giratorio a través del movimiento oscilatorio y alcance automáticamente la posición de equilibrio superior en un rango de operación de estabilización prescrito. Después de que el péndulo alcanza el rango de operación, un sistema de conmutación inteligente permite la transición entre el controlador basculante y un controlador predictivo robusto para mantener la posición angular del péndulo alrededor de la posición vertical ascendente. Para lograr un desempeño robusto, un marco centralizado del controlador propuesto combina un tres acciones de control. El primero compensa las perturbaciones utilizando la trayectoria de regulación control de adelanto. La segunda acción de control corrige los errores producidos por la discrepancia de modelado. El tercer controlador asegura robustez en el sistema de lazo cerrado mientras compensa las desviaciones de las trayectorias de estado con respecto a las nominales (es decir, sin perturbaciones). La estrategia de control proporciona factibilidad robusta a pesar de que las restricciones en la barra del brazo y los actuadores del péndulo son alcanzadas. Dichas restricciones se calculan en línea en base a conjuntos robustos positivamente invariantes caracterizados por conjuntos politópicos (tubos). El controlador propuesto se prueba en una serie de pruebas de simulación y se valida de forma experimental en un entorno de simulación de alta fidelidad que incluye un péndulo invertido giratorio construido con fines educativos. Los resultados muestran que el rendimiento de control robusto se fortalece frente a perturbaciones del sistema de lazo cerrado en comparación con la de los controladores predictivos lineales y no lineales inherentemente robustos.


INTRODUCTION
The underactuated mechanical systems, consisting of a fewer number of actuators than degrees-of-freedom (DOF) to control, have been widely studied in diverse application fields such as terrestrial mobile robotics, marine engineering, and aerospace engineering to name a few (see Scalera et al. (2020); Duan et al. (2020); Hao et al. (2013) and their references). For instance, the rotary inverted-pendulum (RIP) system has been widely used as a suitable prototype in the educational area due to its reduced complexity, high practicality and tractability Hernandez-Guzman et al. (2016). The RIP system, also known as Furuta pendulum system in recognition to its original designer Furuta et al. (1992), is a well-known underactuated mechanism extensively used by several researchers to assess control performance and validate linear and nonlinear control techniques Estupinan et al. (2017). The mechanism comprises a two-degree-of-freedom system with a single actuator that provides the motor torque input to the base arm of the system. In this way, the arm rotating in the horizontal plane enables the mechanically attached pendulum to freely rotate in the vertical plane. The vertical motion of the pendulum depends on the horizontal motion of the base arm; therefore, the objective of the system is to stabilize the pendulum in the unstable vertical position varying the torque input applied to the arm.
To achieve a proper behaviour in the stabilization of the vertical position of a RIP, three-stage control approaches are generally required to fully cover the motion phases Muskinja and Tovornik (2006). These phases usually comprise: i) swing-up, ii) stabilization, and iii) trajectory tracking. The first phase consists on balancing the RIP through controlled oscillations from the resting state until reaching the upward position, and then keep the rotating base fixed. Once the pendulum oscillates within a range of vertical stabilization, the regulation problem must be covered by the control framework within a second phase in order to maintain the rotatory pendulum at the upward unstable position against external or internal disturbances. Then, the third phase enables the base arm to track a prescribed reference trajectory; meanwhile, the system is vertically stabilized by the effect of the arm rotation and pendulum inertia. This work addresses the three aforementioned control objectives regarding swing-up, robust stabilization, and trajectory tracking against disturbances. As the RIP system has under-actuated degrees-of-freedom of the joint between the rotational base and the pendulum arm, many conventional control strategies developed for fully actuated systems cannot be directly applied due to the strong mechanical coupling Kharola et al. (2016). Unlike traditional energy-based, model-free, adaptive, neural networks, genetic and other classical control algorithms Fantoni and Lozano (2002); Tanaka et al. (2011); Mandic et al. (2014); Delibasi et al. (2007); Kennedy et al. (2019), the current literature shows Model Predictive Control (MPC) framework as a promising technology based on optimization that has drawn the attention in control applications for under-actuated and rapid-response mechanisms due to its simple structure, straightforward design procedure, and robust properties against system uncertainties and disturbances Ghanavati et al. (2011). Compared to other classical optimization-based methods such as LQR or LMI to deal with piecewise stabilized dynamics Minouchehr et al. (2015), the MPC approach adopts optimization methods to correct the current dynamics based on feedback and predictive behaviour subject to system constraints. For instance, in Bakarac et al. (2018), it was developed a control system for stabilization of a prototype RIP based on linear MPC (LMPC) with simplified Coriolis, centrifugal, and gravity force model. Although it was reported a favourable control performance under tests on speed changes of the rotatory base, its degree of robustness persisted against external disturbances because of the linear control layout dependency. In Li et al. (2015), a hybrid LMPC architecture based on a neural network approach was proposed to address the regulation and tracking phase of a RIP, in which the lifting speed limitation and constrained actuator capability were both concerned. In the aforementioned works, the stabilization phase of the pendulum at the upright equilibrium position relied only on inherent robust properties of a feedback control loop.
Due to linear models do not fully capture the dynamic behaviour of the lifting angle position and angular speed of the RIP arm, a suitable control performance can hardly be achieved for the full operating range of a reference trajectory. In general, when a nonlinear prediction model is linearised around operating points of the reference, the system dynamics in such points potentially do not correspond accurately to the true ones either by model approximations (i.e., model uncertainties) or internal/external disturbances (i.e., rotatory base inertia or external force exertion). Consequently, the prediction model mismatch and disturbances may incur possibly in the evolution of significant prediction errors and latently in the instability of the closed-loop system Kayacan and Peschel (2016). Thus, compared to linear control formulations, nonlinear MPC (NMPC) arises as a suitable alternative to deal with nonlinear dynamics of an inverted pendulum system. Due to swing-up motion of the RIP is able to take the pendulum arm close to the stabilization zone by motion transmission of the rotating base, few works have taken advantage of this phenomenon to decentralize the control scheme. For example, a recent hybrid control scheme was proposed with a swing-up motion control strategy in Wilson et al. (2016), under which a modified oscillator as reference trajectory was used for lifting, whereas the stabilization phase with an NMPC controller. This method may be unattractive because the oscillations required to reach the stabilization zone were not restricted, thus swinging the pendulum bar for a long time. On the contrary, in Yue et al. (2018), rapid swing-up motion (i.e., one-step lift) was achieved employing a stabilizing adaptive control law taking into account only the unactuated mechanism, and thus the control law was switched to a globally stabilizing NMPC controller valid only within a reduced operating zone without uncertainty and disturbance compensation. The main concern lies in the stabilization phase where the lifting angle considerably affected the motion performance in the upward position with relevant oscillatory motion, thus requiring an intelligent strategy to coordinate swinging-up motion and robust stabilization of a RIP.
Despite all strengths of NMPC, such as the capability to explicitly handle nonlinearities and systematically include constraints in the control framework, robust performance for the stabilization of the RIP can only be achieved if a nominal controller (i.e., disturbance-free) is inherently robust and estimation errors are small enough Mayne et al. (2006). Unfortunately, in practice, inherent robustness properties are not always present in predictive controllers due to model uncertainties or disturbances Ke et al. (2018), although a certain degree of robustness could be achieved due to feedback Gonzalez et al. (2009). To cope with this issue, robust NMPC designs explicitly account for the error compensation originated by disturbances or model discrepancies through corrective control actions Kouvaritakis and Cannon (2015). In this scenario, tube-based nonlinear MPC (T-NMPC) has shown to be an efficient synthesis approach to robustify control actions in a non-deterministic form, whose base focuses on computing admissible regions characterized by polytopic sets so-called tubes Mayne et al. (2011).
The contribution of this paper is twofold. The first consists on introducing a new intelligent swing-up motion approach to balance the rotatory base of underactuated RIP systems until reaching the stabilization zone of the pendulum bar. The strategy is based on assessing the angular speed and position of the pendulum arm as it approaches the stabilization zone in order to control such variables using a Fuzzy logic controller. The second contribution lies in the design of an efficient robust stabilizing and trajectory tracking controller for RIP systems. To this end, a T-NMPC is proposed under a centralized control architecture to reach robust performance of the overall system against disturbances. Firstly, to represent the pendulum motion, forward equations based on the Euler-Lagrange form are proposed. Secondly, the design strategy combines: a) feedforward, b) corrective, and c) tube-based control actions to provide robust performance guarantee with regard to tracking errors, actuator effort, and constraint satisfaction under uncertainties, nonlinearities, and internal/external disturbances. The control framework adopts the Real-Time Iteration (RTI) scheme, as the available in the ACADO Toolkit Houska et al. (2011) to solve efficiently the optimization problem raised in the NMPC strategy.
The work is organized as follows. First, Section 2 describes the Euler-Lagrange formalisms, including the mathematical formulation of the proposed nonlinear model for the rotational invertedpendulum system. Section 3 presents the swing-up controller based on Fuzzy Logic. Section 4 presents the proposed control architecture with the robust tube-based nonlinear predictive controller. It is also included the linear predictive controller. Section 5 details the Fuzzy logic-MPC framework for the intelligent bypass. Section 6 describes simulations and experimentations carried out with the proposed controller. Finally, this document ends in Section 7 with the concluding remarks of this paper.

PROBLEM FORMULATION
This section presents the feedforward equations of nonlinear model that stands out the Rotational Inverted-Pendulum (RIP) system dynamics, and the problem formulation.

Feedforward Dynamics of the Rotational Pendulum
An extension of the dynamical nonlinear model for the RIP dynamics is described. The model employed in this work represents the underactuated pendulum mechanism that connects a horizontal rotating arm with a free-motion pendulum bar, as shown in Fig. 1. The RIP -Furuta pendulum-is different to conventional pendulum systems because it has fewer unmodelled dynamics Ling et al. (2002), owing to a motion transmission mechanism since the rotatory arm directly couples to the motor shaft. A rotatory pendulum is considered taking into account the following assumptions: • The mass of the pendulum bar is considered evenly distributed along the rotated pendulum shaft.
• The interaction effects between the pendulum bar and rotational arm motion are not neglected.
Under these assumptions, it is considered the inverted-pendulum system in the Euler-Lagrange form given by: where q = [q a q u ] T andq = [qaqu] T ∈ R n are vectors of generalized coordinates that represent the RIP system (i.e., rotatory base and pendulum arm position and speeds, respectively); q a and q u are actuated and unactuated variables, respectively; B ∈ R n×n u is the input matrix, and u ∈ R n u is the control input for the RIP system. The Lagrangian function L is described by: where M(q) is a symmetric positive-definite inertia matrix and V (q) denotes the potential energy of the system. Replacing the function L from ((2)) in the dynamic system ((1)), the motion model for the RIP can be rewritten as follows: where C(q,q) stands out the combination of Coriolis, centrifugal, and friction forces; G(q) represents the gravitational loading vector, and D = [d 0 d 1 ] T assumes to satisfy the model matching condition for uncertainties, disturbance, and non-modelled dynamics such as viscous and Coulomb forces exerted on the actuated joint.
The system variable q = [θ 0 θ 1 ] T andq = [θ 0θ1 ] T correspond to the joint angular position and speeds of the rotatory inverted pendulum, respectively; θ 0 and θ 1 denote the angular position of the rotatory base arm and pendulum bar, respectively. The control input is represented by u = [τ 0 0] T , where τ 0 ∈ R is the torque input applied to the RIP base arm. Each matrix that represents the dynamic system in ((3)) can be described as follows: where s 1 = sin (θ 1 ) and c 1 = sin (θ 1 ); J 0 = J 0 + m 0 r 2 0 + m 1 l 2 0 , J 1 = J 1 + m 1 l 2 1 , where J 0 and J 1 are the arm and pendulum bar moment of inertia; m 0 and m 1 are masses of the rotatory base and pendulum bar, respectively; l 0 , l 1 , r 0 , r 1 are geometrical parameters of the inverted pendulum, and d 0 and d 1 are the friction coefficient of the arm and pendulum joint, respectively. Then, obtaining q from (3) and replacing the system matrices from (4), the motion model is given by: where the nonlinear system in (5), composed by the rotatory base arm and pendulum bar, is written with respect to the system states z(t) =q(t) in the following form: The previous dynamic model in (6) for the feedforward dynamics of the RIP system describes the open-loop trajectories as shown in Fig. 2. Parameters of the RIP system under study are descrbied in Table 1, whereas the RIP model can be written in the nonlinear state space representation as follows: where t represents continuous time; z(t) = [θ 0 θ 1θ0θ1 ] T ∈ R n z , and u(t) = [τ 0 0] T ∈ R n u represents the vector of system states and control input for the rotational inverted pendulum, respectively; δ (t) denotes modelling uncertainty. Here, the RIP system is required to satisfy system state and control input constraints described in polytopic form: where Z(t) ⊆ R n z is closed, U(t) ⊆ R n u is compact, and both are bounded convex sets that will be used for designing the robust control strategy, as will be discussed later. The modelling uncertainty of the robot dynamics is unknown, but holds that: where D is a bounded convex and compact set containing the origin in its interior. This set accounts for any uncertain realization including disturbances, subsystem interactions, and modelling errors.

Control Objectives
The major control objectives of this work are: • Rapidness: The pendulum bar is lifted as fast as it approaches the stabilization region in the upward angular position of the inverted pendulum.
• Transitivity: The Fuzzy logic-based swing-up motion control of the pendulum bar is smoothly bypassed to a second phase of NMPC control devoted to the stabilization. It is assured evaluating angular position and speeds. • Robustness: According to the proposed NMPC policy, original constraints (8) are tightened with more restricted ones, which consider additive model uncertainties (9) and timevarying dynamics (7).
• Performance: An optimization problem based on the Real-Time Iteration (RTI) Scheme is solved at each sampling time obtaining proper control inputs as a compromise between deviations of the system trajectory from that of the reference one.
• Control input and state constraint achievement: This requirement is guaranteed by assuring robust constraints satisfaction in the optimization problem involved in the nominal predictive law.
• Local asymptotic stability is assured through a candidate Lyapunov function obtained for all uncertainty realization of the mismatch system.
• Efficient on-line runtime is guaranteed for the optimization problem raised in the nominal NMPC due to the effect of model uncertainties are already included within tightened constraints.

SWING-UP MOTION CONTROL STRATEGY
Swing-up motion control is aimed at lifting the pendulum bar from its stable resting position θ 0 = π[rads] to its upright unstable angular position θ 0 = 0[rads], where the stabilization controller is activated. As the pendulum bar can reach the upright position with a certain speed and acceleration due to the rotational base arm force and pendulum bar inertia, the swing-up motion control requires to anticipate such effect in order not to overpass the stabilization region. In this scenario, the goal of the swing-up controller is to take the pendulum close to an stabilization zone S t a b il iza tion Z o n e including the equilibrium position, instead of a single angular position. As the applied torque relies on the angular accelerationsθ 0 andθ 1 through the nonlinear terms J 1 sin 2 (θ 1 ) and m 1 l 0 r 1 cos (θ 1 ) as in the proposed model (6), respectively, these terms influence the torque effect over the angular accelerations of the pendulum bar at any angular position θ 1 . Then, for sake of analysis, it is assumed that onlyθ 1 has a potential contribution on the applied torque input to the rotatory base due to the fact that the effects ofθ 0 over the pendulum can be accounted as disturbances.
The swing-up control strategy is based on the energy-balance methodology, which is adapted for RIP systems fromMuskinja and Tovornik (2006); Kizir et al. (2008). Fuzzy logic based on Takagi-Sugeno (T-S) model is employed to design the swing-up controller, which is defined by the pendulum bar angle error e θ 1 (i., difference between the reference and current pendulum arm angle position), angular speed error eθ 1 (i., difference between the Tabla 2. Base of Fuzzy rules to represent the Takagi-Sugeno model used in the design of the swing-up controller. reference angular speed and current pendulum angular speed), and torque τ 0 as inputs and output of the swing-up controller. About fifty input-output pairs e θ 1 , eθ 1 and τ 0 are obtained according to the way the pendulum arm behaves as the control problem is solved with different initial conditions. Figure 3 shows a safety zone for the stabilization of the swing-up motion controller, and acceleration-deceleration regions in which an RIP system can approach a suitable swing-up control performance.
In order to balance and lift the inverted pendulum up to a stabilization zone comprised by the angular position range θ 1 ∈ − π 6 , π 6 rads, the swing-up controller is designed according to the following considerations: • It is selected a Fuzzy set with seven rules of the angular position error e θ 1 , evenly distributed within the operating range • It is chosen a set with three Fuzzy rules for the error of the angular speed eθ 1 , evenly distributed within the operating range [−15, 15]rad/s. Each element of this Fuzzy set denotes the rotation direction of the pendulum, which corresponds to Negative (N) for clockwise, Zero (Z) for static angular position, and Positive (P) for counter-clockwise.
• For the full actuation range of the rotatory base arm, the control output τ 0 was divided into seven Fuzzy logic sets within the operating range comprised by [−3, 3]Nm. The three sets of membership functions used to develop the swing-up motion controller are shown in Table 2, whereas Fig. 4 shows the fuzzy regions for acceleration and deceleration in which the controller is able to reach the stabilization zone.
Remark 1. It is worth of mentioning that previous experimentations disclose that increasing the torque actuation reduces the pendulum swings and minimizes the actuation time of the fuzzy controller to reach the stabilization zone, as shown in Fig. 5. Although the actuation time is reduced as fast as the torque actuation is increased, large torques on the rotatory base arm do not meaningfully impact over the reachability of the stabilization zone, thus finding that the minimum lifting time can be achieved through a maximal range of the torque actuation. For the case under study, it was found that the optimal torque value can operate within a threshold of ±3N for minimum lifting time.

STABILIZING CONTROL OF THE ANGULAR POSITION
Once the rotational pendulum is able to reach the stabilization region, the control strategy used in the swing-up phase is switched to a stabilization approach using the NMPC framework to control the RIP system. This Section presents the proposed tube-based NMPC scheme as shown in Fig 6,  Ref.
Figura 6. Graphical representation of the control scheme in block diagram for the T-NMPC. The control architecture combines feedforward, corrective and robust control actions to account for disturbances on the RIP system. ree components, i.e., feedforward control u f f , corrective control u co , and nominal control action u nm . In addition, an LMPC control structure is also described with the aim of comparing to that of the proposed control approach. The actual control input u is obtained by the summation of the feedforward control input u f f , corrective control input u co , and nominal control input u nm , i.e., u = u f f + u co + u nm . The following sub-sections detail the design for each control action mentioned.

Feedforward Control
As the feedback control input for the system dynamics only regulates the trajectory generated between the reference and actual system states, the control input must be combined with a feedforward action to counteract the effects of disturbances. The feedforward control input is derived from a pre-planned reference trajectory in which the RIP exactly describes its motion without acting disturbances, i.e., the system trajectory is evaluated with zero dynamics and disturbance-free reference trajectory. To determine the feedforward control action, the torque input τ 0 is evaluated within the pendulum model dynamics in (6). Accordingly, the reference torque, that comprises the feedforward control input u f f = τ ref 0 , is given by: The reference trajectory described by the system states ref 1 ] T is formulated using the system model (6) in terms of the reference angular position and speeds as follows: where α and ω are give angular position and speed of the rotatory base, respectively. The defined feedforward control action ensures that the RIP is able to track and anticipate the reference trajectory only if there are no initial state errors, measurement errors, or uncertainties, thus a robust feedback control action is required.

Corrective Control
Some previous notation to describe operations in polytopic settheory required here for the robust tube-based control strategy can be found in Blanchini (1999).
The nominal model associated with the nonlinear dynamics of the pendulum model in (7) can be written as:z wherez(t) andū(t) denote the state and control input of the uncertainty-free model, respectively. Since the difference between the actual and nominal system is required to correct the model mismatch, the deviation of the system error trajectory has been modelled as the difference between the tracking error dynamics and modelling error dynamics with respect to the nominal system. The previous procedure has led to a parameter-varying, discretetime model in the form: where t k represents the current time; p(t k ) ∈ R n p stands for the parameter vector of the mismatch model; ∆z e (t k ) = z e (t k ) −z e (t k ) is the error vector associated to the tracking errors z e (t k ) and modelling errorsz e (t k ); ∆u e (t k ) is the control input of the mismatch model, and w e (t k ) denotes unknown uncertainties of the modelling errors bounded in a compact set W e ⊆ R n w . The discrete-time model is obtained with the integral approximation method Sakhdari and Azad (2018) For any permissible realization of the vector p(t k ) enclosed within a polyhedra P ⊆ R n p , the system matrices: A d e ∈ A e and B d e ∈ B e , also remain bounded and determined within the polytopes A e and B e . Note that the parametric model is characterized by a set of linear systems rather than only one, where each element of the set corresponds to a vertex system. Each vertex is characterized by the l th -set of matrices A l e , B l e , which are generated by the extreme values of the parameter range. Thus, the polytopic sets of the system error satisfy A e = co A 1 e , A 2 e , ..., A L e and B e = co B 1 e , B 2 e , ..., B L e , being L = 2 n p the total number of system vertices.
As preliminary objective, the control actions are required to compensate for tracking errors generated by disturbances while the control performance is reached. Hence, the control input ∆u e (t k ), for the system error in (12) without considering uncertainties, is calculated as follows: where K(t k ) is a disturbance rejection controller gain that corrects the error trajectory as close as possible to the disturbancefree trajectory. As the dynamics of the error-based trajectory are required to be invariant to uncertainties, the nominal errorbased control inputū e (t k ) = K(t k )z e (t k ) is conditioned to tracking the reference trajectory. The design of the control gain K(t k ) is required to regulate and stabilize the dynamics of the mismatch system, then assuming a candidate Lyapunov function defined by Γ(∆z e ) = (∆z e ) T P∆z e , the mismatch system is locally asymptotic stabilizing if there is a matrix P = P T > 0 such that Γ(∆z e (t k+1 )) − Γ(∆z e (t k )) < 0 for all ∆z e = 0. In addition, in order to obtain the matrix P while reaching the upper bound of the LQR performance, it is considered that: where · denotes the Euclidean norm, and Q LQR and R LQR are LQR weight matrices. Hence, the stabilizing condition, taking into account the candidate function Γ(∆z e (t k )) and the previous performance specification, is: Γ(∆z e (t k+1 )) − Γ(∆z e (t k )) ≤ Γ LQR (∆z e (t k )) .
As in Gonzalez et al. (2009), after replacing Γ and Γ LQR by their corresponding functions in (14), the new requirement can be arranged according to the following condition: where κ l is the local control gain that corrects the mismatch on the trajectory of the l th -vertex system on the extreme realization of the polytope P. Taking the Schur complement to transform the nonlinear condition (15) into convex inequalities, it holds that: Operating the previous Linear Matrix Inequalities (LMIs) with homogeneous transformations P = W −1 with W > 0, setting Y l = κ l W , and pre-and post-multiplying by a matrix diag(W , I, I, I) of appropriate dimensions, it follows that: where * denotes symmetry, and matrices W , Y l are decision variables obtained from the solution of the following linear maximization problem: max As a result of the previous optimization problem, the matrix P = W −1 , and an l-number of control gains κ l = Y l W −1 are determined. The feedback control gain K(t k ) can be obtained by the convex combination of the gains κ l through an affine interpolation function. Finally, the control input calculated by the local corrective control gain K(t k ) contributes with the applied control input u as a feedback control action such that u co = K(t k )(z e (t k ) −z e (t k )).

Nominal NMPC
As the RIP model entails uncertainties due to unknown modelling dynamics, predictions can generate relevant losses in the tracking control performance if large model mismatch occurs. Thus, to strength robust control actions on the pendulum dynamics, the design of a tube-based control strategy is taken into account. The methodology is based on prediction trajectories centred around the uncertainty-free ones subject to tight constraints. As in Kouvaritakis and Cannon (2015), the robust feedback control action for nonlinear systems can be written according to the control law u(t k ) =ū(t k ) + u e (t k ), where u e (t k ) is the tracking error-based input previously calculated in (13) and u nm =ū(t k ) is the input generated by a nominal NMPC. Then, the optimization problem associated to the nominal control system is: with: where t N denotes the prediction horizon;Q andR are symmetric positive definite matrices, which provide the capability of tuning performance; J is the stage cost function that describes the control objectives; J N is the terminal cost function with stabilizing matrix P N . As the matrixP N is usually hard to calculate for nonlinear systems without increasing conservativeness, it was assumed as a designing parameter. The termZ N denotes the nominal constraint set of the prediction terminal region to ensure robust constraint satisfaction, which is calculated adopting the one-step predictor Gonzalez et al. (2009). The optimizaton problem is solved using the Real-Time Iteration scheme as that available in the ACADO Toolkit Houska et al. (2011). The Global optimality cannot be guaranteed because the optimization problem (19) is non-convex. The overall closed-loop stability is not performed here due to the scope of this work.
Constraints on the nominal system are defined in the following.
As system state trajectories are required not to exceed specified state and control input constraints (8) and uncertainty sets (9), the underlying insights from tube-based control are proposed as an alternative to impose a set of more tightened constraints;Z(t k ) andŪ(t k ), under which the error evolves in such restricted sets. Thus, new constraints can be proposed: where the sets Z e (t k ) and U e (t k ) stand for constraints on predictions of the error states and control input, respectively. Following, as the mismatch model states and control input hold that ∆z e (t k ) = z e (t k )−z e (t k ) and u e (t k ) =ū e (t k ) +K(t k )∆z e (t k ), constraints on the error system in polytopic form must also satisfy that: The difference between the actual z(t) and nominal statesz(t) accounts for additive model uncertainties δ (t) ∈ D. Thus, replacing the error constraints (22) in (21) along with uncertainty polytopic set D, the set of nominal constraints can be rewritten as follows: where the polytope V =Ū e represents a set of prescribed constraints on the control input of the nominal mismatch system; T(t k ) = ∆Z e (t k ) is the polytope referred as the tube, which stands for all possible deviations on the mismatch system states. Since constraints must be tightened as system states deviate from the disturbance-free trajectory, these constraints will change on-line according to the error dynamics (12). Then, the sequence of polytopes, capable of reaching any realization of the closed-loop mismatch system with initial polytope T(t 0 |t k ) = {0}, is given by: where T (t k+1 |t k ) represents the one-step prediction set of all reachable deviations of the error states at current time t k . Finally, the compact representation of the reachable set for all system realization with closed-loop dynamics A l cl = A l e + B l e K(t k ) is as follows: Remark 2. It is worth of mentioning that the online calculation of the tightened system constraints involves additional computational cost, but reduced for a conservative number of constrained system states. In addition, the computational performance depends on the appropriate selection of N.

Linear MPC
The linear MPC controller is designed using the model linearisation with first-order Tylor approximations, which formulation can be described by:ż where the matrices , in the operating point z(t 0 ) = z δ 0 , are: Graphical representation of the RIP system and its separated subsystems.
The RIP system in state space for the linearised model under study (with parameters in Table 1) becomes: (25) Taking into account the linear state space representation of the model (25), the transfer functions associated to the variables of interest; Θ 0 for the rotatory base angular position and Θ 1 for the pendulum bar angular position, the transfer function of the overall system can be obtained with G(s) = C(sI − A) −1 B + D. Then, the resulting subsystems are given by: Under the analysis of the previous transfer functions, the subsystem dynamics related to the pendulum arm are stable and comprise an integrator, where the solution for this part includes only a proportional controller (P). On the other hand, for the pendulum bar, it is observed that this subsystem corresponds to dynamics of non-minimum phase with an unstable pole in s 1,2 = − ± √ 32.66. Furthermore, both subsystems are relatively fast due to the pole location in s = −11.8. Then, to simplify the design of the controller, the overall RIP system is separated into two independent transfer functions working in cascade mode due to the separability analysis performed in Section 2. Figure 7 shows the overall system separated into the two subsystems within a single system representation.
Note that the idea of separating the overall system into two subsystems as if they were independent simple input-simple output subsystems, leads the design to reduce considerably the system architecture and allows to apply LMPC to the subsystem represented by the transfer function of Θ 1 (s). Figure 8 shows the overall control system architecture, where the controller K 1 (s) represents the proportional control gain for the stable output Θ 0 (s) and K 2 (s) denotes the internal gains obtained from the LMPC controller for the unstable output Θ 1 (s).
The cost function associated to the optimization problem for the Figura 8. Representation of the linearised system in a cascade control system architecture. The green solid square represents the internal loop T 1 (s) devoted to control the transfer function G 2 (s) with the MPC control gain K 2 , whereas the red dotted square for the open loop transfer function T 2 (s).

LMPC controller is :
where R s represent the vector of the augmented reference for the prediction horizon N; ∆u + denotes the incremental control input; Γ denotes a positive-definite matrix weighting the incremental control input, and Y is the predicted system outputs. Such outputs can be represented within the horizon prediction according to the predictions Y = H∆u + + Fv δ (k), where the incremental control input is described by ∆u + = [∆u(k) ∆u(k + 1) ... ∆u(k + M − 1)] T . The matrices H and F of the output prediction model are:  (k), and linearised system matrices A e and B e of the augmented discrete model: Then, the solution ∆u(k) o for the optimization control problem in (27) can be explicitly obtained by: according to the control policy of receding horizon, the control input ∆u(k) o to be applied to the RIP system with time-varying reference trajectory r(k) is : or, where the proportional gain K 1 and the predictive control gain K 2 for the controller MPC can be identified from (31) as: and, The MPC gains found for a prediction horizon N = 10 and Γ = 0.8I 2 are: The stability of the closed-loop control system is analysed using control gains K 1 and K 2 , under which the transfer functions T 1 and T 2 for each subsystems are given by: It is worth of mentioning that under the analysis of both closedloop transfer functions T 1 (s) and T 2 (s) for the subsystems, the overall system is stable with control gains K 1 and K 2 due to all poles are located at the left-half plane of the root site.

FUZZY-MPC FRAMEWORK: INTELLIGENT BYPASS
This Section describes the intelligent bypass and their conditions to switch the swing-up motion controller towards the stabilization of the pendulum bar carried out with the predictive controller. To do so, a hysteresis algorithm allows a secure and fast switching mode between both proposed motion control strategies. Also, it is guaranteed a smooth control switching in such a way that the pendulum motion does not loose stability.
Previous experimentations disclose that the stabilization zone defined by the angular position of the pendulum bar lies within a range given by θ 1 ∈ − π 6 , π 6 , thus guaranteeing the suitable commutation of the Fuzzy logic-based controller and the predictive controller. The maximum torque must be within the range of 0.4N up to 3.9N according to the pendulum structure under study to assure the pendulum lifting and to avoid destabilization when the systems commutes between control techniques, as shown in Fig. 9. Likewise, the switching system is capable of bypassing between control techniques when the pendulum angular velocity is reduced as the angular position of the pendulum bar reaches the stabilization zone (i.e., close to 0[rads]). The intelligent bypass is capable of measuring torque actuation, speed and acceleration of the pendulum bar to decide if the pendulum is in conditions of stabilization. Furthermore, if the predictive control algorithm is unable to control due to high perturbations or if the angular position does not reach the stabilization zone, the fuzzy swing-up algorithm is activated to begin a new control cycle.

EXPERIMENTAL RESULTS
Before carrying out robustness tests, two trial cases are reported to quantitatively assess and compare the performance of the proposed controllers. For the first and second case, the proposed controllers were implemented in a simulated RIP system using Simulink in the Matlab 2018a development platform from MathWorks ® , Natick, MA, USA, whose technical parameters can be shown in Table 1 and the simulation scheme can be shown in Fig. 10. For the third case, the controllers were tested using a RIP model built in the simulation environment VRep under the Robotic Operative System (ROS) middleware on Windows, as shown in Fig. 11. The simulation platform was used to synchronize feedback information and distribute the control tasks in parallel nodes. The pendulum model was provided of and IMU/INS with GPS-aided sensors to obtain orientation and rotational speeds, and an RTK-GPS to achieve high-accuracy positioning. Sensors and other components were integrated in a centralized architecture to allocate the torque command on the pendulum base actuator.
For the first case, the proposed controller was tested swinging-up the rotational pendulum, and thus it was evaluated under external disturbances acting on the system. The second test consisted on assessing the stability of the pendulum system for two scenarios, i.e., with and without considering disturbances. The third trial consisted on evaluating robust control performance of the propose controllers by tracking a reference trajectory. The three tests are detailed in the following.

Swing-up Test
This test is performed through three simulation cases. The lifting of the pendulum starting from a resting position is tested in the first case. The second case is devoted to test if the swing-up motion control is capable of recovering the pendulum from external disturbances without exceeding the stabilization region, whereas the third case verifies if the pendulum is able to recover when overpasses the stable zone. The simulation results for the three cases can be seen in Fig. 12. The results for the first case shows that the Fuzzy logic-based controller starts swinging the pendulum arm by applying an initial torque input to the rotatory base, increasing the angular position of the pendulum bar until reaching the stabilization from an initial angular position at the downward equilibrium point θ 1 = −180 • . The pendulum bar performs around four oscillations within a swinging time of 7.5s before achieving the upward pendulum position. The results for the second case shows that even an external disturbance affect the pendulum bar stabilization, the swing-up motion control is not activated due to the pendulum has not leave the stabilization region. As the external disturbance leads the pendulum out of the stabilization region, the swing-up motion controller is activated and the pendulum over the loss of stability, as shown in the third test case of Fig. 12.

Robustness and Stabilization Test
This test is carried out with the proposed tube-based NMPC controller in order to stabilize the pendulum arm in the upward position. In addition, for compassion purposes, the linear MPC (LMPC) approach is implemented with the aim of stabilize the RIP system. Figure. 13 shows the simulation results performed in a trial time set to 10s. By inspection, the control performance of the tube-based NMPC control approach enhances with respect to that of the LMPC. The overshoot of the angular position of the pendulum bar is decreased with the proposed controller due to the effect of the robust constraints on the angular speed of the rotatory arm. Although the angular position of the pendulum bar obtained with the LMPC is faster than the one of the T-NMPC, this variable does not show relevant overshoot for the proposed controller. In addition, the angular speed of the rotatory base is faster using the T-NMPC than that of the LMPC because correc-

Intelligent Bypass
Rotational Inverted Pendulum Flag (N)MPC Figura 10. Simulation scheme for the first and second trials. The first trial consisted on assessing the control performance of the swing-up scheme, whereas the second test is devoted to evaluate performance of the NMPC within the stabilization region.
Figura 11. Simulation model of the Furuta pendulum under study, which was used for the third test. The third test is devoted to assess robust performance of the proposed controllers. tive and feedforward control actions are included in the proposed robust controller. In order to obtain a quantitative of the control performance of the motion controllers, it was used the maximum absolute value of the errors e θ ,1 and eθ ,1 Delibasi et al. (2007) for each algorithm. In this scenario, while the pendulum bar is stable around the equilibrium point, the maximum absolute angular position error for the pendulum bar using the T-NMPC is e max θ ,1 = 1.1[rads], whereas e max θ ,1 = 1.55[rads] for the LMPC controller. The angular speed of the pendulum bar using the T-NMPC becomes e maẋ θ ,1 = 1.26[rads/s], whereas for the LMPC is e maẋ θ ,1 = 1.56[rads/s]. In this scenario, the control performance of the tube-based NMPC improves that of the LMPC.

Trajectory Tracking Test
In this experiment, the pendulum was devoted to tracked an oscillatory-typed reference trajectory to evaluate robustness of the proposed controller under the proposed T-NMPC controller. Such trajectories allowed to investigate control performance for the full operating range of the stabilization zone. The reference trajectory was designed in such a way that only the angular position of the rotatory bar was devoted to track the oscillations while the pendulum bar kept within the stabilization zone. Then, the pre-planned reference trajectory was z ref (t) = [−30cos(2π × 60t) 0 0 0] T with initial angular position of the rotatory base set to −30 [degrees]. The resulting four system states and control input of the RIP for the trajectory tracking test can be shown in Fig. 14. By inspection, the proposed T-NMPC and LMPC are capable of maintaining the pendulum bar within the stabilization zone while the rotatory base tracks the oscillatory reference trajectory; however, the positioning errors are reduced with the T-NMPC control approach compared to that of the LMPC. Similarly, it is remarkable that the oscillations of the pendulum bar has lower amplitude with T-NMPC than the one of LMPC while tracking the reference trajectory, mainly due to the inertias (i.e., internal disturbance) of the pendulum bar by the rotatory base motion. With respect to the maximum absolute value of the errors e θ ,1 and eθ ,1 , the maximum tracking error e θ ,1 does not overpass ±2.5[degrees] from the upright equilibrium point at reduced angular speed of the pendulum bar about ±5[degrees/s] using the T-NMPC control strategy. Then, it is worth of mentioning that the T-NMPC control approach is capable of taking advantage of non-linearities of the system model and meeting constraint unlike its linear counterpart.

CONCLUSIONS
In this work, a robust tube-based NMPC (T-NMPC) framework has been developed and validated on Rotational Inverted-Pendulum (RIP) systems by swinging-up, stabilizing and tracking pre-planned time-based trajectories subject to disturbances. Based on a prediction dynamical model that stands for the RIP motion dynamics, the control strategy has been raised within a centralized control scheme to increase robust control performance of the overall system. Specifically, the control approach was aimed at reinforcing robustness in the trajectory tracking NMPC performance while maintaining asymptotic stability and meeting robust constraints against external disturbances, which was the main contribution of the work. The proposed T-NMPC framework integrated: a) a feedforward control action to anticipate disturbances, and b) a corrective feedback control action to regulate tracking errors Results for the first simulation test. The first column represent to the results of the first trial in which the swing-up motion system is able to lift the pendulum starting from the resting angular position. The second column shows the RIP response against external disturbances acting at t = 30[s]. The last column shows the third trial in which the pendulum bar is capable of recovering from external disturbances as the pendulum bar leaves the stable region. From top to bottom rows, it is shown the angular position and speeds of the rotatory arm and pendulum bar. combined with that of a nominal NMPC to keep the system states around disturbance-free trajectories within feasible tightening constraints (i.e., tubes). Additionally, the RTI scheme was adopted here to solve explicitly the optimization problem associated to the T-NMPC framework. The outcome of the experimental trials shows that robust performance of the T-NMPC controller can be strengthen against disturbances acting on the closed-loop control system when comparing to inherently-robust linear predictive controllers. Figura 13. Results for the second simulation test. The outcome of the linear MPC to control the pendulum arm within the stabilization region are shown in (a), whereas for the proposed robust T-NMPC in (b). An external disturbance is applied to the top of the pendulum bar in both case studies at t = 5s. It is shown that robust constraints on the angular position and speeds are met despite disturbance acting on the RIP system. Note that the overshoot of system response regarding the angular position of the pendulum bar is reduced with the robust T-NMPC with respect to that of the NMPC approach.