%% Anti-Windup Control Using PID Controller Block
%
% This example shows how to use anti-windup schemes to prevent integration
% wind-up in PID controllers when the actuators are saturated. The PID
% Controller block in Simulink(R) features two built-in anti-windup
% methods, |back-calculation| and |clamping|, as well as a tracking mode to
% handle more complex industrial scenarios. The PID Controller block
% supports several features that allow it to handle controller windup
% issues under commonly encountered industrial scenarios.
% Copyright 2009-2022 The MathWorks, Inc.
%%
% The plant to be controlled is a saturated first-order process with
% dead-time.
open_system('sldemo_antiwindup')
%%
% The PID Controller block has been tuned with saturation ignored using the
% Simulink(R) Control Design(TM) PID tuner.
%%
% The controlled plant is a first-order process with dead-time described
% by
%
% $$P(s)=\frac{1}{10s+1}e^{-2s}$.
%
% The plant has known input saturation limits of |[-10, 10]|, which are
% accounted for in the Saturation block labeled |Plant Actuator|. The PID
% Controller block in Simulink features two built-in anti-windup methods
% that allow it to account for the available information about the plant
% input saturation.
%% Performance Without Using Anti-Windup
% First, examine the effect of saturation on the closed-loop when the
% saturation model is not considered by the PID Controller block.
% Simulating the model generates these results. The figure shows the setpoint
% versus measured output with no anti-windup.
open_system('sldemo_antiwindup/Scope');
open_system('sldemo_antiwindup/Scope1'); % This ensures legends get displayed
simout1= sim('sldemo_antiwindup','ReturnWorkspaceOutputs','on');
close_system('sldemo_antiwindup/Scope1');
%%
% The figure shows the controller output and saturated input with no
% anti-windup.
close_system('sldemo_antiwindup/Scope');
open_system('sldemo_antiwindup/Scope1');
%%
% These figures highlight two problems with controlling a system with input
% saturation:
%
% # When the setpoint value is |10|, the PID control signal reaches a
% steady-state at about |36.29|, outside the range of the actuator. The
% controller is therefore operating in a nonlinear region where increasing
% the control signal has no effect on the system output, a condition known
% as _winding up_. Note that the DC-gain of the plant is unity. Therefore,
% the controller output does not need to have a steady-state value outside
% the range of the actuator.
% # When the setpoint value becomes |5|, there is a considerable delay before
% the PID controller output returns to within the actuator range.
%
% Designing the PID controller to account for the effect of saturation
% improves its performance by allowing it to operate in the linear region
% most of the time and recover quickly from nonlinearity. You can use anti-windup
% mechanism to achieve this.
%% Configure Block for Anti-Windup Based on Back-Calculation
% The back-calculation anti-windup method uses a feedback loop to unwind
% the PID Controller block internal integrator when the controller hits
% specified saturation limits and enters nonlinear operation. To enable
% anti-windup, go to the *Output Saturation* tab in the block dialog.
% Select *Limit output* and enter the saturation limits for the plant.
% Next, from the *Anti-windup method* list, select
% |back-calculation|. Then, specify the
% *Back-calculation coefficient (Kb)*. The inverse of this gain is the time
% constant of the anti-windup loop. In this example, the back-calculation
% gain is chosen to be |1|. For more information on how to choose this value,
% see [1].
%
% <<../blkDlgAntiWindup.png>>
%
set_param('sldemo_antiwindup/PID Controller','LimitOutput','on',...
'UpperSaturationLimit','10','LowerSaturationLimit','-10',...
'AntiWindupMode','back-calculation');
%%
% Once back-calculation is enabled, the block has an internal tracking loop
% that unwinds the Integrator output. This figure shows the under-mask
% view of the PID Controller block with back-calculation.
open_system('sldemo_antiwindup/PID Controller','force');
%%
% Note how quickly the PID control signal returns to the linear region and
% how fast the loop recovers from saturation.
close_system('sldemo_antiwindup/PID Controller');
close_system('sldemo_antiwindup/Scope1');
open_system('sldemo_antiwindup/Scope'); % To force data to plot on scope
simout2= sim('sldemo_antiwindup','ReturnWorkspaceOutputs','on');
close_system('sldemo_antiwindup/Scope1');
%%
% The controller output |u(t)| and the saturated input |SAT(u)| coincide with
% each other because *Limit output* is enabled.
%%
close_system('sldemo_antiwindup/Scope');
open_system('sldemo_antiwindup/Scope1');
%%
% To better visualize the effect of anti-windup, this figure illustrates the
% plant measured output |y(t)| with and without anti-windup.
close_system('sldemo_antiwindup/Scope1');
t1 = get(simout1,'tout'); y1 = get(simout1,'yout');
t2 = get(simout2,'tout'); y2 = get(simout2,'yout');
figure('Tag','sldemo_antiwindup');
plot(t1,y1,t2,y2);axis([0 t1(end) round(min([y1;y2])-2) round(max([y1;y2])+2)]);
title('Measured output');
legend('Without anti-windup','With anti-windup');
grid on;
%% Configure Block for Anti-Windup Based on Integrator Clamping
% Another common anti-windup strategy is based on conditional integration.
% To enable anti-windup, in the Block Parameters dialog box, select the
% *Saturation* tab. Select *Limit output* and enter the saturation limits
% for the plant. Then, from the *Anti-windup method* list, select
% *clamping*.
%
% This figure shows setpoint versus measured output with clamping.
open_system('sldemo_antiwindup/Scope');
open_system('sldemo_antiwindup/Scope1'); % To force data to plot on scope
set_param('sldemo_antiwindup/PID Controller','AntiWindupMode','clamping');
sim('sldemo_antiwindup');
close_system('sldemo_antiwindup/Scope1');
%%
% This figure shows that the controller output |u(t)| and the saturated
% input |SAT(u)| coincide with each other because *Limit output* is
% enabled.
close_system('sldemo_antiwindup/Scope');
open_system('sldemo_antiwindup/Scope1');
%%
bdclose('sldemo_antiwindup')
close(findobj('Type','figure','Tag','sldemo_antiwindup'))
%%
% For more information on when to use clamping, see [1].
%% Use Tracking Mode to Handle Complex Anti-Windup Scenarios
% The anti-windup strategies discussed so far rely on built-in methods to
% process the saturation information provided to the block via its dialog.
% For those built-in techniques to work as intended, two conditions must be
% met:
%
% # The saturation limits of the plant are known and can be entered into the
% dialog of the block.
% # The PID Controller block output signal is the only signal feeding the
% actuator.
%
% These conditions may be restrictive when handling general anti-windup
% scenarios. The PID Controller block features a tracking mode that allows
% you to set up a back-calculation anti-windup loop externally. The next
% two examples show the use of tracking mode for
% anti-windup purposes:
%
% # Anti-windup for saturated actuators with cascaded dynamics
% # Anti-windup for PID control with feedforward
%% Construct Anti-Windup Scheme for Saturated Actuators with Cascaded Dynamics
% The actuator in |sldemo_antiwindupactuator| has complex dynamics. Complex
% dynamics are common when an actuator has its own closed-loop dynamics.
% The PID controller is in an outer loop and sees the actuator dynamics as
% an inner loop, which is also called cascaded saturated dynamics.
open_system('sldemo_antiwindupactuator');
%%
% A successful anti-windup strategy requires feeding back the actuator
% output to the tracking port of the PID Controller block. To configure the
% |tracking mode| of the PID Controller block, in the block Parameters
% dialog box, click the *Initialization* tab. Select
% *Enable tracking mode* and specify the gain |Kt|. The inverse of this
% gain
没有合适的资源?快使用搜索试试~ 我知道了~
CAPS-Simulink.zip
共45个文件
xml:39个
slx:3个
m:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 98 浏览量
2024-04-08
20:17:12
上传
评论
收藏 166KB ZIP 举报
温馨提示
1.版本:matlab2014/2019a/2021a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
资源推荐
资源详情
资源评论
收起资源包目录
CAPS-Simulink.zip (45个子文件)
CAPS-Simulink
CAPS-Simulink-main
sldemo_antiwindupactuator.slx 38KB
resources
project
uuid-19b1d05f-2996-4c29-bcd4-548d2320c5c0.xml 46B
rootp.xml 46B
root
fjRQtWiSIy7hIlj-Kmk87M7s21kp.xml 80B
GiiBklLgTxteCEmomM8RCvWT0nQd.xml 71B
qaw0eS1zuuY1ar9TdPn1GMfrjbQp.xml 75B
GiiBklLgTxteCEmomM8RCvWT0nQp.xml 81B
Project.xml 73B
NjSPEMsIuLUyIpr2u1Js5bVPsOs
aEHSZBIY-yve10yGis12Zr5DLZod.xml 82B
QWNDYJD5mGW1bWYvPx9DtKnxzw4d.xml 86B
j4xwF_j8iFTVayUMfxLgMnTbencp.xml 77B
R1RggVhA72agIvELiuhWPRS8F0Ip.xml 75B
r8LR4nLmg9ai3oHrW1r_-KocQzkp.xml 79B
KKyDJtbdIBOlaeHmIZd5VX6vqx8p.xml 76B
KKyDJtbdIBOlaeHmIZd5VX6vqx8d.xml 80B
r8LR4nLmg9ai3oHrW1r_-KocQzkd.xml 83B
R1RggVhA72agIvELiuhWPRS8F0Id.xml 79B
2kj09UetkV_lru3gvSPXnY6-nM4p.xml 75B
2kj09UetkV_lru3gvSPXnY6-nM4d.xml 79B
QWNDYJD5mGW1bWYvPx9DtKnxzw4p.xml 82B
aEHSZBIY-yve10yGis12Zr5DLZop.xml 78B
j4xwF_j8iFTVayUMfxLgMnTbencd.xml 81B
qaw0eS1zuuY1ar9TdPn1GMfrjbQ
qD-kr16wmwlzR-nIg1IG_vvRrWkd.xml 46B
TMK4UzWHdRLhy_w-CHt9y11Q8XAp.xml 80B
wbclzVQZ6PeagU5ym17xZGWijUMd.xml 140B
5V0JYwQ14sqzAvREGol0tVLrvFkp.xml 100B
A4B5kYyyj3CLeAYwx3y6BW1pXBMp.xml 99B
85h2W9bou1HpZk2_ScNenAu6TpYp.xml 91B
KQmKjk652mnbkKIT8i-gzUnW2MEp.xml 102B
qD-kr16wmwlzR-nIg1IG_vvRrWkp.xml 84B
A4B5kYyyj3CLeAYwx3y6BW1pXBMd.xml 140B
5NK9VgqpHz60qnA9beUXDpmZMMMp.xml 90B
wbclzVQZ6PeagU5ym17xZGWijUMp.xml 115B
85h2W9bou1HpZk2_ScNenAu6TpYd.xml 140B
KQmKjk652mnbkKIT8i-gzUnW2MEd.xml 140B
TMK4UzWHdRLhy_w-CHt9y11Q8XAd.xml 46B
5V0JYwQ14sqzAvREGol0tVLrvFkd.xml 46B
5NK9VgqpHz60qnA9beUXDpmZMMMd.xml 46B
fjRQtWiSIy7hIlj-Kmk87M7s21k
NjSPEMsIuLUyIpr2u1Js5bVPsOsd.xml 114B
NjSPEMsIuLUyIpr2u1Js5bVPsOsp.xml 91B
sldemo_antiwindup.slx 38KB
blkDlgAntiWindup.png 33KB
sldemo_antiwindupfeedforward.slx 41KB
CAPS_Presentation.prj 175B
AntiWindupControlUsingAPIDControllerExample.m 10KB
共 45 条
- 1
资源评论
matlab科研助手
- 粉丝: 1w+
- 资源: 1908
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功