📄 robot_arm.mdl
字号:
}
Line {
SrcBlock "purelin"
SrcPort 1
DstBlock "a{2}"
DstPort 1
}
}
}
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"
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 "Original Robot\nArm Subsystem"
Ports [1, 1]
Position [140, 201, 205, 249]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
Port {
PortNumber 1
Name "Angle"
PropagatedSignals "Angle"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
System {
Name "Original Robot\nArm Subsystem"
Location [-67, 97, 518, 410]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [25, 53, 55, 67]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Reference
Name "Model Reference Controller"
Ports [2, 1]
Position [90, 26, 265, 159]
BackgroundColor "cyan"
DropShadow on
NamePlacement "alternate"
SourceBlock "neural/Control Systems/Model Reference Cont"
"roller"
SourceType "NN Model Reference Control"
ShowPortLabels on
Nrc "2"
Nic "1"
Njc "2"
IW_y "[-0.069572273964750006 -0.50887837019159299"
";0.15074312774051651 0.11490189363692252;0.18140136858776268 0.37975663959876"
"699;0.29517102307725995 -0.44709921582493495;-0.58875973816560423 -0.04017717"
"25539046;0.72902870715668755 -0.58159644016547762;-0.79473114301336234 0.8068"
"5810458654827;-0.7203623145291248 1.750020475218397;0.32928031663047497 -0.34"
"567654549749322;-0.68792644345580523 -1.22114357248857;-0.23114045526294194 0"
".52612028452189419;-0.078466033931512136 0.55740283259494039;0.59915577372609"
"53 -0.0046772839951757239]"
IW_u "[-0.28646849912653372;0.2082294676863414;-0"
".38700612728754513;-0.088356433428576742;-0.38246650005135652;-0.199790498291"
"55976;0.12950350585422027;-0.076665336474221038;-0.26363250966352098;0.201625"
"00315525875;0.15592324620945688;-0.28346970834751034;0.055516027366232526]"
IW_r "[0.43133604056604929 2.2349303840625012;-0."
"25268785262535298 0.53956550757338506;-1.3942416031489167 1.6812760026264273;"
"-2.2712469519952609 1.8940014540102785;0.62638823833708646 -1.539359965091461"
"1;-1.3412735806395613 1.994061751122143;0.88233358538907281 -1.11495660122073"
"08;1.2015877427658499 0.060457901863100086;1.3973493005875692 -1.224644647346"
"0524;-1.1621604385833166 -1.1103119260029528;-1.7049791456903904 0.3100076441"
"017976;2.1148038096378441 1.3849513797060495;-0.94244119059308828 1.627382357"
"7565985]"
B1_c "[2.5275336083252959;-2.015153508209353;-1.5"
"73574939030099;0.24807575673883855;0.72804063587227263;-0.15009860896928837;-"
"0.14566022969189182;-0.14503306001354413;0.80257458525071157;-2.3204357652991"
"572;-1.7091111210606085;-2.1755082369914769;2.3060895543527407]"
B2_c "-0.89128704544185799"
LW_c "[0.0090810097275292444 1.016994132671448 -0"
".57703994488362598 -1.4828532318010392 0.21544013872474743 -2.081949012845608"
"4 1.951101458107841 2.2265872491488485 -0.20951152443698737 -2.41832489292109"
"41 -0.17557803620122728 0.4111829140769851 -0.13651025081277837]"
retraining_c "30"
max_i_int "2"
min_i_int "0.1"
max_r_int "2"
min_r_int "0.1"
Ts "0.05"
S1 "10"
Ni "2"
Nj "2"
sim_file "robotarm"
trainfun "trainlm "
Use_validation "1"
Use_Testing "1"
Use_Inc_training "0"
Use_previous_weights "1"
max_i "15"
min_i "-15"
max_r "0.7"
min_r "-0.7"
sam_training "10000"
sam_training_c "6000"
epochs "300"
epochs_c "10"
minp "-14.938368446677966"
maxp "14.990917500914531"
mint "-3.3006125056148323"
maxt "3.2985736367119713"
Normalize "0"
IW "[0.67556972299583085 -0.69678512012524063;0"
".00091251541328585956 -0.0027081486615356675;0.00020438440527543628 0.0001990"
"4673243416438;0.00049656346445165877 0.0004751589166608323;0.8378441170330699"
"4 -0.26889964997200294;-0.00019020895770413364 -0.00011909258917915059;-0.403"
"17423125635427 0.4194745680490527;-0.57818696835623018 0.57975674359031992;-0"
".00022043349689196401 -0.00021518711933560483;-0.00022005213616311755 -0.0001"
"4885817639699326]"
LW1_2 "[1.2764115081604008 -1.3654567744259543;0.8"
"9310137588971361 1.0042430979155006;0.33273669122142152 -0.15270262190099879;"
"0.71703040374417737 -0.36195588775915477;-2.5505602345955283 -4.1931013065877"
"298;-0.48162311647991762 0.1228304948598478;1.5080087551662273 -1.78038062709"
"61875;0.58957956932235933 -0.1379494539478418;-0.35268820684492125 0.16442179"
"826947986;-0.49711480585257867 0.14758471020788191]"
LW2_1 "[-1.3652007830674679e-006 -0.00027236502423"
"72647 4.3375977757897157 0.38766138633249286 1.2167137492000295e-006 2.753521"
"9948226088 1.2897509057532762e-006 -1.2811132141620941e-006 -4.41621355122667"
"67 -2.9235276934566996]"
B1 "[8.3454601861727848;-1.7488652958811703;0.6"
"6134602652445429;1.9828413629191783;2.8470577972675652;0.0013587107297852578;"
"-3.0111623514274384;-1.3201798813874432;0.88505814110298575;0.008491378437892"
"1556]"
B2 "0.26583865321126832"
S1c "13"
Limit_output "1"
min_output "-3.1"
max_output "3.1"
Ref_file "robotref"
Port {
PortNumber 1
Name "Torque"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType SubSystem
Name "More Info"
Ports []
Position [285, 235, 312, 260]
DropShadow on
ShowName off
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
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 "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Annotation {
Name "This system simulates model reference c"
"ontrol\nof a single-link robot arm."
Position [162, 22]
}
Annotation {
Name "Double-click on the Model Reference Con"
"troller block\nto train the neural network controller and plant model."
Position [162, 67]
}
Annotation {
Name "For more information on what the contro"
"ller \ndoes, look under the mask of the Model Reference \nController block."
Position [162, 122]
}
}
}
Block {
BlockType SubSystem
Name "More Info2"
Ports []
Position [435, 230, 537, 281]
DropShadow on
ShowName off
OpenFcn "simcad(bdroot)"
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskDisplay "disp('Double click\\nhere for\\nSimulink He"
"lp')"
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 "A4"
PaperUnits "centimeters"
ZoomFactor "100"
}
}
Block {
BlockType SubSystem
Name "Plant\n(Robot Arm)"
Ports [1, 1]
Position [315, 63, 430, 127]
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 "A4"
PaperUnits "centimeters"
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]
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]
ZeroCross off
}
Block {
BlockType Outport
Name "y"
Position [310, 48, 340, 62]
IconDisplay "Port number"
}
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 Outport
Name "Out2"
Position [520, 88, 550, 102]
IconDisplay "Port number"
}
Line {
Name "Angle"
Labels [0, 0]
SrcBlock "Plant\n(Robot Arm)"
SrcPort 1
Points [0, 0; 65, 0]
Branch {
Points [0, 85; -435, 0; 0, -55]
DstBlock "Model Reference Controller"
DstPort 2
}
Branch {
DstBlock "Out2"
DstPort 1
}
}
Line {
Name "Torque"
Labels [0, 0]
SrcBlock "Model Reference Controller"
SrcPort 1
DstBlock "Plant\n(Robot Arm)"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "Model Reference Controller"
DstPort 1
}
Annotation {
Name "Neural Network Model Reference Control of a"
" Robot Arm\n(Double click on the \"?\" for more info)"
Position [73, 242]
}
Annotation {
Name "To start and stop the simulation, use the "
"\"Start/Stop\"\nselection in the \"Simulation\" pull-down menu"
Position [76, 287]
}
}
}
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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -