To predict the system's characteristics as the gain (Kp) is adjusted and poles move, design the root locus.
Root Locus of the system by default parameter set. It has one zero (s = 0), and three poles (s = -74.93; s =-3.88e-3; s = 73.53).
Closed Loop Root Locus
Where G(s) is Kp the gain can be adjusted ti make the closed loop poles to be in stable location The resultant Root Locus can be seen below (note to plot this graph in param.py you need to set Stabilize_Controller to "PID" mode and set plot_rootlocus to "True") in this graph you can click pole position you want to know Gain Kp to adjust your system characteristics.
Bang-bang Controller:
The swing up control routine and the stabilizing control routine are switched between -25 to 25 degree
Brake Controller: Used as reduced energy of RWIP when RWIP have too much energy for stabilze
Sound Generation
The simulation incorporates sound generation related to the speed of the reaction wheel. This feature adds an auditory element to the simulation, enhancing the user experience.
Compare PID controller and LQR controller
In this project, we explore and compare the performance of two different control strategies: PID (Proportional-Integral-Derivative) controller and LQR (Linear Quadratic Regulator) controller.
Linear quadratic regulator
Error (deg)
settling time (s)
Power (Watt)
5
0.66
0.6
6
0.73
1.01
7
0.85
1.75
8
1.07
3.5
9
can't stabilize
can't stabilize
Max Disturbance : 9.32 Nm
PID : Kp = 500 (choose form root locus)
Error (deg)
settling time (s)
Power (Watt)
5
20.43
10.06
6
21.02
12.17
7
21.37
13.95
8
21.59
15.96
9
can't stabilize
can't stabilize
Max Disturbance : 8.05 Nm
PID : Kp = 215800 (choose form root locus)
Notice that when choose unstable pole the system still stable because now it have hardware limit so the character of controller same like Fuzzy logic control to see unstable you need to unlock hardware limitation by set MotorLimit to False in param.py
Conclusion
Stabilize boundary
LQR
Can stabilize in every position
PID
Can stabilize only in small boundary
PID Controller
The PID controller is a widely used feedback control system that relies on three components: Proportional, Integral, and Derivative. Here's a brief overview of each component:
Proportional (P): Reacts to the current error.
Integral (I): Reacts to the accumulation of past errors.
Derivative (D): Predicts future errors based on the rate of change.
Advantages of PID:
Simplicity and ease of implementation.
Effectiveness in a wide range of systems.
Intuitive tuning parameters for performance optimization.
Considerations:
Tuning may be required for optimal performance in different systems.
Limited capability to handle complex or nonlinear systems.
LQR Controller
The LQR controller is designed based on the principles of optimal control theory. It minimizes a cost function that combines both state and control input, making it suitable for linear, time-invariant systems.
Advantages of LQR:
Optimal control solution for linear systems.
Ability to handle systems with multiple inputs and outputs.
Incorporates a mathematical model for optimal performance.
Considerations:
Requires a good understanding of the system dynamics for effective modeling.
Limited applicability to strictly linear systems.
Acknowledgments
This project is part of the coursework for FRA333 Robot Kinematics at the Institute of Field Robotics, King Mongkut’s University of Technology Thonburi. Special thanks to the course instructors for their guidance and support.
Feel free to explore, modify, and extend this project for educational and research purposes.