台灣控制學習營: 平衡小車倒立單擺

Find AI Tools in second

Find AI Tools
No difficulty
No complicated process
Find ai tools

Table of Contents

台灣控制學習營: 平衡小車倒立單擺

Table of Contents

1. 🌟Introduction

2. 🏗️Understanding the System

2.1 The Inverted Pendulum on a Cart

2.2 Defining the State of the System

2.3 Deriving the Differential Equations

2.4 Linearizing the System

3. 🚧Controllability Analysis

3.1 Computing the Jacobian Matrix

3.2 Checking Controllability

4. 🎮Designing the Controller

4.1 Developing the Control Law

4.2 Proportional Feedback Control

4.3 Optimal Eigenvalue Placement

5. 💡Conclusion

6. 📚Resources


Introduction 🌟

Welcome back! In this article, we will dive into the exciting world of controlling dynamic systems using MATLAB. We will be focusing on a specific system known as an inverted pendulum on a cart, which adds an interesting twist to the conventional pendulum system. We will explore the process of designing controllers to stabilize this dynamic system using MATLAB. So, let's get started and see how easy it is to control a system in MATLAB!


Understanding the System 🏗️

2.1 The Inverted Pendulum on a Cart

Imagine a Scenario where we have an inverted pendulum mounted on a cart. Unlike a traditional pendulum system, the pendulum in this setup is placed on top of a cart, which can be moved around. This combination adds an extra level of complexity and physics to the system. Our goal is to stabilize this inverted pendulum by controlling the cart's movements. This system presents a more physical and engaging challenge compared to a typical pendulum system.

2.2 Defining the State of the System

To effectively control the system, we need to define the state of the system. In this case, the state will consist of two components: the position of the cart (denoted as X) and the angle of the pendulum arm (denoted as θ). We can represent the state as a vector, denoted as Y, which includes the positions X and θ, as well as their respective rates of change, Ẋ and θ̇. Since this system has two degrees of freedom, it will result in four coupled ordinary differential equations (ODEs).

2.3 Deriving the Differential Equations

Deriving the differential equations for this two-degree-of-freedom system can be a complex process. Fortunately, we can use methods like Euler Lagrange equations or Hamilton's equations to obtain these coupled first-order nonlinear ODEs. These equations involve the time derivatives of X, θ, Ẋ, and θ̇.

2.4 Linearizing the System

Although our system's differential equations are nonlinear, we can simplify the analysis by linearizing the system. Intuitively, we know that there are two key fixed points in the system: the pendulum down position (θ = 0) and the pendulum up position (θ = π). By linearizing the system around these fixed points, we can compute the Jacobian matrix and obtain a linear system of equations in the form of Ẋ = AX + BU. Here, U represents the control input, which corresponds to the force applied to the cart in the X direction.


Controllability Analysis 🚧

3.1 Computing the Jacobian Matrix

To analyze the system's controllability, we need to compute the Jacobian matrix. This matrix captures the linearization of the system and provides valuable insights into its behavior. By evaluating the Jacobian matrix for both the pendulum up and pendulum down conditions, we can determine the system's controllability. Offline, we computed the Jacobian matrix using the Euler Lagrange equations and substituted the fixed points.

3.2 Checking Controllability

Once we have the linearized system represented by the A matrix and the B matrix, we can assess its controllability. By performing a rank analysis on the controllability matrix, CTRB, which is derived from the A and B matrices, we can determine if the system is controllable. A rank of 4 indicates that the system is fully controllable, while a lower rank suggests otherwise. In our case, since the rank of the controllability matrix is 4, we can conclude that our system is controllable.


Designing the Controller 🎮

4.1 Developing the Control Law

With the system's controllability established, we can proceed to design a controller. We will use the control law U = -KX, where U represents the control input and K is a matrix that we will determine. By incorporating this control law, we can drive the closed-loop system towards stability.

4.2 Proportional Feedback Control

To stabilize the system, we can Apply proportional feedback control. This involves multiplying the state vector X by the gain matrix K. By appropriately choosing the eigenvalues of the closed-loop system, we can ensure stability. This feedback control allows us to influence the behavior of the pendulum on the cart by adjusting the force applied to the cart.

4.3 Optimal Eigenvalue Placement

In addition to proportional feedback control, we can also use the Linear Quadratic Regulator (LQR) control to achieve optimal eigenvalue placement. The LQR control optimally assigns weights for the state variables, control input, and their respective rates of change to achieve the desired stability and performance. This technique allows us to find the optimal gain matrix K for the given performance criteria.


Conclusion 💡

In this article, we explored the fascinating world of controlling dynamic systems using MATLAB. We specifically focused on the inverted pendulum on a cart system, which provided an engaging and challenging problem. By understanding the system's dynamics, linearizing the equations, and analyzing controllability, we successfully designed a controller to stabilize the system. Through the use of proportional feedback control and the LQR control, we were able to achieve stability and optimize the system's performance.


Resources 📚

  • [Link to YouTube Video](insert YouTube video URL)
  • [GitHub Repository](insert GitHub repository URL)
  • [MATLAB Documentation](insert MATLAB documentation URL)

FAQ

Q: How does proportional feedback control stabilize the system? A: Proportional feedback control adjusts the control input based on the difference between the desired state and the current state. By multiplying the error by a gain matrix, the controller applies a force on the cart to bring the pendulum back to the desired position, thus stabilizing the system.

Q: What is the AdVantage of using the LQR control? A: The LQR control allows us to optimize the control strategy for the best possible performance and stability trade-off. By assigning appropriate weights to the states and control input, the LQR control can achieve desired stability while minimizing control effort and maximizing performance.

Q: Can this control strategy be applied to other dynamic systems? A: Yes, the control strategies discussed in this article can be applied to a wide range of dynamic systems. By understanding the system dynamics, linearizing the equations, and analyzing controllability, you can design controllers to stabilize and control various dynamic systems.

Most people like

Are you spending too much time looking for ai tools?
App rating
4.9
AI Tools
100k+
Trusted Users
5000+
WHY YOU SHOULD CHOOSE TOOLIFY

TOOLIFY is the best ai tool source.