MATLAB/Simulink - inverted pendulum swing-up problem

  • MATLAB
  • Thread starter tatenka
  • Start date
  • Tags
    Pendulum
In summary, the controller has the form u= -umax*sign(thetadot), or u= -umax*sign(thetadot*cos(theta)), where theta is the pendulum angle, thetadot is the pendulum angular velocity (derivative of the angle), umax is the maximum voltage and u is the actual input voltage applied to the system. A couple of blocks in Simulink, nothing special, or so it would seem. However, when the input voltage is changed, the system suddenly oscillates with an amplitude of 1e-4 and period of less than 1e-3 seconds.
  • #1
tatenka
1
0
I'm trying to implement a pendulum swing-up controller to work with my model of a single inverted pendulum on a cart with a motor (the only input is the motor voltage, the outputs are the cart position and the pendulum velocity). The controller has the form
u = -umax*sign(thetadot), or
u = -umax*sign(thetadot*cos(theta))
where theta is the pendulum angle, thetadot is the pendulum angular velocity (derivative of the angle), umax is the maximum voltage and u is the actual input voltage applied to the system. A couple of blocks in Simulink, nothing special, or so it would seem.
I've seen this kind of controller implemented in a variety of sources (http://support.dce.felk.cvut.cz/mediawiki/images/0/08/Bp_2009_korda_milan.pdf pages 19-21) but I'm having a problem with it. To be specific about how the system behaves (see first figure of the attachment):
- the pendulum angle (purple) and angular velocity (thetadot, blue) have the normal sinusoid behavior and the pendulum swings increase (this has been normal behavior so far)
- at one moment, when the pendulum is quite close to the upper equilibrium and thetadot is crossing the zero, thetadot SUDDENLY goes mad and starts oscillating with approximately an amplitude of 1e-4 and period of less than 1e-3 seconds. This means that the controller adopts the same oscillating behavior (second figure of the attachment), and if you change the input voltage of a system (yellow) hundreds of times per second, the system behaves as if there was no input at all
Could anybody help me please?? I have to put this into my thesis and it is starting to drive me mad.
Thanks a lot in advance.
 

Attachments

  • swingup.jpg
    swingup.jpg
    50.7 KB · Views: 738
Physics news on Phys.org
  • #2
The best way to debug this is to look at the code of your controller and see if there are any bugs. You can also try adding a low-pass filter to the input voltage, which might help smooth out any noise that is causing the sudden oscillations. Finally, you could try running the system in a simulator, as this can sometimes help identify issues that may not be apparent in real-world testing.
 

1. What is the inverted pendulum swing-up problem in MATLAB/Simulink?

The inverted pendulum swing-up problem is a classic control problem in which the goal is to balance an inverted pendulum on a cart by controlling the cart's movements. This problem is often used to demonstrate the capabilities of MATLAB/Simulink in designing and implementing control systems.

2. What are the key components of the inverted pendulum swing-up problem in MATLAB/Simulink?

The key components of the inverted pendulum swing-up problem in MATLAB/Simulink include the physical model of the pendulum and cart, the feedback control algorithm, and the simulation environment.

3. What is the role of MATLAB/Simulink in solving the inverted pendulum swing-up problem?

MATLAB/Simulink provides a powerful platform for designing, simulating, and implementing control systems. It allows users to build physical models, design control algorithms, and test their performance in a simulated environment before implementing them in the real world.

4. What are some common challenges in solving the inverted pendulum swing-up problem in MATLAB/Simulink?

Some common challenges in solving the inverted pendulum swing-up problem in MATLAB/Simulink include accurately modeling the physical system, designing a control algorithm that can effectively balance the pendulum, and tuning the parameters of the control algorithm to achieve optimal performance.

5. What are some resources for learning more about the inverted pendulum swing-up problem in MATLAB/Simulink?

There are many online resources available for learning more about the inverted pendulum swing-up problem in MATLAB/Simulink. These include tutorials, videos, and documentation provided by MathWorks, as well as community forums and blogs where users share their experiences and tips for solving this problem.

Similar threads

  • Mechanical Engineering
Replies
1
Views
1K
  • Introductory Physics Homework Help
Replies
9
Views
696
  • Differential Equations
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Programming and Computer Science
Replies
23
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
Back
Top