📄 invert_pendulum.mdl
字号:
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Saturate
UpperLimit "0.5"
LowerLimit "-0.5"
LinearizeAsGain on
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Scope
Floating off
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 "0"
}
Block {
BlockType "S-Function"
FunctionName "system"
SFunctionModules "''"
PortCounts "[]"
}
Block {
BlockType StateSpace
A "1"
B "1"
C "1"
D "1"
X0 "0"
AbsoluteTolerance "auto"
Realization "auto"
}
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 TransferFcn
Numerator "[1]"
Denominator "[1 2 1]"
AbsoluteTolerance "auto"
Realization "auto"
}
}
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 "invert_pendulum"
Location [2, 82, 1430, 853]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Sum
Name "Add"
Ports [2, 1]
Position [405, 272, 430, 323]
Orientation "left"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 2]
Position [635, 141, 640, 179]
BackgroundColor "black"
ShowName off
Outputs "2"
DisplayOption "bar"
}
Block {
BlockType Reference
Name "Fuzzy Logic \nController"
Ports [1, 1]
Position [300, 136, 360, 184]
FontName "Arial"
SourceBlock "fuzblock/Fuzzy Logic \nController"
SourceType "FIS"
ShowPortLabels on
fis "fismat22"
}
Block {
BlockType Gain
Name "Gain"
Position [130, 115, 160, 145]
Gain "7.3"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain1"
Position [200, 190, 230, 220]
Gain "8.4"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain2"
Position [675, 155, 705, 185]
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain3"
Position [675, 45, 705, 75]
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain4"
Position [560, 255, 590, 285]
Orientation "left"
Gain "-24.6"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain5"
Position [500, 300, 530, 330]
Orientation "left"
Gain "-3.1"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Gain
Name "Gain6"
Position [385, 145, 415, 175]
Gain "1.15"
ParameterDataTypeMode "Inherit via internal rule"
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Mux
Name "Mux"
Ports [2, 1]
Position [270, 141, 275, 179]
ShowName off
Inputs "2"
DisplayOption "bar"
}
Block {
BlockType Saturate
Name "Saturation"
Position [485, 145, 515, 175]
UpperLimit "2"
LowerLimit "-2"
}
Block {
BlockType StateSpace
Name "State-Space"
Position [540, 143, 600, 177]
A "[0 0 1 0;0 0 0 1;0 -33.3 -16.74 0;0 -67.48 -11."
"84 0] "
B "[0;0;29.43;20.82]"
C "[1 0 0 0;0 1 0 0]"
D "[0;0]"
}
Block {
BlockType Step
Name "Step"
Position [340, 15, 370, 45]
Time "0"
SampleTime "0"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [440, 150, 460, 170]
ShowName off
IconShape "round"
Inputs "|++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [435, 50, 455, 70]
Orientation "down"
NamePlacement "alternate"
ShowName off
IconShape "round"
Inputs "|-+"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
}
Block {
BlockType TransferFcn
Name "Transfer Fcn"
Position [115, 187, 175, 223]
Numerator "[200 0]"
Denominator "[1 200]"
}
Block {
BlockType TransferFcn
Name "Transfer Fcn1"
Position [570, 297, 630, 333]
Orientation "left"
Numerator "[200 0]"
Denominator "[1 200]"
}
Block {
BlockType Scope
Name "sita1"
Ports [1]
Position [745, 44, 775, 76]
Location [1, 52, 1441, 869]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
SaveName "ScopeData1"
DataFormat "StructureWithTime"
}
Block {
BlockType Scope
Name "sita2"
Ports [1]
Position [740, 154, 770, 186]
Location [1, 52, 1441, 869]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
DataFormat "StructureWithTime"
}
Line {
SrcBlock "Transfer Fcn"
SrcPort 1
DstBlock "Gain1"
DstPort 1
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [85, 0; 0, 20]
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Fuzzy Logic \nController"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Saturation"
DstPort 1
}
Line {
SrcBlock "Saturation"
SrcPort 1
DstBlock "State-Space"
DstPort 1
}
Line {
SrcBlock "State-Space"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
SrcBlock "Gain2"
SrcPort 1
DstBlock "sita2"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 2
Points [10, 0]
Branch {
DstBlock "Gain2"
DstPort 1
}
Branch {
Points [0, 100]
Branch {
DstBlock "Gain4"
DstPort 1
}
Branch {
Points [0, 45]
DstBlock "Transfer Fcn1"
DstPort 1
}
}
}
Line {
SrcBlock "Gain3"
SrcPort 1
DstBlock "sita1"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 1
Points [5, 0; 0, -90]
Branch {
DstBlock "Gain3"
DstPort 1
}
Branch {
DstBlock "Sum1"
DstPort 2
}
}
Line {
SrcBlock "Step"
SrcPort 1
Points [70, 0]
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "Sum1"
SrcPort 1
Points [0, 15; -375, 0; 0, 40]
Branch {
Points [0, 75]
DstBlock "Transfer Fcn"
DstPort 1
}
Branch {
DstBlock "Gain"
DstPort 1
}
}
Line {
SrcBlock "Transfer Fcn1"
SrcPort 1
DstBlock "Gain5"
DstPort 1
}
Line {
SrcBlock "Gain4"
SrcPort 1
Points [-55, 0; 0, 15]
DstBlock "Add"
DstPort 1
}
Line {
SrcBlock "Gain5"
SrcPort 1
Points [-25, 0; 0, -5]
DstBlock "Add"
DstPort 2
}
Line {
SrcBlock "Add"
SrcPort 1
Points [0, -85; 50, 0]
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Gain1"
SrcPort 1
Points [15, 0; 0, -35]
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "Fuzzy Logic \nController"
SrcPort 1
DstBlock "Gain6"
DstPort 1
}
Line {
SrcBlock "Gain6"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -