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

📄 one_pid.mdl

📁 先进PID控制源程序
💻 MDL
📖 第 1 页 / 共 2 页
字号:
  }
  BlockParameterDefaults {
    Block {
      BlockType		      Derivative
      LinearizePole	      "inf"
    }
    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
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      SampleTime	      "-1"
      DataType		      "auto"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      SignalType	      "auto"
      SamplingMode	      "auto"
      Interpolate	      on
    }
    Block {
      BlockType		      Integrator
      ExternalReset	      "none"
      InitialConditionSource  "internal"
      InitialCondition	      "0"
      LimitOutput	      off
      UpperSaturationLimit    "inf"
      LowerSaturationLimit    "-inf"
      ShowSaturationPort      off
      ShowStatePort	      off
      AbsoluteTolerance	      "auto"
      ZeroCross		      on
    }
    Block {
      BlockType		      Mux
      Inputs		      "4"
      DisplayOption	      "none"
      BusObject		      "BusObject"
      NonVirtualBus	      off
    }
    Block {
      BlockType		      Outport
      Port		      "1"
      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		      Scope
      Floating		      off
      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	      "0"
    }
    Block {
      BlockType		      Sin
      SineType		      "Time based"
      TimeSource	      "Use simulation time"
      Amplitude		      "1"
      Bias		      "0"
      Frequency		      "1"
      Phase		      "0"
      Samples		      "10"
      Offset		      "0"
      SampleTime	      "-1"
      VectorParams1D	      on
    }
    Block {
      BlockType		      Step
      Time		      "1"
      Before		      "0"
      After		      "1"
      SampleTime	      "-1"
      VectorParams1D	      on
      ZeroCross		      on
    }
    Block {
      BlockType		      SubSystem
      ShowPortLabels	      on
      Permissions	      "ReadWrite"
      PermitHierarchicalResolution "All"
      SystemSampleTime	      "-1"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      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		      TransferFcn
      Numerator		      "[1]"
      Denominator	      "[1 2 1]"
      AbsoluteTolerance	      "auto"
      Realization	      "auto"
    }
  }
  AnnotationDefaults {
    HorizontalAlignment	    "center"
    VerticalAlignment	    "middle"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  LineDefaults {
    FontName		    "Helvetica"
    FontSize		    9
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  System {
    Name		    "one_PID"
    Location		    [392, 240, 1052, 702]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    212
    ScreenColor		    "white"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "A4"
    PaperUnits		    "centimeters"
    ZoomFactor		    "100"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      Mux
      Name		      "Mux"
      Ports		      [2, 1]
      Position		      [530, 81, 535, 119]
      ShowName		      off
      Inputs		      "2"
      DisplayOption	      "bar"
    }
    Block {
      BlockType		      SubSystem
      Name		      "PID controller"
      Ports		      [1, 1]
      Position		      [235, 80, 275, 140]
      TreatAsAtomicUnit	      off
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      System {
	Name			"PID controller"
	Location		[516, 302, 908, 808]
	Open			on
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"A4"
	PaperUnits		"centimeters"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "In1"
	  Position		  [25, 113, 55, 127]
	  Port			  "1"
	  IconDisplay		  "Port number"
	  LatchInput		  off
	}
	Block {
	  BlockType		  Derivative
	  Name			  "Derivative"
	  Position		  [180, 35, 210, 65]
	}
	Block {
	  BlockType		  Gain
	  Name			  "Gain"
	  Position		  [105, 167, 150, 213]
	  Gain			  "500"
	}
	Block {
	  BlockType		  Gain
	  Name			  "Gain1"
	  Position		  [100, 26, 145, 74]
	  Gain			  "0"
	}
	Block {
	  BlockType		  Gain
	  Name			  "Gain2"
	  Position		  [100, 100, 150, 140]
	  Gain			  "0"
	}
	Block {
	  BlockType		  Integrator
	  Name			  "Integrator"
	  Ports			  [1, 1]
	  Position		  [180, 104, 210, 136]
	}
	Block {
	  BlockType		  Sum
	  Name			  "Sum1"
	  Ports			  [3, 1]
	  Position		  [260, 74, 295, 146]
	  ShowName		  off
	  Inputs		  "|+++"
	  InputSameDT		  off
	  OutDataTypeMode	  "Inherit via internal rule"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out1"
	  Position		  [340, 103, 370, 117]
	  IconDisplay		  "Port number"
	  BusOutputAsStruct	  off
	}
	Line {
	  SrcBlock		  "Gain1"
	  SrcPort		  1
	  DstBlock		  "Derivative"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Derivative"
	  SrcPort		  1
	  Points		  [10, 0; 0, 50]
	  DstBlock		  "Sum1"
	  DstPort		  1
	}
	Line {
	  Labels		  [2, 0]
	  SrcBlock		  "Gain"
	  SrcPort		  1
	  Points		  [70, 0; 0, -50]
	  DstBlock		  "Sum1"
	  DstPort		  3
	}
	Line {
	  SrcBlock		  "In1"
	  SrcPort		  1
	  Points		  [0, 0; 15, 0]
	  Branch {
	    Points		    [0, -70]
	    DstBlock		    "Gain1"
	    DstPort		    1
	  }
	  Branch {
	    Points		    [0, 70]
	    DstBlock		    "Gain"
	    DstPort		    1
	  }
	  Branch {
	    DstBlock		    "Gain2"
	    DstPort		    1
	  }
	}
	Line {
	  SrcBlock		  "Sum1"
	  SrcPort		  1
	  DstBlock		  "Out1"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Integrator"
	  SrcPort		  1
	  DstBlock		  "Sum1"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "Gain2"
	  SrcPort		  1
	  DstBlock		  "Integrator"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Sin
      Name		      "Sine Wave"
      Ports		      [0, 1]
      Position		      [70, 95, 100, 125]
      SineType		      "Time based"
      SampleTime	      "0"
    }
    Block {
      BlockType		      Step
      Name		      "Step"
      Position		      [20, 80, 50, 110]
      SampleTime	      "0"
    }
    Block {
      BlockType		      Sum
      Name		      "Sum"
      Ports		      [2, 1]
      Position		      [170, 100, 190, 120]
      ShowName		      off
      IconShape		      "round"
      Inputs		      "|+-"
      InputSameDT	      off
      OutDataTypeMode	      "Inherit via internal rule"
    }
    Block {
      BlockType		      TransferFcn
      Name		      "Transfer Fcn"
      Position		      [295, 84, 420, 136]
      Numerator		      "24"
      Denominator	      "[1 15 30]"
    }
    Block {
      BlockType		      Scope
      Name		      "output"
      Ports		      [1]
      Position		      [580, 84, 610, 116]
      Location		      [5, 54, 1029, 737]
      Open		      off
      NumInputPorts	      "1"
      List {
	ListType		AxesTitles
	axes1			"%<SignalLabel>"
      }
      SaveToWorkspace	      on
      DataFormat	      "Array"
      MaxDataPoints	      "1000"
      SampleInput	      on
      SampleTime	      "0.005"
    }
    Line {
      SrcBlock		      "Sum"
      SrcPort		      1
      DstBlock		      "PID controller"
      DstPort		      1
    }
    Line {
      SrcBlock		      "PID controller"
      SrcPort		      1
      DstBlock		      "Transfer Fcn"
      DstPort		      1
    }
    Line {
      Labels		      [0, 0]
      SrcBlock		      "Mux"
      SrcPort		      1
      DstBlock		      "output"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Sine Wave"
      SrcPort		      1
      Points		      [15, 0]
      Branch {
	DstBlock		"Sum"
	DstPort			1
      }
      Branch {
	Points			[0, -45; 360, 0; 0, 25]
	DstBlock		"Mux"
	DstPort			1
      }
    }
    Line {
      SrcBlock		      "Transfer Fcn"
      SrcPort		      1
      Points		      [80, 0]
      Branch {
	Points			[0, 90; -325, 0]
	DstBlock		"Sum"
	DstPort			2
      }
      Branch {
	DstBlock		"Mux"
	DstPort			2
      }
    }
  }
}

⌨️ 快捷键说明

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