📄 nonlinaerballbeam.mdl
字号:
Decimation "10"
}
Block {
BlockType Derivative
Name "Derivative"
Position [105, 120, 135, 150]
}
Block {
BlockType Gain
Name "Gain"
Position [50, 55, 80, 85]
Gain "0.05/1.0"
}
Block {
BlockType Integrator
Name "Integrator"
Ports [1, 1]
Position [325, 50, 355, 80]
}
Block {
BlockType Integrator
Name "Integrator1"
Ports [1, 1]
Position [415, 50, 445, 80]
}
Block {
BlockType Mux
Name "Mux"
Ports [4, 1]
Position [165, 47, 200, 83]
}
Block {
BlockType Mux
Name "Mux1"
Ports [4, 1]
Position [285, 151, 290, 189]
ShowName off
DisplayOption "bar"
}
Block {
BlockType ToFile
Name "To File"
Position [235, 210, 295, 240]
Filename "r.mat"
MatrixName "r"
}
Block {
BlockType ToFile
Name "To File1"
Position [295, 265, 355, 295]
Filename "time.mat"
MatrixName "time"
}
Block {
BlockType ToFile
Name "To File2"
Position [70, 210, 130, 240]
Filename "theta.mat"
MatrixName "theta"
}
Block {
BlockType ToFile
Name "To File3"
Position [390, 120, 450, 150]
Filename "a.mat"
MatrixName "a"
}
Block {
BlockType Scope
Name "r,r',a,a'"
Ports [1]
Position [330, 154, 360, 186]
Location [337, 243, 802, 729]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "r,r',a,a'"
}
List {
ListType SelectedSignals
axes1 ""
}
TimeRange "10"
YMin "-0.3"
YMax "0.6"
SaveName "ScopeData1"
DataFormat "StructureWithTime"
}
Block {
BlockType Outport
Name "r"
Position [505, 55, 525, 75]
InitialOutput "0"
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [0, 0]
Branch {
Points [0, 65]
DstBlock "Derivative"
DstPort 1
}
Branch {
Points [60, 0]
Branch {
DstBlock "Mux"
DstPort 3
}
Branch {
Points [0, 105; 100, 0]
Branch {
DstBlock "Mux1"
DstPort 3
}
Branch {
Points [0, -40]
DstBlock "To File3"
DstPort 1
}
}
}
}
Line {
SrcBlock "theta"
SrcPort 1
Points [0, 0]
Branch {
DstBlock "Gain"
DstPort 1
}
Branch {
Points [0, 155]
DstBlock "To File2"
DstPort 1
}
}
Line {
SrcBlock "Derivative"
SrcPort 1
Points [0, 0]
Branch {
Points [10, 0]
DstBlock "Mux"
DstPort 4
}
Branch {
Points [0, 50]
DstBlock "Mux1"
DstPort 4
}
}
Line {
SrcBlock "Integrator1"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "r"
DstPort 1
}
Branch {
Points [0, -55; -265, 0]
Branch {
Points [-90, 0; 0, 40]
DstBlock "Mux"
DstPort 1
}
Branch {
Points [0, 145]
Branch {
DstBlock "Mux1"
DstPort 1
}
Branch {
Points [0, 70]
DstBlock "To File"
DstPort 1
}
}
}
}
Line {
SrcBlock "Integrator"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "Integrator1"
DstPort 1
}
Branch {
Points [0, -40; -165, 0]
Branch {
Points [-90, 0; 0, 35]
DstBlock "Mux"
DstPort 2
}
Branch {
Points [0, 140]
DstBlock "Mux1"
DstPort 2
}
}
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Ball-Beam\nLagrangian\nModel"
DstPort 1
}
Line {
SrcBlock "Ball-Beam\nLagrangian\nModel"
SrcPort 1
DstBlock "Integrator"
DstPort 1
}
Line {
SrcBlock "Mux1"
SrcPort 1
DstBlock "r,r',a,a'"
DstPort 1
}
Line {
SrcBlock "Clock"
SrcPort 1
DstBlock "To File1"
DstPort 1
}
Annotation {
Name "alpha"
Position [101, 61]
}
Annotation {
Name "r"
Position [477, 75]
}
Annotation {
Name "d/dt(r)"
Position [378, 100]
}
}
}
Block {
BlockType Reference
Name "PID Controller"
Ports [1, 1]
Position [205, 135, 235, 165]
SourceBlock "simulink_extras/Additional\nLinear/PID Controll"
"er"
SourceType "PID Controller"
P "1.8"
I "0"
D "3.8"
}
Block {
BlockType Step
Name "Step"
Position [90, 135, 120, 165]
Time "0"
After "0.5"
SampleTime "0"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [155, 140, 175, 160]
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
}
Block {
BlockType Scope
Name "Theta"
Ports [1]
Position [285, 64, 315, 96]
Location [292, 484, 616, 722]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType SelectedSignals
axes1 ""
}
SaveName "ScopeData2"
DataFormat "StructureWithTime"
}
Block {
BlockType Scope
Name "r"
Ports [1]
Position [385, 135, 415, 165]
Location [169, 170, 825, 643]
Open on
NumInputPorts "1"
TickLabels "on"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType SelectedSignals
axes1 ""
}
DataFormat "Array"
}
Line {
SrcBlock "Ball and Beam\nModel"
SrcPort 1
Points [0, 0; 20, 0]
Branch {
DstBlock "r"
DstPort 1
}
Branch {
Points [0, 75; -180, 0]
DstBlock "Sum"
DstPort 2
}
}
Line {
SrcBlock "Step"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "PID Controller"
SrcPort 1
Points [10, 0]
Branch {
DstBlock "Ball and Beam\nModel"
DstPort 1
}
Branch {
Points [0, -70]
DstBlock "Theta"
DstPort 1
}
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "PID Controller"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -