main content

implement gain-凯发k8网页登录

this example shows how to implement gain-scheduled control in a simulink® model using a family of pid controllers. the pid controllers are tuned for a series of steady-state operating points of the plant, which is highly nonlinear.

this example builds on the work done in . in that example, the continuous stirred-tank reactor (cstr) plant model is linearized at steady-state operating points that have output concentrations c = 2, 3, ..., 8, 9. the nonlinearity in the cstr plant yields different linearized dynamics at different output concentrations. the example uses the pidtune function to generate and tune a separate pid controller for each output concentration.

you can expect each controller to perform well in a small operating range around its corresponding output concentration. this example shows how to use the pid controller block to implement all of these controllers in a gain-scheduled configuration. in such a configuration, the pid gains change as the output concentration changes. this configuration ensures good pid control at any output concentration within the operating range of the control system.

begin with the controllers generated in . if these controllers are not already in the matlab® workspace, load them from the data file pidgainschedexample.mat.

load pidgainschedexample

this operation puts two variables in the matlab workspace, controllers and c. the model array controllers contains eight models, each tuned for one output concentration in the vector c.

to implement these controllers in a gain-scheduled configuration, create lookup tables that associate each output concentration with the corresponding set of pid gains. the simulink model pidgainschedcstrexamplemodel contains such lookup tables, configured to provide gain-scheduled control for the cstr plant. open this model.

open_system("pidgainschedcstrexamplemodel")

in this model, the pid controller block is configured to have external input ports for the pid coefficients. using external inputs allows the coefficients to vary as the output concentration varies. open the block to examine the configuration.

setting the source parameter to external enables the input ports for the coefficients.

the model uses a block for each of the pid coefficients. in general, for gain-scheduled pid control, use your scheduling variable as the lookup-table input, and the corresponding controller coefficient values as the output. in this example, the cstr plant output concentration is the lookup table input, and the output is the pid coefficient corresponding to that concentration. to see how the lookup tables are configured, open the p lookup table block.

the table data parameter contains the array of proportional coefficients for each controller, controllers.kp. (for more information about the properties of the pid models in the controllers array, see .) each entry in this array corresponds to an entry in the array c that is entered in the breakpoints 1 parameter. for concentration values that fall between entries in c, the p lookup table block performs linear interpolation to determine the value of the proportional coefficient. to set up lookup tables for the integral and derivative coefficients, configure the i lookup table and d lookup table blocks using controllers.ki and controllers.kd, respectively. for this example, this configuration is already done in the model.

the pid models in the controllers array express the derivative filter coefficient as a time constant, controllers.tf (see the reference page for more information). however, the pid controller block expresses the derivative filter coefficient as the inverse constant, n. therefore, the n lookup table block must be configured to use the inverse of each value in controllers.tf. open the n lookup table block to see the configuration.

simulate the model. the concentration setpoint block is configured to step through a sequence of setpoints that spans the operating range between c = 2 and c = 9 (shown in yellow on the scope). the simulation shows that the gain-scheduled configuration achieves good setpoint tracking across this range (blue on the scope).

as was shown in , the cstr plant is unstable in the operating range between c = 4 and c = 7. the gain-scheduled pid controllers stabilize the plant and yield good setpoint tracking through the entire unstable region. to fully validate the control design against the nonlinear plant, apply a variety of setpoint test sequences that test the tracking performance for steps of different sizes and directions across the operating range. you can also compare the performance against a design without gain scheduling, by setting all entries in the controllers array equal.

see also

| | |

related topics

    网站地图