⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mrefrobotarm2.mdl

📁 神经网络预测控制程序的源代码
💻 MDL
📖 第 1 页 / 共 5 页
字号:
	  Name			  "Plant Output"
	  Position		  [250, 265, 280, 280]
	  Orientation		  "up"
	  Port			  "2"
	}
	Block {
	  BlockType		  SubSystem
	  Name			  "NN Controller"
	  Ports			  [3, 1]
	  Position		  [165, 97, 235, 163]
	  TreatAsAtomicUnit	  off
	  System {
	    Name		    "NN Controller"
	    Location		    [51, 74, 1027, 726]
	    Open		    off
	    ModelBrowserVisibility  off
	    ModelBrowserWidth	    200
	    ScreenColor		    "white"
	    PaperOrientation	    "landscape"
	    PaperPositionMode	    "auto"
	    PaperType		    "usletter"
	    PaperUnits		    "inches"
	    ZoomFactor		    "100"
	    Block {
	      BlockType		      Inport
	      Name		      "r"
	      Position		      [15, 368, 45, 382]
	    }
	    Block {
	      BlockType		      Inport
	      Name		      "u"
	      Position		      [75, 208, 105, 222]
	      Port		      "2"
	    }
	    Block {
	      BlockType		      Inport
	      Name		      "y"
	      Position		      [25, 63, 55, 77]
	      Port		      "3"
	    }
	    Block {
	      BlockType		      Constant
	      Name		      "Constant2"
	      Position		      [135, 255, 155, 275]
	      Value		      "Normalize"
	    }
	    Block {
	      BlockType		      Constant
	      Name		      "Constant3"
	      Position		      [105, 130, 125, 150]
	      Value		      "Normalize"
	    }
	    Block {
	      BlockType		      Constant
	      Name		      "Constant4"
	      Position		      [985, 255, 1005, 275]
	      Value		      "Normalize"
	    }
	    Block {
	      BlockType		      Constant
	      Name		      "Constant5"
	      Position		      [95, 435, 115, 455]
	      Value		      "Normalize"
	    }
	    Block {
	      BlockType		      Constant
	      Name		      "Constant6"
	      Position		      [475, 455, 505, 475]
	      Value		      "B1_c"
	    }
	    Block {
	      BlockType		      Constant
	      Name		      "Constant7"
	      Position		      [755, 310, 785, 330]
	      Value		      "B2_c"
	    }
	    Block {
	      BlockType		      DiscreteStateSpace
	      Name		      "Discrete State-Space1"
	      Position		      [325, 201, 435, 239]
	      A			      "[zeros(1,max([Nic-1 1]));eye(Nic-2,Nic-"
"1)]"
	      B			      "eye(max([Nic-1 1]),1)"
	      C			      "[zeros(1,max([Nic-1 1]));eye(Nic-1,Nic-"
"1)]"
	      D			      "eye(Nic,1)"
	      SampleTime	      "Ts"
	    }
	    Block {
	      BlockType		      DiscreteStateSpace
	      Name		      "Discrete State-Space2"
	      Position		      [315, 66, 425, 104]
	      A			      "[zeros(1,max([Njc-1 1]));eye(Njc-2,Njc-"
"1)]"
	      B			      "eye(max([Njc-1 1]),1)"
	      C			      "[zeros(1,max([Njc-1 1]));eye(Njc-1,Njc-"
"1)]"
	      D			      "eye(Njc,1)"
	      SampleTime	      "Ts"
	    }
	    Block {
	      BlockType		      DiscreteStateSpace
	      Name		      "Discrete State-Space3"
	      Position		      [275, 366, 385, 404]
	      A			      "[zeros(1,max([Nrc-1 1]));eye(Nrc-2,Nrc-"
"1)]"
	      B			      "eye(max([Nrc-1 1]),1)"
	      C			      "[zeros(1,max([Nrc-1 1]));eye(Nrc-1,Nrc-"
"1)]"
	      D			      "eye(Nrc,1)"
	      SampleTime	      "Ts"
	    }
	    Block {
	      BlockType		      Fcn
	      Name		      "Fcn"
	      Position		      [130, 200, 165, 230]
	      Expr		      "(u(1)-minp)*2/(maxp-minp) - 1"
	    }
	    Block {
	      BlockType		      Fcn
	      Name		      "Fcn1"
	      Position		      [95, 55, 130, 85]
	      Expr		      "(u(1)-mint)*2/(maxt-mint) - 1"
	    }
	    Block {
	      BlockType		      Fcn
	      Name		      "Fcn2"
	      Position		      [925, 150, 960, 180]
	      Expr		      "(maxp-minp)*(u(1)+1)/2 + minp"
	    }
	    Block {
	      BlockType		      Fcn
	      Name		      "Fcn3"
	      Position		      [85, 360, 120, 390]
	      Expr		      "(u(1)-min_r)*2/(max_r-min_r) - 1"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "Matrix\nGain1"
	      Position		      [745, 215, 775, 245]
	      Gain		      "LW_c"
	      Multiplication	      "Matrix(K*u)"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "Matrix\nGain2"
	      Position		      [420, 370, 450, 400]
	      Gain		      "IW_r"
	      Multiplication	      "Matrix(K*u)"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "Matrix\nGain3"
	      Position		      [510, 205, 540, 235]
	      Gain		      "IW_u"
	      Multiplication	      "Matrix(K*u)"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "Matrix\nGain4"
	      Position		      [500, 75, 530, 105]
	      Gain		      "IW_y"
	      Multiplication	      "Matrix(K*u)"
	    }
	    Block {
	      BlockType		      Saturate
	      Name		      "Saturation1"
	      Position		      [1105, 255, 1135, 285]
	      UpperLimit	      "max_i"
	      LowerLimit	      "min_i"
	    }
	    Block {
	      BlockType		      Switch
	      Name		      "Switch"
	      Position		      [200, 255, 230, 285]
	      Threshold		      "0.5"
	    }
	    Block {
	      BlockType		      Switch
	      Name		      "Switch1"
	      Position		      [160, 130, 190, 160]
	      Threshold		      "0.5"
	    }
	    Block {
	      BlockType		      Switch
	      Name		      "Switch2"
	      Position		      [1040, 255, 1070, 285]
	      Threshold		      "0.5"
	    }
	    Block {
	      BlockType		      Switch
	      Name		      "Switch3"
	      Position		      [150, 435, 180, 465]
	      Threshold		      "0.5"
	    }
	    Block {
	      BlockType		      UnitDelay
	      Name		      "Unit Delay1"
	      Position		      [235, 70, 265, 100]
	      SampleTime	      "Ts"
	    }
	    Block {
	      BlockType		      UnitDelay
	      Name		      "Unit Delay5"
	      Position		      [260, 205, 290, 235]
	      SampleTime	      "Ts"
	    }
	    Block {
	      BlockType		      ZeroOrderHold
	      Name		      "Zero-Order\nHold"
	      Position		      [1165, 251, 1200, 289]
	      SampleTime	      "Ts"
	    }
	    Block {
	      BlockType		      SubSystem
	      Name		      "netsum"
	      Ports		      [4, 1]
	      Position		      [605, 194, 630, 261]
	      TreatAsAtomicUnit	      off
	      MaskDisplay	      "disp('+')"
	      MaskIconFrame	      on
	      MaskIconOpaque	      on
	      MaskIconRotate	      "none"
	      MaskIconUnits	      "autoscale"
	      System {
		Name			"netsum"
		Location		[326, 79, 826, 380]
		Open			off
		ModelBrowserVisibility	off
		ModelBrowserWidth	200
		ScreenColor		"white"
		PaperOrientation	"landscape"
		PaperPositionMode	"auto"
		PaperType		"usletter"
		PaperUnits		"inches"
		ZoomFactor		"100"
		Block {
		  BlockType		  Inport
		  Name			  "In1"
		  Position		  [20, 50, 40, 70]
		}
		Block {
		  BlockType		  Inport
		  Name			  "In2"
		  Position		  [20, 90, 40, 110]
		  Port			  "2"
		}
		Block {
		  BlockType		  Inport
		  Name			  "In3"
		  Position		  [25, 135, 45, 155]
		  Port			  "3"
		}
		Block {
		  BlockType		  Inport
		  Name			  "In4"
		  Position		  [25, 190, 45, 210]
		  Port			  "4"
		}
		Block {
		  BlockType		  Sum
		  Name			  "netsum"
		  Ports			  [4, 1]
		  Position		  [90, 57, 115, 118]
		  Inputs		  "4"
		}
		Block {
		  BlockType		  Outport
		  Name			  "Out1"
		  Position		  [145, 80, 165, 100]
		}
		Line {
		  SrcBlock		  "In1"
		  SrcPort		  1
		  DstBlock		  "netsum"
		  DstPort		  1
		}
		Line {
		  SrcBlock		  "In2"
		  SrcPort		  1
		  DstBlock		  "netsum"
		  DstPort		  2
		}
		Line {
		  SrcBlock		  "netsum"
		  SrcPort		  1
		  DstBlock		  "Out1"
		  DstPort		  1
		}
		Line {
		  SrcBlock		  "In3"
		  SrcPort		  1
		  DstBlock		  "netsum"
		  DstPort		  3
		}
		Line {
		  SrcBlock		  "In4"
		  SrcPort		  1
		  Points		  [25, 0]
		  DstBlock		  "netsum"
		  DstPort		  4
		}
	      }
	    }
	    Block {
	      BlockType		      SubSystem
	      Name		      "netsum1"
	      Ports		      [2, 1]
	      Position		      [825, 220, 850, 255]
	      TreatAsAtomicUnit	      off
	      MaskDisplay	      "disp('+')"
	      MaskIconFrame	      on
	      MaskIconOpaque	      on
	      MaskIconRotate	      "none"
	      MaskIconUnits	      "autoscale"
	      System {
		Name			"netsum1"
		Location		[320, 85, 820, 386]
		Open			off
		ModelBrowserVisibility	off
		ModelBrowserWidth	200
		ScreenColor		"white"
		PaperOrientation	"landscape"
		PaperPositionMode	"auto"
		PaperType		"usletter"
		PaperUnits		"inches"
		ZoomFactor		"100"
		Block {
		  BlockType		  Inport
		  Name			  "In1"
		  Position		  [20, 65, 40, 85]
		}
		Block {
		  BlockType		  Inport
		  Name			  "In2"
		  Position		  [20, 105, 40, 125]
		  Port			  "2"
		}
		Block {
		  BlockType		  Sum
		  Name			  "netsum1"
		  Ports			  [2, 1]
		  Position		  [90, 60, 115, 95]
		  Inputs		  "2"
		}
		Block {
		  BlockType		  Outport
		  Name			  "Out1"
		  Position		  [145, 80, 165, 100]
		}
		Line {
		  SrcBlock		  "In1"
		  SrcPort		  1
		  DstBlock		  "netsum1"
		  DstPort		  1
		}
		Line {
		  SrcBlock		  "In2"
		  SrcPort		  1
		  DstBlock		  "netsum1"
		  DstPort		  2
		}
		Line {
		  SrcBlock		  "netsum1"
		  SrcPort		  1
		  DstBlock		  "Out1"
		  DstPort		  1
		}
	      }
	    }
	    Block {
	      BlockType		      SubSystem
	      Name		      "purelin"
	      Ports		      [1, 1]
	      Position		      [865, 228, 890, 252]
	      TreatAsAtomicUnit	      off
	      MaskDisplay	      "plot([-1 1],[0 0],[-1 1],[-1 1])"
	      MaskIconFrame	      on
	      MaskIconOpaque	      on
	      MaskIconRotate	      "none"
	      MaskIconUnits	      "autoscale"
	      System {
		Name			"purelin"
		Location		[144, 218, 404, 300]
		Open			off
		ModelBrowserVisibility	off
		ModelBrowserWidth	200
		ScreenColor		"white"
		PaperOrientation	"landscape"
		PaperPositionMode	"auto"
		PaperType		"usletter"
		PaperUnits		"inches"
		ZoomFactor		"100"
		Block {
		  BlockType		  Inport
		  Name			  "n"
		  Position		  [25, 33, 55, 47]
		}
		Block {
		  BlockType		  Outport
		  Name			  "a"
		  Position		  [205, 33, 235, 47]
		}
		Line {
		  SrcBlock		  "n"
		  SrcPort		  1
		  DstBlock		  "a"
		  DstPort		  1
		}
	      }
	    }
	    Block {
	      BlockType		      SubSystem
	      Name		      "tansig"
	      Ports		      [1, 1]
	      Position		      [655, 218, 680, 242]
	      TreatAsAtomicUnit	      off
	      MaskDisplay	      "plot([-1 1],[0 0],[-1 -.9 -.8 -.7 -.6 -"
".5 -.4 -.3 -.2 -.1 0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1],2./(1+exp(-8*[-1 -.9 -.8 -"
".7 -.6 -.5 -.4 -.3 -.2 -.1 0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1]))-1)"
	      MaskIconFrame	      on
	      MaskIconOpaque	      on
	      MaskIconRotate	      "none"
	      MaskIconUnits	      "autoscale"
	      System {
		Name			"tansig"
		Location		[0, 38, 640, 480]
		Open			off
		ModelBrowserVisibility	off
		ModelBrowserWidth	200
		ScreenColor		"white"
		PaperOrientation	"landscape"
		PaperPositionMode	"auto"
		PaperType		"usletter"
		PaperUnits		"inches"
		ZoomFactor		"100"
		Block {
		  BlockType		  Inport
		  Name			  "n"
		  Position		  [25, 33, 55, 47]
		}
		Block {
		  BlockType		  Math
		  Name			  "Exp"
		  Ports			  [1, 1]
		  Position		  [155, 25, 185, 55]
		  MaskIconFrame		  on
		  MaskIconOpaque	  on
		  MaskIconRotate	  "none"
		  MaskIconUnits		  "autoscale"
		}
		Block {
		  BlockType		  Gain
		  Name			  "Gain"
		  Position		  [90, 25, 120, 55]
		  Gain			  "-2"
		}
		Block {
		  BlockType		  Gain
		  Name			  "Gain1"
		  Position		  [370, 30, 400, 60]
		  Gain			  "2"
		}
		Block {
		  BlockType		  Math
		  Name			  "Reciprocal"
		  Ports			  [1, 1]
		  Position		  [295, 30, 325, 60]
		  Operator		  "reciprocal"
		  MaskIconFrame		  on
		  MaskIconOpaque	  on
		  MaskIconRotate	  "none"
		  MaskIconUnits		  "autoscale"
		}
		Block {
		  BlockType		  Sum
		  Name			  "Sum"
		  Ports			  [2, 1]
		  Position		  [225, 27, 255, 58]
		}
		Block {
		  BlockType		  Sum
		  Name			  "Sum1"
		  Ports			  [2, 1]
		  Position		  [445, 27, 475, 58]
		  Inputs		  "+-"
		}
		Block {
		  BlockType		  Constant
		  Name			  "one"
		  Position		  [160, 85, 180, 105]
		}
		Block {
		  BlockType		  Constant
		  Name			  "one1"
		  Position		  [375, 85, 395, 105]
		}
		Block {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -