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

📄 a_ss_controller.mdl

📁 这是一个电机PID控制的程序
💻 MDL
📖 第 1 页 / 共 4 页
字号:
      OutDataTypeMode	      "Same as first input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Zero"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Saturate
      UpperLimit	      "0.5"
      LowerLimit	      "-0.5"
      LinearizeAsGain	      on
      ZeroCross		      on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Scope
      ModelBased	      off
      TickLabels	      "OneTimeTick"
      ZoomMode		      "on"
      Grid		      "on"
      TimeRange		      "auto"
      YMin		      "-5"
      YMax		      "5"
      SaveToWorkspace	      off
      SaveName		      "ScopeData"
      LimitDataPoints	      on
      MaxDataPoints	      "5000"
      Decimation	      "1"
      SampleInput	      off
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Step
      Time		      "1"
      Before		      "0"
      After		      "1"
      SampleTime	      "-1"
      VectorParams1D	      on
      ZeroCross		      on
    }
    Block {
      BlockType		      SubSystem
      ShowPortLabels	      on
      Permissions	      "ReadWrite"
      PermitHierarchicalResolution "All"
      TreatAsAtomicUnit	      off
      SystemSampleTime	      "-1"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      RTWMemSecFuncInitTerm   "Inherit from model"
      RTWMemSecFuncExecute    "Inherit from model"
      RTWMemSecDataConstants  "Inherit from model"
      RTWMemSecDataInternal   "Inherit from model"
      RTWMemSecDataParameters "Inherit from model"
      SimViewingDevice	      off
      DataTypeOverride	      "UseLocalSettings"
      MinMaxOverflowLogging   "UseLocalSettings"
    }
    Block {
      BlockType		      Sum
      IconShape		      "rectangular"
      Inputs		      "++"
      InputSameDT	      on
      OutDataTypeMode	      "Same as first input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Terminator
    }
  }
  AnnotationDefaults {
    HorizontalAlignment	    "center"
    VerticalAlignment	    "middle"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    FontName		    "Arial"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  LineDefaults {
    FontName		    "Arial"
    FontSize		    9
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  System {
    Name		    "a_ss_controller"
    Location		    [433, 82, 1220, 352]
    Open		    on
    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"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      SubSystem
      Name		      "Amplifier"
      Ports		      [3, 1]
      Position		      [335, 61, 405, 149]
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      MaskHideContents	      off
      System {
	Name			"Amplifier"
	Location		[565, 553, 1183, 870]
	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			  "Uref"
	  Position		  [25, 88, 55, 102]
	  IconDisplay		  "Port number"
	}
	Block {
	  BlockType		  Inport
	  Name			  "Im"
	  Position		  [25, 223, 55, 237]
	  Port			  "2"
	  IconDisplay		  "Port number"
	}
	Block {
	  BlockType		  Inport
	  Name			  "Back_emf"
	  Position		  [30, 258, 60, 272]
	  Port			  "3"
	  IconDisplay		  "Port number"
	}
	Block {
	  BlockType		  Gain
	  Name			  "AmpGain"
	  Position		  [225, 80, 280, 110]
	  Gain			  "200"
	  ParameterDataTypeMode	  "Inherit via internal rule"
	  OutDataTypeMode	  "Inherit via internal rule"
	  SaturateOnIntegerOverflow off
	  Port {
	    PortNumber		    1
	    Name		    "voltage"
	    RTWStorageClass	    "Auto"
	    DataLoggingNameMode	    "SignalName"
	  }
	}
	Block {
	  BlockType		  Saturate
	  Name			  "Saturation"
	  Position		  [435, 80, 465, 110]
	  UpperLimit		  "12"
	  LowerLimit		  "-12"
	}
	Block {
	  BlockType		  Sum
	  Name			  "Sum"
	  Ports			  [2, 1]
	  Position		  [165, 85, 185, 105]
	  ShowName		  off
	  IconShape		  "round"
	  Inputs		  "|+-"
	  InputSameDT		  off
	  OutDataTypeMode	  "Inherit via internal rule"
	  SaturateOnIntegerOverflow off
	  Port {
	    PortNumber		    1
	    Name		    "Ierr"
	    RTWStorageClass	    "Auto"
	    DataLoggingNameMode	    "SignalName"
	  }
	}
	Block {
	  BlockType		  Sum
	  Name			  "Sum1"
	  Ports			  [2, 1]
	  Position		  [365, 85, 385, 105]
	  ShowName		  off
	  IconShape		  "round"
	  Inputs		  "|+-"
	  InputSameDT		  off
	  OutDataTypeMode	  "Inherit via internal rule"
	  SaturateOnIntegerOverflow off
	}
	Block {
	  BlockType		  Gain
	  Name			  "Uref->Iref"
	  Position		  [95, 80, 125, 110]
	  ParameterDataTypeMode	  "Inherit via internal rule"
	  OutDataTypeMode	  "Inherit via internal rule"
	  SaturateOnIntegerOverflow off
	}
	Block {
	  BlockType		  Outport
	  Name			  "Vamp"
	  Position		  [515, 88, 545, 102]
	  IconDisplay		  "Port number"
	  BusOutputAsStruct	  off
	}
	Line {
	  SrcBlock		  "Uref"
	  SrcPort		  1
	  Points		  [0, 0]
	  DstBlock		  "Uref->Iref"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Saturation"
	  SrcPort		  1
	  Points		  [0, 0]
	  DstBlock		  "Vamp"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Uref->Iref"
	  SrcPort		  1
	  DstBlock		  "Sum"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Im"
	  SrcPort		  1
	  Points		  [115, 0]
	  DstBlock		  "Sum"
	  DstPort		  2
	}
	Line {
	  Name			  "Ierr"
	  Labels		  [0, 0]
	  SrcBlock		  "Sum"
	  SrcPort		  1
	  DstBlock		  "AmpGain"
	  DstPort		  1
	}
	Line {
	  Name			  "voltage"
	  Labels		  [0, 0]
	  SrcBlock		  "AmpGain"
	  SrcPort		  1
	  DstBlock		  "Sum1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Back_emf"
	  SrcPort		  1
	  Points		  [310, 0]
	  DstBlock		  "Sum1"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "Sum1"
	  SrcPort		  1
	  DstBlock		  "Saturation"
	  DstPort		  1
	}
	Annotation {
	  Name			  "Uref is the disired current, expressed as a"
" voltage\nfrom D/As. The gain gives it the corresponding current value. "
	  Position		  [164, 52]
	  UseDisplayTextAsClickCallback	off
	}
      }
    }
    Block {
      BlockType		      Demux
      Name		      "Demux"
      Ports		      [1, 4]
      Position		      [660, 146, 665, 184]
      BackgroundColor	      "black"
      ShowName		      off
      DisplayOption	      "bar"
    }
    Block {
      BlockType		      Gain
      Name		      "Kstat"
      Position		      [110, 57, 170, 93]
      Gain		      "Kstat"
      ParameterDataTypeMode   "Inherit via internal rule"
      OutDataTypeMode	      "Inherit via internal rule"
      SaturateOnIntegerOverflow	off
      SampleTime	      "Ts"
    }
    Block {
      BlockType		      Gain
      Name		      "L"
      Position		      [197, 135, 263, 200]
      Orientation	      "up"
      Gain		      "L1"
      Multiplication	      "Matrix(K*u) (u vector)"
      ParameterDataTypeMode   "Inherit via internal rule"
      OutDataTypeMode	      "Inherit via internal rule"
      SaturateOnIntegerOverflow	off
      SampleTime	      "Ts"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Mechanics"
      Ports		      [1, 3]
      Position		      [470, 57, 555, 153]
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      MaskHideContents	      off
      System {
	Name			"Mechanics"
	Location		[505, 98, 1120, 605]
	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			  "Vin"
	  Position		  [25, 48, 55, 62]
	  IconDisplay		  "Port number"
	}
	Block {
	  BlockType		  SubSystem
	  Name			  "Load"
	  Ports			  [2, 3]
	  Position		  [145, 298, 225, 372]
	  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		    [480, 439, 1031, 777]
	    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"
	      }
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "Load\ndamping"
	      Position		      [175, 233, 255, 267]
	      Orientation	      "left"
	      Gain		      "bl"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "Rotor inertia1"
	      Position		      [115, 164, 160, 196]
	      Gain		      "1/Jl"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	      Port {
		PortNumber		1
		Name			"ddth_l"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "Spring \nconstant"
	      Position		      [415, 135, 445, 165]
	      Gain		      "Ks"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	      Port {
		PortNumber		1
		Name			"torque_k"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "Spring \ndamping"
	      Position		      [305, 70, 335, 100]
	      Gain		      "b"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	      Port {
		PortNumber		1
		Name			"torque_b"
		RTWStorageClass		"Auto"
		DataLoggingNameMode	"SignalName"
	      }
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum2"
	      Ports		      [2, 1]
	      Position		      [265, 75, 285, 95]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "+-"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum4"
	      Ports		      [2, 1]
	      Position		      [355, 140, 375, 160]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "+-"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum5"
	      Ports		      [2, 1]
	      Position		      [490, 105, 510, 125]
	      ShowName		      off
	      IconShape		      "round"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum6"
	      Ports		      [2, 1]
	      Position		      [70, 170, 90, 190]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "|+-"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "c_torque"
	      Position		      [45, 118, 75, 132]
	      IconDisplay	      "Port number"
	      BusOutputAsStruct	      off
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "dth_l"
	      Position		      [295, 243, 325, 257]
	      Port		      "2"
	      IconDisplay	      "Port number"
	      BusOutputAsStruct	      off
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "th_l"
	      Position		      [480, 173, 510, 187]
	      Port		      "3"
	      IconDisplay	      "Port number"
	      BusOutputAsStruct	      off
	    }
	    Line {
	      SrcBlock		      "th_m"
	      SrcPort		      1

⌨️ 快捷键说明

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