📄 pid_apx2.mdl
字号:
DstPort 1
}
}
}
Block {
BlockType Sum
Name "Sum5"
Ports [2, 1, 0, 0, 0]
Position [275, 75, 295, 95]
IconShape "rectangular"
Inputs "++"
SaturateOnIntegerOverflow on
}
Block {
BlockType TransferFcn
Name "Transfer Fcn"
Position [105, 102, 180, 138]
Numerator "XnumPs{2}"
Denominator "XdenPs{2}"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn1"
Position [105, 25, 180, 65]
Numerator "XnumPs{1}"
Denominator "XdenPs{1}"
}
Block {
BlockType Outport
Name "Out1"
Position [315, 78, 345, 92]
Port "1"
OutputWhenDisabled "held"
InitialOutput "0"
}
Line {
SrcBlock "Transfer Fcn1"
SrcPort 1
DstBlock "Pdelay"
DstPort 1
}
Line {
SrcBlock "Transfer Fcn"
SrcPort 1
DstBlock "Pdelay1"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "Transfer Fcn1"
DstPort 1
}
Branch {
DstBlock "Transfer Fcn"
DstPort 1
}
}
Line {
SrcBlock "Sum5"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "Pdelay"
SrcPort 1
DstBlock "Sum5"
DstPort 1
}
Line {
SrcBlock "Pdelay1"
SrcPort 1
DstBlock "Sum5"
DstPort 2
}
}
}
Block {
BlockType Saturate
Name "Saturation"
Position [325, 138, 355, 162]
UpperLimit "Satub"
LowerLimit "Satlb"
}
Block {
BlockType Scope
Name "Scope"
Ports [1, 0, 0, 0, 0]
Position [600, 170, 630, 200]
Floating off
Location [188, 365, 512, 604]
Open off
NumInputPorts "1"
TickLabels "on"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "Matrix"
LimitMaxRows on
MaxRows "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Scope
Name "Scope1"
Ports [1, 0, 0, 0, 0]
Position [300, 210, 330, 240]
Orientation "left"
Floating off
Location [188, 365, 512, 604]
Open off
NumInputPorts "1"
TickLabels "on"
ZoomMode "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
DataFormat "Matrix"
LimitMaxRows on
MaxRows "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType Step
Name "Step Input"
Position [15, 135, 35, 155]
Time "0"
Before "0"
After "Setpoint"
SampleTime "0"
}
Block {
BlockType Step
Name "Step Input1"
Position [230, 55, 250, 75]
Time "0"
Before "0"
After "Disturb"
SampleTime "0"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1, 0, 0, 0]
Position [165, 140, 185, 160]
IconShape "rectangular"
Inputs "+-"
SaturateOnIntegerOverflow on
}
Block {
BlockType Sum
Name "Sum2"
Ports [2, 1, 0, 0, 0]
Position [535, 130, 555, 150]
IconShape "rectangular"
Inputs "++"
SaturateOnIntegerOverflow on
}
Block {
BlockType Sum
Name "Sum3"
Ports [2, 1, 0, 0, 0]
Position [385, 135, 405, 155]
IconShape "rectangular"
Inputs "++"
SaturateOnIntegerOverflow on
}
Block {
BlockType ToWorkspace
Name "To Workspace"
Position [595, 90, 655, 120]
VariableName "simout"
Buffer "inf"
Decimation "1"
SampleTime "-1"
SaveFormat "Matrix"
}
Block {
BlockType ToWorkspace
Name "To Workspace1"
Position [405, 210, 465, 240]
VariableName "effort"
Buffer "inf"
Decimation "1"
SampleTime "-1"
SaveFormat "Matrix"
}
Block {
BlockType SubSystem
Name "approximated PID"
Ports [1, 1, 0, 0, 0]
Position [210, 128, 300, 172]
ShowPortLabels on
System {
Name "approximated PID"
Location [76, 77, 517, 321]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
AutoZoom on
Block {
BlockType Inport
Name "In1"
Position [15, 93, 45, 107]
Port "1"
PortWidth "-1"
SampleTime "-1"
DataType "auto"
SignalType "auto"
Interpolate on
}
Block {
BlockType Gain
Name "Gain"
Position [70, 84, 105, 116]
Gain "keps"
SaturateOnIntegerOverflow on
}
Block {
BlockType Saturate
Name "Saturation"
Position [175, 93, 205, 117]
UpperLimit "Satub"
LowerLimit "Satlb"
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1, 0, 0, 0]
Position [135, 95, 155, 115]
IconShape "rectangular"
Inputs "++"
SaturateOnIntegerOverflow on
}
Block {
BlockType Sum
Name "Sum3"
Ports [2, 1, 0, 0, 0]
Position [330, 90, 350, 110]
IconShape "rectangular"
Inputs "++"
SaturateOnIntegerOverflow on
}
Block {
BlockType TransferFcn
Name "Transfer Fcn1"
Position [145, 155, 200, 195]
Orientation "left"
NamePlacement "alternate"
Numerator "[1]"
Denominator "[a1 1]"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn2"
Position [165, 22, 245, 68]
Numerator "[(a2-b2) 0]"
Denominator "[b1 1]"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn3"
Position [240, 84, 295, 126]
Numerator "[a1]"
Denominator "[b1 1]"
}
Block {
BlockType Outport
Name "Out1"
Position [370, 93, 400, 107]
Port "1"
OutputWhenDisabled "held"
InitialOutput "0"
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [0, 0]
Branch {
Points [0, -55]
DstBlock "Transfer Fcn2"
DstPort 1
}
Branch {
DstBlock "Sum1"
DstPort 1
}
}
Line {
SrcBlock "Transfer Fcn1"
SrcPort 1
Points [-20, 0]
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Saturation"
SrcPort 1
Points [10, 0]
Branch {
Points [0, 70]
DstBlock "Transfer Fcn1"
DstPort 1
}
Branch {
DstBlock "Transfer Fcn3"
DstPort 1
}
}
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "Saturation"
DstPort 1
}
Line {
SrcBlock "Transfer Fcn3"
SrcPort 1
DstBlock "Sum3"
DstPort 2
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Gain"
DstPort 1
}
Line {
SrcBlock "Sum3"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "Transfer Fcn2"
SrcPort 1
Points [65, 0]
DstBlock "Sum3"
DstPort 1
}
Annotation {
Position [222, 127]
VerticalAlignment "top"
Text "Md\n"
}
}
}
Block {
BlockType SubSystem
Name "conditinal switch\nd_through_p"
Description "pass input signal through out1 if condition is "
"true."
Ports [1, 2, 0, 0, 0]
Position [295, 45, 345, 85]
ShowPortLabels on
System {
Name "conditinal switch\nd_through_p"
Location [401, 225, 815, 518]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
AutoZoom on
Block {
BlockType Inport
Name "In"
Position [235, 133, 265, 147]
Orientation "left"
Port "1"
PortWidth "-1"
SampleTime "-1"
DataType "auto"
SignalType "auto"
Interpolate on
}
Block {
BlockType Constant
Name "Condition"
Position [60, 80, 130, 120]
Value "d_through_p"
}
Block {
BlockType Constant
Name "Constant1"
Position [115, 180, 145, 200]
Value "0"
}
Block {
BlockType Constant
Name "Constant2"
Position [155, 50, 185, 70]
Value "0"
}
Block {
BlockType Switch
Name "Switch"
Position [230, 70, 260, 100]
Threshold "1"
}
Block {
BlockType Switch
Name "Switch1"
Position [190, 165, 220, 195]
Threshold "1"
}
Block {
BlockType Outport
Name "Out2"
Position [285, 78, 315, 92]
Port "1"
OutputWhenDisabled "held"
InitialOutput "0"
}
Block {
BlockType Outport
Name "Out1"
Position [245, 173, 275, 187]
Port "2"
OutputWhenDisabled "held"
InitialOutput "0"
}
Line {
SrcBlock "In"
SrcPort 1
Points [-15, 0]
Branch {
DstBlock "Switch"
DstPort 3
}
Branch {
Points [-40, 0]
DstBlock "Switch1"
DstPort 1
}
}
Line {
SrcBlock "Condition"
SrcPort 1
Points [20, 0]
Branch {
Points [0, 80]
DstBlock "Switch1"
DstPort 2
}
Branch {
Points [0, -15]
DstBlock "Switch"
DstPort 2
}
}
Line {
SrcBlock "Constant1"
SrcPort 1
DstBlock "Switch1"
DstPort 3
}
Line {
SrcBlock "Constant2"
SrcPort 1
Points [25, 0]
DstBlock "Switch"
DstPort 1
}
Line {
SrcBlock "Switch"
SrcPort 1
DstBlock "Out2"
DstPort 1
}
Line {
SrcBlock "Switch1"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType TransferFcn
Name "pre-filter"
Position [60, 125, 140, 165]
Numerator "Pre_fil_num"
Denominator "Pre_fil_den"
}
Line {
SrcBlock "Step Input"
SrcPort 1
DstBlock "pre-filter"
DstPort 1
}
Line {
SrcBlock "pre-filter"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "approximated PID"
DstPort 1
}
Line {
SrcBlock "approximated PID"
SrcPort 1
DstBlock "Saturation"
DstPort 1
}
Line {
SrcBlock "Sum3"
SrcPort 1
DstBlock "Multi_tf Process"
DstPort 1
}
Line {
SrcBlock "Multi_tf Process"
SrcPort 1
DstBlock "Sum2"
DstPort 2
}
Line {
SrcBlock "Disturbance lag"
SrcPort 1
Points [10, 0]
DstBlock "Sum2"
DstPort 1
}
Line {
SrcBlock "conditinal switch\nd_through_p"
SrcPort 2
Points [20, 0]
DstBlock "Sum3"
DstPort 1
}
Line {
SrcBlock "conditinal switch\nd_through_p"
SrcPort 1
DstBlock "Disturbance lag"
DstPort 1
}
Line {
SrcBlock "Step Input1"
SrcPort 1
DstBlock "conditinal switch\nd_through_p"
DstPort 1
}
Line {
SrcBlock "Saturation"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "Sum3"
DstPort 2
}
Branch {
DstBlock "To Workspace1"
DstPort 1
}
Branch {
DstBlock "Scope1"
DstPort 1
}
}
Line {
SrcBlock "Sum2"
SrcPort 1
Points [0, 0]
Branch {
Points [0, 130; -410, 0]
DstBlock "Sum"
DstPort 2
}
Branch {
DstBlock "To Workspace"
DstPort 1
}
Branch {
DstBlock "Scope"
DstPort 1
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -