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

📄 g_pid_disc.mdl

📁 这是一个电机PID控制的程序
💻 MDL
📖 第 1 页 / 共 2 页
字号:
	      IncludeERTFirstTime     on
	      ERTFirstTimeCompliant   on
	      IncludeFileDelimiter    "Auto"
	      ERTCustomFileBanners    on
	      SupportAbsoluteTime     off
	      LogVarNameModifier      "rt_"
	      MatFileLogging	      off
	      MultiInstanceERTCode    off
	      SupportNonFinite	      off
	      SupportComplex	      off
	      PurelyIntegerCode	      off
	      SupportContinuousTime   off
	      SupportNonInlinedSFcns  off
	      GenerateErtSFunction    off
	      GenerateASAP2	      off
	      ExtMode		      off
	      ExtModeTransport	      0
	      ExtModeStaticAlloc      off
	      ExtModeStaticAllocSize  1000000
	      ExtModeTesting	      off
	      ExtModeMexFile	      "ext_comm"
	      InlinedParameterPlacement	"NonHierarchical"
	      TargetOS		      "BareBoardExample"
	      MultiInstanceErrorCode  "Error"
	      RateGroupingCode	      on
	      RootIOFormat	      "Individual arguments"
	      RTWCAPISignals	      off
	      RTWCAPIParams	      off
	      RTWCAPIStates	      off
	      ERTSrcFileBannerTemplate "ert_code_template.cgt"
	      ERTHdrFileBannerTemplate "ert_code_template.cgt"
	      ERTDataSrcFileTemplate  "ert_code_template.cgt"
	      ERTDataHdrFileTemplate  "ert_code_template.cgt"
	      ERTCustomFileTemplate   "example_file_process.tlc"
	      InitialValueSource      "Model"
	      ModuleNamingRule	      "Unspecified"
	      SignalDisplayLevel      10
	      ParamTuneLevel	      10
	      GlobalDataDefinition    "Auto"
	      DataDefinitionFile      "global.c"
	      GlobalDataReference     "Auto"
	      DataReferenceFile	      "global.h"
	      GRTInterface	      off
	      EnableUserReplacementTypes off
	      Array {
		Type			"Struct"
		Dimension		1
		MATStruct {
		  double		  ""
		  single		  ""
		  int32			  ""
		  int16			  ""
		  int8			  ""
		  uint32		  ""
		  uint16		  ""
		  uint8			  ""
		  boolean		  ""
		  int			  ""
		  uint			  ""
		  char			  ""
		}
		PropName		"ReplacementTypes"
	      }
	      MemSecPackage	      "--- None ---"
	      MemSecDataConstants     "Default"
	      MemSecDataIO	      "Default"
	      MemSecDataInternal      "Default"
	      MemSecDataParameters    "Default"
	      MemSecFuncInitTerm      "Default"
	      MemSecFuncExecute	      "Default"
	    }
	    PropName		    "Components"
	  }
	}
	PropName		"Components"
      }
      Name		      "Configuration"
      SimulationMode	      "normal"
      CurrentDlgPage	      "Real-Time Workshop/Interface"
    }
    PropName		    "ConfigurationSets"
  }
  Simulink.ConfigSet {
    $PropName		    "ActiveConfigurationSet"
    $ObjectID		    1
  }
  BlockDefaults {
    Orientation		    "right"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    NamePlacement	    "normal"
    FontName		    "Arial"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
    ShowName		    on
  }
  BlockParameterDefaults {
    Block {
      BlockType		      DiscreteIntegrator
      IntegratorMethod	      "Integration: Forward Euler"
      gainval		      "1.0"
      ExternalReset	      "none"
      InitialConditionSource  "internal"
      InitialCondition	      "0"
      InitialConditionMode    "State and output"
      SampleTime	      "1"
      OutDataTypeMode	      "Inherit via internal rule"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	off
      LimitOutput	      off
      UpperSaturationLimit    "inf"
      LowerSaturationLimit    "-inf"
      ShowSaturationPort      off
      ShowStatePort	      off
      IgnoreLimit	      off
      StateMustResolveToSignalObject off
      RTWStateStorageClass    "Auto"
    }
    Block {
      BlockType		      Gain
      Gain		      "1"
      Multiplication	      "Element-wise(K.*u)"
      ParameterDataTypeMode   "Same as input"
      ParameterDataType	      "sfix(16)"
      ParameterScalingMode    "Best Precision: Matrix-wise"
      ParameterScaling	      "2^0"
      OutDataTypeMode	      "Same as input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Inport
      Port		      "1"
      UseBusObject	      off
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      SampleTime	      "-1"
      DataType		      "auto"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      SignalType	      "auto"
      SamplingMode	      "auto"
      LatchByDelayingOutsideSignal off
      LatchByCopyingInsideSignal off
      Interpolate	      on
    }
    Block {
      BlockType		      Outport
      Port		      "1"
      UseBusObject	      off
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      SampleTime	      "-1"
      DataType		      "auto"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      SignalType	      "auto"
      SamplingMode	      "auto"
      OutputWhenDisabled      "held"
      InitialOutput	      "[]"
    }
    Block {
      BlockType		      Saturate
      UpperLimit	      "0.5"
      LowerLimit	      "-0.5"
      LinearizeAsGain	      on
      ZeroCross		      on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      "S-Function"
      FunctionName	      "system"
      SFunctionModules	      "''"
      PortCounts	      "[]"
    }
    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		      UnitDelay
      X0		      "0"
      SampleTime	      "1"
      StateMustResolveToSignalObject off
      RTWStateStorageClass    "Auto"
    }
  }
  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		    "g_pid_disc"
    Location		    [81, 124, 771, 358]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
    ScreenColor		    "lightBlue"
    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		      Reference
      Name		      "Discrete PID"
      Ports		      [2, 1]
      Position		      [295, 39, 400, 161]
      SourceBlock	      "dc_motor_lib/Controllers/Discrete PID"
      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"
      K			      "0.1"
      b			      "0.7"
      Ti		      "0.01"
      Td		      "1e-5"
      N			      "4"
      Tt		      "0.005"
      Umax		      "12"
      Umin		      "-12"
      Ts		      "Ts"
    }
    Block {
      BlockType		      Gain
      Name		      "Gain"
      Position		      [165, 139, 210, 171]
      Gain		      "200"
      ParameterDataTypeMode   "Inherit via internal rule"
      OutDataTypeMode	      "Inherit via internal rule"
      SaturateOnIntegerOverflow	off
    }
    Block {
      BlockType		      Reference
      Name		      "MM-16-AT "
      Ports		      [0, 1]
      Position		      [15, 42, 120, 98]
      SourceBlock	      "xpcdiamondlib/A//D/MM-16-AT "
      SourceType	      "addiamondmm16at"
      firstChan		      "1"
      numChans		      "1"
      range		      "-5V to 5V"
      coupling		      "16 single-ended channels"
      showStatus	      off
      sampleTime	      "0.0001"
      base		      "0x300"
    }
    Block {
      BlockType		      Reference
      Name		      "MM-16-AT 1"
      Ports		      [0, 1]
      Position		      [15, 127, 120, 183]
      SourceBlock	      "xpcdiamondlib/A//D/MM-16-AT "
      SourceType	      "addiamondmm16at"
      firstChan		      "2"
      numChans		      "1"
      range		      "-5V to 5V"
      coupling		      "16 single-ended channels"
      showStatus	      off
      sampleTime	      "0.0001"
      base		      "0x301"
    }
    Block {
      BlockType		      Reference
      Name		      "MM-16-AT 2"
      Ports		      [1]
      Position		      [495, 72, 600, 128]
      SourceBlock	      "xpcdiamondlib/D//A/MM-16-AT "
      SourceType	      "dadiamondmm16at"
      channel		      "[1]"
      range		      "0 to 5V"
      reset		      "[1]"
      initValue		      "[0]"
      sampleTime	      "0.001"
      base		      "0x300"
    }
    Line {
      SrcBlock		      "MM-16-AT "
      SrcPort		      1
      DstBlock		      "Discrete PID"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Discrete PID"
      SrcPort		      1
      DstBlock		      "MM-16-AT 2"
      DstPort		      1
    }
    Line {
      SrcBlock		      "MM-16-AT 1"
      SrcPort		      1
      DstBlock		      "Gain"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Gain"
      SrcPort		      1
      Points		      [35, 0; 0, -25]
      DstBlock		      "Discrete PID"
      DstPort		      2
    }
  }
}

⌨️ 快捷键说明

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