📄 autotunerpid.mdl
字号:
Ports [2]
Position [475, 84, 535, 171]
TreatAsAtomicUnit off
MaskType "Pendulum plot"
MaskDescription "Pendulum plot"
MaskHelp "Pendulum animation function using Handle graphi"
"cs."
MaskPromptString "Reference signal block name:"
MaskStyleString "edit"
MaskTunableValueString "on"
MaskEnableString "on"
MaskVisibilityString "on"
MaskToolTipString "on"
MaskVariables "RefBlock=&1;"
MaskDisplay "plot([-6 6 6 -6 -6],[-10 -10 10 10 -10])\npatch"
"([-5 -3 -3 -5],[4 4 -2 -2],[1 1 0])\nplot([-5 -3 -3 -5 -5],[9 9 -2 -2 9])\npa"
"tch([-1 1 1 -1],[2 2 -2 -2],[1 0 1])\nplot([-1 1 1 -1 -1],[9 9 -2 -2 9])\npat"
"ch([3 5 5 3],[7 7 -2 -2],[0 1 1])\nplot([3 5 5 3 3],[9 9 -2 -2 9])\npatch([-5"
" -2 -2 -5],[-4 -4 -6 -6],[0.4 0.4 0.4])\nplot([-5 -2 -2 -5 -5],[-4 -4 -6 -6 -"
"4])\npatch([-5 2 2 -5],[-7 -7 -9 -9],[0.6 0.6 0.6])\nplot([-5 2 2 -5 -5],[-7 "
"-7 -9 -9 -7])"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "SetPoint"
System {
Name "PID Control Panel"
Location [423, 428, 658, 571]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "CV"
Position [25, 58, 55, 72]
ForegroundColor "green"
}
Block {
BlockType Inport
Name "PV"
Position [25, 13, 55, 27]
ForegroundColor "blue"
Port "2"
}
Block {
BlockType Mux
Name "Mux2"
Ports [2, 1]
Position [90, 25, 95, 60]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType "S-Function"
Name "S-function"
Ports [1]
Position [130, 33, 185, 57]
DeleteFcn "pendan([],[],[],'DeleteBlock');"
FunctionName "autogui"
Parameters "RefBlock"
}
Line {
SrcBlock "Mux2"
SrcPort 1
DstBlock "S-function"
DstPort 1
}
Line {
SrcBlock "PV"
SrcPort 1
Points [5, 0; 0, 15]
DstBlock "Mux2"
DstPort 1
}
Line {
SrcBlock "CV"
SrcPort 1
Points [5, 0; 0, -15]
DstBlock "Mux2"
DstPort 2
}
}
}
Block {
BlockType SubSystem
Name "PID with Autotuning"
Ports [2, 1]
Position [135, 110, 230, 185]
TreatAsAtomicUnit off
MaskPromptString "Gain (K)|Integral time (Ti)|Derivative time (Td"
")|Derivative Filter (N)|Setpoint weigthing (b)|Antiwindup saturation ([umin,u"
"max])|Sample time (Ts)|Amplitude of the identifcation step or relay (As)|Hyst"
"eresis of the relay (hystLevel)"
MaskStyleString "edit,edit,edit,edit,edit,edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on,on,on,on,on,on"
MaskCallbackString "||||||||"
MaskEnableString "on,on,on,on,on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on,on,on,on,on"
MaskToolTipString "on,on,on,on,on,on,on,on,on"
MaskVarAliasString ",,,,,,,,"
MaskVariables "K=@1;Ti=@2;Td=@3;N=@4;b=@5;uaw=@6;Ts=@7;As=@8;h"
"ystLevel=@9;"
MaskInitialization "umin = uaw(1);\numax = uaw(2);\nglobal PIDPARAM"
"ETERS;\nPIDPARAMETERS = [K Ti Td N b];\n\n"
MaskDisplay "disp('PID with\\nAutotuning')"
MaskIconFrame on
MaskIconOpaque off
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "1|2|0.5|10|1|[-5 5]|0.1|1|0.05"
System {
Name "PID with Autotuning"
Location [295, 405, 750, 608]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "SP"
Position [15, 33, 45, 47]
ForegroundColor "yellow"
}
Block {
BlockType Inport
Name "PV"
Position [15, 128, 45, 142]
ForegroundColor "magenta"
Port "2"
}
Block {
BlockType "S-Function"
Name "Autotuner\nsupervisor"
Ports [1, 1]
Position [85, 110, 160, 160]
BackgroundColor "lightBlue"
FunctionName "pid_autotuner"
Parameters "Ts,As"
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 2]
Position [185, 116, 190, 154]
BackgroundColor "black"
ShowName off
Outputs "2"
}
Block {
BlockType "S-Function"
Name "Discrete time\nISA-PID"
Ports [1, 1]
Position [295, 45, 370, 95]
BackgroundColor "lightBlue"
FunctionName "pid_isatd"
Parameters "Ts,umin,umax,As,hystLevel"
}
Block {
BlockType Mux
Name "Mux2"
Ports [4, 1]
Position [265, 34, 270, 106]
ShowName off
DisplayOption "bar"
}
Block {
BlockType Outport
Name "CV"
Position [395, 63, 425, 77]
ForegroundColor "cyan"
}
Line {
SrcBlock "Autotuner\nsupervisor"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
SrcBlock "SP"
SrcPort 1
DstBlock "Mux2"
DstPort 1
}
Line {
SrcBlock "PV"
SrcPort 1
Points [10, 0]
Branch {
Points [0, -75]
DstBlock "Mux2"
DstPort 2
}
Branch {
DstBlock "Autotuner\nsupervisor"
DstPort 1
}
}
Line {
SrcBlock "Discrete time\nISA-PID"
SrcPort 1
DstBlock "CV"
DstPort 1
}
Line {
SrcBlock "Mux2"
SrcPort 1
DstBlock "Discrete time\nISA-PID"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 1
Points [20, 0; 0, -45]
DstBlock "Mux2"
DstPort 3
}
Line {
SrcBlock "Demux"
SrcPort 2
Points [35, 0; 0, -45]
DstBlock "Mux2"
DstPort 4
}
}
}
Block {
BlockType SubSystem
Name "Plant"
Ports [1, 1]
Position [285, 112, 375, 188]
BackgroundColor "magenta"
TreatAsAtomicUnit off
MaskDisplay "disp('PLANT')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "Plant"
Location [71, 89, 456, 280]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "CV"
Position [35, 53, 65, 67]
ForegroundColor "green"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn"
Position [95, 32, 210, 88]
ShowName off
Numerator "[0.1 1]"
Denominator "[1 4 6 4 1]"
}
Block {
BlockType TransportDelay
Name "Transport\nDelay"
Position [245, 45, 275, 75]
ShowName off
DelayTime "0.75"
}
Block {
BlockType Outport
Name "PV"
Position [310, 53, 340, 67]
ForegroundColor "blue"
}
Line {
SrcBlock "Transfer Fcn"
SrcPort 1
DstBlock "Transport\nDelay"
DstPort 1
}
Line {
SrcBlock "CV"
SrcPort 1
DstBlock "Transfer Fcn"
DstPort 1
}
Line {
SrcBlock "Transport\nDelay"
SrcPort 1
DstBlock "PV"
DstPort 1
}
Annotation {
Name "Don't change the block name\nif you want to"
" use the Step and Bode\ntools in the \"Compact Analysis\" menu"
Position [185, 139]
ForegroundColor "red"
FontWeight "bold"
}
}
}
Block {
BlockType Scope
Name "SP - PV - CV"
Ports [1]
Position [555, 24, 585, 56]
Location [9, 309, 637, 735]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "SP (yellow) -=- PV (magenta) -=- CV (cyan)"
}
List {
ListType SelectedSignals
axes1 ""
}
TimeRange "100"
DataFormat "StructureWithTime"
}
Block {
BlockType Constant
Name "SetPoint"
Position [15, 115, 75, 145]
BackgroundColor "yellow"
Value "0"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [310, 230, 330, 250]
Orientation "left"
ShowName off
IconShape "round"
Inputs "|++"
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [405, 140, 425, 160]
ShowName off
IconShape "round"
Inputs "++|"
}
Line {
SrcBlock "SetPoint"
SrcPort 1
Points [25, 0]
Branch {
DstBlock "PID with Autotuning"
DstPort 1
}
Branch {
Points [0, -105]
DstBlock "Mux2"
DstPort 1
}
}
Line {
SrcBlock "PID with Autotuning"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "Plant"
DstPort 1
}
Branch {
Points [0, -45; 200, 0]
Branch {
DstBlock "PID Control Panel"
DstPort 1
}
Branch {
Points [0, -50]
DstBlock "Mux2"
DstPort 3
}
}
}
Line {
Labels [1, 0]
SrcBlock "Mux2"
SrcPort 1
DstBlock "SP - PV - CV"
DstPort 1
}
Line {
SrcBlock "MeasurementNoise"
SrcPort 1
Points [-20, 0]
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Butterworth\nAnalog Filter"
DstPort 1
}
Line {
SrcBlock "Plant"
SrcPort 1
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Sum1"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "PID Control Panel"
DstPort 2
}
Branch {
Points [0, 90]
DstBlock "Sum"
DstPort 1
}
Branch {
Points [0, -110]
DstBlock "Mux2"
DstPort 2
}
}
Line {
SrcBlock "LoadDisturbance"
SrcPort 1
Points [50, 0]
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "Butterworth\nAnalog Filter"
SrcPort 1
Points [-30, 0; 0, -75]
DstBlock "PID with Autotuning"
DstPort 2
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -