📄 mrefrobotarm2.mdl
字号:
DstPort 2
}
Line {
SrcBlock "Unit Delay4"
SrcPort 1
DstBlock "Mux2"
DstPort 2
}
Line {
SrcBlock "Switch"
SrcPort 1
Points [0, -75; 90, 0]
Branch {
Points [75, 0]
DstBlock "Mux2"
DstPort 1
}
Branch {
DstBlock "Unit Delay4"
DstPort 1
}
}
Line {
SrcBlock "Zero-Order\nHold"
SrcPort 1
DstBlock "yhat"
DstPort 1
}
Line {
SrcBlock "Switch2"
SrcPort 1
DstBlock "Zero-Order\nHold"
DstPort 1
}
}
}
Block {
BlockType Terminator
Name "Terminator"
Position [420, 145, 440, 165]
}
Block {
BlockType Terminator
Name "Terminator1"
Position [425, 225, 445, 245]
}
Block {
BlockType Outport
Name "Control Signal"
Position [195, 220, 225, 235]
Orientation "down"
NamePlacement "alternate"
}
Line {
SrcBlock "Plant Output"
SrcPort 1
Points [0, -15]
Branch {
Points [0, -30]
DstBlock "NN Plant"
DstPort 2
}
Branch {
Points [-155, 0; 0, -95]
DstBlock "NN Controller"
DstPort 3
}
}
Line {
SrcBlock "NN Controller"
SrcPort 1
Points [45, 0; 0, 65]
Branch {
DstBlock "NN Plant"
DstPort 1
}
Branch {
Points [-75, 0]
Branch {
DstBlock "Control Signal"
DstPort 1
}
Branch {
Points [-60, 0]
DstBlock "NN Controller"
DstPort 2
}
}
}
Line {
SrcBlock "Reference"
SrcPort 1
Points [55, 0]
DstBlock "NN Controller"
DstPort 1
}
Line {
SrcBlock "NN Plant"
SrcPort 1
Points [30, 0]
DstBlock "Terminator"
DstPort 1
}
Line {
SrcBlock "NN Plant"
SrcPort 2
Points [35, 0]
DstBlock "Terminator1"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "More Info"
Ports []
Position [420, 230, 447, 255]
DropShadow on
ShowName off
TreatAsAtomicUnit off
MaskDisplay "disp('?')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "More Info"
Location [615, 382, 963, 565]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Annotation {
Name "This system simulates model reference contr"
"ol\nof a single-link robot arm."
Position [162, 22]
}
Annotation {
Name "Double-click on the Model Reference Control"
"ler block\nto train the neural network controller and plant model."
Position [162, 67]
}
Annotation {
Name "For more information on what the controller"
" \ndoes, look under the mask of the Model Reference \nController block."
Position [162, 122]
}
}
}
Block {
BlockType SubSystem
Name "More Info2"
Ports []
Position [570, 225, 672, 276]
DropShadow on
ShowName off
OpenFcn "simcad(bdroot)"
TreatAsAtomicUnit off
MaskDisplay "disp('Double click\\nhere for\\nSimulink Help')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "More Info2"
Location [128, 280, 487, 453]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
}
}
Block {
BlockType SubSystem
Name "Plant\n(Robot Arm)"
Ports [1, 1]
Position [450, 53, 565, 117]
TreatAsAtomicUnit off
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"
TestPoint off
LinearAnalysisOutput off
LinearAnalysisInput off
RTWStorageClass "Auto"
DataLogging off
DataLoggingNameMode "SignalName"
DataLoggingDecimateData off
DataLoggingDecimation "2"
DataLoggingLimitDataPoints off
DataLoggingMaxPoints "5000"
}
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]
}
Block {
BlockType Gain
Name "Friction"
Position [110, 100, 140, 130]
Orientation "left"
Gain "2"
}
Block {
BlockType Fcn
Name "Gravity"
Position [170, 150, 230, 180]
Orientation "left"
Expr "10*sin(u(1))"
}
Block {
BlockType Integrator
Name "Position"
Ports [1, 1]
Position [210, 40, 240, 70]
}
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]
}
Block {
BlockType Outport
Name "y"
Position [310, 48, 340, 62]
}
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
}
}
Line {
SrcBlock "Friction"
SrcPort 1
Points [-35, 0]
DstBlock "Sum"
DstPort 3
}
}
}
Block {
BlockType UniformRandomNumber
Name "Random Reference"
Position [40, 39, 70, 71]
Minimum "-0.5"
Maximum "0.5"
Seed "round(now)"
SampleTime "10"
}
Block {
BlockType SubSystem
Name "XY Graph"
Ports [3]
Position [695, 62, 730, 108]
CopyFcn "sfunxy2([],[],[],'CopyBlock')"
DeleteFcn "sfunxy2([],[],[],'DeleteBlock')"
LoadFcn "sfunxy2([],[],[],'LoadBlock')"
StartFcn "sfunxy2([],[],[],'Start')"
StopFcn "sfunxy2([],[],[],'Stop')"
NameChangeFcn "sfunxy2([],[],[],'NameChange')"
TreatAsAtomicUnit off
MaskType "XY scope."
MaskDescription "XY scope using MATLAB graph window. First inpu"
"t is used as time base. Enter plotting ranges."
MaskHelp "This block can be used to explore limit cycles."
" Look at the m-file sfunxy.m to see how it works."
MaskPromptString "x-min:|x-max:|y-min:|y-max:|Sample time:"
MaskStyleString "edit,edit,edit,edit,edit"
MaskTunableValueString "on,on,on,on,on"
MaskCallbackString "||||"
MaskEnableString "on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on"
MaskToolTipString "on,on,on,on,on"
MaskVarAliasString ",,,,"
MaskVariables "xmin=@1;xmax=@2;ymin=@3;ymax=@4;st=@5;"
MaskDisplay "plot([.05 .95 .95 .05 .05],[.45 .45 .95 .95 .45"
"], 0.5+cos(0:0.1:2*pi)*0.3,0.7+sin(0:0.1:2*pi)*0.2)"
MaskSelfModifiable on
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "normalized"
MaskValueString "0|5|-1|1|-1"
System {
Name "XY Graph"
Location [82, 157, 342, 335]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "x"
Position [25, 27, 55, 43]
}
Block {
BlockType Inport
Name "y1"
Position [25, 67, 55, 83]
Port "2"
}
Block {
BlockType Inport
Name "y2"
Position [25, 107, 55, 123]
Port "3"
}
Block {
BlockType Mux
Name "Mux"
Ports [3, 1]
Position [105, 48, 135, 102]
ShowName off
Inputs "3"
}
Block {
BlockType "S-Function"
Name "sfunxy"
Ports [1]
Position [175, 65, 225, 85]
ShowName off
FunctionName "sfunxy2"
Parameters "[xmin xmax ymin ymax], st"
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "sfunxy"
DstPort 1
}
Line {
SrcBlock "x"
SrcPort 1
Points [15, 0; 0, 20]
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "y1"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "y2"
SrcPort 1
Points [15, 0; 0, -20]
DstBlock "Mux"
DstPort 3
}
}
}
Line {
Name "Angle"
Labels [0, 0]
SrcBlock "Plant\n(Robot Arm)"
SrcPort 1
Points [65, 0]
Branch {
DstBlock "XY Graph"
DstPort 2
}
Branch {
Points [0, 90; -435, 0; 0, -65]
DstBlock "Model Reference Controller"
DstPort 2
}
}
Line {
Name "Torque"
Labels [0, 0]
SrcBlock "Model Reference Controller"
SrcPort 1
DstBlock "Plant\n(Robot Arm)"
DstPort 1
}
Line {
SrcBlock "Clock"
SrcPort 1
Points [20, 0; 0, 25]
DstBlock "XY Graph"
DstPort 1
}
Line {
Labels [1, 0]
SrcBlock "Random Reference"
SrcPort 1
Points [70, 0]
Branch {
DstBlock "Model Reference Controller"
DstPort 1
}
Branch {
Points [0, 140; 520, 0; 0, -95]
DstBlock "XY Graph"
DstPort 3
}
}
Annotation {
Name "Neural Network Model Reference Control of a Rob"
"ot Arm\n(Double click on the \"?\" for more info)"
Position [208, 237]
}
Annotation {
Name "To start and stop the simulation, use the \"Sta"
"rt/Stop\"\nselection in the \"Simulation\" pull-down menu"
Position [211, 282]
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -