主要内容

使用自动PID调整和图形Bode设计的设计补偿器

This example shows how to design a compensator for a Simulink®使用自动PID调谐模型控制系统设计师app. It then shows how to fine tune the compensator design using the open-loop Bode editor.

System Model

This example uses thewatertank_comp_design金宝appSimulink模型。打开模型,在MATLAB上®command line, enter:

open_system('watertank_comp_design')

This model contains a水坦克系统plant model and a PID controller in a single-loop feedback system.

To view the water tank model, open the水坦克系统子系统。

该模型代表以下水箱系统。

Here:

  • His the height of water in the tank.

  • Volis the volume of water in the tank.

  • V是施加到泵的电压。

  • A是水箱的横截面区域。

  • b是与流入水箱的流速有关的常数。

  • a是与水箱中流速相关的常数。

Water enters the tank from the top at a rate proportional to the voltage applied to the pump. The water leaves through an opening in the tank base at a rate that is proportional to the square root of the water height in the tank. The presence of the square root in the water flow rate results in a nonlinear plant. Based on these flow rates, the rate of change of the tank volume is:

d d t V o l = A d H d t = b V a H

设计要求

Tune the PID controller to meet the following closed-loop step response design requirements:

  • Overshoot less than 5%

  • Rise time less than five seconds

开放控制系统设计师

To open控制系统设计师, 在里面Simulink model window, in theAppsgallery, click控制系统设计师

控制系统设计师opens and automatically opens the Edit Architecture dialog box.

指定块调整

要指定补偿器调整,在“编辑体系结构”对话框中,单击Add Blocks

在“选择块”调整对话框中,在左窗格中,单击控制器子系统。在里面Tune专栏,选中该框的piD Controller

Click好的

在“编辑体系结构对话框”中,该应用将所选控制器块添加到块列表中,以调整tab. On the信号选项卡,该应用还添加了piD Controller块到分析点列表位置

什么时候控制系统设计师opens, it adds any analysis points previously defined in the Simulink model to the位置列表。为了watertank_comp_design,有两个这样的信号。

  • 所需的水位block output — Reference signal for the closed-loop step response

  • 水坦克系统块输出 - 闭环步骤响应的输出信号

To linearize the Simulink model and set the control architecture, click好的

默认,控制系统设计师在模型初始条件下线性化植物模型。

The app adds the PID controller to the数据浏览器, 在里面控制器和固定块部分。该应用程序还计算出在输出处的开环传输函数piD Controller块并将此响应添加到数据浏览器

情节闭环步骤响应

要分析控制器设计,请创建系统的闭环传输函数,并绘制其步骤响应。

On theControl Systemtab, click新情节, and select新步骤

在绘制对话框的新步骤中,在选择对情节的响应drop-down list, select新的输入输出转移响应

要添加输入信号,在指定输入信号区域,单击+。在里面drop-down list, select the output of the所需的水位block.

To add an output signal, in theSpecify output signals区域,单击+。在里面drop-down list, select the output of the水坦克系统block.

To create the closed-loop transfer function and plot the step response, click阴谋

要查看响应图上的最大超冲压,请右键单击绘图区域,然后选择特征>峰值响应

要查看响应图上的上升时间,请右键单击绘图区域,然后选择特征>上升时间

鼠标以查看其值的特征指标。当前的设计有:

  • 最大超冲压为47.9%。

  • Rise time of 2.13 seconds.

这种响应无法满足5%的过冲设计要求。

使用自动PID调整调整补偿器

To tune the compensator using automated PID tuning, click调整方法, and selectpiD Tuning

在里面piD Tuning dialog box, in theSpecificationssection, select the following options:

  • 调整方法强大的响应时间

  • 控制器Typepi

ClickUpdate Compensator。该应用程序更新了新补偿器设置的闭环响应,并更新了步骤响应图。

要检查系统性能,请鼠标遵循响应特征标记。使用调整补偿器的系统响应具有:

  • Maximum overshoot of 13.8%.

  • 上升时间为51.2秒。

This response exceeds the maximum allowed overshoot of 5%. The rise time is much slower than the required rise time of five seconds.

Tune Compensator Using Bode Graphical Tuning

为了减少上升时间,使用图形Bode调整互动增加补偿器增益。

To open the open-loop Bode editor, click调整方法, and selectBode编辑器

在“选择编辑”对话框的选择响应中,在输出的输出处的开环响应piD Controller块已经被选中。打开预示编辑器for this response, click阴谋

To view theBode编辑器Step Response并排图Viewtab, click左右

在里面Bode编辑器plot, drag the magnitude response up to increase the compensator gain. By increasing the gain, you increase the bandwidth and speed up the response.

As you drag the Bode response upward, the app automatically updates the compensator and the associated response plots. Also, when you release the plot, in the status bar, on the right side, the app displays the updated gain value.

增加补偿器的增益,直到步骤响应满足设计要求。一种潜在的解决方案是将增益设置为1.7

At this gain value, the closed loop response has a:

  • 最大超冲压为4.74%。

  • 上升时间为4.36秒。

Fine Tune Controller Using Compensator Editor

To tune the parameters of your compensator directly, use the compensator editor. In theBode编辑器, right-click the plot area, and select编辑补偿器

在里面Compensator Editor dialog box, on theParametertab, tune the PID controller gains. For more information on editing compensator parameters, seeTune Simulink Blocks Using Compensator Editor

While the tuned compensator meets the design requirements, the settling time is over 30 seconds. To improve the settling time, adjust thePIparameters of the controller manually.

例如,将补偿器参数设置为:

  • P=4

  • I=0.1

This compensator produces a closed-loop response with a:

  • Maximum overshoot of 0.206%.

  • Rise time of 1.74 seconds.

  • 定居时间约为三秒钟。

Simulate Closed-Loop System in金宝app

通过使用调谐控制器参数模拟非线性simulink模型来验证您的补偿器设计。金宝app

To write the tuned compensator parameters to thepiD Controllerblock, in控制系统设计师, on theControl Systemtab, clickUpdate Blocks

在Simuli金宝appnk模型窗口中,运行模拟。

要查看闭环模拟输出,请双击Scopeblock.

非线性系统的闭环响应满足了设计需求,而增加的时间不到五秒钟,并且过冲的时间最小。

See Also

相关话题