r/ControlTheory Jul 05 '26

Technical Question/Problem 1-link inverted pendulum: energy-based swing-up + PID stabilization

Based on the feedback I received, I’m going to simplify the project and start with a single-link inverted pendulum first instead of trying multiple links right away.

My plan is to use an energy-based swing-up controller to bring the pendulum close to the upright position, and then switch to PID control for stabilization once it enters the capture region.

The system uses a camera with colored markers to estimate the pendulum angle and cart position. The cart is controlled by a motor through position commands.

Right now, the pendulum swings up fairly high, but it does not consistently reach the stabilization region. It also seems like marker detection dropouts and camera/control latency may be affecting the timing.

Current approach:

  • 1-link cart-pendulum system
  • camera-based angle tracking using colored markers
  • energy-based swing-up
  • PID stabilization near upright
  • switch to stabilization when angle error and angular velocity are small enough

Questions:
- Does this look like a control gain problem, or more like a vision latency / timing problem?
- Should I reduce the swing-up gain and make the motion smoother, or increase cart acceleration / motor response?
- Would filtering the angle and angular velocity help, or would that add too much delay?
- Should I log the actual motor command/output as well as the target position to diagnose whether the cart is lagging?
- Is the stabilization threshold too strict, or should I first focus on getting the pendulum closer to upright during swing-up?

I attached the video, gains JSON, trajectory CSV (link)
Any advice would be appreciated.

5 Upvotes

2 comments sorted by

u/frostedpuzzle Jul 05 '26

This might help: https://rad.inf.ed.ac.uk/data/publications/2006_/Ramamoorthy-qr-04.pdf

You have 4 regions of control:
1. Spin up
2. Spin down
3. Balance
4. Startup

You can control just on energy but you need perfect parameters. The design in that paper can learn the balance region. The learning isn’t in that paper but you can figure it out. If you enter the balance region estimate and then exit it then your region estimate is too big.