📄 robot2_arm.mdl
字号:
}
}
Block {
BlockType Goto
Name "a{1}"
Position [380, 40, 400, 60]
DialogController "Simulink.DDGSource"
GotoTag "feedback1"
TagVisibility "local"
MaskDisplay "plot(cos(0:.1:2*pi),sin(0:.1:2*pi))"
MaskIconFrame off
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
}
Block {
BlockType Outport
Name "y{1}"
Position [380, 120, 400, 140]
BackgroundColor "magenta"
IconDisplay "Port number"
BusOutputAsStruct off
InitialOutput "0"
}
Line {
SrcBlock "p{1}"
SrcPort 1
DstBlock "Layer 1"
DstPort 1
}
Line {
SrcBlock "Layer 1"
SrcPort 1
DstBlock "a{1}"
DstPort 1
}
Line {
SrcBlock " a{1} "
SrcPort 1
DstBlock "Layer 2"
DstPort 1
}
Line {
SrcBlock "Layer 2"
SrcPort 1
DstBlock "y{1}"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Plant\n(Robot Arm)"
Ports [1, 2]
Position [305, 54, 365, 96]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskDisplay "plot([-10],[0],[10],[0],[-2 -2 2 2 -2],[5 4 4 5"
" 5],[0 3],[4.5 0.5])"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
Port {
PortNumber 1
Name "Angle"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
System {
Name "Plant\n(Robot Arm)"
Location [365, 225, 736, 441]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "u"
Position [15, 33, 45, 47]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Gain
Name "Friction"
Position [110, 100, 140, 130]
Orientation "left"
Gain "a"
}
Block {
BlockType Fcn
Name "Gravity"
Position [170, 150, 230, 180]
Orientation "left"
Expr "K*sin(u(1))"
}
Block {
BlockType Integrator
Name "Position"
Ports [1, 1]
Position [210, 40, 240, 70]
IgnoreLimit off
ZeroCross off
}
Block {
BlockType Sum
Name "Sum"
Ports [3, 1]
Position [85, 33, 105, 77]
ShowName off
Inputs "+--"
}
Block {
BlockType Integrator
Name "Velocity"
Ports [1, 1]
Position [135, 40, 165, 70]
IgnoreLimit off
ZeroCross off
}
Block {
BlockType Outport
Name "y"
Position [310, 48, 340, 62]
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "dy"
Position [310, 13, 340, 27]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Position"
SrcPort 1
Points [20, 0]
Branch {
DstBlock "y"
DstPort 1
}
Branch {
Points [0, 110]
DstBlock "Gravity"
DstPort 1
}
}
Line {
SrcBlock "u"
SrcPort 1
DstBlock "Sum"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
DstBlock "Velocity"
DstPort 1
}
Line {
SrcBlock "Gravity"
SrcPort 1
Points [-120, 0; 0, -110]
DstBlock "Sum"
DstPort 2
}
Line {
SrcBlock "Velocity"
SrcPort 1
Points [15, 0]
Branch {
DstBlock "Position"
DstPort 1
}
Branch {
Points [0, 60]
DstBlock "Friction"
DstPort 1
}
Branch {
Points [0, -35]
DstBlock "dy"
DstPort 1
}
}
Line {
SrcBlock "Friction"
SrcPort 1
Points [-35, 0]
DstBlock "Sum"
DstPort 3
}
}
}
Block {
BlockType UniformRandomNumber
Name "Random Reference"
Position [35, 209, 65, 241]
Minimum "-0.5"
Maximum "0.5"
Seed "86700"
SampleTime "10"
}
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [440, 59, 470, 91]
Location [6, 65, 389, 377]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
TimeRange "60"
YMin "-2"
YMax "1.5"
SaveToWorkspace on
SaveName "yout"
DataFormat "Array"
MaxDataPoints "50000"
}
Block {
BlockType Sum
Name "Sum"
Ports [2, 1]
Position [80, 55, 100, 75]
ShowName off
IconShape "round"
Inputs "|+-"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
}
Block {
BlockType Sum
Name "Sum1"
Ports [2, 1]
Position [250, 65, 270, 85]
ShowName off
IconShape "round"
Inputs "|++"
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
}
Block {
BlockType Outport
Name "err"
Position [130, 133, 160, 147]
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "in"
Position [65, 148, 95, 162]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "x1"
Position [440, 23, 470, 37]
Port "3"
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "x2"
Position [280, 98, 310, 112]
Port "4"
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "Out1"
Position [440, 178, 470, 192]
Port "5"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
Name "Angle"
Labels [0, 0]
SrcBlock "Plant\n(Robot Arm)"
SrcPort 1
Points [0, 5; 15, 0]
Branch {
Points [0, 50; -295, 0]
DstBlock "Sum"
DstPort 2
}
Branch {
Points [15, 0; 0, -5]
Branch {
DstBlock "Mux1"
DstPort 1
}
Branch {
Points [0, -35]
DstBlock "x1"
DstPort 1
}
}
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Neural Network"
DstPort 1
}
Line {
SrcBlock "Sum"
SrcPort 1
Points [0, 0; 5, 0]
Branch {
DstBlock "Mux"
DstPort 1
}
Branch {
Points [0, 75]
Branch {
DstBlock "err"
DstPort 1
}
Branch {
Points [0, 10]
DstBlock "Discrete-Time\nIntegrator"
DstPort 1
}
}
}
Line {
SrcBlock "Plant\n(Robot Arm)"
SrcPort 2
Points [5, 0; 0, 65]
DstBlock "Gain1"
DstPort 1
}
Line {
SrcBlock "Mux1"
SrcPort 1
DstBlock "Scope"
DstPort 1
}
Line {
SrcBlock "Random Reference"
SrcPort 1
DstBlock "Gain2"
DstPort 1
}
Line {
SrcBlock "Clock"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
Name "Torque"
Labels [0, 0]
SrcBlock "Neural Network"
SrcPort 1
DstBlock "Sum1"
DstPort 1
}
Line {
SrcBlock "Sum1"
SrcPort 1
DstBlock "Plant\n(Robot Arm)"
DstPort 1
}
Line {
SrcBlock "Discrete-Time\nIntegrator"
SrcPort 1
DstBlock "Gain"
DstPort 1
}
Line {
SrcBlock "Gain"
SrcPort 1
Points [5, 0]
DstBlock "Sum1"
DstPort 2
}
Line {
SrcBlock "Gain1"
SrcPort 1
Points [-25, 0; 0, -35]
Branch {
Points [-150, 0]
DstBlock "Mux"
DstPort 2
}
Branch {
DstBlock "x2"
DstPort 1
}
}
Line {
SrcBlock "Gain2"
SrcPort 1
Points [5, 0; 0, -45; -110, 0; 0, -115; 30, 0]
Branch {
Points [25, 0]
Branch {
DstBlock "Sum"
DstPort 1
}
Branch {
Points [0, 60; 330, 0; 0, -40]
DstBlock "Mux1"
DstPort 2
}
}
Branch {
Points [0, 90]
DstBlock "in"
DstPort 1
}
}
Annotation {
Name "Neural Network Model Reference Control of a Rob"
"ot Arm"
Position [153, 17]
}
Annotation {
Name "robot2_arm.mdl"
Position [97, 36]
}
Annotation {
Name "Load robot_data.mat file in which\n it contains"
" weights and bias and KI values before simulation"
Position [298, 251]
}
Annotation {
Name "Sample time=0.05 sec."
Position [215, 212]
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -