📄 fuzzy_pid.mdl
字号:
}
Line {
SrcBlock "Skd"
SrcPort 1
DstBlock "Abs Kd"
DstPort 1
}
Line {
SrcBlock "Gain4"
SrcPort 1
DstBlock "Abs2"
DstPort 1
}
Line {
SrcBlock "Abs Kp"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "Product"
DstPort 2
}
Branch {
Points [0, 0]
Branch {
DstBlock "Product"
DstPort 1
}
Branch {
Points [0, -15; 50, 0]
Branch {
DstBlock "Product3"
DstPort 2
}
Branch {
Points [0, 155]
DstBlock "kp"
DstPort 1
}
}
}
}
Line {
SrcBlock "Abs Kd"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "Product1"
DstPort 1
}
Branch {
Points [0, -30; 50, 0]
Branch {
DstBlock "Product4"
DstPort 2
}
Branch {
Points [0, 105]
DstBlock "kd"
DstPort 1
}
}
}
Line {
SrcBlock "Abs2"
SrcPort 1
DstBlock "Product1"
DstPort 2
}
Line {
SrcBlock "Product1"
SrcPort 1
DstBlock "Math\nFunction"
DstPort 1
}
Line {
SrcBlock "Math\nFunction"
SrcPort 1
DstBlock "Product Ki"
DstPort 2
}
Line {
SrcBlock "Product"
SrcPort 1
Points [35, 0; 0, 60]
DstBlock "Product Ki"
DstPort 1
}
Line {
SrcBlock "Product Ki"
SrcPort 1
DstBlock "Ski"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "Product3"
SrcPort 1
Points [4, 0]
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Integrator"
SrcPort 1
Points [480, 0]
DstBlock "Product5"
DstPort 1
}
Line {
SrcBlock "Product4"
SrcPort 1
Points [4, 0]
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Product5"
SrcPort 1
Points [0, -45]
DstBlock "Sum"
DstPort 3
}
Line {
SrcBlock "Ski"
SrcPort 1
Points [0, 0]
Branch {
DstBlock "Product5"
DstPort 2
}
Branch {
Points [0, 100]
DstBlock "ki"
DstPort 1
}
}
}
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [360, 131, 365, 169]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType SubSystem
Name "Plant Subsystem"
Ports [1, 1]
Position [265, 34, 315, 66]
ShowPortLabels on
TreatAsAtomicUnit off
RTWSystemCode "Auto"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
System {
Name "Plant Subsystem"
Location [414, 99, 739, 189]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "automatic"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
AutoZoom on
Block {
BlockType Inport
Name "In1"
Position [25, 38, 55, 52]
Port "1"
Interpolate on
}
Block {
BlockType TransferFcn
Name "Transfer Fcn"
Position [215, 26, 245, 64]
Numerator "[27]"
Denominator "[1 1]"
Realization "auto"
AbsoluteTolerance "auto"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn1"
Position [170, 27, 200, 63]
Numerator "[1]"
Denominator "[1 3]"
Realization "auto"
AbsoluteTolerance "auto"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn2"
Position [125, 27, 155, 63]
Numerator "[1]"
Denominator "[1 3]"
Realization "auto"
AbsoluteTolerance "auto"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn3"
Position [80, 27, 110, 63]
Numerator "[1]"
Denominator "[1 3]"
Realization "auto"
AbsoluteTolerance "auto"
}
Block {
BlockType Outport
Name "Out1"
Position [270, 38, 300, 52]
Port "1"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Line {
SrcBlock "Transfer Fcn1"
SrcPort 1
DstBlock "Transfer Fcn"
DstPort 1
}
Line {
SrcBlock "Transfer Fcn2"
SrcPort 1
DstBlock "Transfer Fcn1"
DstPort 1
}
Line {
SrcBlock "Transfer Fcn3"
SrcPort 1
DstBlock "Transfer Fcn2"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Transfer Fcn3"
DstPort 1
}
Line {
SrcBlock "Transfer Fcn"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [390, 134, 420, 166]
Floating off
Location [6, 72, 281, 242]
Open on
NumInputPorts "1"
TickLabels "OneTimeTick"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
Grid "on"
TimeRange "10"
YMin "0"
YMax "1.5"
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "StructureWithTime"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Step
Name "Step"
Position [30, 50, 60, 80]
Time "1"
Before "0"
After "1"
SampleTime "0"
VectorParams1D on
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [110, 55, 130, 75]
ShowName off
IconShape "round"
Inputs "|+-"
SaturateOnIntegerOverflow on
}
Block {
BlockType ToWorkspace
Name "To Workspace"
Position [110, 151, 130, 179]
VariableName "t"
MaxDataPoints "inf"
Decimation "1"
SampleTime "-1"
SaveFormat "Array"
}
Block {
BlockType ToWorkspace
Name "To Workspace1"
Position [220, 181, 240, 209]
VariableName "y"
MaxDataPoints "inf"
Decimation "1"
SampleTime "-1"
SaveFormat "Array"
}
Block {
BlockType ToWorkspace
Name "To Workspace2"
Position [140, 26, 160, 54]
VariableName "in"
MaxDataPoints "inf"
Decimation "1"
SampleTime "-1"
SaveFormat "Array"
}
Block {
BlockType ToWorkspace
Name "To Workspace3"
Position [385, 46, 405, 74]
VariableName "kp"
MaxDataPoints "inf"
Decimation "1"
SampleTime "-1"
SaveFormat "Array"
}
Block {
BlockType ToWorkspace
Name "To Workspace4"
Position [400, 91, 420, 119]
VariableName "kd"
MaxDataPoints "inf"
Decimation "1"
SampleTime "-1"
SaveFormat "Array"
}
Block {
BlockType ToWorkspace
Name "To Workspace5"
Position [280, 146, 300, 174]
VariableName "ki"
MaxDataPoints "inf"
Decimation "1"
SampleTime "-1"
SaveFormat "Array"
}
Block {
BlockType Outport
Name "NCD Outport"
Position [270, 190, 325, 250]
DropShadow on
OpenFcn "optblock"
Port "1"
OutputWhenDisabled "held"
InitialOutput "0"
MaskType "NCD Outport"
MaskDisplay "plot([0:10],[-.5 1.5 .6 1.3 .8 1.1 .95 1.02 .99"
" 1 1]);\ndisp('\\n\\n NCD\\n OutPort 1'); "
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
}
Block {
BlockType Outport
Name "Out1"
Position [255, 98, 285, 112]
Port "2"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Outport
Name "Out2"
Position [105, 13, 135, 27]
Port "3"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Outport
Name "Out3"
Position [385, 13, 415, 27]
Port "4"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Outport
Name "Out4"
Position [350, 83, 380, 97]
Port "5"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Outport
Name "Out5"
Position [350, 108, 380, 122]
Port "6"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Line {
SrcBlock "Step"
SrcPort 1
Points [15, 0]
Branch {
Points [10, 0]
Branch {
DstBlock "Sum1"
DstPort 1
}
Branch {
Points [0, 75]
DstBlock "Mux"
DstPort 1
}
}
Branch {
Points [0, -25; 5, 0]
Branch {
DstBlock "To Workspace2"
DstPort 1
}
Branch {
Points [0, -20]
DstBlock "Out2"
DstPort 1
}
}
}
Line {
SrcBlock "Plant Subsystem"
SrcPort 1
Points [10, 0; 0, 70]
Branch {
Points [0, 40]
DstBlock "Mux"
DstPort 2
}
Branch {
Points [-135, 0]
Branch {
Points [-75, 0]
DstBlock "Sum1"
DstPort 2
}
Branch {
Points [0, 75]
Branch {
Points [0, 25]
DstBlock "NCD Outport"
DstPort 1
}
Branch {
DstBlock "To Workspace1"
DstPort 1
}
}
}
}
Line {
SrcBlock "Clock"
SrcPort 1
DstBlock "To Workspace"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Scope"
DstPort 1
}
Line {
SrcBlock "Sum1"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "Fuzzy PID \nSubsystem"
DstPort 1
}
Branch {
Points [0, 40]
DstBlock "Out1"
DstPort 1
}
}
Line {
SrcBlock "Fuzzy PID \nSubsystem"
SrcPort 1
DstBlock "Plant Subsystem"
DstPort 1
}
Line {
SrcBlock "Fuzzy PID \nSubsystem"
SrcPort 4
Points [5, 0; 0, 10]
Branch {
Points [0, 70]
DstBlock "To Workspace5"
DstPort 1
}
Branch {
DstBlock "Out4"
DstPort 1
}
}
Line {
SrcBlock "Fuzzy PID \nSubsystem"
SrcPort 3
Points [115, 0]
Branch {
Points [50, 0]
DstBlock "To Workspace4"
DstPort 1
}
Branch {
DstBlock "Out5"
DstPort 1
}
}
Line {
SrcBlock "Fuzzy PID \nSubsystem"
SrcPort 2
Points [25, 0; 0, 25; 100, 0; 0, -25; 20, 0]
Branch {
DstBlock "To Workspace3"
DstPort 1
}
Branch {
Points [0, -40]
DstBlock "Out3"
DstPort 1
}
}
Annotation {
Position [204, 15]
Text "fuzzy_pid.mdl"
}
Annotation {
Position [136, 255]
Text "Kp=1.5, Ki=0.75, Kd=0.6 for normal PID control"
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -