📄 servo_demo1.mdl
字号:
InitialCondition "0"
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
AbsoluteTolerance "auto"
IgnoreLimit off
ZeroCross on
}
Block {
BlockType Logic
Operator "AND"
Inputs "2"
AllPortsSameDT on
OutDataTypeMode "Logical (see Configuration Parameters: Optimiza"
"tion)"
LogicDataType "uint(8)"
SampleTime "-1"
}
Block {
BlockType Lookup2D
RowIndex "[0 1]"
ColumnIndex "[0 1]"
OutputValues "[0 0;0 0]"
LookUpMeth "Interpolation-Extrapolation"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
LUTDesignTableMode "Redesign Table"
LUTDesignDataSource "Block Dialog"
LUTDesignFunctionName "sqrt(x)"
LUTDesignUseExistingBP on
LUTDesignRelError "0.01"
LUTDesignAbsError "1e-6"
}
Block {
BlockType Memory
X0 "0"
InheritSampleTime off
LinearizeMemory off
StateMustResolveToSignalObject off
RTWStateStorageClass "Auto"
}
Block {
BlockType Mux
Inputs "4"
DisplayOption "none"
UseBusObject off
BusObject "BusObject"
NonVirtualBus off
}
Block {
BlockType Outport
Port "1"
UseBusObject off
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 RelationalOperator
Operator ">="
InputSameDT on
LogicOutDataTypeMode "Logical (see Configuration Parameters: Optimiza"
"tion)"
LogicDataType "uint(8)"
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Saturate
UpperLimit "0.5"
LowerLimit "-0.5"
LinearizeAsGain on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Scope
ModelBased off
TickLabels "OneTimeTick"
ZoomMode "on"
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "-1"
}
Block {
BlockType "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType Signum
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Step
Time "1"
Before "0"
After "1"
SampleTime "-1"
VectorParams1D on
ZeroCross on
}
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"
}
Block {
BlockType Switch
Criteria "u2 >= Threshold"
Threshold "0"
InputSameDT on
OutDataTypeMode "Inherit via internal rule"
RndMeth "Floor"
SaturateOnIntegerOverflow on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Terminator
}
Block {
BlockType UnitDelay
X0 "0"
SampleTime "1"
StateMustResolveToSignalObject off
RTWStateStorageClass "Auto"
}
Block {
BlockType ZeroOrderHold
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 "servo_demo1"
Location [2, 78, 1022, 718]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType SubSystem
Name "Controller"
Ports [2, 1]
Position [110, 79, 185, 161]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "Controller"
Location [2, 78, 1022, 718]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "set point"
Position [25, 28, 55, 42]
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "feedback"
Position [50, 105, 80, 120]
Orientation "up"
Port "2"
IconDisplay "Port number"
}
Block {
BlockType Constant
Name "Constant5"
Position [295, 115, 315, 135]
Orientation "up"
ShowName off
Value "0"
}
Block {
BlockType Saturate
Name "Saturation"
Position [665, 60, 695, 90]
UpperLimit "dcmax"
LowerLimit "dcmin"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [620, 15, 640, 135]
ShowName off
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [95, 27, 125, 58]
ShowName off
Inputs "+-"
}
Block {
BlockType Sum
Name "Sum2"
Ports [2, 1]
Position [490, 87, 520, 118]
ShowName off
}
Block {
BlockType Switch
Name "Switch"
Position [340, 80, 370, 110]
ShowName off
Threshold "0.5"
}
Block {
BlockType UnitDelay
Name "Unit Delay"
Position [545, 90, 575, 120]
ShowName off
X0 "dcnull"
SampleTime "0.02"
}
Block {
BlockType Gain
Name "integral\ngain"
Position [405, 76, 455, 114]
BackgroundColor "green"
Gain "Ki"
}
Block {
BlockType Gain
Name "loop\ngain"
Position [220, 25, 255, 65]
BackgroundColor "green"
Gain "Ka"
}
Block {
BlockType SubSystem
Name "prevent\nwindup"
Ports [2, 1]
Position [725, 138, 765, 187]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "prevent\nwindup"
Location [329, 233, 829, 562]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "dc"
Position [25, 30, 55, 50]
NamePlacement "alternate"
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "e1"
Position [25, 90, 55, 110]
NamePlacement "alternate"
Port "2"
IconDisplay "Port number"
}
Block {
BlockType Constant
Name "Constant1"
Position [160, 44, 195, 66]
ShowName off
Value "dcmin"
}
Block {
BlockType Constant
Name "Constant2"
Position [165, 204, 200, 226]
ShowName off
Value "dcmax"
}
Block {
BlockType Constant
Name "Constant5"
Position [215, 105, 235, 125]
ShowName off
Value "0"
}
Block {
BlockType Constant
Name "Constant6"
Position [210, 285, 230, 305]
ShowName off
Value "0"
}
Block {
BlockType Logic
Name "Logical\nOperator"
Ports [2, 1]
Position [325, 62, 355, 93]
ShowName off
}
Block {
BlockType Logic
Name "Logical\nOperator1"
Ports [2, 1]
Position [315, 217, 345, 248]
ShowName off
}
Block {
BlockType Logic
Name "Logical\nOperator2"
Ports [2, 1]
Position [390, 127, 420, 158]
ShowName off
Operator "NOR"
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator"
Position [240, 32, 270, 63]
ShowName off
Operator "<="
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator1"
Position [245, 192, 275, 223]
ShowName off
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator2"
Position [250, 92, 280, 123]
ShowName off
Operator "<="
}
Block {
BlockType RelationalOperator
Name "Relational\nOperator3"
Position [250, 272, 280, 303]
ShowName off
}
Block {
BlockType Outport
Name "nothold"
Position [445, 138, 475, 152]
IconDisplay "Port number"
BusOutputAsStruct off
InitialOutput "0"
}
Line {
SrcBlock "Logical\nOperator2"
SrcPort 1
DstBlock "nothold"
DstPort 1
}
Line {
SrcBlock "Logical\nOperator1"
SrcPort 1
Points [25, 0]
DstBlock "Logical\nOperator2"
DstPort 2
}
Line {
SrcBlock "Logical\nOperator"
SrcPort 1
Points [15, 0]
DstBlock "Logical\nOperator2"
DstPort 1
}
Line {
SrcBlock "Relational\nOperator3"
SrcPort 1
Points [5, 0; 0, -50]
DstBlock "Logical\nOperator1"
DstPort 2
}
Line {
SrcBlock "Relational\nOperator1"
SrcPort 1
Points [5, 0; 0, 15]
DstBlock "Logical\nOperator1"
DstPort 1
}
Line {
SrcBlock "Constant6"
SrcPort 1
DstBlock "Relational\nOperator3"
DstPort 2
}
Line {
SrcBlock "Constant5"
SrcPort 1
DstBlock "Relational\nOperator2"
DstPort 2
}
Line {
SrcBlock "Relational\nOperator2"
SrcPort 1
Points [25, 0]
DstBlock "Logical\nOperator"
DstPort 2
}
Line {
SrcBlock "Constant2"
SrcPort 1
DstBlock "Relational\nOperator1"
DstPort 2
}
Line {
SrcBlock "Relational\nOperator"
SrcPort 1
Points [20, 0; 0, 20]
DstBlock "Logical\nOperator"
DstPort 1
}
Line {
SrcBlock "Constant1"
SrcPort 1
DstBlock "Relational\nOperator"
DstPort 2
}
Line {
SrcBlock "dc"
SrcPort 1
Points [70, 0]
Branch {
DstBlock "Relational\nOperator"
DstPort 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -