📄 pid.mdl
字号:
}
Block {
BlockType Inport
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
Interpolate on
}
Block {
BlockType Integrator
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
ZeroCross on
}
Block {
BlockType Outport
Port "1"
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Product
Inputs "2"
Multiplication "Element-wise(.*)"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Zero"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "Helvetica"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "PID"
Location [343, 248, 923, 541]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Inport
Name "Kp"
Position [85, 18, 115, 32]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "e"
Position [85, 103, 115, 117]
Port "2"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "Ki"
Position [85, 143, 115, 157]
Port "3"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "Kd"
Position [85, 228, 115, 242]
Port "4"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Sum
Name "Add"
Ports [2, 1]
Position [380, 18, 395, 82]
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Add1"
Ports [2, 1]
Position [380, 102, 395, 158]
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Add2"
Ports [2, 1]
Position [380, 191, 395, 249]
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Add3"
Ports [3, 1]
Position [450, 84, 470, 176]
Inputs "+++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Derivative
Name "Derivative"
Position [160, 165, 190, 195]
}
Block {
BlockType Gain
Name "Gain"
Position [215, 165, 245, 195]
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain1"
Position [155, 50, 185, 80]
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain2"
Position [215, 95, 245, 125]
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1]
Position [155, 95, 185, 125]
}
Block {
BlockType SubSystem
Name "PID Subsystem"
Ports [4, 1]
Position [450, 209, 550, 251]
FontSize 10
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "PID Subsystem"
Location [335, 562, 833, 862]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "e"
Position [100, 83, 130, 97]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "Kp"
Position [100, 48, 130, 62]
Port "2"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "Ki"
Position [100, 13, 130, 27]
Port "3"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Inport
Name "Kd"
Position [105, 128, 135, 142]
Port "4"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Outport
Name "Out1"
Position [360, 103, 390, 117]
IconDisplay "Port number"
BusOutputAsStruct off
}
}
}
Block {
BlockType Product
Name "Product"
Ports [2, 1]
Position [240, 17, 270, 48]
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Product1"
Ports [2, 1]
Position [295, 127, 325, 158]
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Product
Name "Product2"
Ports [2, 1]
Position [295, 212, 325, 243]
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Outport
Name "Out1"
Position [495, 123, 525, 137]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Kp"
SrcPort 1
DstBlock "Product"
DstPort 1
}
Line {
SrcBlock "e"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "Integrator"
DstPort 1
}
Branch {
Points [0, -45]
Branch {
Points [0, -25]
DstBlock "Product"
DstPort 2
}
Branch {
DstBlock "Gain1"
DstPort 1
}
}
Branch {
Points [0, 70]
DstBlock "Derivative"
DstPort 1
}
}
Line {
SrcBlock "Ki"
SrcPort 1
DstBlock "Product1"
DstPort 2
}
Line {
SrcBlock "Integrator"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "Gain2"
DstPort 1
}
Branch {
Points [0, 30; 85, 0]
DstBlock "Product1"
DstPort 1
}
}
Line {
SrcBlock "Derivative"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "Gain"
DstPort 1
}
Branch {
Points [0, 40]
DstBlock "Product2"
DstPort 1
}
}
Line {
SrcBlock "Kd"
SrcPort 1
DstBlock "Product2"
DstPort 2
}
Line {
SrcBlock "Product2"
SrcPort 1
Points [15, 0; 0, 5]
DstBlock "Add2"
DstPort 2
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [55, 0; 0, 25]
DstBlock "Add2"
DstPort 1
}
Line {
SrcBlock "Product1"
SrcPort 1
DstBlock "Add1"
DstPort 2
}
Line {
SrcBlock "Gain2"
SrcPort 1
Points [55, 0; 0, 5]
DstBlock "Add1"
DstPort 1
}
Line {
SrcBlock "Product"
SrcPort 1
DstBlock "Add"
DstPort 1
}
Line {
SrcBlock "Gain1"
SrcPort 1
DstBlock "Add"
DstPort 2
}
Line {
SrcBlock "Add"
SrcPort 1
Points [15, 0; 0, 50]
DstBlock "Add3"
DstPort 1
}
Line {
SrcBlock "Add1"
SrcPort 1
DstBlock "Add3"
DstPort 2
}
Line {
SrcBlock "Add2"
SrcPort 1
Points [15, 0; 0, -60]
DstBlock "Add3"
DstPort 3
}
Line {
SrcBlock "Add3"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -