From the series: How to Develop DC-DC Converter Control in Simulink
Vasco Lenzi, MathWorks
Learn how to design a digital PID controller for a DC-DC converter. As the simulation model contains high-frequency switching and thus cannot be linearized, you can obtain the transfer function by using System Identification Toolbox™ on simulated input-output data. The PID Tuner app from Simulink Control Design™ uses the transfer function to automatically compute PID gains. Verify the PID controller design in a nonlinear simulation model.
See an example that starts with an untuned controller. Simulation of a step response of output voltage shows that the controller does not provide desired response time. Use the PID Tuner app to tune the controller. See how to open the feedback loop and inject a step signal into the plant. Then collect and use the simulation results to identify a transfer function of the converter at the current operating condition.
Once the transfer function has been obtained, use the PID Tuner app to automatically compute PID controller gains to meet bandwidth and phase margin requirements. Use the computed gains to update the gains of PID Controller block in the Simulink® model. Verify the improved controller performance that meets response time requirements with the full nonlinear simulation.
So we now get to the fun part. My background is control engineering, and I'm always happy when I can do some control design. What I would like to do is design our control algorithm and tune it based on time and frequency requirement.
So this will be for the voltage part. For the LEDs, it would be very similar, but we would like now to do it for the voltage control of our SEPIC. And we are going to use a different approach to what you usually see in our videos. This time, we're going to use as a plant model, a switch linear model which cannot be linearized. We will need to create a Tensor function equivalent model and then tune it based on our requirement. Let's see this in action.
So I prepared here a second model to talk about this. We have here our Seamscape model. And actually, since I'm using a subsystem reference, which you can recognize as one of the two corners being cut-- the top left and the bottom right-- I'm referring to an external file called SEPIC Circuit. This is a very powerful technique that allows me to reuse complex system using different files. This can be very useful when you're working in a larger team and somebody needs to develop a specific version of a subcomponent-- doesn't want to use a library, doesn't want to work within a huge, large single file for version control reason. So you can actually break down your physical model using a subsystem reference.
Let's take a look on this in our documentation. It's a very interesting technique for when your system is starting to get really big and you want to split it out in multiple files. Now, here I have my controller. It's not only the PI. There is some switches as well, depending on if I enabled the closed loop or not, the ability to output only 0, maybe for safety reasons, shut off everything, and a saturation as well.
Here, I'm using one of our off-the-shelf PI block which has the ability to tune a plant. Let's see first our result without any tuning. So I just used value from my gut instinct, from my past experience. I'm using the ODN technique with the specific PVM blocked at VI. But we can see that we can simulate 100 milliseconds at 100 kilohertz quite fast, actually. This is usable for control design purposes.
We can see that our system reacts, and then there is a huge overshoot. We go up to 33 volts. And this is not good. We would like to have a much more smooth approach, no overshoot at all. And let's get this tuned.
So as you may know, if you have someone in control design, you can actually click the Tune button, and it will be trying to linearize the plan, everything that is after the PI block, and in this case, it's going to fail. It's going to fail because we are using a switched linear system with our ideal MOSFET and piecewise linear diode. But still they create something that cannot be linearized. Since there is on and off, on and off, on and off, you cannot fix on a specific operating point to get a new plant model.
So what you're going to do, well, we're going to do what it's suggesting. We can use the Plant menu to create or select a new plant. And we are going to click on identify New Plant. In this case, we are going to use-- we fully integrate system identification toolbox within the system tuner app.
So we need just to provide it from I/O data. And in this case, I can have it from my experiment, or I could simply simulate them. Let's changed the view to a single one, just to see my system identification view.
And here, I can generate my step function that I want my system to simulate. I do the step at 10 milliseconds, and I stop the simulation at 100 milliseconds. And I will step up to around 61% of duty cycle.
Here, now this is my test vector. And I'm going to automatically split the system to an open loop step test to 61% of duty cycle. I'm going to read the error. And now, they're going to-- while I start, I will explain-- they're going to need to simulate three times, one with the 0 open loop, 1-0. So in order to get the right offset to take away so that they can calculate actually the plant response.
So now, this is going to take some seconds. But still, thanks to the fact that we are simulating using this approach, ODN solver forced to take a step at the right moment. This is actually not going to take a lot of time. This, as I said, I combined very effectively two toolboxes in one app-- the system identification toolbox and the Simulink control design. We're going to see, when the system is done, that we are going to have the response to this open loop test as an output signal.
Yes, it seems ready. Now it needs to simulate for the last time. And then it is going to be able to recalculate the output of our plant just by the error and with the appropriate input.
And now we have it. We can see the output. We can apply and use this input/output response to our system identification. We can close this Simulate I/O Data and go back to the client identification.
We can see a very nice interactive way to create a transfer function based on our input/output. Here now, I see that I have some kind of delay here. So I may want to add a delay with a one-pole structure. Then I can click Auto Estimate.
It's going to use the algorithm in the system identification toolbox to provide me with a good approximation. You can see that it is not as good. This is true because the system is slightly more complex to be able to approximate with a one-pole transfer function. So let's put two poles.
Click again on Auto Estimate. We can see that we can reach a very good approximation. This SEPIC is a well-known system. It can be approximated with a two real pole with some delays. We have now a very good match to our input/output.
And again, this works with any kind of converter design. So if you have your custom design, you don't need to spend time driving average system equation in order to do control design and be able to linearize your system. You can use any design as you have it, implement this kind of first of switch linear simulation, use system identification technique, and get back your transfer function.
We can take a look at our transfer function. So we apply this as our new plant. And then we can go back to our reference tracking and see that this time, it's going to work.
We can see that we are using this ID PROC identified system. Double-click on it, we can see how the transfer function looks like. And this can actually be used to retrieve any kind of transfer function approximation, as I said, with any kind of converter topology.
So we would like to be way more robust. We don't want any kind of overshoot. And we are happy, maybe, to be a bit slower. We don't need a lot of speed. We are happy if we can reach the 40 milliseconds, but without overshoot.
So right now, we can update the block. And then we can see how the system behaves. Close it, this will have the new value in it. We can simulate, and see our system is behaving right now.
You can see that actually it's way better. It's behaving like we expect. And this is what I did.
And these were actually the results that you saw live in my video of the demonstration. I was simply using the same value I calculated using this technique. It's a very powerful technique.
So what are we seeing? We tune based on a system identification technique integrated in the PID tuner app. It works with any topology, any kind of a converter. It just requires this kind of switch linear simulation.
And even better, we now have, for a lot of converters, actually direct average switch option. So if you don't want to use this energy efficient technique, or if you are ever working with a traditional AC/DC converter, we provide for you a lot of blocks from 620 which are average, off the shelf, which can then be linearized and used in your control design without problems.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .Select web site
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.