📄 quadrotorsim.mdl
字号:
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 ZeroOrderHold
SampleTime "1"
}
}
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 "quadrotorsim"
Location [737, 82, 1582, 508]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType SubSystem
Name "Autopilot"
Ports [2, 1]
Position [190, 131, 275, 184]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "Autopilot"
Location [724, 500, 1484, 1027]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "y"
Position [120, 235, 150, 245]
NamePlacement "alternate"
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "camera"
Position [125, 125, 155, 135]
NamePlacement "alternate"
Port "2"
IconDisplay "Port number"
}
Block {
BlockType SubSystem
Name "Autopilot"
Ports [2, 2]
Position [370, 73, 465, 297]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "Autopilot"
Location [913, 99, 1386, 405]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "cam"
Position [60, 93, 90, 107]
IconDisplay "Port number"
}
Block {
BlockType Inport
Name "xhat"
Position [60, 163, 90, 177]
Port "2"
IconDisplay "Port number"
}
Block {
BlockType MATLABFcn
Name "Autopilot"
Position [205, 155, 265, 185]
MATLABFcn "autopilot(u,Ts,C)"
OutputDimensions "4+12"
SampleTime "Ts"
}
Block {
BlockType Clock
Name "Clock"
Position [65, 230, 85, 250]
Decimation "10"
}
Block {
BlockType Demux
Name "Demux"
Ports [1, 2]
Position [320, 108, 325, 232]
BackgroundColor "black"
ShowName off
Outputs "[4;12]"
}
Block {
BlockType Mux
Name "Mux1"
Ports [3, 1]
Position [155, 62, 160, 278]
ShowName off
Inputs "3"
DisplayOption "bar"
}
Block {
BlockType Outport
Name "u"
Position [375, 133, 405, 147]
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "xd"
Position [370, 193, 400, 207]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Clock"
SrcPort 1
DstBlock "Mux1"
DstPort 3
}
Line {
SrcBlock "Autopilot"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 1
DstBlock "u"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 2
DstBlock "xd"
DstPort 1
}
Line {
SrcBlock "Mux1"
SrcPort 1
DstBlock "Autopilot"
DstPort 1
}
Line {
SrcBlock "xhat"
SrcPort 1
DstBlock "Mux1"
DstPort 2
}
Line {
SrcBlock "cam"
SrcPort 1
DstBlock "Mux1"
DstPort 1
}
Annotation {
Name "MAGICC UAV Autopilot"
Position [233, 30]
ForegroundColor "blue"
UseDisplayTextAsClickCallback off
FontName "Arial"
FontSize 12
FontWeight "bold"
}
}
}
Block {
BlockType Goto
Name "Goto"
Position [520, 60, 560, 90]
ShowName off
GotoTag "u"
TagVisibility "global"
}
Block {
BlockType Goto
Name "Goto1"
Position [505, 225, 545, 255]
ShowName off
GotoTag "xd"
TagVisibility "global"
}
Block {
BlockType Goto
Name "Goto2"
Position [245, 315, 285, 345]
ShowName off
GotoTag "xhat"
TagVisibility "global"
}
Block {
BlockType Constant
Name "estimated State"
Position [145, 315, 175, 345]
Value "zeros(12,1)"
}
Block {
BlockType Outport
Name "u"
Position [530, 123, 560, 137]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Autopilot"
SrcPort 2
Points [0, 0]
DstBlock "Goto1"
DstPort 1
}
Line {
SrcBlock "Autopilot"
SrcPort 1
Points [0, 0; 20, 0]
Branch {
Points [0, -55]
DstBlock "Goto"
DstPort 1
}
Branch {
DstBlock "u"
DstPort 1
}
}
Line {
SrcBlock "y"
SrcPort 1
DstBlock "Autopilot"
DstPort 2
}
Line {
SrcBlock "camera"
SrcPort 1
DstBlock "Autopilot"
DstPort 1
}
Line {
SrcBlock "estimated State"
SrcPort 1
DstBlock "Goto2"
DstPort 1
}
Annotation {
Name "UAV Autopilot System"
Position [363, 35]
ForegroundColor "blue"
UseDisplayTextAsClickCallback off
FontName "Arial"
FontSize 12
FontWeight "bold"
}
}
}
Block {
BlockType SubSystem
Name "Quadrotor"
Ports [1, 2]
Position [330, 132, 420, 188]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "Quadrotor"
Location [2, 78, 1598, 1180]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "u"
Position [65, 58, 95, 72]
IconDisplay "Port number"
}
Block {
BlockType "S-Function"
Name "Dynamics"
Ports [1, 1]
Position [200, 95, 300, 125]
FunctionName "quadrotor_dynamics"
Parameters "C"
}
Block {
BlockType Constant
Name "East wind"
Position [65, 140, 95, 170]
Value "0"
}
Block {
BlockType Goto
Name "Goto"
Position [335, 195, 375, 225]
GotoTag "x"
TagVisibility "global"
}
Block {
BlockType Mux
Name "Mux"
Ports [3, 1]
Position [155, 43, 160, 177]
ShowName off
Inputs "3"
DisplayOption "bar"
}
Block {
BlockType Constant
Name "North wind"
Position [65, 95, 95, 125]
Value "0"
}
Block {
BlockType SubSystem
Name "sensors"
Ports [1, 1]
Position [335, 92, 395, 128]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
MaskHideContents off
System {
Name "sensors"
Location [622, 465, 1159, 966]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "x"
Position [155, 158, 185, 172]
IconDisplay "Port number"
}
Block {
BlockType Selector
Name "Selector"
Ports [1, 1]
Position [235, 85, 280, 245]
Elements "[7 8 10 11 12]"
InputPortWidth "12"
}
Block {
BlockType Outport
Name "y"
Position [415, 158, 445, 172]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "x"
SrcPort 1
DstBlock "Selector"
DstPort 1
}
Line {
SrcBlock "Selector"
SrcPort 1
DstBlock "y"
DstPort 1
}
Annotation {
Name "Sensor Model"
Position [283, 20]
ForegroundColor "blue"
UseDisplayTextAsClickCallback off
FontName "Arial"
FontSize 12
FontWeight "bold"
}
Annotation {
Name "(phi, theta, p, q, r)"
Position [343, 145]
UseDisplayTextAsClickCallback off
}
}
}
Block {
BlockType Outport
Name "y"
Position [440, 103, 470, 117]
IconDisplay "Port number"
BusOutputAsStruct off
}
Block {
BlockType Outport
Name "x"
Position [440, 163, 470, 177]
Port "2"
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Dynamics"
SrcPort 1
Points [5, 0]
Branch {
DstBlock "sensors"
DstPort 1
}
Branch {
Points [0, 60]
Branch {
DstBlock "x"
DstPort 1
}
Branch {
Points [0, 40]
DstBlock "Goto"
DstPort 1
}
}
}
Line {
SrcBlock "sensors"
SrcPort 1
DstBlock "y"
DstPort 1
}
Line {
SrcBlock "Mux"
SrcPort 1
DstBlock "Dynamics"
DstPort 1
}
Line {
SrcBlock "u"
SrcPort 1
DstBlock "Mux"
DstPort 1
}
Line {
SrcBlock "North wind"
SrcPort 1
DstBlock "Mux"
DstPort 2
}
Line {
SrcBlock "East wind"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -