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

📄 ball_anim_obs.mdl

📁 基于状态观测器的二自由度汽车建模及控制分析
💻 MDL
📖 第 1 页 / 共 3 页
字号:
      D			      "1"
      X0		      "0"
      SampleTime	      "1"
      StateMustResolveToSignalObject off
      RTWStateStorageClass    "Auto"
      Realization	      "auto"
    }
    Block {
      BlockType		      Fcn
      Expr		      "sin(u[1])"
      SampleTime	      "-1"
    }
    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		      Integrator
      ExternalReset	      "none"
      InitialConditionSource  "internal"
      InitialCondition	      "0"
      LimitOutput	      off
      UpperSaturationLimit    "inf"
      LowerSaturationLimit    "-inf"
      ShowSaturationPort      off
      ShowStatePort	      off
      AbsoluteTolerance	      "auto"
      IgnoreLimit	      off
      ZeroCross		      on
    }
    Block {
      BlockType		      Mux
      Inputs		      "4"
      DisplayOption	      "none"
      UseBusObject	      off
      BusObject		      "BusObject"
      NonVirtualBus	      off
    }
    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		      SignalGenerator
      WaveForm		      "sine"
      TimeSource	      "Use simulation time"
      Amplitude		      "1"
      Frequency		      "1"
      Units		      "Hertz"
      VectorParams1D	      on
    }
    Block {
      BlockType		      StateSpace
      A			      "1"
      B			      "1"
      C			      "1"
      D			      "1"
      X0		      "0"
      AbsoluteTolerance	      "auto"
      Realization	      "auto"
    }
    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		      ToWorkspace
      VariableName	      "simulink_output"
      MaxDataPoints	      "1000"
      Decimation	      "1"
      SampleTime	      "0"
      FixptAsFi		      off
    }
    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		    "ball_anim_obs"
    Location		    [475, 433, 1166, 804]
    Open		    on
    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"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      SubSystem
      Name		      "Animation"
      Ports		      [1]
      Position		      [615, 45, 670, 95]
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      MaskHideContents	      off
      MaskType		      "Pendulum plot"
      MaskDescription	      "Pendulum plot"
      MaskHelp		      "Pendulum animation function using Handle graphi"
"cs."
      MaskPromptString	      "DC reference signal block name:"
      MaskStyleString	      "edit"
      MaskTunableValueString  "on"
      MaskEnableString	      "on"
      MaskVisibilityString    "on"
      MaskToolTipString	      "on"
      MaskInitialization      "RefBlock=&1;\n"
      MaskDisplay	      "plot([-10 10],[0 0],[-2 -2 2 2],[0 1 1 0],[0 3]"
",[1 5])"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "Reference"
      System {
	Name			"Animation"
	Location		[636, 545, 877, 643]
	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			  "in_1"
	  Position		  [40, 25, 60, 45]
	  IconDisplay		  "Port number"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  "S-function"
	  Ports			  [1]
	  Position		  [95, 23, 150, 47]
	  DeleteFcn		  "pendan([],[],[],'DeleteBlock');"
	  FunctionName		  "ball_anim"
	  Parameters		  "RefBlock"
	}
	Line {
	  SrcBlock		  "in_1"
	  SrcPort		  1
	  DstBlock		  "S-function"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Clock
      Name		      "Clock"
      Position		      [565, 165, 585, 185]
      ShowName		      off
      Decimation	      "10"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Discrete State Estimator"
      Ports		      [2, 1]
      Position		      [430, 217, 475, 268]
      Orientation	      "left"
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      MaskHideContents	      off
      MaskType		      "Pendulum Discrete state estimator"
      MaskDescription	      "Pendulum discrete state estimator"
      MaskHelp		      "The states of the pendulum and cart system are "
"the pendulum angle and angular velocity and cart position and velocity.  Sinc"
"e the sensors output the pendulum angle and cart position, this state estimat"
"or just does a one step difference calculation to get the velocities."
      MaskPromptString	      "Sample time"
      MaskStyleString	      "edit"
      MaskTunableValueString  "on"
      MaskEnableString	      "on"
      MaskVisibilityString    "on"
      MaskToolTipString	      "on"
      MaskInitialization      "Ts = @1;"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "0.02"
      System {
	Name			"Discrete State Estimator"
	Location		[257, 269, 568, 425]
	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			  "Cart"
	  Position		  [15, 45, 35, 65]
	  IconDisplay		  "Port number"
	}
	Block {
	  BlockType		  Inport
	  Name			  "Pendulum"
	  Position		  [15, 100, 35, 120]
	  Port			  "2"
	  IconDisplay		  "Port number"
	}
	Block {
	  BlockType		  DiscreteStateSpace
	  Name			  "Dis. State-space"
	  Position		  [115, 65, 235, 105]
	  A			  "zeros(2)"
	  B			  "-eye(2)/Ts"
	  C			  "[0 0; 1 0; 0 0; 0 1]"
	  D			  "[1 0; 1/Ts 0; 0 1; 0 1/Ts]"
	  SampleTime		  "Ts"
	}
	Block {
	  BlockType		  Mux
	  Name			  "Mux2"
	  Ports			  [2, 1]
	  Position		  [55, 56, 80, 109]
	  ShowName		  off
	  Inputs		  "2"
	}
	Block {
	  BlockType		  Outport
	  Name			  "X"
	  Position		  [260, 75, 280, 95]
	  IconDisplay		  "Port number"
	  BusOutputAsStruct	  off
	  InitialOutput		  "0"
	}
	Line {
	  SrcBlock		  "Pendulum"
	  SrcPort		  1
	  DstBlock		  "Mux2"
	  DstPort		  2
	}
	Line {
	  SrcBlock		  "Dis. State-space"
	  SrcPort		  1
	  DstBlock		  "X"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Cart"
	  SrcPort		  1
	  DstBlock		  "Mux2"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "Mux2"
	  SrcPort		  1
	  DstBlock		  "Dis. State-space"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      TransferFcn
      Name		      "Feedforward Gain"
      Position		      [205, 207, 260, 243]
      Numerator		      "[7.12 0]"
      Denominator	      "[1 2]"
    }
    Block {
      BlockType		      Gain
      Name		      "Integral\nGain"
      Position		      [205, 138, 240, 172]
      Gain		      "0.06"
    }
    Block {
      BlockType		      Integrator
      Name		      "Limited\nIntegrator"
      Ports		      [1, 1]
      Position		      [260, 138, 295, 172]
      LimitOutput	      on
      UpperSaturationLimit    "5"
      LowerSaturationLimit    "-5"
      IgnoreLimit	      off
    }
    Block {
      BlockType		      StateSpace
      Name		      "Matrix gain."
      Position		      [350, 231, 405, 259]
      Orientation	      "left"
      ShowName		      off
      A			      "[]"
      B			      "[]"
      C			      "[]"
      D			      "K"
      MaskType		      "Matrix gain"
      MaskDescription	      "Matrix Gain:"
      MaskHelp		      "Multiplies input vector by entered matrix to pr"
"oduce output vector."
      MaskPromptString	      "Gain matrix:"
      MaskStyleString	      "edit"
      MaskTunableValueString  "on"
      MaskEnableString	      "on"
      MaskVisibilityString    "on"
      MaskToolTipString	      "on"
      MaskInitialization      "K = @1;"
      MaskDisplay	      "disp('LQR')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "[0 -18 -166.5 -15.2]"
    }
    Block {
      BlockType		      SubSystem
      Name		      "More Info"
      Ports		      []
      Position		      [25, 20, 52, 45]
      DropShadow	      on
      OpenFcn		      "showdemo(bdroot(gcb))"
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      MaskHideContents	      off
      MaskDisplay	      "disp('?')"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      System {
	Name			"More Info"
	Location		[209, 71, 557, 254]
	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		      Mux
      Name		      "Mux"
      Ports		      [3, 1]
      Position		      [545, 54, 575, 86]
      ShowName		      off
      Inputs		      "3"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Pendulum"
      Ports		      [1, 2]
      Position		      [430, 132, 480, 183]
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      MaskHideContents	      off
      MaskType		      "Inverted pendulum on cart"

⌨️ 快捷键说明

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