Overview: The governing equations of a pendulum mounted on a moving cart were derived using Newton's, Lagrange's, and Kane's method. Four numerical solvers were used to model the system and verify the solutions in MATLAB. The influence of how the cart's applied force, cart's mass, pendulum's mass, and pendulum's starting angle impact the system's behavior was analyzed. Animations were created to visualize how those parameters influence the pendulum's amplitude and the cart's position.
The system featured is an inverted pendulum mounted on a moving cart. The behavior of the system was modeled by applying the Newtonian (Image 2), Lagrangian, and Kane's method (Image 3). The system was simplified based on these assumptions:
The cart and pendulum are rigid bodies.
Uniform gravity forces.
No air resistance.
The ground is frictionless.
The pin's reaction forces are negligible.
Kane's method was used to model the system in MATLAB due to its computational simplicity and efficiency. When deriving the governing equations, the Newtonian method was the most straight-forward but most time-consuming process. The Lagrangian method was quicker, but it still required the Lagrangian and partial derivatives to be calculated. Kane's method was the quickest since only the generalized forces were required.
The system is composed of four primary state variables: X, θ, and their respective rates. These variables are known as the cart's position, cart's velocity, pendulum's angular position, and pendulum's angular velocity. A set of parameters (Image 1) were inputted in MATLAB to obtain a plot of the state variables (Image 2). In the subsequent plots, the initial value conditions that were altered are specified under each plot.
The analysis was centered around how X and θ behave as parameters are varied; these variables directly show how the system is directly behaving. Secondly, this analysis was focused solely on how the system behaves; a control system to balance the inverted pendulum was not created.
The parameters that were altered were Fc, mA, mB, and θ. Four solvers--ODE 15s, ODE 45, ODE 89, and RK-4--were used to model the system, and to verify whether the solution is accurate
The first parameter that was altered was the applied force on the cart. The standard plot shows that the pendulum experiences sustained oscillation between 135° to 240° (Image 1). By conducting a sanity check, the amplitude of θ increases to 240° before decreasing to 135°. This meets expectations because θ was defined with respect to the vertical. Secondly, the magnitude of the oscillations is correct because there's no damping term. Next, the position of Acm exponentially increasing is expected because there's an external force acting on the system (Image 2).
When Fc is increased to 100 N, θ's amplitude and frequency increased (Image 1). A reason why this may be the case is that the moment acting on the inverted pendulum increased; this results in a greater angular velocity.
At Fc = 0, perfect harmonic pendulum motion is modeled. The swinging motion of the pendulum causes the cart to oscillate at negligible distances (Image 2).
With Fc analyzed, mA was varied next. When mA is decreased to 0.0006 kg, there was no noticeable change to the amplitude or frequency of θ (Image 1). However, the cart's position radically increased from 600 m to 3,000 m. This is expected behavior because the applied force could move the cart further when it is lighter. When the mass was increased, the opposite effect could be observed; the maximum displacement was 0.75 m. Increasing the cart's mass caused the maximum amplitude to decrease from 240° to 220°. The cause for this is unknown because the cart's mass should not influence the pendulum's angular position.
Variance of the pendulum's mass was the third case analyzed. By reducing the pendulum's mass to 0.0006 kg, the pendulum's period drastically decreased. When increased to 600 kg, the pendulum's frequency increased and caused three of the ODEs to diverge. Based on MATLAB documentation, ODE89 is one of the most accurate numerical solvers due to its small error tolerances. Considering a simple pendulum, varying the pendulum's should not effect its frequency. However, a reason why this is not the case in this system is that the moment of inertia remains constant. Then, mass does not get cancelled out within the pendulum's period equation. Which is why increasing pendulum mass causes a high frequency response; the converse is true.
Examining the cart's displacement plots shows that increasing the pendulum's mass causes the cart to have a lower maximum displacement (Image 2).
The pendulum's starting angle was the final modified parameter. By examining all six plots of the pendulum's angular position, it is evident that the ODE 15s solver diverges (Image 1). This is either due to the solver's error tolerances or that the time step was insufficient.
Generally, the pendulum reaches its mirrored starting angle because there is no damping term. For example, a starting angle of 45° would cause it to swing 315° (Image 1). This conclusion is shown in the 90°, 135°, and 225° as well (Image 1 - 2).
Two special cases were modeled: θ = 0° and θ=180° (Image 1 - 2). These cases are based on where the pendulum is directly upright (inverted pendulum) and downward. In the first case, when the cart is pushed to the right, a moment causes the pendulum to swing counter clockwise (Image 1). For the second case, a moment causes the pendulum to swing clockwise (Image 2). Comparing these two plots shows that the the 0° case experience a greater angular displacement than the 180°. The former nearly does a full 360° rotation, whereas the latter experiences a maximum angular displacement of 15°. As concluded in the first case, the pendulum's maximum angular displacement is influenced by the force acting on the cart.
Varying the pendulum's starting angle did not influence the cart's maximum displacement (Image 3). As previously concluded in cases 1 - 3, the cart's displacement is influenced the applied force, cart mass, and pendulum mass; a lighter cart allows it to travel greater distances.
Animations were created to visualize how the system behaves base on a set of initial value conditions. ODE89 was used to animate the system due to its high accuracy.
Figure 1 shows how the system behaves when the pendulum starts at 0°. The animation closely mirrors its pendulum's angular position and position graphs. Initially, the pendulum slowly rotates counter-clockwise before picking up speed during the descent. As the pendulum nears its mirrored maximum amplitude, the pendulum slows down before changing directions; the process repeats. Since there's no damping term, the pendulum achieves the magnitude of its starting angular position.
Figure 2 shows how the system behaves when 1 N pushes the cart to the right when the pendulum is at 45°. The previous conclusions drawn from the previous case applies here as well. In both cases, each cart arrives at the same final position. This supports the previous conclusion that the pendulum's starting angle does not influence the cart's final position.