Dynamical analysis of an inverted pendulum with positive position feedback controller approximate uniform solution

The inverted pendulum is controlled in this article by using the nonlinear control theory. From classical analytical mechanics, its substructure equation of motion is derived. Because of the inclusion of the restoring forces, the Taylor expansion is employed to facilitate the analysis. An estimated satisfactory periodic solution is obtained with the aid of the modified Homotopy perturbation method. A numerical technique based on the fourth-order Runge–Kutta method is employed to justify the previous solution. On the other hand, a positive position feedback control is developed to dampen the vibrations of an IP system subjected to multi-excitation forces. The multiple time scale perturbation technique of the second order is introduced as a mathematical method to solve a two-degree-of-freedom system that simulates the IP with the PPF at primary and 1:1 internal resonance. The stability of these solutions is checked with the aid of the Routh–Hurwitz criterion. A set of graphs, based on the frequency response equations resulting from the MSPT method, is incorporated. Additionally, a numerical simulation is set up with RK-4 to confirm the overall controlled performance of the studied model. The quality of the solution is confirmed by the match between the approximate solution and the numerical simulation. Numerous other nonlinear systems can be controlled using the provided control method. Illustrations are offered that pertain to implications in design and pedagogy. The linearized stability of IP near the fixed points as well as the phase portraits is depicted for the autonomous and non-autonomous cases. Because of the static stability of the IP, it is found that its instability can be suppressed by the increase of both the generalized force as well as the torsional constant stiffness of the spring. Additionally, the presence of the magnetic field enhances the stability of IP.


Scientific Reports
| (2023) 13:8849 | https://doi.org/10.1038/s41598-023-34918-x www.nature.com/scientificreports/ a magnetic dipole, an extra electromagnetic relationship created by eddy currents in a neighboring thick conducting plate was investigated 6 . Studies addressing the scientific framework, recommending a hybrid control technique, and creating a workable model of an IP were examined 7 . Results from simulations and actual experiments were achieved, confirming the IP model performance and adaptability when combined with a suitable hybrid control method in a balanced situation. The IP was a straightforward and useful laboratory simulation of a mechanical system that was unstable. The explanation of the historical development of IP and the contrast between a number of its earlier procedures, which were carried out between 1960 and 1970 according to the earlier bibliography, were examined 8 . In order to comprehend how design decisions, affect balancing effectiveness, five areas of development for wheeling IP systems were examined 9 . Elasticity needs to be incorporated into mathematical models for the system of dynamics analysis. Elasticity was taken into consideration when a new type of IP, the elastic IP, was developed 10 . For a reaction wheel IP subject to biased angle measurements, a linear analysis was developed 11 . In this study, the stability issue was considered when there was an ongoing, unidentified bias in measurements of the pendulum angle. It has significant practical implications because it permits both a closer approximation of the control of robots and a less exact arrangement of sensors. A generalized mathematical model of IP was used to study how the pendulum factors and follower force affect the development of equilibrium situations. The parameter extension approach was used to plot equilibrium curves 12 . Numerous engineering and physical phenomena are described via nonlinear differential equations. Most of those concerns, with the exception of a few numbers, lack obtaining an exact analytical solution. Really, this requires approximate methods to determine such equations because the HPM 13 has better quality calculation than the earlier techniques. Additionally, it is a straightforward, strong, efficient, attractive, powerful, and promising approach. Therefore, scientists and engineers have given much attention to this methodology in application in nonlinear problems. The Laplace transforms dispersive heat radiation, integral heat conduction, nonlinear oscillators, nonlinear Schrodinger equations, nonlinear chemistry, and many other nonlinear issues have already been addressed by using the HPM 14 . In most situations, it results in a very quick convergence of the series solution, typically with just a few iterations leading to highly precise solutions. Consequently, HPM is efficient in resolving many types of nonlinear equations. A minor equational parameter has no bearing on the technique. The homotopy was built using the homotopy procedure in topology with an embedded parameter ρ ∈ [0, 1] that was regarded as a "small parameter". It has been used to approximately solve a wide range of nonlinear problems efficiently, quickly, and appropriately. These approximations quickly reach the correct answers as found earlier in 15,16 . A hybrid Rayleigh-Van der Pol-Duffing oscillator with an exciting exterior force and nonlinear terms was studied 17 . To reach an approximate solution, the method of Poincaré-Lindstedt was adopted during their approach.
In order to demonstrate that the vibration induced by the external force was suppressed, a time history comparison was made for both the uncontrolled and the controlled models. Three different types of controllers were added to study the best of them in damping the vibration occurring in the harmonic force Duffing oscillator system 18 . They used the MSPT to find the approximate solution for this system after connecting it to the nonlinear integrated positive position feedback (NIPPF) controller. The PPF controller dampens the vibration that occurred in a nonlinear exciting beam. To clarify the best conditions to reduce this vibration, they examined the effect of different parameters in the resonance case 19 . The influence of the PPF technique was utilized to analyze a solar panel prototype 20 . On the other hand, EL-Ganaini et al. 21 used a PPF control to decrease the nonlinear vibration of a dynamical framework within a 1:1 internal resonance. The approximate solution was achieved by applying the MSPT. Moreover, EL-Sayed 22 investigated a pair of delay PPF control that can minimize the vibration of double Van der Pol oscillators with external forces. The impacts of both the delayed feedback signal and the control gains were studied to demonstrate the low vibration amplitudes.
In light of the above-mentioned aspects, the current paper focuses on examining the problem of the motion of an IP. Furthermore, the main aim of this study is to suppress the harmful vibration in the IP system by using a PPF controller which has also been used in the previous references. The rest of the manuscript is structured as follows: The methodology of the problem is described in section "Methodology of the problem". In view of the HPM and the idea of the extended nonlinear frequency, an approximate uniform solution to the problem is described in section "Expanded frequency analysis". Section "Linearized stability of the autonomous equation" is dedicated to illustrating the linearized problem. The IP system with the controller is applied in section "IP system with PPF controller". The frequency response equations (FREs) and stability studies are shown in section "Linearized stability of the non-autonomous equation". Section "Results and discussions" introduces the results and discussions for the controller design. Finally, section "Conclusions" summarizes the key results.

Methodology of the problem
A magnetic IP is regarded as a mechanical system, where its bob has a point mass m and an electrical charge e . It is connected to the length L of the weightless stiff rod. The other end of the rod swings vertically with a periodic displacement Q 0 cos t where Q 0 and are the movement amplitude and frequency, respectively. The IP revolves around a fixed point 0 . It rotates under the influence of a constant gravity force g and a steady negative oriented magnetic field B that acts in the negative z-direction. Because of the strong instability of the configuration of the IP, a light torsional spring of constant stiffness k is attached between its base and the y-axis. The sketch of the theoretical prototype of the IP may be exemplified in Fig. 1.
As shown in this figure, the position vector of the bob of the IP is given as: where θ is measured between the IP and the y-axis. It follows that velocity may be given by: (1) r = L sin θ i + (L cos θ + Q 0 cos �t )j, The potential energy probably originated from a number of actions, which can be grouped into the following categories: • The energy in the relation to a gravitational field, or gravitational potential energy has a definition of mgL cos θ . • The potential energy stored as a result of flexible body deformation, such as a spring expanding, is known as elastic energy. The effort put forth in stretching the spring could serve as its metaphor. It is based on the constricted length and the constant stiffness of the spring k . It can be written as kθ 2 /2. • The potential function of the issue, therefore, must include the magnetic term q P . v , where P is the magnetic vector potential; for example, see Eyal and Goldstein 23 , due to the charged IP traveling in a homogeneous magnetic field B = B k . Remember that it determines the connection between the magnetic field B and the magnetic potential P and is given by B = ∇ ∧ P . The practical significance of a homogenous magnetic field is widely established. One may demonstrate that one of the vector potential alternatives is provided by P = 1 2 (B ∧ r) . The sentence that follows can be expressed as follows 24 : The potential energy caused by the uniform magnetic field can be expressed by merging Eqs. (2) and (4) as follows: Accordingly, the formulation for the total expected energy is as follows: Incorporating Eqs. (3) and (6), it is evident that the magnetic IP under consideration has the following Lagrangian function: However, the force under consideration becomes a non-conservative force when the air-dampening force is considered. This force can be expressed in the following way: Therefore, one gets ℜ = T − V = 1 2 m L 2θ 2 + 2L�Q 0θ sin θ sin �t + � 2 Q 2 0 sin 2 �t − m g L cos θ + 1 2 k θ 2 − 1 2 q LB Lθ + Q 0θ cos θ cos �t + � Q 0 sin θ sin �t .  The structure has only one degree of freedom, and the generalized coordinate is expressed by an angle of measure θ . In addition to this explanation, the generalized force is described as: From the analytical mechanics perspective, Lagrange's equation with the non-conservative system may be written as 25 : When Eqs. (7) and (10) are inserted into Eq. (11), the controlling dynamic model of the magnetic IP under consideration can be described as follows: A second-order differential equation with a harmonic restoring force and multiple parameterized forces is represented by Eq. (12). Now let us go back to the initial controlling equation found in Eq. (12). The stability requirements of the magnetic IP under consideration will be analyzed using a unique technique in the following sections. A nondimensional approach will be required before dealing with the quantitative equations of the governing equation of the IP as stated in Eq. (12), for more convenience. For this purpose, the non-dimensional technique is performed in a wide range of ways which largely depend on the characteristics of length, duration, and mass. In the problem under consideration, the characteristics are taken as follows Q 0 , Q 0 /g and m . Therefore, Eq. (12) may be transformed into the reduced communication form in addition to these features: where the non-dimensional term of the magnetic contributions H , which results from the multiplication qB , is referred to as the parameterization of the magnetic field.

Expanded frequency analysis
The primary aim of this Section is to achieve a circumscribed analytical approximate solution for the secondorder differential as given in Eq. (13). For this purpose, we will use an approximation of the circle functions as: sin θ ≈ θ − 1 6 θ 3 + ... and cos θ ≈ 1 − 1 2 θ 2 + ... . Therefore, Eq. (13) then becomes: where the natural frequency of the current prototype becomes ω 2 = 1 L 2 (k − L). The following performance is primarily dependent on a few HPM and Laplace transforms ( L T ). Equation (14) may be then interpreted as: and For this objective, it is appropriate to presume the initial condition listed below: Therefore, the Homotopy equation may be formulated as follows: where ρ is a synthetic embedded factor. Occasionally, it is known as the Homotopy constraint.
The HPM can offer a variety of approximate solutions, as was clearly demonstrated in our earlier work 26,27 . One of these approaches results in a conventional solution with secular terms; the elimination of these secular terms produces a trivial solution, which is not appropriate. By using the expanded frequency conception, an alternative solution generates a solution that is consistently satisfactory; however, it does not satisfy the numerical solution. Therefore, the HPM must consequently be changed once more. In order to investigate the impacts of the delay parameter, which is better at avoiding bifurcations and reducing vibration, we may therefore re-analyze the basic Homotopy equation using a novel expansion in replacement of the conventional expansion. In light of our previous work 23 , we believe that θ(t, ρ) needs to be further developed. The following are the procedures to obtain the required solution: (9) G D = δ (−Lθ cos θ) i + (Lθ sin θ + � Q 0 sin �t )j .  www.nature.com/scientificreports/ Throughout this process 28 , the time-dependent parameter may be formulated as:θ(t) = θ(t; ρ) and As earlier stated, the homotopy formula for the equation under consideration is provided by Eq. (18). The expanded frequency analysis will serve as the foundation for the instability analysis. This method necessitates the following equation, see Moatimid 26,27 : where the factors σ i will be calculated later on after being combined with the initial features of the problem. By doing so, secular terms will be made meaningless.
When Eqs. (18)(19)(20) are combined, the Laplace transform is applied, the initial conditions from Eq. (17) are considered, and the outcome then becomes: Findings are obtained by employing the inverse transform to both sides of Eq. (21).
By producing the development of the dependent variable θ(t; ρ) as presented in Eq. (22), and then recognizing the coefficients of comparable powers ρ on each side, one obtains and Characteristically, the consistent logical statement goes out from the removal of the secular terms. For this purpose, the coefficient of the function sin σ t should be disregarded. This implementation goes to create the parameter σ 1 as follows: The periodical response at this point in time is provided by where θ ij are given in the Appendix to follow the paper easily.
Consequently, the circumscribed approximate solution of the equation of motion provided in Eq. (14) may be expressed as follows: In reality, the constrained approximate solution as provided in Eq. (27) requires that the arguments of the trigonometric functions should be of real significance. For this objective, Eq. (25) is inserted into Eq. (20), and it follows that the characteristic nonlinear frequency fulfills a particular equation. To this approximation, the computation indicates that this equation exemplifies a polynomial of fourth degree in the nonlinear frequency. This equation may be written as: www.nature.com/scientificreports/ It is convenient to match this procedure with the numerical approach that is identified as RK-4 to evaluate the practicality of the previously expanded frequency implications. The requirements for implementation are listed below. Consequently, in what follows, the analytic approximate solution as provided by Eq. (28) is drawn in blue. Additionally, the RK-4 of the considered structure as offered by Eq. (14) is highlighted in red. The following figure is a graph of a scheme receiving the following specifics: The computations demonstrate that the synthetic frequency has the amount σ = 1.32038 and other roots (two are complex conjugate and the third is negative. It is also helpful to compare the numerical solution of the original Eq. (14) generated by RK-4 with the corresponding linear ODE solution. Equation (27) provides the approximate analytical solution. In this comparison, the structure is displayed, as seen in Fig. 2. For an appropriate sample with the provided details, the two figures are obtained in light of the previous data. The findings are reasonably reliable with one another, as can be observed. Further, the mathematical software demonstrated that the absolute difference between the analytical and numerical results, up to a time of 100 units, is 0.186645.

Linearized stability of the autonomous equation
For more convenience, the linearized stability of the IP may be derived in the special case, in the absence of the periodicity of the pin motion ( = 0 ). In this situation, the governing equation of motion then becomes Contemplating the conversion: θ = φ , it follows that Eq. (29) may be transformed to the following equation where The fixed points (equilibrium points) occur at the points (θ 0 , φ 0 ),where It follows that and Consequently, the only fixed point is (0, 0) . Here, the Jacobian matrix is defined as The eigenvalues r , ( r = 1, 2 ) are given by J − r I 2×2 = 0 . Therefore, these eigenvalues are provided by k = 0.9, L = 0.5, , H = 0.2, � = 0.01 and δ = 0.1. www.nature.com/scientificreports/ When the Jacobian eigenvalues have a negative real portion, the equilibrium point is typically transformed into a stable state. On the contrary, if at least one of the eigenvalues has a positive real portion, the equilibrium point is unstable. As demonstrated by He et al. 17 and Ghaleb et al. 29 , it is more acceptable to consider a sample system to indicate the stability/instability arrangement in light of the equilibrium points. As a result, the condition is determined by the type of the eigenvalues. Table 1 below provides a summary of this process.

IP system with PPF controller
Returning again to the fundamental equation of motion as given in (14) and letting Adding the PPF controller as previously shown [19][20][21] to the preceding equation of motion, the following equations are established as follows: and where the coefficients scale are as follows: θ and v are the amplitudes of the model of the IP and controller, respectively. δ and δ 1 are the coefficients of damping, ω and ω 1 are natural frequencies, β is the coefficients of the nonlinear parameter, is the excitation frequency, F 1 , F 2 and F 3 are the parametric excitations, q 1 and q 2 are the parameters of control signals sign.

Numerical simulation with time history.
In what follows, the numerical RK-4 is employed to graph the time history curve as well as the phase portrait before and after combining the PPF control at the primary    Table 1. www.nature.com/scientificreports/ resonance ( � ∼ = ω ) and the internal resonance ( ω 1 ∼ = ω ). These calculations are performed based on MATLAB® computer program control. For this purpose, the sample chosen system is taken as follows: The time history is illustrated through Fig. 9a for the steady state amplitude of IP system before adding the control. As shown from this figure, the amplitude reaches 1.074. Simultaneously, Fig. 9b represents the phase portrait between the velocity and amplitude for the same case, which shows the chaotic attractor and approximately multi-limit cycle. In addition, the response of the IP with and without the PPF controller is depicted as a Poincare map diagram in Fig. 9c. This figure is depicted to mention the type of motion of the system and the controller. On the other hand, Fig. 10a depicts the amplitude of the considered structure after combining the PPF control. It is found that that amplitude becomes 0.103. Therefore, according to this controller, the amplitudes have been reduced by the ratio 90.5%. Additionally, Fig. 10b displays the phase portrait between the velocity and amplitude after adding the PPF controller, which shows improvement of the chaotic attractor and limited cycle numbers. Finally, the effectiveness of the PPF controller E a is defined as ( E a = steady-state amplitude of the structure before PPF separated by after controlling) and is of 10.43. Similar results were obtained earlier in our previous work 19 . As previously shown, Fig. 9c introduced Poincaré map for detecting chaos behavior in IP system before adding PPF controller. Furthermore, Fig. 10c presented the Poincaré map to show that the IP system after applying the PPF controller is no longer chaotic, which indicates a better quality of this controller.   Table 1 Table 1. and where c.c signifies the complex conjugates of the previous terms.
To this end, the purpose of the study is to reduce the vibration of the considered prototype. Consequently, the non-resonance case will be omitted. So, the following investigation focuses only on the resonance cases. It should be noticed that the resonance cases must be determined for Eqs. (52) and (53), namely, the primary resonance ( � = ω ) and the internal resonance ( ω 1 = ω ). Subsequently, the detuning parameters σ 1 and σ 2 as a closeness to the described frequencies are assumed as follows: Substituting Eq. (54) into Eqs. (52)  (46)  where ã 1 ,ã 2 , ρ 1 and ρ 2 are real functions on the time t.
(76) f (a 1 , ψ 1 ) = 0, u(a 1 , ψ 1 ) = 0,  = 1, 2) . Therefore, the FREs of the existing case ( a 1 = 0, a 2 = 0 ) are given by solving the following algebraic equations: a 1 sin 2 ψ 1 , Table 2. Equilibria classification of the eigenvalues and their stability/instability.   where the above square matrix is called the Jacobian matrix X . The coefficients values r i j , ( i, j = 1, 2, 3, 4 ) are listed in the Appendix. Therefore, the eigenvalues γ r , ( r = 1, 2, 3, 4 ) are given by X − γ r I 4×4 = 0 and lead to the following equation: where the coefficients R 1 ,R 2 , R 3 and R 4 are known from the context. In light of the Routh-Hurwitz criterion 28 , if the real part of the eigenvalue is negative, then the periodic solution is stable; otherwise, it is unstable.

Results and discussions
Frequency response curve (FRC) and effect of different factors. In the following Figs. 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 and 27, it should be noted that the thick curves refer to the stable regions. Otherwise, the thin ones represent the unstable regions.
To clarify the importance of adding the control, we make a comparison between the FRC for the system before and after adding the controller as represented in the Fig. 17. From this comparison, at the region near to σ 1 = 0 , the steady-state amplitude for the uncontrolled structure is very high as indicated by the black curve. In the same region, the amplitude of the system after adding PPF control decreases completely as indicated by the red curve. This demonstrates the quality of the controller in reducing the vibration at the considered resonance situation. Consequently, when adding the controller, the area around σ 1 = 0 is called the vibration bandwidth region because it is located between two peaks as shown earlier 17,34 .
The steady-state solution of the model FREs, as given by Eqs. (78)-(81), is described by plotting the FRC at the current case ( a 1 = 0,a 2 = 0 ) as shown in Fig. 18. For this purpose, Fig. 18a displays the amplitude model a 1 versus σ 1 . Simultaneously, Fig. 18b depicts the controller amplitude a 2 versus σ 1 . Moreover, from Fig. 18a it appears that the vibrations after being connected to the PPF controller are damped in the region of the frequency bandwidth. Consequently, we can say that the optimal mode of vibration reduction is σ 1 = σ 2 = 0 . Earlier examples were included 21,34 . Figure 19 illustrates the effects of various amounts of δ on the FRC. When the values of δ have increased, the amplitude of the structure has increased around the region σ 1 = 0 . This is called the jump phenomenon, which was displayed earlier 35,36 . Additionally, the areas of instability and the heights of the two peaks are decreased.
By improving the amounts of δ 1 , the bandwidth region in Fig. 20a,b are expanded. Moreover, the height of the left peak as well as the instability regions decrease. Finally, the jump phenomenon of the controller decreases as indicated in Fig. 20b. Examples from the previous phenomenon were included in 17 .
From Fig. 21, it is clear that as the values of β increase, the amplitude decreases, and the right peak is more bent to the right. Instances from the earlier occurrence were provided earlier 29 . Figure 22 shows that when the ω-values decrease, the bandwidth region expands, and the regions of instability increase. Additionally, the height of the left peak increases, while the right peak gradually continues to bend to the right. Examples from the first incident were given earlier in 17,21 .
(79)  Fig. 23, we note that the lowest values of the steady-state amplitude of the IP occur at σ 2 = σ 1 . This establishes that the vibration has been damped at the resonance case. There have already been examples provided from the first instance 17 . Figure 24 depicts the change of the different values of F 1 on the FRC curve. It is found that the higher amounts of F 1 produces the higher amounts of the amplitude and vice-versa for the bandwidth area. Illustrations from the previous situation were already supplied 34 . Therefore, the presence of the magnetic field suppresses the instability of the system.
In what follows, the influences of the parameters q 1 and q 2 on the curve FRC will be discussed throughout Figs. 25 and 26. The bandwidth region expands and the left peak goes up when the value of q 1 and q 2 are enhanced as displayed in Figs. 25a and 26a. Simultaneously, in Figs. 25b and 26b, the left peak decrease down with an increase of q 1 , while it grows with an increase in q 2 . Similar results were obtained earlier 17,21 .
In the following two figures, a comparison will be made to graphically verify the validation of the theoretical and numerical approaches. For this objective, the comparison of FRC between both analytic and numerical solutions. The solid red lines represent the former, while the blue circles represent the latter as shown in Fig. 27. Fairly good results were obtained (look Tables 3 and 4). It is shown that the analytical solution is very consistent with the numerical one. In Fig. 28, a comparison between the perturbation procedure as given in Eqs.   www.nature.com/scientificreports/ the system with PPF-controller. As observed, we found acceptable harmony between numerical and analytical producers, which confirmed our solution as done in Fig. 27. Figure 29 presents a comparison between different controllers to verify the good performance of the vibration reduction which appears in the IP without a controller described with the red line. The comparison is made with a green line for the nonlinear saturation control (NSC), and with a yellow line for the proportional derivative control (PD), and with a blue line for the PPF.

Conclusions
In the current work, the vibrating IP system is analyzed analytically and numerically without and with a PPF controller. The approximate solution before the PPF controller is accomplished by applying a modified HPM. A numerical method based on the RK-4 is employed to validate the prior approximate solution. Furthermore, both the phase portraits and the linearized stability are plotted. On the other side, the vibration reduction for IP model via PPF controller is proposed in one of the worst resonance cases. The MSPT technique is used for getting a second-order approximate solution of the controlled measured system. The stability analysis of the situations � ∼ = ω and ω 1 ∼ = ω , with the aid of the Routh-Hurwitz criterion, is examined. Moreover, a collection of drawings is made to demonstrate the FRC and different factors using the MATLAB program. The main outcomes of the whole work may be summed in the subsequent points:  3. The PPF controller is succeeded in reducing vibrations for the considered IP system with a reduced rate of 90.5%. 4. The amplitude of the IP system is increased as the following parameters: F 1 , ω and δ increase, and the bandwidth region progressively decreases for F 1 , ω and progressively disappears for δ . Additionally, the unstable regions are decreased. 5. The increasing the values of the following parameters q 1 , q 2 , β and δ 1 leads to a decrease in the amplitude of the IP system progressively. 6. The IP system with a PPF controller is reached to the smallest values on the frequency response curve at σ 1 = σ 2 . 7. A comparison between the analytical and the numerical scheme provides an appropriate agreement between them before and after adding the PPF controller as presented in Figs. 2 and 28. 8. For validation response curves, there exist great agreements between the approximation FRC and RK-4 solutions as presented in Fig. 27.        www.nature.com/scientificreports/ For progress works, the topic of IP can be analyzed in different situations: Concerning the approximate analytical solution, and away from the weakness of expanding the restoring forces, a relatively new methodology which is known as the He's frequency [37][38][39] can be applied. Another effective controller could be adopted like a proportional integral derivative (PID) controller or nonlinear integral positive position feedback (NIPPF) controller to decrease the high vibration amplitude of the systems in a small time.

Data availability
All data generated or analyzed during this study are included in this manuscript.