主要内容

PID控制器调整in Simulink

This example shows how to automatically tune a PID Controller block usingPID Tuner.

引入the PID Tuner

PID Tuner为Simulink®PID控制器块提供了快速且广泛适用的单环PID调整方法。金宝app使用此方法,您可以调整PID控制器参数以实现所需响应时间的稳健设计。

A typical design workflow with thePID Tunerinvolves the following tasks:

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

(2)调整控制器PID Tunerby 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.

打开模型

Open the engine speed control model with PID Controller block and take a few moments to explore it.

open_system('scdspeedctrlpidblock')

Design Overview

在此示例中,您可以在发动机速度控制环中设计一个PI控制器。设计的目的是跟踪Simulink步骤块中的参考信号金宝appscdspeedctrlpidblock/速度参考. The design requirement are:

  • 在5秒钟以下定居时间

  • Zero steady-state error to the step reference input.

在此示例中,您可以通过设计PI控制器来稳定反馈循环并实现良好的参考跟踪性能scdspeedctrl/PID Controller在里面PID Tuner.

Open PID Tuner

To launch thePID Tuner, double-click the PID Controller block to open its block dialog. In the主要的tab, clickTune.

Initial PID Design

When thePID Tuner该软件发射,计算控制器看到的线性化植物模型。该软件会自动识别工厂的输入和输出,并使用当前的工作点进行线性化。该工厂可以有任何订单,并且可以有时间延迟。

ThePID Tuner计算初始PI控制器,以实现性能和稳健性之间的合理权衡。默认情况下,步骤参考跟踪性能在图中显示。

The following figure shows thePID Tunerdialog with the initial design:

Display PID Parameters

ClickShow parameters查看控制器参数P和I,以及一组性能和鲁棒性测量。在此示例中,最初的PI控制器设计给出了2秒钟的安装时间,满足了要求。

Adjust PID Design in PID Tuner

The overshoot of the reference tracking response is about 7.5 percent. Since we still have some room before reaching the settling time limit, you could reduce the overshoot by increasing the response time. Move the response time slider to the left to increase the closed loop response time. Notice that when you adjust response time, the response plot and the controller parameters and performance measurements update.

The following figure shows an adjusted PID design with an overshoot of zero and a settling time of 4 seconds. The designed controller effectively becomes an integral-only controller.

Complete PID Design with Performance Trade-Off

为了在减少2秒钟以下的定居时间时实现零超冲击,您需要利用两个滑块。您需要更快地进行控制响应,以减少安定时间并增加鲁棒性以减少过冲。例如,您可以将响应时间从3.4秒减少到1.5秒,并将鲁棒性从0.6增加到0.72。

The following figure shows the closed-loop response with these settings:

将调谐参数写入PID控制器块

After you are happy with the controller performance on the linear plant model, you can test the design on the nonlinear model. To do this, click更新块在里面PID Tuner. This action writes the parameters back to the PID Controller block in the Simulink model.

下图显示了更新的PID控制器块对话框:

Completed Design

下图显示了闭环系统的响应:

响应表明,新控制器符合所有设计要求。

You can also use the控制系统设计师to design the PID Controller block, when the PID Controller block belongs to a multi-loop design task. See the exampleSingle Loop Feedback/Prefilter Compensator Design.

bdclose('scdspeedctrlpidblock')

See Also

相关话题