Alan asked . 2021-08-24

Simulink PID Controller Tuning

Hi,
I am a new user to Simulink. I created a model and added a PID controller. When I tune the controller it says the response should be about 1 second with a 20% overshoot. When I run the model the reality is 1000 seconds with 10,000% overshoot. What could cause this to happen?
 
I created my own PID controller and modified the coefficients and it seems to be working, but I would definitely like to get the built-in PID controller working since I am spending about 5 hours just to tune my homemade controller.
 
I have been debugging for about a week now, I am not sure what look for. Any assistance would be greatly appreciated.

simulink , pid controller , tuning

Expert Answer

John Williams answered . 2024-11-16 20:31:26

actually sent me his model. He is trying to control the quadrotor position and orientation by controlling 4 rotor speeds.
 
1) In the most general case this is a coupled MIMO system, and PID Tuner would not work - it only works for SISO systems or MIMO systems that can be designed as a set of SISO loops. For a MIMO system like the quadrotor, the right tools are Robust Control Toolbox and/or Simulink Design Optimization.
 
2) The specific case Alan was working with is to make the quadrotor go up from 0 to 1 m, without changing x and y positions, and while keeping all attitude angles at zero. In this specific case all 4 rotor speeds are the same. The system effectively becomes a SISO loop described by the equation
 
zdotdot=lift/m -g,
 
where z is altitude, lift is PID Controller output, m is mass, and g is gravity. Alan applied PID Tuner to this system. When he accepted the design and ran it in Simulink, he observed huge overshoots he wrote about in his question.
 
This happened because PID Tuner works by linearizing the Simulink model. When linearizing the model zdotdot=lift/m-g, the resulting linearized model is zdotdot=lift/m. In other words, the tuner cannot see g - gravity, which in this case can be thought of as a huge input disturbance (10 times larger than the reference signal). So there is no error in the tuner here - it just does not know about the huge input disturbance acting on the system.
 
There are 2 ways to deal with this:
 
A. The better way: compensate for gravity in the feedforward path. You know what the gravity is, so just cancel it.
 
Effectively your PID will then be calculating the lift force required in addition to gravity, not the total lift force. To do this in Simulink, add a constant term, equal to g*m to PID output.
 
B. The other, not recommended option - crank the bandwidth of the PID all the way up to cancel input disturbance. Not recommended as option 1 makes more sense in this case.
 
We have also put together a comprehensive page with resources on designing and implementing PID controllers in MATLAB and Simulink. It might provide some help as well.
 
 
 
 

PID Tuner provides a fast and widely applicable single-loop PID tuning method for the Simulink® PID Controller blocks. With this method, you can tune PID controller parameters to achieve a robust design with the desired response time.

A typical design workflow with the PID Tuner involves the following tasks:

(1) Launch the PID Tuner. When launching, the software automatically computes a linear plant model from the Simulink model and designs an initial controller.

(2) Tune the controller in the PID Tuner by manually adjusting design criteria in two design modes. The tuner computes PID parameters that robustly stabilize the system.

(3) Export the parameters of the designed controller back to the PID Controller block and verify controller performance in Simulink.


Not satisfied with the answer ?? ASK NOW

Frequently Asked Questions

MATLAB offers tools for real-time AI applications, including Simulink for modeling and simulation. It can be used for developing algorithms and control systems for autonomous vehicles, robots, and other real-time AI systems.

MATLAB Online™ provides access to MATLAB® from your web browser. With MATLAB Online, your files are stored on MATLAB Drive™ and are available wherever you go. MATLAB Drive Connector synchronizes your files between your computers and MATLAB Online, providing offline access and eliminating the need to manually upload or download files. You can also run your files from the convenience of your smartphone or tablet by connecting to MathWorks® Cloud through the MATLAB Mobile™ app.

Yes, MATLAB provides tools and frameworks for deep learning, including the Deep Learning Toolbox. You can use MATLAB for tasks like building and training neural networks, image classification, and natural language processing.

MATLAB and Python are both popular choices for AI development. MATLAB is known for its ease of use in mathematical computations and its extensive toolbox for AI and machine learning. Python, on the other hand, has a vast ecosystem of libraries like TensorFlow and PyTorch. The choice depends on your preferences and project requirements.

You can find support, discussion forums, and a community of MATLAB users on the MATLAB website, Matlansolutions forums, and other AI-related online communities. Remember that MATLAB's capabilities in AI and machine learning continue to evolve, so staying updated with the latest features and resources is essential for effective AI development using MATLAB.

Without any hesitation the answer to this question is NO. The service we offer is 100% legal, legitimate and won't make you a cheater. Read and discover exactly what an essay writing service is and how when used correctly, is a valuable teaching aid and no more akin to cheating than a tutor's 'model essay' or the many published essay guides available from your local book shop. You should use the work as a reference and should not hand over the exact copy of it.

Matlabsolutions.com provides guaranteed satisfaction with a commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been empanelled after extensive research and quality check.

Matlabsolutions.com provides undivided attention to each Matlab assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work done at the best price in industry.