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

📄 h_pid_disc.mdl

📁 这是一个电机PID控制的程序
💻 MDL
📖 第 1 页 / 共 4 页
字号:
	      ParameterDataTypeMode   "Inherit via internal rule"
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	      SampleTime	      "Ts"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "Kdd"
	      Position		      [435, 352, 540, 388]
	      Orientation	      "left"
	      Gain		      "Td/(Td+N*Ts)"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	      SampleTime	      "Ts"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "Ki"
	      Position		      [175, 50, 230, 80]
	      Gain		      "1/Ti"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	      SampleTime	      "Ts"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "P"
	      Position		      [165, 115, 195, 145]
	      Gain		      "b"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	      SampleTime	      "Ts"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "P2"
	      Position		      [280, 115, 310, 145]
	      Gain		      "K"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	      SampleTime	      "Ts"
	      Port {
		PortNumber		1
		Name			"P(k)"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    Block {
	      BlockType		      Saturate
	      Name		      "Saturation"
	      Position		      [655, 115, 685, 145]
	      UpperLimit	      "Umax"
	      LowerLimit	      "Umin"
	      SampleTime	      "Ts"
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum1"
	      Ports		      [2, 1]
	      Position		      [75, 150, 95, 170]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "+-"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	      Port {
		PortNumber		1
		Name			"error"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum2"
	      Ports		      [2, 1]
	      Position		      [225, 120, 245, 140]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "|+-"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum3"
	      Ports		      [2, 1]
	      Position		      [215, 295, 235, 315]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "-+"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum4"
	      Ports		      [3, 1]
	      Position		      [450, 120, 470, 140]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "+++"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum5"
	      Ports		      [2, 1]
	      Position		      [420, 295, 440, 315]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "|-+"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	      Port {
		PortNumber		1
		Name			"D(k)"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum6"
	      Ports		      [2, 1]
	      Position		      [610, 30, 630, 50]
	      Orientation	      "left"
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "|+-"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum8"
	      Ports		      [2, 1]
	      Position		      [265, 55, 285, 75]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "++|"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      UnitDelay
	      Name		      "Unit Delay"
	      Position		      [135, 253, 170, 287]
	      SampleTime	      "Ts"
	      Port {
		PortNumber		1
		Name			"y(k-1)"
		PropagatedSignals	"y(k)"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    Block {
	      BlockType		      UnitDelay
	      Name		      "Unit Delay1"
	      Position		      [485, 288, 520, 322]
	      SampleTime	      "Ts"
	      Port {
		PortNumber		1
		Name			"D(k-1)"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "Out1"
	      Position		      [725, 123, 755, 137]
	      IconDisplay	      "Port number"
	      BusOutputAsStruct	      off
	    }
	    Line {
	      SrcBlock		      "Sum8"
	      SrcPort		      1
	      DstBlock		      "Discrete-Time\nIntegrator1"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Ki"
	      SrcPort		      1
	      DstBlock		      "Sum8"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "Anti-Windup Feedback"
	      SrcPort		      1
	      DstBlock		      "Sum8"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Sum6"
	      SrcPort		      1
	      DstBlock		      "Anti-Windup Feedback"
	      DstPort		      1
	    }
	    Line {
	      Name		      "I(k)"
	      Labels		      [-1, 0]
	      SrcBlock		      "Discrete-Time\nIntegrator1"
	      SrcPort		      1
	      Points		      [110, 0]
	      DstBlock		      "Sum4"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Saturation"
	      SrcPort		      1
	      Points		      [0, 0; 15, 0]
	      Branch {
		Points			[0, -90]
		DstBlock		"Sum6"
		DstPort			1
	      }
	      Branch {
		DstBlock		"Out1"
		DstPort			1
	      }
	    }
	    Line {
	      SrcBlock		      "Sum4"
	      SrcPort		      1
	      Points		      [0, 0; 145, 0]
	      Branch {
		DstBlock		"Sum6"
		DstPort			2
	      }
	      Branch {
		DstBlock		"Saturation"
		DstPort			1
	      }
	    }
	    Line {
	      Name		      "P(k)"
	      Labels		      [-1, 1]
	      SrcBlock		      "P2"
	      SrcPort		      1
	      Points		      [0, 0]
	      DstBlock		      "Sum4"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "uc"
	      SrcPort		      1
	      Points		      [0, 0; 25, 0]
	      Branch {
		DstBlock		"Sum1"
		DstPort			1
	      }
	      Branch {
		DstBlock		"P"
		DstPort			1
	      }
	    }
	    Line {
	      SrcBlock		      "P"
	      SrcPort		      1
	      Points		      [10, 0; 0, -5]
	      DstBlock		      "Sum2"
	      DstPort		      1
	    }
	    Line {
	      Name		      "y(k)"
	      Labels		      [0, 0]
	      SrcBlock		      "y"
	      SrcPort		      1
	      Points		      [0, 0; 25, 0]
	      Branch {
		Points			[150, 0]
		DstBlock		"Sum2"
		DstPort			2
	      }
	      Branch {
		DstBlock		"Sum1"
		DstPort			2
	      }
	      Branch {
		Points			[0, 80]
		Branch {
		  Labels		  [1, 0]
		  DstBlock		  "Unit Delay"
		  DstPort		  1
		}
		Branch {
		  Points		  [0, 65; 140, 0]
		  DstBlock		  "Sum3"
		  DstPort		  2
		}
	      }
	    }
	    Line {
	      SrcBlock		      "Sum2"
	      SrcPort		      1
	      DstBlock		      "P2"
	      DstPort		      1
	    }
	    Line {
	      Name		      "error"
	      Labels		      [2, 0]
	      SrcBlock		      "Sum1"
	      SrcPort		      1
	      Points		      [10, 0; 0, -95]
	      DstBlock		      "Ki"
	      DstPort		      1
	    }
	    Line {
	      Name		      "y(k-1)"
	      Labels		      [0, 0]
	      SrcBlock		      "Unit Delay"
	      SrcPort		      1
	      Points		      [50, 0]
	      DstBlock		      "Sum3"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Sum3"
	      SrcPort		      1
	      DstBlock		      "Kd"
	      DstPort		      1
	    }
	    Line {
	      Name		      "D(k)"
	      SrcBlock		      "Sum5"
	      SrcPort		      1
	      Points		      [0, 0; 15, 0]
	      Branch {
		DstBlock		"Unit Delay1"
		DstPort			1
	      }
	      Branch {
		Labels			[-1, 1]
		DstBlock		"Sum4"
		DstPort			3
	      }
	    }
	    Line {
	      Name		      "D(k-1)"
	      Labels		      [0, 0]
	      SrcBlock		      "Unit Delay1"
	      SrcPort		      1
	      Points		      [50, 0; 0, 65]
	      DstBlock		      "Kdd"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Kd"
	      SrcPort		      1
	      Points		      [10, 0; 0, -5]
	      DstBlock		      "Sum5"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Kdd"
	      SrcPort		      1
	      DstBlock		      "Sum5"
	      DstPort		      2
	    }
	    Annotation {
	      Name		      "Derivative approximation"
	      Position		      [283, 364]
	      UseDisplayTextAsClickCallback off
	    }
	  }
	}
	Block {
	  BlockType		  Outport
	  Name			  "U"
	  Position		  [390, 53, 420, 67]
	  IconDisplay		  "Port number"
	  BusOutputAsStruct	  off
	}
	Line {
	  SrcBlock		  "10bit"
	  SrcPort		  1
	  Points		  [60, 0; 0, -20]
	  DstBlock		  "Discrete PID"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "A/D"
	  SrcPort		  1
	  DstBlock		  "Discrete PID"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "y"
	  SrcPort		  1
	  DstBlock		  "10bit"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Uref"
	  SrcPort		  1
	  Points		  [0, 0]
	  DstBlock		  "A/D"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Discrete PID"
	  SrcPort		  1
	  Points		  [0, 0]
	  DstBlock		  "U"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "Mechanics"
      Ports		      [1, 2]
      Position		      [545, 47, 660, 163]
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      MaskHideContents	      off
      Port {
	PortNumber		2
	Name			"dth_m_tacho"
	RTWStorageClass		"Auto"
	DataLoggingNameMode	"SignalName"
      }
      System {
	Name			"Mechanics"
	Location		[286, 462, 916, 887]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"A4"
	PaperUnits		"centimeters"
	TiledPaperMargins	[0.500000, 0.500000, 0.500000, 0.500000]
	TiledPageScale		1
	ShowPageBoundaries	off
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "In1"
	  Position		  [25, 33, 55, 47]
	  IconDisplay		  "Port number"
	}
	Block {
	  BlockType		  Reference
	  Name			  "DC-Tacho"
	  Ports			  [2, 1]
	  Position		  [430, 25, 510, 85]
	  BackgroundColor	  "lightBlue"
	  DropShadow		  on
	  SourceBlock		  "dc_motor_lib/DC-Tacho"
	  SourceType		  ""
	  ShowPortLabels	  on
	  SystemSampleTime	  "-1"
	  FunctionWithSeparateData off
	  RTWMemSecFuncInitTerm	  "Inherit from model"
	  RTWMemSecFuncExecute	  "Inherit from model"
	  RTWMemSecDataConstants  "Inherit from model"
	  RTWMemSecDataInternal	  "Inherit from model"
	  RTWMemSecDataParameters "Inherit from model"
	  dth_gain		  "0.005"
	  th_gain		  "pi*0.0229"
	  rel_dth_gain		  "1/486.25"
	}
	Block {
	  BlockType		  SubSystem
	  Name			  "Load"
	  Ports			  [2, 3]
	  Position		  [160, 223, 240, 297]
	  Orientation		  "left"
	  MinAlgLoopOccurrences	  off
	  RTWSystemCode		  "Auto"
	  FunctionWithSeparateData off
	  MaskHideContents	  off
	  Port {
	    PortNumber		    2
	    Name		    "dth_l"
	    PropagatedSignals	    "dth_l"
	    RTWStorageClass	    "Auto"
	    DataLoggingNameMode	    "SignalName"
	  }
	  Port {
	    PortNumber		    3
	    Name		    "th_l"
	    PropagatedSignals	    "th_l"
	    RTWStorageClass	    "Auto"
	    DataLoggingNameMode	    "SignalName"
	  }
	  System {
	    Name		    "Load"
	    Location		    [270, 486, 821, 824]
	    Open		    off
	    ModelBrowserVisibility  off
	    ModelBrowserWidth	    200
	    ScreenColor		    "white"
	    PaperOrientation	    "landscape"
	    PaperPositionMode	    "auto"
	    PaperType		    "A4"
	    PaperUnits		    "centimeters"
	    TiledPaperMargins	    [0.500000, 0.500000, 0.500000, 0.500000]
	    TiledPageScale	    1
	    ShowPageBoundaries	    off
	    ZoomFactor		    "100"
	    Block {
	      BlockType		      Inport
	      Name		      "dth_m"
	      Position		      [260, 25, 290, 40]
	      Orientation	      "down"
	      IconDisplay	      "Port number"
	    }
	    Block {
	      BlockType		      Inport
	      Name		      "th_m"
	      Position		      [350, 105, 380, 120]
	      Orientation	      "down"
	      Port		      "2"
	      IconDisplay	      "Port number"
	    }
	    Block {
	      BlockType		      Integrator
	      Name		      "Integrator3"
	      Ports		      [1, 1]
	      Position		      [210, 165, 240, 195]
	      IgnoreLimit	      off
	      Port {
		PortNumber		1
		Name			"dth_l"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    Block {
	      BlockType		      Integrator
	      Name		      "Integrator4"
	      Ports		      [1, 1]
	      Position		      [300, 165, 330, 195]
	      IgnoreLimit	      off
	      Port {
		PortNumber		1
		Name			"th_l"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"

⌨️ 快捷键说明

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