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

📄 kalmanlti.mdl

📁 几个kalman滤波的例程 适合初学者使用 并有优化建议
💻 MDL
📖 第 1 页 / 共 3 页
字号:
  BlockDefaults {
    Orientation		    "right"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    NamePlacement	    "normal"
    FontName		    "Arial"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
    ShowName		    on
  }
  BlockParameterDefaults {
    Block {
      BlockType		      Gain
      Gain		      "1"
      Multiplication	      "Element-wise(K.*u)"
      ParamMin		      "[]"
      ParamMax		      "[]"
      ParameterDataTypeMode   "Same as input"
      ParameterDataType	      "fixdt(1,16,0)"
      ParameterScalingMode    "Best Precision: Matrix-wise"
      ParameterScaling	      "[]"
      OutMin		      "[]"
      OutMax		      "[]"
      OutDataTypeMode	      "Same as input"
      OutDataType	      "fixdt(1,16,0)"
      OutScaling	      "[]"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Inport
      Port		      "1"
      UseBusObject	      off
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      SampleTime	      "-1"
      OutMin		      "[]"
      OutMax		      "[]"
      DataType		      "auto"
      OutDataType	      "fixdt(1,16,0)"
      OutScaling	      "[]"
      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"
      OutMin		      "[]"
      OutMax		      "[]"
      DataType		      "auto"
      OutDataType	      "fixdt(1,16,0)"
      OutScaling	      "[]"
      SignalType	      "auto"
      SamplingMode	      "auto"
      OutputWhenDisabled      "held"
      InitialOutput	      "[]"
    }
    Block {
      BlockType		      RandomNumber
      Mean		      "0"
      Variance		      "1"
      Seed		      "0"
      SampleTime	      "-1"
      VectorParams1D	      on
    }
    Block {
      BlockType		      SubSystem
      ShowPortLabels	      "FromPortIcon"
      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		      "++"
      CollapseMode	      "All dimensions"
      CollapseDim	      "1"
      InputSameDT	      on
      OutMin		      "[]"
      OutMax		      "[]"
      OutDataTypeMode	      "Same as first input"
      OutDataType	      "fixdt(1,16,0)"
      OutScaling	      "[]"
      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"
    UseDisplayTextAsClickCallback off
  }
  LineDefaults {
    FontName		    "Arial"
    FontSize		    9
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  System {
    Name		    "KalmanLTI"
    Location		    [243, 281, 904, 855]
    Open		    on
    ModelBrowserVisibility  on
    ModelBrowserWidth	    167
    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		      Inport
      Name		      "In1"
      Position		      [30, 63, 60, 77]
      IconDisplay	      "Port number"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Kalman Filter"
      Ports		      [2, 2]
      Position		      [195, 161, 270, 219]
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      FunctionWithSeparateData off
      MaskDescription	      "Linear Random Process\nx(k+1)=Ax(k)+Bu(k)+w\ny(k)=Cx(k)+Du(k)+v\nw~N(0,Q)\nw~N(0,R)"
      MaskPromptString	      "x0|A|B|C|D|K"
      MaskStyleString	      "edit,edit,edit,edit,edit,edit"
      MaskTunableValueString  "on,on,on,on,on,on"
      MaskCallbackString      "|||||"
      MaskEnableString	      "on,on,on,on,on,on"
      MaskVisibilityString    "on,on,on,on,on,on"
      MaskToolTipString	      "on,on,on,on,on,on"
      MaskVarAliasString      ",,,,,"
      MaskVariables	      "x0=@1;A=@2;B=@3;C=@4;D=@5;K=@6;"
      MaskDisplay	      "disp(sprintf('Kalman\\n Filter'))\nport_label('output',2,'y')\nport_label('output',1,'x')\nport_label('input',1,'y')\nport_label('input',2,'u')\n\n\n\n"
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "x1|A1|B1|C1|D1|K"
      MaskTabNameString	      ",,,,,"
      System {
	Name			"Kalman Filter"
	Location		[1208, 294, 1869, 868]
	Open			off
	ModelBrowserVisibility	on
	ModelBrowserWidth	167
	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			  "yr"
	  Position		  [35, 88, 65, 102]
	  IconDisplay		  "Port number"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	}
	Block {
	  BlockType		  Inport
	  Name			  "u"
	  Position		  [35, 48, 65, 62]
	  Port			  "2"
	  IconDisplay		  "Port number"
	  PortDimensions	  "size(B,2)"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	}
	Block {
	  BlockType		  Gain
	  Name			  "Filter Gain"
	  Position		  [175, 80, 205, 110]
	  Gain			  "K"
	  Multiplication	  "Matrix(K*u)"
	  ParameterDataTypeMode	  "Inherit via internal rule"
	  ParameterDataType	  "sfix(16)"
	  ParameterScaling	  "2^0"
	  OutDataTypeMode	  "Inherit via internal rule"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	  SaturateOnIntegerOverflow off
	}
	Block {
	  BlockType		  Sum
	  Name			  "Sum3"
	  Ports			  [2, 1]
	  Position		  [115, 85, 135, 105]
	  ShowName		  off
	  IconShape		  "round"
	  Inputs		  "|+-"
	  CollapseMode		  "All dimensions"
	  InputSameDT		  off
	  OutDataTypeMode	  "Inherit via internal rule"
	  OutDataType		  "sfix(16)"
	  OutScaling		  "2^0"
	  SaturateOnIntegerOverflow off
	}
	Block {
	  BlockType		  SubSystem
	  Name			  "filter model"
	  Ports			  [2, 2]
	  Position		  [245, 35, 360, 115]
	  MinAlgLoopOccurrences	  off
	  RTWSystemCode		  "Auto"
	  FunctionWithSeparateData off
	  System {
	    Name		    "filter model"
	    Location		    [243, 280, 768, 555]
	    Open		    off
	    ModelBrowserVisibility  on
	    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		      "u"
	      Position		      [25, 113, 55, 127]
	      IconDisplay	      "Port number"
	      PortDimensions	      "size(B,2)"
	      OutDataType	      "sfix(16)"
	      OutScaling	      "2^0"
	    }
	    Block {
	      BlockType		      Inport
	      Name		      "k*e"
	      Position		      [345, 233, 375, 247]
	      Port		      "2"
	      IconDisplay	      "Port number"
	      OutDataType	      "sfix(16)"
	      OutScaling	      "2^0"
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "A"
	      Position		      [290, 24, 330, 66]
	      Orientation	      "left"
	      Gain		      "A"
	      Multiplication	      "Matrix(K*u)"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      ParameterDataType	      "sfix(16)"
	      ParameterScaling	      "2^0"
	      OutDataTypeMode	      "Inherit via internal rule"
	      OutDataType	      "sfix(16)"
	      OutScaling	      "2^0"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "B"
	      Position		      [160, 99, 200, 141]
	      Gain		      "B"
	      Multiplication	      "Matrix(K*u)"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      ParameterDataType	      "sfix(16)"
	      ParameterScaling	      "2^0"
	      OutDataTypeMode	      "Inherit via internal rule"
	      OutDataType	      "sfix(16)"
	      OutScaling	      "2^0"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "C"
	      Position		      [255, 164, 295, 206]
	      Orientation	      "left"
	      Gain		      "C"
	      Multiplication	      "Matrix(K*u)"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      ParameterDataType	      "sfix(16)"
	      ParameterScaling	      "2^0"
	      OutDataTypeMode	      "Inherit via internal rule"
	      OutDataType	      "sfix(16)"
	      OutScaling	      "2^0"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Gain
	      Name		      "D"
	      Position		      [125, 164, 165, 206]
	      Gain		      "D"
	      Multiplication	      "Matrix(K*u)"
	      ParameterDataTypeMode   "Inherit via internal rule"
	      ParameterDataType	      "sfix(16)"
	      ParameterScaling	      "2^0"
	      OutDataTypeMode	      "Inherit via internal rule"
	      OutDataType	      "sfix(16)"
	      OutScaling	      "2^0"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum"
	      Ports		      [2, 1]
	      Position		      [255, 110, 275, 130]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "++|"
	      CollapseMode	      "All dimensions"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      OutDataType	      "sfix(16)"
	      OutScaling	      "2^0"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum1"
	      Ports		      [2, 1]
	      Position		      [200, 175, 220, 195]
	      Orientation	      "down"
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "+|+"
	      CollapseMode	      "All dimensions"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      OutDataType	      "sfix(16)"
	      OutScaling	      "2^0"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      Sum
	      Name		      "Sum2"
	      Ports		      [2, 1]
	      Position		      [400, 110, 420, 130]
	      ShowName		      off
	      IconShape		      "round"
	      Inputs		      "|++"
	      CollapseMode	      "All dimensions"
	      InputSameDT	      off
	      OutDataTypeMode	      "Inherit via internal rule"
	      OutDataType	      "sfix(16)"
	      OutScaling	      "2^0"
	      SaturateOnIntegerOverflow	off
	    }
	    Block {
	      BlockType		      UnitDelay
	      Name		      "Unit Delay"
	      Position		      [370, 28, 405, 62]
	      Orientation	      "left"
	      X0		      "x0"
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "x"
	      Position		      [470, 113, 500, 127]
	      IconDisplay	      "Port number"
	      OutDataType	      "sfix(16)"
	      OutScaling	      "2^0"
	    }
	    Block {
	      BlockType		      Outport
	      Name		      "y1"
	      Position		      [265, 233, 295, 247]
	      Port		      "2"
	      IconDisplay	      "Port number"
	      OutDataType	      "sfix(16)"
	      OutScaling	      "2^0"
	    }
	    Line {
	      SrcBlock		      "u"
	      SrcPort		      1
	      Points		      [35, 0]
	      Branch {
		DstBlock		"B"
		DstPort			1
	      }
	      Branch {
		Points			[0, 65]
		DstBlock		"D"
		DstPort			1
	      }
	    }
	    Line {
	      SrcBlock		      "B"
	      SrcPort		      1
	      DstBlock		      "Sum"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "A"
	      SrcPort		      1
	      Points		      [-20, 0]
	      DstBlock		      "Sum"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Unit Delay"
	      SrcPort		      1
	      DstBlock		      "A"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "Sum"
	      SrcPort		      1
	      Points		      [50, 0]
	      Branch {
		DstBlock		"Sum2"
		DstPort			1
	      }
	      Branch {
		Points			[0, 65]
		DstBlock		"C"
		DstPort			1
	      }
	    }
	    Line {
	      SrcBlock		      "Sum2"
	      SrcPort		      1
	      Points		      [15, 0]
	      Branch {
		DstBlock		"x"
		DstPort			1
	      }
	      Branch {
		Points			[0, -75]
		DstBlock		"Unit Delay"
		DstPort			1
	      }
	    }
	    Line {
	      SrcBlock		      "D"
	      SrcPort		      1
	      DstBlock		      "Sum1"
	      DstPort		      1
	    }
	    Line {
	      SrcBlock		      "C"
	      SrcPort		      1
	      DstBlock		      "Sum1"
	      DstPort		      2
	    }
	    Line {
	      SrcBlock		      "k*e"

⌨️ 快捷键说明

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