bldc.mdl

来自「基于MATLBA的无刷直流电机仿真」· MDL 代码 · 共 2,157 行 · 第 1/5 页

MDL
2,157
字号
	  DstBlock		  "Three-phase Inverter"
	  DstPort		  1
	}
	Line {
	  Name			  "<Rotor speed wm (rad/s)>"
	  Labels		  [0, 0]
	  SrcBlock		  "Bus\nSelector"
	  SrcPort		  1
	  Points		  [-495, 0]
	  DstBlock		  "Speed Controller"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Rate Transition"
	  SrcPort		  1
	  DstBlock		  "Permanent Magnet\nSynchronous Machine"
	  DstPort		  1
	}
	Annotation {
	  Name			  "(trapezoidal back-EMF)"
	  Position		  [689, 376]
	}
	Annotation {
	  Name			  "Three-phase\ndiode rectifier "
	  Position		  [126, 224]
	  FontName		  "Arial"
	  FontSize		  12
	}
      }
    }
    Block {
      BlockType		      Terminator
      Name		      "Terminator"
      Position		      [400, 140, 420, 160]
      ShowName		      off
    }
    Block {
      BlockType		      Reference
      Name		      "Torque"
      Ports		      [0, 1]
      Position		      [110, 71, 155, 89]
      DialogController	      "POWERSYS.PowerSysDialog"
      SourceBlock	      "powerlib_extras/Control \nBlocks/Timer"
      SourceType	      "Timer"
      ShowPortLabels	      "FromPortIcon"
      SystemSampleTime	      "-1"
      FunctionWithSeparateData off
      RTWMemSecFuncInitTerm   "Inherit from model"
      RTWMemSecFuncExecute    "Inherit from model"
      RTWMemSecDataConstants  "Inherit from model"
      RTWMemSecDataInternal   "Inherit from model"
      RTWMemSecDataParameters "Inherit from model"
      t			      "[0.5 1.5]"
      e			      "[11 -11]"
    }
    Block {
      BlockType		      SubSystem
      Name		      "demux"
      Ports		      [3, 4]
      Position		      [435, 47, 505, 133]
      FontName		      "Arial"
      FontSize		      12
      MinAlgLoopOccurrences   off
      PropExecContextOutsideSubsystem off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      Opaque		      off
      RequestExecContextInheritance off
      MaskHideContents	      off
      Port {
	PortNumber		1
	Name			"Stator current"
	PropagatedSignals	"Stator current is_a (A)"
	RTWStorageClass		"Auto"
	DataLoggingNameMode	"SignalName"
      }
      Port {
	PortNumber		2
	Name			"Rotor speed"
	PropagatedSignals	", Reference"
	RTWStorageClass		"Auto"
	DataLoggingNameMode	"SignalName"
      }
      Port {
	PortNumber		3
	Name			"Electromagnetic Torque"
	PropagatedSignals	"Electromagnetic torque Te (N*m), Torque reference (Nm)"
	RTWStorageClass		"Auto"
	DataLoggingNameMode	"SignalName"
      }
      Port {
	PortNumber		4
	Name			"DC bus voltage"
	PropagatedSignals	"V bus (V)"
	RTWStorageClass		"Auto"
	DataLoggingNameMode	"SignalName"
      }
      System {
	Name			"demux"
	Location		[345, 197, 822, 474]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"usletter"
	PaperUnits		"inches"
	TiledPaperMargins	[0.500000, 0.500000, 0.500000, 0.500000]
	TiledPageScale		1
	ShowPageBoundaries	off
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "motor"
	  Position		  [20, 78, 50, 92]
	  IconDisplay		  "Port number"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	}
	Block {
	  BlockType		  Inport
	  Name			  "Conv."
	  Position		  [25, 163, 55, 177]
	  Port			  "2"
	  IconDisplay		  "Port number"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	}
	Block {
	  BlockType		  Inport
	  Name			  "Ctrl"
	  Position		  [25, 223, 55, 237]
	  Port			  "3"
	  IconDisplay		  "Port number"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	}
	Block {
	  BlockType		  BusSelector
	  Name			  "Bus\nSelector"
	  Ports			  [1, 3]
	  Position		  [85, 27, 90, 143]
	  ShowName		  off
	  OutputSignals		  "Stator current is_a (A),Rotor speed wm (rad/s),Electromagnetic torque Te (N*m)"
	  Port {
	    PortNumber		    1
	    Name		    "<Stator current is_a (A)>"
	    RTWStorageClass	    "Auto"
	    DataLoggingNameMode	    "SignalName"
	  }
	  Port {
	    PortNumber		    2
	    Name		    "<Rotor speed wm (rad/s)>"
	    RTWStorageClass	    "Auto"
	    DataLoggingNameMode	    "SignalName"
	  }
	  Port {
	    PortNumber		    3
	    Name		    "<Electromagnetic torque Te (N*m)>"
	    RTWStorageClass	    "Auto"
	    DataLoggingNameMode	    "SignalName"
	  }
	}
	Block {
	  BlockType		  BusSelector
	  Name			  "Bus\nSelector1"
	  Ports			  [1, 2]
	  Position		  [85, 202, 90, 253]
	  ShowName		  off
	  OutputSignals		  "Torque reference (Nm),Reference"
	  Port {
	    PortNumber		    1
	    Name		    "<Torque reference (Nm)>"
	    RTWStorageClass	    "Auto"
	    DataLoggingNameMode	    "SignalName"
	  }
	  Port {
	    PortNumber		    2
	    Name		    "<Reference>"
	    RTWStorageClass	    "Auto"
	    DataLoggingNameMode	    "SignalName"
	  }
	}
	Block {
	  BlockType		  BusSelector
	  Name			  "Bus\nSelector2"
	  Ports			  [1, 1]
	  Position		  [85, 156, 90, 184]
	  ShowName		  off
	  OutputSignals		  "V bus (V)"
	  Port {
	    PortNumber		    1
	    Name		    "<V bus (V)>"
	    RTWStorageClass	    "Auto"
	    DataLoggingNameMode	    "SignalName"
	  }
	}
	Block {
	  BlockType		  Gain
	  Name			  "Gain"
	  Position		  [240, 70, 270, 100]
	  ShowName		  off
	  Gain			  "30/pi"
	  ParameterDataType	  "sfix(16)"
	  ParameterScaling	  "2^0"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux"
	  Ports			  [2, 1]
	  Position		  [385, 76, 390, 114]
	  ShowName		  off
	  Inputs		  "2"
	  DisplayOption		  "bar"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux1"
	  Ports			  [2, 1]
	  Position		  [335, 116, 340, 154]
	  ShowName		  off
	  Inputs		  "2"
	  DisplayOption		  "bar"
	}
	Block {
	  BlockType		  Outport
	  Name			  "i_a"
	  Position		  [280, 38, 310, 52]
	  IconDisplay		  "Port number"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	}
	Block {
	  BlockType		  Outport
	  Name			  "speed"
	  Position		  [425, 88, 455, 102]
	  NamePlacement		  "alternate"
	  Port			  "2"
	  IconDisplay		  "Port number"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Tem"
	  Position		  [425, 128, 455, 142]
	  Port			  "3"
	  IconDisplay		  "Port number"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	}
	Block {
	  BlockType		  Outport
	  Name			  "v_dc"
	  Position		  [425, 163, 455, 177]
	  Port			  "4"
	  IconDisplay		  "Port number"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	}
	Line {
	  Name			  "<Rotor speed wm (rad/s)>"
	  Labels		  [0, 0]
	  SrcBlock		  "Bus\nSelector"
	  SrcPort		  2
	  DstBlock		  "Gain"
	  DstPort		  1
	}
	Line {
	  Name			  "<V bus (V)>"
	  Labels		  [0, 0]
	  SrcBlock		  "Bus\nSelector2"
	  SrcPort		  1
	  DstBlock		  "v_dc"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Conv."
	  SrcPort		  1
	  DstBlock		  "Bus\nSelector2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Ctrl"
	  SrcPort		  1
	  DstBlock		  "Bus\nSelector1"
	  DstPort		  1
	}
	Line {
	  Name			  "<Torque reference (Nm)>"
	  Labels		  [0, 0]
	  SrcBlock		  "Bus\nSelector1"
	  SrcPort		  1
	  Points		  [225, 0]
	  DstBlock		  "Mux1"
	  DstPort		  2
	}
	Line {
	  Name			  "<Reference>"
	  Labels		  [0, 0]
	  SrcBlock		  "Bus\nSelector1"
	  SrcPort		  2
	  Points		  [255, 0; 0, -135]
	  DstBlock		  "Mux"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "Gain"
	  SrcPort		  1
	  DstBlock		  "Mux"
	  DstPort		  1
	}
	Line {
	  Name			  "<Stator current is_a (A)>"
	  Labels		  [0, 1]
	  SrcBlock		  "Bus\nSelector"
	  SrcPort		  1
	  DstBlock		  "i_a"
	  DstPort		  1
	}
	Line {
	  Name			  "<Electromagnetic torque Te (N*m)>"
	  Labels		  [0, 0]
	  SrcBlock		  "Bus\nSelector"
	  SrcPort		  3
	  DstBlock		  "Mux1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux1"
	  SrcPort		  1
	  DstBlock		  "Tem"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux"
	  SrcPort		  1
	  DstBlock		  "speed"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "motor"
	  SrcPort		  1
	  DstBlock		  "Bus\nSelector"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      SubSystem
      Name		      "powergui"
      Ports		      []
      Position		      [60, 270, 138, 304]
      AncestorBlock	      "powerlib/powergui"
      CopyFcn		      "powergui( 'Copy_Callback' , gcb , 0 , [ ] );"
      DeleteFcn		      "powergui( 'Copy_Callback' , gcb , 1 , [ ] );         \npowergui( 'CloseButton_Callback' , gcb , [ ] , [ ] );\n                                                     "
      ModelCloseFcn	      "powergui( 'CloseButton_Callback' , gcb , [ ] , [ ] );"
      PreSaveFcn	      "powergui( 'PreSaveFcn_Callback' , gcb , [ ] , [ ] ); \npowergui( 'CloseButton_Callback' , gcb , [ ] , [ ] );"
      InitFcn		      "powergui( 'InitFcn_Callback' , gcb , 0 , [ ] );"
      NameChangeFcn	      "powergui( 'NameChangeFcn_Callback' , gcb , 0 , [ ] );"
      OpenFcn		      "powergui(gcb,1)"
      FontSize		      11
      MinAlgLoopOccurrences   off
      PropExecContextOutsideSubsystem off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      Opaque		      off
      RequestExecContextInheritance off
      MaskHideContents	      off
      MaskType		      "PSB option menu block"
      MaskDescription	      "Provides the simulation environment for a connected SimPowerSystems block diagram. When the hook port option is used, each separate diagram requires exactly one connected Powergui Environment block.\n\nTo access the Powergui Graphical Interface tools for this model, type:  \n>>powergui\n"
      MaskHelp		      "web(psbhelp)"
      MaskPromptString	      "Simulation type:  |Sample time (s):|Phasor frequency (Hz):|Implement switching devices as ideal switches|Switch tolerance|Interpolate|Initial electrical states:     |Display SimPowerSystems warnings and infos messages|Add a hook port to the powergui block|Display internal function messages|Use TLC file when in Accelerator Simulation Mode and for RTW applications|Restore disabled links of SimPowerSystems blocks|Load flow frequency (Hz):|Frequency Range|Log impedance|log Frequency|grid|Save Data To Workspace|Variable Name|Structure Name (PSBFFTSCOPE)|ZoomFFT (PSBFFTSCOPE)|Start Time (PSBFFTSCOPE)|Cycles (PSBFFTSCOPE)|Display style (PSBFFTSCOPE)|Fundamental (PSBFFTSCOPE)|Frequency Axis (PSBFFTSCOPE)|Max Frequency (PSBFFTSCOPE)|Frequency indice (STEADYSTATE)|RMS display (STEADYSTATE)|Display Results|Old Ts setting (OBSOLETE)|Phasor simulation (OBSOLETE)"
      MaskStyleString	      "popup(Continuous|Discrete|Phasor),edit,edit,checkbox,edit,checkbox,popup(blocks|steady|zero),checkbox,checkbox,checkbox,checkbox,popup(yes|warning|no),edit,edit,checkbox,checkbox,checkbox,checkbox,edit,edit,checkbox,edit,edit,edit,edit,checkbox,edit,edit,edit,checkbox,edit,checkbox"
      MaskTunableValueString  "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on"
      MaskCallbackString      "powergui('SimulationType',[],[],gcb);|||powergui('SPID',[],[],gcb);|||||powergui('HookPort',[],[],gcb);|||||||||||||||||||||||"
      MaskEnableString	      "on,on,off,off,off,off,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,off"
      MaskVisibilityString    "on,on,on,on,on,off,on,on,on,on,on,on,off,off,off,off,off,off,off,off,off,off,off,off,off,off,off,off,off,off,off,off"
      MaskToolTipString	      "on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on,on"
      MaskVarAliasString      ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"
      MaskVariables	      "SimulationMode=@1;SampleTime=&2;frequency=@3;SPID=@4;SwTol=@5;Interpol=@6;x0status=@7;echomessages=@8;HookPort=@9;FunctionMessages=@10;EnableUseOfTLC=@11;RestoreLinks=&12;frequencyindice=@13;Frange=@14;Ylog=@15;Xlog=@16;ShowGrid=@17;save=@18;variable=&19;structure=&20;ZoomFFT=@21;StartTime=@22;cycles=@23;DisplayStyle=&24;fundamental=@25;FreqAxis=@26;MaxFrequency=@27;frequencyindicesteady=@28;RmsSteady=@29;display=@30;Ts=@31;methode=@32;"
      MaskInitialization      "message = powergui('MaskInitialization',gcb,SimulationMode,SampleTime);"
      MaskDisplay	      "disp(message)"
      MaskSelfModifiable      on
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "Discrete|Ts|60|off|0|off|blocks|off|off|off|off|warning|60|[0:2:500]|off|on|off|off|ZData||on|0.0|1|1|60|off|1000|1|1|off|0|off"
      MaskTabNameString	      "Solver,Solver,Solver,Solver,Solver,Solver,Solver,Preferences,Preferences,Preferences,Preferences,Preferences,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Tools,Solver,Solver"
      System {
	Name			"powergui"
	Location		[137, 405, 682, 583]
	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		  SubSystem
	  Name			  "EquivalentModel1"
	  Ports			  []
	  Position		  [15, 70, 143, 105]
	  FontName		  "Arial"
	  MinAlgLoopOccurrences	  off
	  PropExecContextOutsideSubsystem off
	  RTWSystemCode		  "Auto"
	  FunctionWithSeparateData off
	  Opaque		  off
	  RequestExecContextInheritance	off
	  MaskHideContents	  off
	  MaskInitialization	  "SPS = get_param(gcbh,'UserData');\nif isempty(SPS)\n	Ts=1;\n    A=0;\n    B=0;\n    C=0;\n    D=0;\n    x0=0;\n    SwitchResistance=1;\n    SwitchType=1;\n    SwitchGateInitialValue=1;\n    OutputsToResetToZero=1;\n    NoErrorOnMaxIteration=1;\nelse\n	Ts=SPS.PowerguiInfo.Ts;\n	A=SPS.Adiscrete;\n    B=SPS.Bdiscrete;\n    C=SPS.Cdiscrete;\n    D=SPS.Ddiscrete;\n    x0=SPS.x0discrete;\n    SwitchResistance=SPS.SwitchResistance;\n    SwitchType=SPS.SwitchType;\n    SwitchGateInitialValue=SPS.SwitchGateInitialValue;\n    OutputsToResetToZero=SPS.YSwitchCurrent;\n    NoErrorOnMaxIteration=SPS.NoErrorOnMaxIteration;\nend"
	  MaskDisplay		  "color('orange')\ndisp('EQUIVALENT CIRCUIT')"
	  MaskIconFrame		  on
	  MaskIconOpaque	  on
	  MaskIconRotate	  "none"
	  MaskIconUnits		  "autoscale"
	  System {
	    Name		 

⌨️ 快捷键说明

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