📄 pidcontr.mdl
字号:
DataLogging off
DataLoggingNameMode "SignalName"
DataLoggingDecimateData off
DataLoggingDecimation "2"
DataLoggingLimitDataPoints off
DataLoggingMaxPoints "5000"
}
System {
Name "PID Controller"
Location [612, 335, 1221, 637]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "e"
Position [25, 90, 45, 110]
}
Block {
BlockType Abs
Name "Abs"
Position [80, 85, 110, 115]
}
Block {
BlockType Derivative
Name "Derivative"
Position [135, 153, 175, 177]
}
Block {
BlockType Gain
Name "Derivative\nGain"
Position [215, 149, 245, 181]
Gain "Kd"
}
Block {
BlockType TransferFcn
Name "Integral"
Position [185, 82, 220, 118]
Numerator "1"
Denominator "[1 0]"
}
Block {
BlockType Gain
Name "Integral\nGain"
Position [245, 84, 275, 116]
Gain "Ki"
}
Block {
BlockType Gain
Name "Proportional\nGain"
Position [380, 84, 410, 116]
Gain "Kp"
}
Block {
BlockType Sum
Name "Sum"
Ports [3, 1]
Position [325, 82, 345, 118]
Inputs "+++"
}
Block {
BlockType Switch
Name "Switch"
Position [140, 85, 170, 115]
Threshold "integ_threshold"
}
Block {
BlockType Constant
Name "Zero"
Position [80, 25, 110, 55]
Value "0"
}
Block {
BlockType Outport
Name "u"
Position [445, 90, 465, 110]
InitialOutput "0"
}
Line {
SrcBlock "Integral"
SrcPort 1
DstBlock "Integral\nGain"
DstPort 1
}
Line {
SrcBlock "Derivative\nGain"
SrcPort 1
Points [40, 0; 0, -55]
DstBlock "Sum"
DstPort 3
}
Line {
SrcBlock "e"
SrcPort 1
Points [0, 0; 15, 0]
Branch {
Points [0, -90; 225, 0; 0, 80]
DstBlock "Sum"
DstPort 1
}
Branch {
Points [0, 40]
Branch {
Points [0, 25]
DstBlock "Derivative"
DstPort 1
}
Branch {
Points [55, 0; 0, -30]
DstBlock "Switch"
DstPort 3
}
}
Branch {
DstBlock "Abs"
DstPort 1
}
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Proportional\nGain"
DstPort 1
}
Line {
SrcBlock "Derivative"
SrcPort 1
DstBlock "Derivative\nGain"
DstPort 1
}
Line {
SrcBlock "Proportional\nGain"
SrcPort 1
DstBlock "u"
DstPort 1
}
Line {
SrcBlock "Integral\nGain"
SrcPort 1
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Switch"
SrcPort 1
DstBlock "Integral"
DstPort 1
}
Line {
SrcBlock "Abs"
SrcPort 1
DstBlock "Switch"
DstPort 2
}
Line {
SrcBlock "Zero"
SrcPort 1
Points [5, 0; 0, 50]
DstBlock "Switch"
DstPort 1
}
}
}
Block {
BlockType Saturate
Name "Saturation"
Position [215, 200, 245, 230]
BackgroundColor "green"
UpperLimit "limit"
LowerLimit "-limit"
}
Block {
BlockType Step
Name "Step"
Position [15, 200, 45, 230]
BackgroundColor "yellow"
Time "0"
SampleTime "0"
Port {
PortNumber 1
Name "r(t)"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
DataLogging off
DataLoggingNameMode "SignalName"
DataLoggingDecimateData off
DataLoggingDecimation "2"
DataLoggingLimitDataPoints off
DataLoggingMaxPoints "5000"
}
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [90, 205, 110, 225]
BackgroundColor "yellow"
ShowName off
IconShape "round"
Inputs "|+-"
Port {
PortNumber 1
Name "e(t)"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
DataLogging off
DataLoggingNameMode "SignalName"
DataLoggingDecimateData off
DataLoggingDecimation "2"
DataLoggingLimitDataPoints off
DataLoggingMaxPoints "5000"
}
}
Block {
BlockType ToWorkspace
Name "To Workspace"
Position [230, 25, 290, 55]
BackgroundColor "lightBlue"
ShowName off
VariableName "error"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "StructureWithTime"
}
Block {
BlockType ToWorkspace
Name "To Workspace1"
Position [230, 80, 290, 110]
BackgroundColor "lightBlue"
ShowName off
VariableName "derivative"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "StructureWithTime"
}
Block {
BlockType ToWorkspace
Name "To Workspace2"
Position [230, 135, 290, 165]
BackgroundColor "lightBlue"
ShowName off
VariableName "integral"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "StructureWithTime"
}
Block {
BlockType ToWorkspace
Name "To Workspace3"
Position [545, 200, 605, 230]
BackgroundColor "lightBlue"
ShowName off
VariableName "response"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "StructureWithTime"
}
Block {
BlockType ToWorkspace
Name "To Workspace4"
Position [445, 145, 505, 175]
BackgroundColor "lightBlue"
ShowName off
VariableName "actuator"
MaxDataPoints "inf"
SampleTime "-1"
SaveFormat "StructureWithTime"
}
Block {
BlockType TransportDelay
Name "Transport\nDelay"
Position [290, 200, 320, 230]
BackgroundColor "green"
DelayTime "delay"
}
Line {
SrcBlock "Inertia"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
DstBlock "To Workspace3"
DstPort 1
}
Branch {
Points [0, 55; -420, 0]
DstBlock "Sum"
DstPort 2
}
}
Line {
Name "e(t)"
Labels [0, 0]
SrcBlock "Sum"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
Points [0, -65]
Branch {
DstBlock "Integrator"
DstPort 1
}
Branch {
Points [0, -55]
Branch {
Points [0, -55]
DstBlock "To Workspace"
DstPort 1
}
Branch {
DstBlock "Derivative"
DstPort 1
}
}
}
Branch {
DstBlock "PID Controller"
DstPort 1
}
}
Line {
Name "r(t)"
Labels [0, 0]
SrcBlock "Step"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Motor"
SrcPort 1
Points [0, 0; 10, 0]
Branch {
DstBlock "Inertia"
DstPort 1
}
Branch {
Points [0, -55]
DstBlock "To Workspace4"
DstPort 1
}
}
Line {
SrcBlock "Integrator"
SrcPort 1
DstBlock "To Workspace2"
DstPort 1
}
Line {
SrcBlock "Derivative"
SrcPort 1
DstBlock "To Workspace1"
DstPort 1
}
Line {
Name "u(t)"
Labels [0, 0]
SrcBlock "PID Controller"
SrcPort 1
DstBlock "Saturation"
DstPort 1
}
Line {
SrcBlock "Saturation"
SrcPort 1
DstBlock "Transport\nDelay"
DstPort 1
}
Line {
SrcBlock "Transport\nDelay"
SrcPort 1
DstBlock "Motor"
DstPort 1
}
Annotation {
Name "Embedded Control Systems in C/C++\nby Jim Ledin"
"\n\nThis model is used by \"figures.m\"\n\nModel of a motor driving an inerti"
"al load\nusing PID control.\nThe model includes actuator saturation\nand the "
"processing time delay"
Position [474, 75]
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -