How to correct 180-degree phase shift caused by negative feedback loop
Show older comments
I'm in the process of designing a cascaded PI controller by following a tutorial published by MathWork in 2022. By comparing the close-loop response and the open-loop response of the inner loop, i'm noticing a 180-degree phase shift. The tutorial states before working on the outer loop, this phase shift must be corrected. Can someone please explain how i can do that ? Thanks in advance.
10 Comments
Umar
on 6 Aug 2024
Hi @Austin,
To address your query regarding, “The tutorial states before working on the outer loop, this phase shift must be corrected. Can someone please explain how i can do that ?”
After thoroughly reading the article provided by you, I did realize that , it is necessary to address the 180-degree phase shift observed between the close-loop response and the open-loop response of the inner loop before proceeding with tuning the outer loop because this phase shift correction is essential to ensure stability and optimal performance of the control system. Now, to correct the 180-degree phase shift in the inner loop of your cascaded PI controller, you can follow these steps based on your shared article. First, make sure that the Manual Switch block connects the PWM Generator block input to the Constant block named "Duty Cycle."Compute a simulation snapshot at a steady-state time point (e.g., 0.007 seconds) to capture system dynamics accurately and initialize the model.Assign "Input Perturbation" to the output signal of the Constant block named "Duty Cycle" and "Output Measurement" to the output of the Rate Transition block named "Current ADC."Select a PRBS (Pseudo-Random Binary Sequence) input signal with specific parameters to balance estimation speed and accuracy.Perform FRE by injecting the PRBS signal into the system, measure responses, and estimate the plant transfer function at discrete frequency points.Tune the controller gains using the nonparametric model:Utilize tools like PID Tuner to adjust controller gains based on the estimated plant model, ensuring stability and desired performance criteria.Validate the tuned inner loop in both time and frequency domains to confirm regulation of inductor current. Use open-loop Bode plots to assess stability margins and adjust as needed. Hopefully, following these steps, you can effectively correct the 180-degree phase shift in your inner loop and proceed with tuning the outer loop of your cascaded PI controller for optimal control of your buck converter. Remember to verify performance at each stage before moving forward to ensure a robust control design implementation.
Good luck!
Austin
on 6 Aug 2024
Hi @Austin,
I don’t have Simulink installed on my system. However, I am familiar with some of the blocks in the system when using it years ago and things have changed. However, after analyzing your plots and to help you resolve your problem, I have few suggestions listed below for you to try. Let me know if these suggestions help resolve your problem.
*Ensure the Manual Switch block connects the PWM Generator block input to the Constant block named "Duty Cycle."
*Compute a simulation snapshot at a steady-state time point (e.g., 0.007 seconds) to capture system dynamics accurately and initialize the model.
*Assign "Input Perturbation" to the output signal of the Constant block named "Duty Cycle" and "Output Measurement" to the output of the Rate Transition block named "Current ADC."
*Perform Frequency Response Estimation (FRE) by injecting the PRBS signal into the system, measure responses, and estimate the plant transfer function at discrete frequency points.
*Tune the controller gains using the estimated plant model.
*Utilize tools like PID Tuner to adjust controller gains based on the estimated plant model, ensuring stability and desired performance criteria.
*Validate the tuned inner loop in both time and frequency domains to confirm regulation of inductor current.
For future reference regarding phase shift issues, please always validate system responses at each stage of controller design, ensuring stability and performance criteria are met before moving forward with tuning or implementation.
Antonino Riccobono
on 6 Aug 2024
Hi Austin,
The solution to your query is the result of a script in MATLAB after you export the estimated object to the MATLAB workspace.
Hope this helps.
Cheers,
Antonino

Austin
on 6 Aug 2024
Umar
on 6 Aug 2024
Hi @Austin,
One of our Staff @Antonino Riccobono took a shot at answering your question and pointed out the problem. Please let us know if this helps resolve your problem.
Austin
on 6 Aug 2024
Antonino Riccobono
on 6 Aug 2024
Edited: Antonino Riccobono
on 6 Aug 2024
Dear Austin,
You are right, it's just plotting the loop gain with the corrected phase in order to validate your control design. More specifically, you need to check that you've got the desired phase margin at the bandwidth frequency you made the control gain tuning for.
The 180 deg phase shift originates from the negative feedback when you estimate the loop gain with the Loop Transfer analysis point placed after the Discrete PID Controller block. You need to compensate for it - further motivation for this compensation may come if you execute the function margin (have a look at the documentation) as follow
>> loopGain_phaseCompensated = - loopGain;
>> margin(loopGain_phaseCompensated)
If you need to learn more about Power Electronics Control Design, please refer to the training course I authored at https://www.mathworks.com/learn/training/power-electronics-control-design-with-simulink-and-simscape.html
Hope this helps.
Sincerely,
Antonino
Austin
on 6 Aug 2024
Umar
on 6 Aug 2024
Hi @Austin,
Please don’t forget to click answer button and if you choose to vote for us, that will be highly appreciated. Again, good luck 👍 with your project.
Accepted Answer
More Answers (0)
Communities
More Answers in the Power Electronics Control
Categories
Find more on PID Controller Tuning in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!