Enhancing stability control of inverted pendulum using Takagi–Sugeno fuzzy model with disturbance rejection and input–output constraints

The Takagi–Sugeno (T–S) fuzzy model is a versatile approach widely used in system control, often in combination with other strategies. This paper addresses key control challenges linked to the T–S system and presents important considerations to ensure its successful application using the Lyapunov theorem. One crucial aspect is determining the optimal number of premise variables and selecting accurate fuzzy rules for the T–S model. Additionally, the theorem based on Linear Matrix Inequality (LMI) is developed to enable effective disturbance rejection. To enhance stability control, constraints are imposed on the output angle and control input of a rotary inverted pendulum (RIP). By integrating T–S fuzzy control, disturbance rejection, and input/output constraints, robust stability in controlling the RIP is achieved. Extensive simulations are performed to showcase the efficiency of the suggested method, and the simulation results are thoroughly discussed and analyzed to verify the efficacy of the control method.

• The appropriate selection of variables premises in the T-S fuzzy model for RIP system.
• The development of a control strategy that integrates T-S fuzzy control and the H∞ method, resulting in a more stable and robust control system with the disturbance rejection capabilities for the RIP.• Effectively handling input and output constraints in the control of the RIP, ensuring that the pendulum angle position and control input remain within predefined limits to enhance safety and stability.• Constrained optimization techniques are applied to generate control signals that satisfy imposed constraints and optimize the performance of the RIP system, ensuring efficient control while respecting limitations and operational constraints.• Providing a comprehensive and effective control strategy with practical applications and opportunities for further research and development.
The next section provides an introduction to the T-S model, which will be specifically applied to the control of a RIP.In this section, the appropriate quantity of fuzzy rules for controlling the pendulum will be determined.Following that, the main results section presents some theorems that address stability, disturbance rejection, and input-output constraints within the T-S model framework.The simulation results of these cases will then be showcased to validate the efficacy of the proposed control approach for the RIP.Finally, the conclusion will summarize the findings and highlight the contributions of the study.

T-S fuzzy model
The T-S fuzzy model utilized in this study is based on the principles of fuzzy logic.Unlike Mamdani's method, Sugeno proposed a simplified approach for analyzing and controlling nonlinear systems by representing them as a collection of model subsystems.Each subsystem is characterized by an IF-THEN rule that establishes a relationship between the input and output signals of the system.T-S method relies on locally linearizing the nonlinear systems, providing a practical framework for analysis and control.It is important to note that this article exclusively focuses on continuous-time systems.Therefore, the equations, calculation formulas, and theorems presented in this study are specifically applicable to continuous-time systems.
The T-S fuzzy model for continuous-time systems is described by the following equation: where x(t) is state vector, x(t) ∈ R n ; y(t) is output vector, y(t) ∈ R q ; u(t) is input vector, u(t) ∈ R m ; A, B, C are matrix, A ∈ R n×n , B ∈ R n×m , C ∈ R q×n .In the context of the T-S fuzzy system, the state variables of the system, denoted by σ (t) , play a crucial role as the premise variables.These variables describe the dynamics behavior of the system and serve as the basis for the fuzzy rule-based control approach.These variables are represented as: with x(t) = [x 1 (t) x 2 (t) . . .x n (t)] T .It is important to note that σ (t) can be described as a set of component variables in vector form, represented as follows: The number of rules in the symbolic model is denoted as r and can be calculated by r = 2 p .In this control method, a crucial concept is the membership function, which plays a key role in modeling the system's states.However, it is important to note that this method involves two different types of membership functions.These types represent the equation of state and are expressed using a membership function in the following form: where w i (σ (t)) = p j=1 M ij (σ j (t)) and h i (σ (t)) = w i (σ (t)) r i=1 w i (σ (t)) for all t.M ij (σ j (t)) is the grade of σ j (t) .In the T-S fuzzy method, an important property known as the convex sum property plays a crucial role in combining the outputs of individual fuzzy rules to obtain the overall system response.This property ensures that the overall fuzzy output is obtained through a convex combination of the outputs of activated rules, weighted by their respective degrees of activation.By employing the convex sum property, the T-S fuzzy method achieves smooth transitions between different fuzzy sets and allows for adaptive and flexible control of nonlinear systems.For all t, denote that: Concluding the section on the T-S fuzzy model, it is evident that this approach offers a versatile and adaptive control framework for precise control of nonlinear systems.By employing fuzzy rules, membership functions, premise variables, and state equations, the T-S fuzzy model effectively captures the complexities of system dynamics and provides a systematic control design methodology.With this foundation in place, the subsequent section will focus on the application of the T-S fuzzy model to the RIP system.This application aims to address the unique challenges posed by the rotary inverted pendulum and develop a robust control strategy that ensures stability, robustness, and optimal performance.

Application of T-S fuzzy model to the rotary inverted pendulum system
In this section, the application of the T-S fuzzy model to the RIP system is presented.The section begins with an overview of the kinematic modeling of the RIP system, followed by the transformation of this model into T-S fuzzy equations.Furthermore, a discussion is provided on how to choose the premise variable and the quantity of fuzzy rules for the RIP system.The RIP system comprises a servo motor system and two pendulum rods.The pendulum arm rod is characterized by a length denoted as r a , whereas the pendulum rod has a length of l and a mass of m, see Fig. 1.Table 1 presents the parameters of the RIP system 27 .
The equations of state for the RIP system can be represented as where the values of s 1 , s 2 , s 3 , s 4 , s 5 , s 6 , s 7 are determined by the following formulas:  www.nature.com/scientificreports/and V m is voltage input.Since the inception of the Takagi-Sugeno fuzzy system modeling method, there has been no established standard for constructing premise variables that are the most suitable and optimal for the model.Most axiomatic variables are developed based on individual experience.The absence of a rigid framework in the selection of axiomatic variables for model construction has provided flexibility, which is also a notable advantage of the Takagi-Sugeno fuzzy method.However, the absence of specific binding rules in building the Takagi-Sugeno fuzzy model can sometimes lead to challenging cases during system simulation.This article aims to present examples of errors encountered in the model-building process, along with their causes and simpler, more optimal solutions.For instance, considering the equation representing the state of the RIP system, Eq. (1) with x(t) = [φ(t) θ(t) φ(t) θ(t)] T , it can be expressed as follows: where By utilizing the equation of state, a T-S fuzzy model consisting of 64 rules can be derived as shown below: Subsequently, the matrices A and B are transformed as follows: Consider the following: Let D = R 4 be the state space of an RIP system, with a state vector represented as x(t) = [φ(t) θ(t) φ(t) θ(t)] T .It is evident that the functions σ 1 (t), σ 3 (t), σ 4 (t), σ 6 (t) are continuous functions in D, ∀x(t) ∈ D .Now, let's con- sider a set of state space vectors in the form of x itrj = [φ j θ j φj θj ] T , where it is assumed that φj = 0, ∀j ∈ N .Specifically, we have the following limits: Therefore, the function σ 2 (t) experiences an interruption at φ = 0 , for all φ = 0 .Furthermore, it should be noted that the left limit of σ 2 (t) as φ approaches 0 from the negative side is different from the right limit of σ 2 (t) as φ approaches 0 from the positive side.In this case, it is apparent that achieving continuity for the function σ 2 (t) is not feasible.It is also observed that σ 5 (t) is an interrupted function at φ = 0 for all φ = 0 .As a result, the system described by the 64 rules, as given in Eqs.(7) and (8), exhibits an interruption function at φ = 0 for all φ = 0.
Hence, within the RIP system model consisting of 64 rules, there exists a set of state vectors that can induce interruptions in the system.This set of state vectors is of the form: x itrj = [φ j θ j 0 θj ] T , ∀ φ � = 0 .To ensure effective system control, it becomes necessary to apply stability criteria to the existing model.However, it is important to acknowledge that each stability criterion imposes specific constraints.In the context of utilizing the Takagi-Sugeno fuzzy model for control, the direct Lyapunov method is often employed as it provides a straightforward approach backed by available tools and theorems.
The Lyapunov function in the system is represented by the equation: To utilize Lyapunov's theorem for continuous time for controlling a stable operating system, it is necessary for the system to satisfy specific conditions: In the direct Lyapunov condition, it is necessary for the Lyapunov function to be differentiable.However, the T-S fuzzy model, consisting of 64 rules, is a discontinuous model.Consequently, the direct Lyapunov theorem does not directly apply to this model.Applying Lyapunov's theorem directly to the T-S fuzzy model described by the 64 rules mentioned above would lead to incorrect results.This article aims to propose a straightforward solution utilizing the available mathematical tools.Therefore, it is crucial to carefully choose a function that satisfies the conditions of the theorem to be employed when selecting a rule.Now, we will proceed to construct the model described by 256 rules, unlike the previous model, fulfills all the conditions of Lyapunov's theorem.
In this 256-rule model, slight changes will be made to the matrix A, while the matrix B remains unchanged.
where To construct the new T-S model, select 8 premise variables in the form of: As a result, the matrix A is updated as follows: The Takagi-Sugeno fuzzy model described by these 256 rules exhibits a discontinuity at φ = 0 .However, it is pos- sible to parameterize this discontinuity with a specific value, ensuring the uninterrupted nature of the Lyapunov function.Consequently, the direct application of the Lyapunov theorem becomes feasible.

Main results
In this section, the key findings obtained from employing the T-S fuzzy model to the RIP system will be showcased.The section is organized into four subsections, each addressing a specific aspect of the system's performance.These subsections encompass the stability theorem, disturbance rejection theorem, constraint output theorem, and constraint input theorem.Through an examination of these theorems, valuable insights into the stability, disturbance rejection capabilities, and handling of constraints by the T-S fuzzy model for the RIP system can be obtained.The subsequent exploration of each subsection will unveil the key findings and implications of the study.

Stability analysis. Within the domain of T-S systems, the Parallel Distributed Compensation (PDC)
method emerges as a popular choice for controlling system input.This method facilitates the construction of a controller comprising multiple parallel control modules, each correlated with a distinct fuzzy rule.Operating autonomously, these modules make localized control decisions grounded in the premise variables of their respective fuzzy rules.Through the aggregation of their outputs, an overarching control input is derived to govern the T-S system effectively.The control input of the system (1), formulated in the PDC form, can be represented by the following equation: Theorem 1 The stability PDC control design, as defined in Eq. ( 11), is achieved by finding a positive definite matrix X and matrices F j = M j X −1 that satisfies the specified condition.
Proof The Lyapunov function selected is described by Eq. ( 9).Next, let's examine the Lyapunov condition: Equation ( 12) holds true if and only if: Denote X = P −1 and multiplying both sides of the inequality by X results in:

yields the following equation:
This conclude the proof.

Robust disturbance rejection. In the context of disturbance rejection in T-S systems, one prominent
performance criterion is H∞ performance.This criterion aims to design a controller that minimizes the effect of external disturbances on the system while achieving desired closed-loop stability and performance specifications.The T-S model, incorporating the presence of disturbances, can be represented as follows: with v(t) is the disturbance.The performance criterion for disturbance rejection in T-S systems can be expressed by minimizing the value of γ to achieve the following property: Theorem 2 The feedback gains F i , responsible for stabilizing the T-S fuzzy model under the presence of disturbances and minimizing the expression γ as shown in Eq. ( 14), can be determined by solving an LMI-based problem where www.nature.com/scientificreports/Proof Let's assume the existence of a quadratic function V (x(t)) = x T (t)Px(t) and P > 0, γ ≥ 0 ∀t ≥ 0, the fol- lowing conditions hold: Assuming an initial condition x(0) = 0 , we can derive the following expression: The inequality V (x(t)) ≥ 0 implies the following: Taking the derivative of V (x(t)) , the following expression is obtained: Additionally, it follows: Therefore, inequality (15) can be expressed as: Referring to Eq. ( 16), it can be observed that: Applying the Schur complement, the result can be obtained as follows: V (x(t)) Vol.:(0123456789) Input constraints.In addition to stability and disturbance rejection, addressing input constraints is crucial in ensuring safe and reliable operation of the system.This section focuses on the consideration and incorporation of input constraints into the control design framework for the T-S fuzzy model.

Theorem 3
Assuming the initial condition x(0) is known, the constraint �u(t)� 2 ≤ µ can be maintained at all times t ≥ 0 by satisfying the following LMI conditions: where X = P −1 , M i = F i X, τ > 0 and µ > 0.
Proof Let us assume the Lyapunov function such as: and Applying the Schur complement yields: with This conclude the proof.
Output constraints.The section on output constraints delves into the restrictions placed on the system's output variables, which are crucial for preserving system stability and achieving desired performance.To handle these constraints within the framework of the Takagi-Sugeno fuzzy model, a theorem similar to the one presented for input constraints will be introduced.
Theorem 4 Suppose that the initial condition x(0) is given, and the constraint � y(t) � 2 ≤ is satisfied for all t ≥ 0 if the linear matrix inequality (LMI) is met. with The proof of this theorem will follow the same approach as in the previous section.
In the main results section, it is important to emphasize the capability of LMI to combine multiple control theorems, such as disturbance rejection and input-output constraints, into a unified framework.By simultaneously solving the corresponding LMI conditions, the control strategy can effectively address both disturbance rejection and input-output constraints.This approach allows for the synthesis of controllers that provide robust disturbance rejection while ensuring that the system operates within specified input-output limits.The use of LMIs enables the integration of these control objectives and constraints, simplifying the design process and facilitating the development of a comprehensive and efficient control strategy.By leveraging the power of LMIs, it becomes possible to achieve desired performance and robustness requirements while satisfying multiple control objectives simultaneously.
Remark 1 To assess the effectiveness of the proposed control strategies, simulations were conducted for each of the four cases using the framework of LMI.In the first case, the focus was on stabilization (Theorem 1), where the LMI conditions were employed to ensure the stability of the system.For the second case, the objective was disturbance rejection (Theorem 2), and LMIs were utilized to design controllers that effectively attenuate disturbances.In the third case, both disturbance rejection and output constraint were considered, combining Theorem 2 and Theorem 4. The LMIs played a crucial role in achieving disturbance rejection while satisfying the specified output constraint.Finally, in the fourth case, the aim was to address disturbance rejection along with input-output constraints, which involved the integration of Theorem 2, Theorem 3, and Theorem 4. Through the application of LMIs, controllers were designed to mitigate disturbances while ensuring the system operated within the prescribed input-output limits.These simulations, conducted with the aid of LMIs and LMI theorems, demonstrate the efficacy and versatility of the proposed control strategies in addressing various control objectives and constraints.

Results
This section presents the findings and outcomes obtained from the application of the stability theorem, disturbance rejection theorem, constraint output theorem, and constraint input theorem discussed in the previous section.These results showcase the efficiency and suitability of the suggested methodologies in achieving system stability, robust disturbance rejection, and satisfying input and output constraints within the T-S system.The analysis and evaluation of the results provide valuable insights into the performance and control capabilities of the developed control strategies.Considering the model parameters specified in the Table 1, the following initial conditions have been selected: By applying the parameters, one can determine the maximum and minimum values of premise variables, see Table 2.
The membership functions are represented as follows: To avoid excessive length in this article, the state matrix A, control matrix B, and common positive definite matrix P will be represented using a general formula, as follows: where and q 1 , q 2 , ... q 8 ∈ [1, 2] .The value of the premise variable can be determined as: 2(q 7 − 1) + 4(q 6 − 1) + 8(q 5 − 1) + 16(q 4 − 1) + 32(q 3 − 1) + 64(q 2 − 1) + 128(q 1 − 1) www.nature.com/scientificreports/ In the study, four distinct cases were investigated.The first case focused on achieving stability in the T-S fuzzy model by computing the matrix P based on the stability condition.In the second case, the objective was to attenuate and compensate for disturbances by optimizing the γ .The third case addressed both disturbance rejection and output constraints, ensuring effective rejection of disturbances while operating within φ angle limit.Lastly, the fourth case expanded the analysis to include input voltage u, providing a comprehensive control strategy for effective disturbance rejection while satisfying both input and output limitations.The T-S fuzzy model was implemented, and the corresponding control design based on the LMI theorems was applied.The simulation outcomes illustrate the successful achievement of the desired objectives in each case, showcasing the stability, disturbance rejection capability, and adherence to input and output constraints.The following sections present the specific simulation results and performance evaluations for each case.
The positive definite matrix P results are: Here are the matrices A and B for the selected rules ( 1st , 16th , 64th , and 256th ), which are similar across the four cases: Here are some selected control gains obtained for each case to demonstrate the differences in the results: • First case : The previously presented results include the matrix P and gain F obtained from the LMI solution.In addition, for cases 2, 3, and 4 utilizing the disturbance rejection method, the γ value has been optimized.Specifically, the optimal γ values found for cases 2, 3, and 4 are 1.41, 1.308, and 6, respectively.
During testing and evaluation, remarkable results indicate that the system can effectively control the maximum deflection angle within the [ −56π 180 ; 56π 180 ] range.However, consider practical limitations of certain mechanisms within the system, the optimal operating range of the controller for the initial deviation angle φ 0 lies within the range of [ −π/4; π/4 ].In order to investigate the dependence of the fuzzy controller on the system's initial conditions, small changes have been made to vary the value of the original deflection angle, denoted as φ 0 .Simu- lation results in the first case with different initial conditions are presented, see Figs. .By analyzing the system's response under these varying initial conditions, the efficiency and robustness of the stabilization control method can be evaluated and some necessary remarks can be drawn.
In Fig. 2a, the results of the pendulum angle for the First case are presented.The initial angle φ 0 falls within the operational range of the fuzzy controller.As the initial deflection pendulum angle varies, the controller reaches a steady state after approximately 3s.It is observed that larger initial deflection angles lead to longer settling times and increased overshoot.Specifically, when φ 0 = π 4 , the settling time is about 3s with an overshoot of 0.439 rad.On the other hand, for the cases where the initial deviation angles are φ 0 = π 6 and φ 0 = π 12 , the   system achieves steady-state in approximately 2.5s and 2.3s, respectively, with overshoot values of 0.2251 rad and 0.096 rad. Figure 2b displays the angular velocity of the pendulum.As the pendulum angle increases, the magnitude of the voltage required to drive the motor shaft also increases.This leads to larger variations in the pendulum's angular velocity.The figure illustrates the maximum pendulum angular velocity in the cases of , which are approximately 4.957 rad/s, 2.346 rad/s, and 1.106 rad/s, respectively.It is evident that during the initial period of motion, the velocities of the system undergo rapid changes in a short time interval.Specifically, for φ 0 = π 4 , the pendulum angular velocity varies by approximately 4 rad/s, for φ 0 = π 6 , it varies by 2 rad/s, and for φ 0 = π 12 , it varies by 1 rad/s.Similarly to Fig. 2a,b, the arm angle and angular velocity exhibit a proportional relationship with the magnitude of the initial deflection φ 0 .When observing Fig. 3a,b, it is appar- ent that the variation in these two values is greater compared to the pendulum angle and pendulum angular velocity.This phenomenon can be attributed to the fact that in the system, the pendulum arm is the component directly impacted by the motor, while the pendulum undergoes a secondary effect.Once the pendulum angle has converged to its equilibrium position after approximately 3s, the arm angular velocity also tends to stabilize at zero.However, due to the initial significant variation, the arm angle takes a longer time to converge to zero, typically around 200s. Figure 4 demonstrates that as the initial deflection angle increases, the required starting voltage for the system also increases.Specifically, for initial deviation angle values of φ 0 = π 4 , φ 0 = π 6 , and , the corresponding starting voltage values are 189.2V, 115.5 V, and 55.2 V, respectively.Despite the variations in the initial angles, Theorem 1 guarantees the stability of both the pendulum angle and the arm angle.This highlights the robustness of the control strategy in maintaining stability across different initial conditions.www.nature.com/scientificreports/ The response of the pendulum angle φ and arm angle θ is compared between the T-S 256 fuzzy rules (Pro- posed Control) and the T-S 8 fuzzy rules 27 .In the study employing 8 fuzzy rules, the authors applied the T-S fuzzy descriptor model to control the RIP using the identical parameters as presented in Table 1.The Fig. 5 provides a visual representation of the comparison results for these controllers.Upon considering a condition where the initial deflection angle of the pendulum is π 4 , a comparison between the T-S 8 fuzzy rules 27 and the proposed controller reveals notable differences.Figure 5a demonstrates the behavior of the angle φ : With the T-S 8 fuzzy rules, the overshoot value is merely 0.02 rad, considerably smaller than the proposed controller's 0.4395 rad.However, it is noteworthy that despite the minor overshoot, the T-S 8 fuzzy rules controller maintains the angle φ within a small amplitude fluctuation of 0.004 rad after approximately 200 seconds, eventually reaching a steady state.In contrast, the proposed control controller achieves a steady state in just 4 seconds.Moving on to Fig. 5b, which depicts the angle θ : When utilizing the proposed controller, the overshoot is only 5.863 rad, whereas the T-S 8 fuzzy rules controller results in an overshoot of up to 101.7 rad, approximately 17.5 times larger than that of the proposed control.Additionally, the settling time for the angle θ with the proposed controller is significantly faster compared to the T-S 8 fuzzy rules controller.The proposed controller reaches a steady state in around 200 seconds, while the T-S 8 fuzzy rules controller takes approximately 250 seconds.In conclusion, the proposed controller exhibits a faster setting time than the T-S 8 fuzzy rules controller.Moreover, although the T-S 8 fuzzy rules controller shows improved performance in terms of the angle φ overshoot, it leads to a substantially larger overshoot in the angle θ compared to the proposed controller.
In the second case, which involves disturbance rejection using Theorem 2, the simulation results are shown in Figs. 6, 7 and 8.The impact of the disturbance v(t) = 3 sin(πt) on the angle acceleration of the pendulum and the pendulum arm can be observed from the figures, which demonstrate the effectiveness of the controller in mitigating its effects Fig. 6a,b.When a fuzzy controller is employed in the presence of disturbance, the pendulum angle oscillates around the equilibrium position with an amplitude of 0.13 rad and an angular velocity of 0.1395 rad/s.However, when a disturbance rejection controller is used, the swing of the pendulum angle from the equilibrium position is significantly reduced.The amplitude of the pendulum angle oscillation with the controller is only 0.007 rad, and the angular velocity is 0.008 rad/s.These results highlight the superior disturbance rejection capability of the controller, demonstrating its effectiveness in minimizing the impact of disturbance on the system's behavior.By examining Figs.7a,b, and 8, it becomes evident that when employing a disturbance rejection controller, the values of arm angle, arm velocity, and control voltage exhibit more pronounced fluctuations compared to using      9a,b illustrate that the use of a controller with limited angle φ improves disturbance rejection performance.The maximum amplitude of the angle φ after reaching the steady state is significantly reduced to approximately 0.0056 rad, with an angular velocity of 0.0059 rad/s.However, during the initial phase, the pendulum angular velocity exhibits a more pronounced change, with a variation of around 23 rad/s compared to about 1 rad/s for a conventional disturbance rejection controller.This is attributed to the fact that the angle φ constrains the oscillation range of the angle φ to a relatively small around the equilibrium position.It is observed that when the initial deviation angle φ 0 = π 12 is significantly far from the active region's maximum boundary value of approximately 0.008 rad, the controller needs to apply a quick and forceful initial action to bring the pendulum into the desired range of oscillations.From the analysis of Figs.10a,b, and 11, a similar that can be observed as in Figs.3a,b, and 4. When there is a large and rapid change in the pendulum angular velocity, it affects the values of the arm angle, arm angle velocity, and control voltage, causing them to increase significantly.However, it is important to note that both controllers reach a steady state at approximately the same time.In the initial moments of the voltage response, there are two distinct phases characterized by rapid variations, each occurring within a few milliseconds.The first phase involves an increase in voltage from 0 to 989.9V to bring the pendulum from φ 0 to the stable oscillation region.In the second phase, the voltage is reduced from 989.9V to -102V to maintain the pendulum in a stationary position due to inertia.After stabilization, the voltage settles within the control range of -3.6V to 3.24V.Furthermore, upon observing the system after it has reached a stable state, it is evident that the operating voltage range of the controller in Case 3 (with limited angle φ ) is smaller compared to that of the conventional disturbance rejection controller in Case 2.
In order to maintain stability and minimize the impact of disturbances on the pendulum, the voltage must be adjusted to counteract these disturbances.In Case 3, the results indicate that a higher level of disturbance rejection performance requires a larger starting voltage value.However, in practical applications, most systems operate at low or medium voltage levels.Therefore, achieving an acceptable level of disturbance rejection can be considered a success.In the case 1, a significant finding is that the input voltage of the system is directly proportional to the initial deflection angle of the pendulum.Therefore, reducing the system voltage can be achieved by decreasing the initial angle of the pendulum.However, this will result in a smaller operating range for the pendulum angle.Designing a controller that simultaneously satisfies disturbance rejection and achieves an optimal starting voltage value is a challenging task.It should be noted that in practical scenarios, improving one aspect often involves a trade-off with another aspect.
In Figs. 12, 13 and 14, the results of Case 4, where both disturbance rejection and input-output constraints are combined, are presented.By comparing Figs.12a,b, it is evident that the controller in Case 4 yields significantly improved performance in terms of the deflection φ angle compared to Case 3. At steady state, the maximum amplitude of φ angle oscillation is reduced to 0.0004 rad in Case 4, whereas it is 0.0056 rad in Case 3. Furthermore, the change in φ is also much smaller in Case 4 compared to Case 3.However, it should be noted   www.nature.com/scientificreports/ that in Case 4, the oscillatory angle follows a second-degree oscillation pattern, requiring a relatively long time of approximately 800s to reach the steady state, as analyzed previously.Overall, the in Case 4 demonstrates improved performance in terms of reducing oscillations and achieving better stability, albeit with a longer convergence time.Upon examining Figs.13a,b, and 14, it becomes evident that while both the arm angle and arm angular velocity exhibit fluctuations around the equilibrium position after the settling time, there is a noteworthy observation.The system's settling time experiences the most significant alteration when employing the controller in Case 4. Once the steady state is reached, the amplitude of oscillation for the arm angle and arm angular velocity is nearly identical for both controllers.The large amplitude oscillation observed in the θ angle can be attributed to the prolonged stability time of the system.In Case 4, the starting voltage is reduced to 568.9V, causing a delay in the parameter settling time due to the significant impact of the reduced starting voltage.As mentioned earlier, a higher starting voltage value contributes to improved disturbance rejection efficiency.Therefore, when attempting to lower the starting voltage, the controller requires additional time to reach the steady state.Once the system has reached a steady state, the amplitude of voltage fluctuations in both Case 3 and Case 4 controllers is comparable.
To evaluate the disturbance rejection improvement of the controllers, this article employs a formula that compares the maximum oscillation amplitude of the φ angle between the case 1 without disturbance rejection and the others case 2, case 3 and case 4. The disturbance rejection improvement (H) is calculated using the following formula: where T 0 denotes the maximum oscillation amplitude of the φ angle in case 1, and T 1 represents the maximum oscillation amplitude of the φ angle in the others cases when the system reaches a steady state.This calculation provides a quantitative measure of the effectiveness of the controllers in reducing disturbance and improving system performance.The disturbance rejection improvement results for the different cases are as follows: in case 2, the disturbance rejection improvement H is 93.55% .In case 3, the disturbance rejection improvement is 95.7% .Lastly, in case 4, the disturbance rejection improvement is significantly higher at 99.67% .These results demonstrate the effectiveness of the controllers in reducing disturbance and enhancing the stability and performance of the system.
The paper yields several notable findings.Firstly, the initial deflection angle of the pendulum showed direct proportionality to overshoot, transient time, and starting voltage.In the presence of disturbance, controllers with disturbance rejection can improve the pendulum angle and velocity, but require the compensation for disturbance effects on other aspects.These results enhance our understanding of system behavior under disturbance rejection and offer insights for designing controllers in practical applications.

Conclusion
In conclusion, this study focused on the development and analysis of different control strategies for a RIP system.Through the utilization of various theorems and controllers, including disturbance rejection and input-output constraints, the performance and stability of the system were evaluated.The results showcased the effectiveness of the proposed controllers in mitigating disturbances and achieving desirable system behavior.Furthermore, the trade-offs between disturbance rejection, starting voltage, and settling time were explored, providing insights into the design and implementation of controllers for practical applications.Overall, the findings of this study contribute to the advancement of control techniques for RIP systems and highlight the importance of considering multiple factors when designing controllers to achieve optimal system performance.Future research may further investigate the application of these controllers in real-world scenarios and explore additional optimization strategies to enhance system stability and performance.

4 , the blue line corresponds to π 6 ,
2, 3 and 4. The red line represents the case where φ 0 is set to π and the black line corresponds to π 12

Figure 2 .
Figure 2. Angle and angular velocity of the pendulum with changing initial conditions in the first case: stabilization theorem.

Figure 3 .
Figure 3. Angle and angular velocity of the arm with changing initial conditions in the first case: stabilization theorem.

Figure 4 .
Figure 4.The voltage u with changing initial conditions in the first case: stabilization theorem.

Figure 5 .
Figure 5.Comparison of pendulum and arm angles: Ref 27 vs. proposed control.

Figure 6 .
Figure 6.Angle and angular velocity of the pendulum in the first case and second case.

Figure 7 .Figure 8 .
Figure 7. Angle and angular velocity of the arm in the first case and second case.

Figure 9 .
Figure 9. Angle and Angular velocity of the pendulum in the second case and third case.

Figure 10 .
Figure 10.Angle and Angular velocity of the arm in the second case and third case.

Figure 11 .Figure 12 .
Figure 11.The voltage u in the second case and third case.

Figure 13 .
Figure 13.Angle and angular velocity of the arm in the third case and fourth case.

Figure 14 .
Figure 14.The voltage u in the third case and fourth case.

Table 1 .
The rotary inverted pendulum parameters.