主要内容

PID Autotuning for a Plant Modeled in金宝app

To use PID autotuning for a plant modeled in Simulink®,您将PID自动块块纳入模型中。您可以在模型运行时控制自动调用过程。调整完成后,您可以针对模拟工厂验证调谐控制器参数。使用这种方式使用PID自动调整对于生成初始PID设计很有用,然后您以后进行实时自动调整来完善。

Workflow for Autotuning in金宝app

这following steps provide a general overview of the workflow for PID autotuning in Simulink using the关闭d-Loop PID Autotuner或者开环PID自动调节器块。

  1. 合并PID自动块块进入PID控制器和工厂之间的模型。

  2. Configure the start/stop signal当调整实验开始和结束时,这可以控制。

  3. Specify controller parameterssuch as controller type and the target bandwidth for tuning.

  4. 配置实验参数例如在频率响应实验期间注入的扰动的幅度。

  5. 运行模型并启动调整。使用启动/停止信号启动PID自动传动过程。启动该过程时,自动块块注入测试信号并测量工厂的响应。

  6. 停止实验with the start/stop signal. When the experiment stops, the autotuner block computes and returns tuned PID gains. You can examine the tuned gains for reasonableness.

  7. 传递调谐收益从自动块块到您的PID控制器。然后,您可以在Simulink中验证调谐控制器的性能。金宝app

Step 1. Incorporate Autotuner into Model

这following illustration shows one way to incorporate a关闭d-Loop PID Autotuner在您的PID控制器和工厂之间阻塞。

这control signalu从PID控制器馈入u自动块端口的端口。这u +Δ端口输入工厂的输入。在开始自动调用过程之前,AutoTuner块直接从PID控制信号中直接从utou +Δ和工厂的输入。在该状态下,自动块块对植物或控制器行为没有影响。在自动调用过程中,该块在工厂输入中注入测试信号,并测量y

start/stop自动调整过程开始和结束时信号控制(请参阅Step 2. Configure Start/Stop Signal). When the experiment ends, the block calculates PID gains and returns them at thepid gains港口。

For a more detailed example of a Simulink model configured for closed-loop PID autotuning, seeTune PID Controller in Real Time Using Closed-Loop PID Autotuner Block

漫步转移用于开环调节

开环PID自动调节器块打开循环uu +Δduring the estimation experiment. If your controller includes integral action, you can use signal tracking to avoid integrator windup while the loop is open. Signal tracking enables the PID controller to continue to track the real plant input while it is out of the loop. Without it, your system can experience a bump when the control loop is closed at the end of the tuning process. In system of the following illustration, the PID controller is a SimulinkPID控制器Enable tracking mode参数打开。工厂的输入进给了控制器块的跟踪输入。

有关为开环PID自动调整配置的Simulink模型的更详细的示例,金宝app请参见使用开环PID自动块实时调整PID控制器

Step 2. Configure Start/Stop Signal

要启动和停止自动传动过程,请在start/stop港口。当实验不运行时,块通过信号不变。utou +Δ。在这种状态下,该区块对植物或控制器行为没有影响。

这frequency-response estimation experiment begins and ends when the block receives a rising or falling signal at thestart/stop端口分别。在说明的系统中Step 1. Incorporate Autotuner into Model,开始/停止信号是一个简单的开关。在运行模型时,您可以使用开关开始和结束实验。当您结束实验时,该算法会生成调谐的PID增益,并且块将它们返回pid gains港口。

As an alternative to a manual switch, you can configure thestart/stop信号在特定的模拟时间内自动开始和结束实验。例如,您可以使用两个总和Step块:配置一个Step实验开始时间从0到1的块,第二个Step堵塞to step from 1 to 0 at the end time. Feed the sum of the two signals into thestart/stopport of the PID autotuner block.

You can configure any other logic appropriate for your application to control the start and stop times of the experiment. For more information about when to start and stop the experiment, seeStep 5. Run Model and Initiate Tuning Experiment

步骤3.指定控制器参数和调整目标

在PID AutoTuner块中,使用以下块参数指定您正在调谐的PID控制器的配置:

  • 类型

  • Form

  • Time Domain

  • Controller sample time (sec)

  • 集成器方法

  • 过滤器方法

这n, specify the target bandwidth and phase margin for tuning with the目标带宽(rad/sec)目标相距(学位)参数分别。

这target bandwidth, specified in rad/sec, is the target value for the 0-dB gain crossover frequency of the tuned open-loop responseCP, 在哪里Pis the plant response, andCis the controller response. This crossover frequency roughly sets the control bandwidth. For a desired rise-timeτ秒,目标带宽的一个很好的猜测为2/τrad/sec。

目标相距反映了您对调谐系统的理想鲁棒性。通常,在约45° - 60°的范围内选择一个值。通常,高阶段边缘改善了过时,但可以限制响应速度。默认值60°倾向于平衡性能和鲁棒性,根据植物的特征,产生约5-10%的过冲。

有关设置这些参数的更多信息,请参见关闭d-Loop PID Autotuner或者开环PID自动调节器块参考页。

步骤4.设置实验参数

这frequency-response estimation experiment injects sinusoidal signals at frequencies around the target bandwidthωc:

  • [1/3、1、3、10]ωc为了开环PID自动调节器堵塞

  • [1/10,1/3,1,3,10]ωc为了关闭d-Loop PID Autotuner堵塞

Use theSine Amplitudes块的参数指定这些信号的幅度。

如果您的植物渐近稳定,开环PID自动调节器块可以通过逐步扰动估算植物直流的增益。指定使用此扰动的幅度步骤振幅范围。如果您的植物有一个集成商,请清除Estimate DC gain with step signal范围。

警告

  • Do not use either closed-loop or open-loop PID autotuning with an unstable plant.

  • 请勿使用具有多个积分器的植物使用开环PID自动调节。您可以使用多积分厂使用闭环PID自动调节。

All the perturbation amplitudes must be:

  • 足够大的扰动使植物执行器中的任何死条都超过了噪声水平的响应。

  • 足够小,可以使植物在名义工作点附近的大约线性区域内运行,并避免饱和植物的输入或输出。

For more information about setting the experiment parameters, see the关闭d-Loop PID Autotuner开环PID自动调节器块参考页。

Step 5. Run Model and Initiate Tuning Experiment

After you have configured all the parameters for tuning, run the model.

  • 如果您配置了手册start/stop信号,当您的植物达到稳态时开始实验。

  • If you have configured thestart/stopsignal to begin and end the tuning process at specific times, allow the simulation to run long enough to begin the experiment.

步骤6.停止实验并检查调谐收益

当频率响应估计实验结束start/stop信号下降。

  • 如果您配置了手册start/stop信号,在信号处结束实验%转换产出稳定接近100%。

  • If you have configured thestart/stopsignal to begin and end the tuning process at specific times, allow the simulation to run through the end of the experiment.

无论哪种情况,实验时间的保守估计值为200/ωc用于闭环调整或100/ωcfor open-loop tuning, whereωc是您的目标带宽。

当您停止实验时,该块根据系统的估计频率响应和指定的调整目标计算新的PID增益。检查它们是否合理。例如,如果您有初始的PID控制器,则可能期望调谐的收益大致与初始设计的增长大致相同。有几种方法可以看到调整的收益:

  • 查看输出pid gains自动块端口的端口。One way to view this output is to connect the output to a SimulinkDisplay堵塞。

  • 在街区中堵塞tab, clickExport to MATLAB。这堵塞creates a structure in the MATLAB®工作区,OnlinePIDTuningResult。For more information about the contents of this structure, see the关闭d-Loop PID Autotuner或者开环PID自动调节器块参考页。

步骤7.使用调谐收益更新PID控制器

这autotuner block can write tuned controller parameters directly to the PID controller block, if your PID controller is either:

  • 模拟金宝appPID控制器堵塞。

  • 以下条件都正确的自定义PID控制器:

    • 自定义控制器是蒙版子系统。

    • PID收益是命名的掩模参数P,I,D, 和N。(您不需要使用所有四个参数。例如,如果使用自定义PI控制器,则只需要掩码参数PI

要配置AutoTuner块以将调谐收益写入您的控制器,请指定控制器为相关的PID块在PID Autotuner块参数中。(有关更多信息,请参见关闭d-Loop PID Autotuner或者开环PID自动调节器然后,通过单击来更新控制器。Update PID Block。您可以在模拟运行时更新PID收益。这样做对于立即验证调谐的PID收益很有用。

Note

在模拟过程中的任何时间,您都可以更改调整或实验参数,再次开始实验,然后将新调谐增益推到PID块。然后,您可以观察植物的行为,因为模拟继续随着新的收益而继续。

PID收益的手动更新

如果您的自定义PID控制器无法满足直接更新的条件,则必须将调谐收益转移到控制器上,例如手动或使用您自己的逻辑。

When you examine these gains and transfer them to your own controller, be aware of the meaning of these gains in the PID autotuner blocks. In discrete time, the blocks assume the following PID controller transfer function:

C = P + I F i ( z ) + D [ N 1 + N F d ( z ) ] ,

以平行形式或理想形式,

C = P [ 1 + I F i ( z ) + D ( N 1 + N F d ( z ) ) ]

Fi(z) 和Fd(z)取决于您指定的值集成器方法过滤器方法公式分别。有关更多详细信息,请参阅关闭d-Loop PID Autotuner或者开环PID自动调节器块参考页。

See Also

|

相关话题