diff --git a/controls/model/Quadcopter_Model_R2015_A.mdl b/controls/model/Quadcopter_Model_R2015_A.mdl index 21c689f9c1363cf6438b4809569990f9cfcac0e2..1ce8804095f97383c65bf5506d2a66c794009662 100644 --- a/controls/model/Quadcopter_Model_R2015_A.mdl +++ b/controls/model/Quadcopter_Model_R2015_A.mdl @@ -6,7 +6,7 @@ Model { NumRootInports 0 NumRootOutports 0 ParameterArgumentNames "" - ComputedModelVersion "1.288" + ComputedModelVersion "1.351" NumModelReferences 0 NumTestPointedSignals 0 } @@ -45,16 +45,28 @@ Model { $ClassName "Simulink.ExplorerBarInfo" Visible [1] } - Object { - $PropName "EditorsInfo" - $ObjectID 5 - $ClassName "Simulink.EditorInfo" - IsActive [1] - ViewObjType "SimulinkTopLevel" - LoadSaveID "0" - Extents [1755.0, 876.0] - ZoomFactor [1.25] - Offset [537.09047619047556, 303.24285714285782] + Array { + Type "Simulink.EditorInfo" + Dimension 2 + Object { + $ObjectID 5 + IsActive [0] + ViewObjType "SimulinkSubsys" + LoadSaveID "541" + Extents [1755.0, 874.0] + ZoomFactor [1.5] + Offset [-408.3367559523798, 164.59047619047868] + } + Object { + $ObjectID 6 + IsActive [1] + ViewObjType "SimulinkTopLevel" + LoadSaveID "0" + Extents [1755.0, 874.0] + ZoomFactor [1.5] + Offset [661.09523809523807, 324.57142857142884] + } + PropName "EditorsInfo" } } } @@ -64,9 +76,9 @@ Model { ModifiedByFormat "%<Auto>" LastModifiedBy "Andy" ModifiedDateFormat "%<Auto>" - LastModifiedDate "Sat Dec 03 21:49:47 2016" - RTWModifiedTimeStamp 402702587 - ModelVersionFormat "1.%<AutoIncrement:288>" + LastModifiedDate "Mon Dec 05 22:25:03 2016" + RTWModifiedTimeStamp 402877502 + ModelVersionFormat "1.%<AutoIncrement:351>" ConfigurationManager "none" SampleTimeColors off SampleTimeAnnotations off @@ -107,7 +119,7 @@ Model { TryForcingSFcnDF off Object { $PropName "DataLoggingOverride" - $ObjectID 7 + $ObjectID 8 $ClassName "Simulink.SimulationData.ModelLoggingInfo" model_ "Quadcopter_Model_R2015_A" overrideMode_ [0.0] @@ -126,7 +138,7 @@ Model { } Object { $PropName "InstrumentedSignals" - $ObjectID 8 + $ObjectID 9 $ClassName "Simulink.HMI.InstrumentedSignals" Persistence [] } @@ -178,13 +190,13 @@ Model { Type "Handle" Dimension 1 Simulink.ConfigSet { - $ObjectID 9 + $ObjectID 10 Version "1.15.0" Array { Type "Handle" Dimension 8 Simulink.SolverCC { - $ObjectID 10 + $ObjectID 11 Version "1.15.0" StartTime "0.0" StopTime "20" @@ -219,7 +231,7 @@ Model { InsertRTBMode "Whenever possible" } Simulink.DataIOCC { - $ObjectID 11 + $ObjectID 12 Version "1.15.0" Decimation "1" ExternalInput "[t, u]" @@ -252,7 +264,7 @@ Model { Refine "1" } Simulink.OptimizationCC { - $ObjectID 12 + $ObjectID 13 Version "1.15.0" Array { Type "Cell" @@ -309,7 +321,7 @@ Model { AccelVerboseBuild off } Simulink.DebuggingCC { - $ObjectID 13 + $ObjectID 14 Version "1.15.0" RTPrefix "error" ConsistencyChecking "none" @@ -397,7 +409,7 @@ Model { IntegerSaturationMsg "warning" } Simulink.HardwareCC { - $ObjectID 14 + $ObjectID 15 Version "1.15.0" ProdBitPerChar 8 ProdBitPerShort 16 @@ -437,7 +449,7 @@ Model { ProdEqTarget on } Simulink.ModelReferenceCC { - $ObjectID 15 + $ObjectID 16 Version "1.15.0" UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" CheckModelReferenceTargetMessage "error" @@ -452,7 +464,7 @@ Model { SupportModelReferenceSimTargetCustomCode off } Simulink.SFSimCC { - $ObjectID 16 + $ObjectID 17 Version "1.15.0" SFSimEcho on SimCtrlC on @@ -464,7 +476,7 @@ Model { } Simulink.RTWCC { $BackupClass "Simulink.RTWCC" - $ObjectID 17 + $ObjectID 18 Version "1.15.0" Array { Type "Cell" @@ -532,7 +544,7 @@ Model { Type "Handle" Dimension 2 Simulink.CodeAppCC { - $ObjectID 18 + $ObjectID 19 Version "1.15.0" Array { Type "Cell" @@ -605,7 +617,7 @@ Model { } Simulink.GRTTargetCC { $BackupClass "Simulink.TargetCC" - $ObjectID 19 + $ObjectID 20 Version "1.15.0" Array { Type "Cell" @@ -701,11 +713,11 @@ Model { } Simulink.ConfigSet { $PropName "ActiveConfigurationSet" - $ObjectID 9 + $ObjectID 10 } Object { $PropName "DataTransfer" - $ObjectID 21 + $ObjectID 22 $ClassName "Simulink.GlobalDataTransfer" DefaultTransitionBetweenSyncTasks "Ensure deterministic transfer (maximum delay)" DefaultTransitionBetweenAsyncTasks "Ensure data integrity only" @@ -867,6 +879,14 @@ Model { ZeroCross on ContinuousStateAttributes "''" } + Block { + BlockType Mux + Inputs "4" + DisplayOption "none" + UseBusObject off + BusObject "BusObject" + NonVirtualBus off + } Block { BlockType Outport Port "1" @@ -996,9 +1016,9 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "125" + ZoomFactor "150" ReportName "simulink-default.rpt" - SIDHighWatermark "953" + SIDHighWatermark "1020" Block { BlockType SubSystem Name "\n\n\n\n\n\n" @@ -1010,7 +1030,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 22 + $ObjectID 23 $ClassName "Simulink.Mask" Display "port_label('input', 1, 'Rotor 1 Duty Cycle', 'texmode', 'on');\nport_label('input', 2, 'Rotor 2 Duty Cycle" "', 'texmode', 'on');\nport_label('input', 3, 'Rotor 3 Duty Cycle', 'texmode', 'on');\nport_label('input', 4, 'Rotor 4" @@ -1033,7 +1053,7 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "60" + ZoomFactor "150" Block { BlockType Inport Name "Rotor 0 Duty Cycle" @@ -1084,7 +1104,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 23 + $ObjectID 24 $ClassName "Simulink.Mask" Display "port_label('input', 1, 'Vb_{eff}', 'texmode', 'on');\nport_label('input', 2, '\\omega', 'texmode', " "'on');\nport_label('output', 1, '\\alpha', 'texmode', 'on');\ndisp('Motor System');\n" @@ -1221,7 +1241,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 24 + $ObjectID 25 $ClassName "Simulink.Mask" Display "port_label('input', 1, 'Rotor 0 Duty Cycle', 'texmode', 'on');\nport_label('input', 2, 'Rotor 1 Dut" "y Cycle', 'texmode', 'on');\nport_label('input', 3, 'Rotor 2 Duty Cycle', 'texmode', 'on');\nport_label('input', " @@ -1391,7 +1411,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 25 + $ObjectID 26 $ClassName "Simulink.Mask" Display "port_label('output', 1, '^EF_g', 'texmode', 'on');\nfprintf('Gravity');\n" } @@ -1509,7 +1529,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 26 + $ObjectID 27 $ClassName "Simulink.Mask" Display "port_label('input', 1, '^Bv_o', 'texmode', 'on');\nport_label('input', 2, '\\Theta', 'texmode', 'on" "');\nport_label('output', 1, '^Er_o', 'texmode', 'on');\ndisp('L_{EB}', 'texmode', 'on');" @@ -1645,7 +1665,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 27 + $ObjectID 28 $ClassName "Simulink.Mask" Display "port_label('input', 1, '\\alpha', 'texmode', 'on');\nport_label('input', 2, '\\omega', 'texmode', '" "on');\nport_label('input', 3, '^BF_g', 'texmode', 'on');\nport_label('input', 4, '^B\\Omega', 'texmode', 'on');\n" @@ -1856,7 +1876,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 28 + $ObjectID 29 $ClassName "Simulink.Mask" Display "port_label('input', 1, '^B\\Omega', 'texmode', 'on');\nport_label('input', 2, '\\Theta', 'texmode'," " 'on');\nport_label('output', 1, 'd\\Theta/dt', 'texmode', 'on');\ndisp('A_{EB}', 'texmode', 'on');" @@ -1992,7 +2012,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 29 + $ObjectID 30 $ClassName "Simulink.Mask" Display "port_label('input', 1, '^EF_g', 'texmode', 'on');\nport_label('input', 2, '\\Theta', 'texmode', 'on" "');\nport_label('output', 1, '^BF_g', 'texmode', 'on');\ndisp('L_{BE}', 'texmode', 'on');" @@ -2147,6 +2167,151 @@ Model { ShowName off DisplayOption "bar" } + Block { + BlockType Demux + Name "Demux1" + SID "954" + Ports [1, 3] + Position [1830, 526, 1835, 574] + ZOrder 107 + ShowName off + Outputs "3" + DisplayOption "bar" + Port { + PortNumber 1 + Name "x position" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + Port { + PortNumber 2 + Name "y position" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + Port { + PortNumber 3 + Name "z position" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + } + Block { + BlockType Demux + Name "Demux2" + SID "955" + Ports [1, 3] + Position [1830, 301, 1835, 349] + ZOrder 109 + ShowName off + Outputs "3" + DisplayOption "bar" + Port { + PortNumber 1 + Name "Roll" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + Port { + PortNumber 2 + Name "Pitch" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + Port { + PortNumber 3 + Name "Yaw" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + } + Block { + BlockType Demux + Name "Demux3" + SID "957" + Ports [1, 3] + Position [1830, 406, 1835, 454] + ZOrder 117 + ShowName off + Outputs "3" + DisplayOption "bar" + Port { + PortNumber 1 + Name "Body x velocity" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + Port { + PortNumber 2 + Name "Body y velocity" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + Port { + PortNumber 3 + Name "Body z velocity" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + } + Block { + BlockType Demux + Name "Demux4" + SID "959" + Ports [1, 3] + Position [1830, 161, 1835, 209] + ZOrder 115 + ShowName off + Outputs "3" + DisplayOption "bar" + Port { + PortNumber 1 + Name "Body roll velocity" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + Port { + PortNumber 2 + Name "Body pitch velocity" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + Port { + PortNumber 3 + Name "Body yaw velocity" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + } + Block { + BlockType Demux + Name "Demux5" + SID "961" + Ports [1, 3] + Position [1830, 641, 1835, 689] + ZOrder 119 + ShowName off + Outputs "3" + DisplayOption "bar" + Port { + PortNumber 1 + Name "Body x acceleration" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + Port { + PortNumber 2 + Name "Body y acceleration" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + Port { + PortNumber 3 + Name "Body z acceleration" + RTWStorageClass "Auto" + DataLoggingNameMode "SignalName" + } + } Block { BlockType Integrator Name "Integrator" @@ -2270,22 +2435,22 @@ Model { } Block { BlockType Scope - Name "Scope2" - SID "560" - Ports [1] - Position [890, 229, 920, 261] - ZOrder 51 - NumInputPorts "1" + Name "Scope10" + SID "956" + Ports [3] + Position [1935, 303, 1975, 347] + ZOrder 108 + NumInputPorts "3" Open off TimeRange auto TickLabels OneTimeTick - ShowLegends off + ShowLegends on LimitDataPoints off MaxDataPoints 5000 SaveToWorkspace off - SaveName ScopeData2 - YMin -100.77485 - YMax 906.97366 + SaveName ScopeData1 + YMin -1.00000~-1.00000~-1.00000 + YMax 1.00000~1.00000~1.00000 SampleInput off SampleTime -1 ZoomMode on @@ -2295,6 +2460,8 @@ Model { List { ListType AxesTitles axes1 "%<SignalLabel>" + axes2 "%<SignalLabel>" + axes3 "%<SignalLabel>" } List { ListType ScopeGraphics @@ -2306,15 +2473,57 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [1 76 1921 1039] + Location [643 335 1366 766] } Block { BlockType Scope - Name "Scope3" - SID "561" + Name "Scope11" + SID "960" + Ports [3] + Position [1935, 163, 1975, 207] + ZOrder 114 + NumInputPorts "3" + Open off + TimeRange auto + TickLabels OneTimeTick + ShowLegends on + LimitDataPoints off + MaxDataPoints 5000 + SaveToWorkspace off + SaveName ScopeData3 + YMin -1.00000~-1.00000~-1.00000 + YMax 1.00000~1.00000~1.00000 + SampleInput off + SampleTime -1 + ZoomMode on + Grid on + DataFormat StructureWithTime + Decimation 1 + List { + ListType AxesTitles + axes1 "%<SignalLabel>" + axes2 "%<SignalLabel>" + axes3 "%<SignalLabel>" + } + List { + ListType ScopeGraphics + FigureColor "[0.156862745098039 0.156862745098039 0.156862745098039]" + AxesColor "[0 0 0]" + AxesTickColor "[0.686274509803922 0.686274509803922 0.686274509803922]" + LineColors "[1 1 0;1 0 1;0 1 1;1 0 0;0 1 0;0 0 1]" + LineStyles "-|-|-|-|-|-" + LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" + MarkerStyles "none|none|none|none|none|none" + } + Location [643 335 1366 766] + } + Block { + BlockType Scope + Name "Scope2" + SID "560" Ports [1] - Position [1790, 304, 1820, 336] - ZOrder 69 + Position [890, 229, 920, 261] + ZOrder 51 NumInputPorts "1" Open off TimeRange auto @@ -2323,9 +2532,9 @@ Model { LimitDataPoints off MaxDataPoints 5000 SaveToWorkspace off - SaveName ScopeData1 - YMin -1.00000 - YMax 1.00000 + SaveName ScopeData2 + YMin -100.77485 + YMax 906.97366 SampleInput off SampleTime -1 ZoomMode on @@ -2350,22 +2559,22 @@ Model { } Block { BlockType Scope - Name "Scope4" - SID "562" - Ports [1] - Position [1790, 169, 1820, 201] - ZOrder 70 - NumInputPorts "1" + Name "Scope3" + SID "958" + Ports [3] + Position [1935, 408, 1975, 452] + ZOrder 116 + NumInputPorts "3" Open off TimeRange auto TickLabels OneTimeTick - ShowLegends off + ShowLegends on LimitDataPoints off MaxDataPoints 5000 SaveToWorkspace off SaveName ScopeData2 - YMin -19.78789 - YMax 178.09104 + YMin -1.00000~-71.40595~-81.80792 + YMax 1.00000~93.1255~67.47699 SampleInput off SampleTime -1 ZoomMode on @@ -2375,6 +2584,8 @@ Model { List { ListType AxesTitles axes1 "%<SignalLabel>" + axes2 "%<SignalLabel>" + axes3 "%<SignalLabel>" } List { ListType ScopeGraphics @@ -2390,22 +2601,22 @@ Model { } Block { BlockType Scope - Name "Scope5" - SID "563" - Ports [1] - Position [1790, 419, 1820, 451] - ZOrder 78 - NumInputPorts "1" + Name "Scope4" + SID "962" + Ports [3] + Position [1935, 643, 1975, 687] + ZOrder 118 + NumInputPorts "3" Open off TimeRange auto TickLabels OneTimeTick - ShowLegends off + ShowLegends on LimitDataPoints off MaxDataPoints 5000 SaveToWorkspace off - SaveName ScopeData3 - YMin -0.11953 - YMax 1.0758 + SaveName ScopeData4 + YMin -1019.9483~-1019.9483~-1019.9483 + YMax 1049.2638~1049.2638~1049.2638 SampleInput off SampleTime -1 ZoomMode on @@ -2415,6 +2626,8 @@ Model { List { ListType AxesTitles axes1 "%<SignalLabel>" + axes2 "%<SignalLabel>" + axes3 "%<SignalLabel>" } List { ListType ScopeGraphics @@ -2426,26 +2639,26 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [1 76 1917 1039] + Location [1 76 1921 1039] } Block { BlockType Scope Name "Scope6" SID "564" - Ports [1] - Position [1790, 534, 1820, 566] + Ports [3] + Position [1935, 528, 1975, 572] ZOrder 79 - NumInputPorts "1" + NumInputPorts "3" Open off TimeRange auto TickLabels OneTimeTick - ShowLegends off + ShowLegends on LimitDataPoints off MaxDataPoints 5000 SaveToWorkspace off SaveName ScopeData4 - YMin -0.86518 - YMax 7.7866 + YMin -1.00000~-1.00000~-980.09781 + YMax 1.00000~1.00000~109.0196 SampleInput off SampleTime -1 ZoomMode on @@ -2455,6 +2668,8 @@ Model { List { ListType AxesTitles axes1 "%<SignalLabel>" + axes2 "%<SignalLabel>" + axes3 "%<SignalLabel>" } List { ListType ScopeGraphics @@ -2466,7 +2681,7 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [1 76 1917 1039] + Location [643 335 1366 766] } Block { BlockType Scope @@ -2594,8 +2809,8 @@ Model { SID "935" Position [-150, 375, -120, 405] ZOrder 106 - Before "68.08*ones(4,1)" - After "68.08*ones(4,1)" + Before "68.25*ones(4,1)" + After "[ 68.25; 69.25; 69.25; 68.25 ]" SampleTime "0" } Block { @@ -2628,7 +2843,7 @@ Model { BlockType Outport Name "E_ro" SID "571" - Position [1815, 598, 1845, 612] + Position [1830, 598, 1860, 612] ZOrder 88 Port "4" IconDisplay "Port number" @@ -2637,7 +2852,7 @@ Model { BlockType Outport Name "B_vo_dot" SID "572" - Position [1815, 718, 1845, 732] + Position [1830, 718, 1860, 732] ZOrder 103 Port "5" IconDisplay "Port number" @@ -2646,7 +2861,7 @@ Model { BlockType Outport Name "B_g" SID "573" - Position [1815, 778, 1845, 792] + Position [1830, 778, 1860, 792] ZOrder 104 Port "6" IconDisplay "Port number" @@ -2746,9 +2961,18 @@ Model { Points [32, 0] Branch { ZOrder 22 - Points [0, 265] - DstBlock "B_vo_dot" - DstPort 1 + Points [0, 265; 600, 0] + Branch { + ZOrder 199 + Points [0, -60] + DstBlock "Demux5" + DstPort 1 + } + Branch { + ZOrder 198 + DstBlock "B_vo_dot" + DstPort 1 + } } Branch { ZOrder 23 @@ -2763,16 +2987,16 @@ Model { Points [55, 0] Branch { ZOrder 25 - Points [0, -95; 453, 0] + Points [0, -95; 454, 0] Branch { - ZOrder 26 - Points [0, -60] - DstBlock "Scope4" + ZOrder 117 + DstBlock "B_omega" DstPort 1 } Branch { - ZOrder 27 - DstBlock "B_omega" + ZOrder 115 + Points [0, -60] + DstBlock "Demux4" DstPort 1 } } @@ -2788,42 +3012,6 @@ Model { DstPort 1 } } - Line { - ZOrder 30 - SrcBlock "Integrator1" - SrcPort 1 - Points [34, 0; 0, 90] - Branch { - ZOrder 31 - Points [-383, 0; 0, -60] - DstBlock "\n\n\n\n\n\n\n\n" - DstPort 5 - } - Branch { - ZOrder 32 - Points [81, 0] - Branch { - ZOrder 33 - DstBlock "\n\n\n\n\n\n\n" - DstPort 1 - } - Branch { - ZOrder 34 - Points [0, -75; 393, 0] - Branch { - ZOrder 35 - DstBlock "B_vo" - DstPort 1 - } - Branch { - ZOrder 36 - Points [0, -40] - DstBlock "Scope5" - DstPort 1 - } - } - } - } Line { ZOrder 37 SrcBlock "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" @@ -2831,52 +3019,6 @@ Model { DstBlock "Integrator4" DstPort 1 } - Line { - ZOrder 38 - SrcBlock "Integrator4" - SrcPort 1 - Points [20, 0] - Branch { - ZOrder 39 - Points [28, 0] - Branch { - ZOrder 40 - Points [0, -60] - DstBlock "Scope3" - DstPort 1 - } - Branch { - ZOrder 41 - DstBlock "euler_angles" - DstPort 1 - } - } - Branch { - ZOrder 42 - Points [0, 460; -385, 0] - Branch { - ZOrder 65 - Points [0, -185] - Branch { - ZOrder 44 - DstBlock "\n\n\n\n\n\n\n" - DstPort 2 - } - Branch { - ZOrder 45 - Points [0, -240] - DstBlock "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" - DstPort 2 - } - } - Branch { - ZOrder 46 - Points [-787, 0; 0, -55] - DstBlock "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" - DstPort 2 - } - } - } Line { ZOrder 47 SrcBlock "\n\n\n\n" @@ -2905,15 +3047,15 @@ Model { ZOrder 51 SrcBlock "Integrator3" SrcPort 1 - Points [51, 0] + Points [64, 0] Branch { - ZOrder 52 + ZOrder 88 Points [0, -55] - DstBlock "Scope6" + DstBlock "Demux1" DstPort 1 } Branch { - ZOrder 53 + ZOrder 87 DstBlock "E_ro" DstPort 1 } @@ -2981,30 +3123,247 @@ Model { DstBlock "Demux" DstPort 1 } - } - } - Block { - BlockType SubSystem - Name " " - SID "601" - Ports [6, 3] - Position [1445, 477, 1665, 713] - ZOrder 68 - RequestExecContextInheritance off - Variant off - Object { - $PropName "MaskObject" - $ObjectID 30 - $ClassName "Simulink.Mask" - Display "port_label('input', 1, '^{B}Omega', 'texmode', 'on');\nport_label('input', 2, '\\Theta', 'texmode', 'on');" - "\nport_label('input', 3, '^{B}v_o', 'texmode', 'on');\nport_label('input', 4, '^{E}r_o', 'texmode', 'on');\nport_labe" - "l('input', 5, '^{B}dv_o/dt', 'texmode', 'on');\nport_label('input', 6, '^{B}g', 'texmode', 'on');\nport_label('output" - "', 1, 'Euler Angles Filtered', 'texmode', 'on');\nport_label('output', 2, 'Euler Rates', 'texmode', 'on');\nport_labe" - "l('output', 3, 'Current Position', 'texmode', 'on');\ndisp('Sensor Systen', 'texmode', 'on');" - } - System { - Name " " - Location [-8, -8, 1928, 1048] + Line { + Name "y position" + ZOrder 89 + Labels [0, 0] + SrcBlock "Demux1" + SrcPort 2 + DstBlock "Scope6" + DstPort 2 + } + Line { + Name "x position" + ZOrder 90 + Labels [0, 0] + SrcBlock "Demux1" + SrcPort 1 + DstBlock "Scope6" + DstPort 1 + } + Line { + Name "z position" + ZOrder 91 + Labels [0, 0] + SrcBlock "Demux1" + SrcPort 3 + DstBlock "Scope6" + DstPort 3 + } + Line { + ZOrder 38 + SrcBlock "Integrator4" + SrcPort 1 + Points [20, 0] + Branch { + ZOrder 39 + Points [30, 0] + Branch { + ZOrder 97 + Points [0, -55] + DstBlock "Demux2" + DstPort 1 + } + Branch { + ZOrder 96 + DstBlock "euler_angles" + DstPort 1 + } + } + Branch { + ZOrder 42 + Points [0, 460; -385, 0] + Branch { + ZOrder 65 + Points [0, -185] + Branch { + ZOrder 44 + DstBlock "\n\n\n\n\n\n\n" + DstPort 2 + } + Branch { + ZOrder 45 + Points [0, -240] + DstBlock "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + DstPort 2 + } + } + Branch { + ZOrder 46 + Points [-787, 0; 0, -55] + DstBlock "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + DstPort 2 + } + } + } + Line { + Name "Pitch" + ZOrder 93 + Labels [0, 0] + SrcBlock "Demux2" + SrcPort 2 + DstBlock "Scope10" + DstPort 2 + } + Line { + Name "Roll" + ZOrder 94 + Labels [0, 0] + SrcBlock "Demux2" + SrcPort 1 + DstBlock "Scope10" + DstPort 1 + } + Line { + Name "Yaw" + ZOrder 95 + Labels [0, 0] + SrcBlock "Demux2" + SrcPort 3 + DstBlock "Scope10" + DstPort 3 + } + Line { + Name "Body pitch velocity" + ZOrder 111 + Labels [0, 0] + SrcBlock "Demux4" + SrcPort 2 + DstBlock "Scope11" + DstPort 2 + } + Line { + Name "Body roll velocity" + ZOrder 112 + Labels [0, 0] + SrcBlock "Demux4" + SrcPort 1 + DstBlock "Scope11" + DstPort 1 + } + Line { + Name "Body yaw velocity" + ZOrder 113 + Labels [0, 0] + SrcBlock "Demux4" + SrcPort 3 + DstBlock "Scope11" + DstPort 3 + } + Line { + Name "Body y velocity" + ZOrder 118 + Labels [0, 0] + SrcBlock "Demux3" + SrcPort 2 + DstBlock "Scope3" + DstPort 2 + } + Line { + Name "Body x velocity" + ZOrder 119 + Labels [0, 0] + SrcBlock "Demux3" + SrcPort 1 + DstBlock "Scope3" + DstPort 1 + } + Line { + Name "Body z velocity" + ZOrder 120 + Labels [0, 0] + SrcBlock "Demux3" + SrcPort 3 + DstBlock "Scope3" + DstPort 3 + } + Line { + Name "Body y acceleration" + ZOrder 124 + Labels [0, 0] + SrcBlock "Demux5" + SrcPort 2 + DstBlock "Scope4" + DstPort 2 + } + Line { + Name "Body x acceleration" + ZOrder 125 + Labels [0, 0] + SrcBlock "Demux5" + SrcPort 1 + DstBlock "Scope4" + DstPort 1 + } + Line { + Name "Body z acceleration" + ZOrder 126 + Labels [0, 0] + SrcBlock "Demux5" + SrcPort 3 + DstBlock "Scope4" + DstPort 3 + } + Line { + ZOrder 30 + SrcBlock "Integrator1" + SrcPort 1 + Points [34, 0; 0, 90] + Branch { + ZOrder 195 + Points [-383, 0; 0, -60] + DstBlock "\n\n\n\n\n\n\n\n" + DstPort 5 + } + Branch { + ZOrder 194 + Points [76, 0] + Branch { + ZOrder 196 + DstBlock "\n\n\n\n\n\n\n" + DstPort 1 + } + Branch { + ZOrder 192 + Points [0, -75; 401, 0] + Branch { + ZOrder 201 + Points [0, -45] + DstBlock "Demux3" + DstPort 1 + } + Branch { + ZOrder 200 + DstBlock "B_vo" + DstPort 1 + } + } + } + } + } + } + Block { + BlockType SubSystem + Name " " + SID "601" + Ports [6, 3] + Position [1445, 477, 1665, 713] + ZOrder 68 + RequestExecContextInheritance off + Variant off + Object { + $PropName "MaskObject" + $ObjectID 31 + $ClassName "Simulink.Mask" + Display "port_label('input', 1, '^{B}Omega', 'texmode', 'on');\nport_label('input', 2, '\\Theta', 'texmode', 'on');" + "\nport_label('input', 3, '^{B}v_o', 'texmode', 'on');\nport_label('input', 4, '^{E}r_o', 'texmode', 'on');\nport_labe" + "l('input', 5, '^{B}dv_o/dt', 'texmode', 'on');\nport_label('input', 6, '^{B}g', 'texmode', 'on');\nport_label('output" + "', 1, 'Euler Angles Filtered', 'texmode', 'on');\nport_label('output', 2, 'Euler Rates', 'texmode', 'on');\nport_labe" + "l('output', 3, 'Current Position', 'texmode', 'on');\ndisp('Sensors', 'texmode', 'on'); " + } + System { + Name " " + Location [-8, -8, 1928, 1048] Open off ModelBrowserVisibility off ModelBrowserWidth 200 @@ -3016,7 +3375,7 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "100" + ZoomFactor "80" Block { BlockType Inport Name "B_Omega" @@ -3029,7 +3388,7 @@ Model { BlockType Inport Name "euler_angles" SID "864" - Position [1990, 1068, 2020, 1082] + Position [1720, 1043, 1750, 1057] ZOrder 266 Port "2" IconDisplay "Port number" @@ -3047,7 +3406,7 @@ Model { BlockType Inport Name "E_ro" SID "866" - Position [1990, 1038, 2020, 1052] + Position [1720, 963, 1750, 977] ZOrder 268 Port "4" IconDisplay "Port number" @@ -3085,7 +3444,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 31 + $ObjectID 32 $ClassName "Simulink.Mask" Display "port_label('input', 1, '\\theta_{accel}', 'texmode', 'on');\nport_label('input', 2, '\\phi_{accel}'" ", 'texmode', 'on');\nport_label('input', 3, 'd\\Theta_{IMU}/dt', 'texmode', 'on');\nport_label('input', 4, '\\The" @@ -3250,7 +3609,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 32 + $ObjectID 33 $ClassName "Simulink.Mask" Display "port_label('input', 1, '^{B}dv_o/dt', 'texmode', 'on')\nport_label('input', 2, '^{B}v_o', 'texmode'" ", 'on')\nport_label('input', 3, '^{B}\\Omega', 'texmode', 'on')\nport_label('input', 4, '^{B}g', 'texmode', 'on')" @@ -3271,7 +3630,7 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "150" + ZoomFactor "100" Block { BlockType Inport Name "B_vo_dot" @@ -3323,7 +3682,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 33 + $ObjectID 34 $ClassName "Simulink.Mask" Display "port_label('input', 1, '^{B}dv_o/dt', 'texmode', 'on')\nport_label('input', 2, '^{B}v_o', 'texmode', 'on'" ")\nport_label('input', 3, '^{B}\\Omega', 'texmode', 'on')\nport_label('input', 4, '^{B}g', 'texmode', 'on')\nport_la" @@ -3345,7 +3704,7 @@ Model { TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" - SIDHighWatermark "29" + SIDHighWatermark "31" Block { BlockType Inport Name "B_vo_dot" @@ -3450,35 +3809,35 @@ Model { IconDisplay "Port number" } Line { - ZOrder 1 + ZOrder 57 SrcBlock "B_vo_dot" SrcPort 1 DstBlock " SFunction " DstPort 1 } Line { - ZOrder 2 + ZOrder 58 SrcBlock "B_vo" SrcPort 1 DstBlock " SFunction " DstPort 2 } Line { - ZOrder 3 + ZOrder 59 SrcBlock "B_Omega" SrcPort 1 DstBlock " SFunction " DstPort 3 } Line { - ZOrder 4 + ZOrder 60 SrcBlock "B_g" SrcPort 1 DstBlock " SFunction " DstPort 4 } Line { - ZOrder 5 + ZOrder 61 SrcBlock "r_oc" SrcPort 1 DstBlock " SFunction " @@ -3486,7 +3845,7 @@ Model { } Line { Name "accelReading" - ZOrder 6 + ZOrder 62 Labels [0, 0] SrcBlock " SFunction " SrcPort 2 @@ -3495,7 +3854,7 @@ Model { } Line { Name "gyroReading" - ZOrder 7 + ZOrder 63 Labels [0, 0] SrcBlock " SFunction " SrcPort 3 @@ -3503,14 +3862,14 @@ Model { DstPort 1 } Line { - ZOrder 8 + ZOrder 64 SrcBlock " Demux " SrcPort 1 DstBlock " Terminator " DstPort 1 } Line { - ZOrder 9 + ZOrder 65 SrcBlock " SFunction " SrcPort 1 DstBlock " Demux " @@ -3821,7 +4180,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 34 + $ObjectID 35 $ClassName "Simulink.Mask" Display "port_label('input', 1, 'Gyroscope Reading', 'texmode', 'on');\nport_label('input', 2, '\\Theta_{IMU" "}', 'texmode', 'on');\nport_label('output', 1, 'd\\Theta_{IMU}/dt', 'texmode', 'on');\ndisp('A_{EB}', 'texmode', " @@ -3958,7 +4317,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 35 + $ObjectID 36 $ClassName "Simulink.Mask" Display "port_label('input', 1, 'Accelerometer Reading', 'texmode', 'on');\nport_label('output', 1, '\\theta" "_{accel}', 'texmode', 'on');\nport_label('output', 2, '\\phi_{accel}', 'texmode', 'on');\ndisp('Calculate Pitch a" @@ -4032,73 +4391,365 @@ Model { } } Block { - BlockType Terminator - Name " Terminator " - SID "908::21" - Position [460, 241, 480, 259] - ZOrder 12 + BlockType Terminator + Name " Terminator " + SID "908::21" + Position [460, 241, 480, 259] + ZOrder 12 + } + Block { + BlockType Outport + Name "accel_pitch" + SID "908::5" + Position [460, 101, 480, 119] + ZOrder -5 + IconDisplay "Port number" + } + Block { + BlockType Outport + Name "accel_roll" + SID "908::22" + Position [460, 136, 480, 154] + ZOrder 13 + Port "2" + IconDisplay "Port number" + } + Line { + ZOrder 14 + SrcBlock "accel_reading" + SrcPort 1 + DstBlock " SFunction " + DstPort 1 + } + Line { + ZOrder 15 + SrcBlock "accel_roll_prev" + SrcPort 1 + DstBlock " SFunction " + DstPort 2 + } + Line { + Name "accel_pitch" + ZOrder 16 + Labels [0, 0] + SrcBlock " SFunction " + SrcPort 2 + DstBlock "accel_pitch" + DstPort 1 + } + Line { + Name "accel_roll" + ZOrder 17 + Labels [0, 0] + SrcBlock " SFunction " + SrcPort 3 + DstBlock "accel_roll" + DstPort 1 + } + Line { + ZOrder 18 + SrcBlock " Demux " + SrcPort 1 + DstBlock " Terminator " + DstPort 1 + } + Line { + ZOrder 19 + SrcBlock " SFunction " + SrcPort 1 + DstBlock " Demux " + DstPort 1 + } + } + } + Block { + BlockType SubSystem + Name "\n\n " + SID "989" + Ports [2, 2] + Position [1990, 946, 2230, 1039] + ZOrder 299 + RequestExecContextInheritance off + Variant off + Object { + $PropName "MaskObject" + $ObjectID 37 + $ClassName "Simulink.Mask" + Display "port_label('input', 1, '^{E}r_o', 'texmode', 'on');\nport_label('input', 2, '\\psi', 'texmode', 'on" + "');\nport_label('output', 1, '^{E}r_o camera', 'texmode', 'on');\nport_label('output', 2, '\\psi camera', 'texmod" + "e', 'on');\ndisp('OptiTrack Camera System', 'texmode', 'on');" + } + System { + Name "\n\n " + Location [-8, -8, 1928, 1048] + 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 "E_ro" + SID "990" + Position [295, 238, 325, 252] + ZOrder -1 + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "yaw" + SID "991" + Position [295, 338, 325, 352] + ZOrder 4 + Port "2" + IconDisplay "Port number" + } + Block { + BlockType RandomNumber + Name "E_ro_noise" + SID "992" + Position [545, 175, 575, 205] + ZOrder 30 + Mean "zeros(3,1)" + Variance "[ 7.9664e-10 ; 1.1928e-10 ; 5.0636e-10 ] " + Seed "[0,1,2]" + SampleTime "6.1e-3" + } + Block { + BlockType Quantizer + Name "E_ro_quantizer" + SID "993" + Position [685, 230, 715, 260] + ZOrder 34 + QuantizationInterval "2.4400e-04" + } + Block { + BlockType ZeroOrderHold + Name "E_ro_sampling" + SID "994" + Position [410, 230, 445, 260] + ZOrder 38 + SampleTime "6.1e-3" + } + Block { + BlockType Ground + Name "Ground1" + SID "995" + Position [465, 180, 485, 200] + ZOrder 42 + } + Block { + BlockType Ground + Name "Ground2" + SID "996" + Position [465, 390, 485, 410] + ZOrder 56 + } + Block { + BlockType Sum + Name "Sum1" + SID "997" + Ports [2, 1] + Position [605, 235, 625, 255] + ZOrder 33 + ShowName off + IconShape "round" + Inputs "++|" + InputSameDT off + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + } + Block { + BlockType Sum + Name "Sum3" + SID "998" + Ports [2, 1] + Position [485, 235, 505, 255] + ZOrder 37 + ShowName off + IconShape "round" + Inputs "++|" + InputSameDT off + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + } + Block { + BlockType Sum + Name "Sum4" + SID "999" + Ports [2, 1] + Position [605, 335, 625, 355] + ZOrder 47 + ShowName off + IconShape "round" + Inputs "|++" + InputSameDT off + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + } + Block { + BlockType Sum + Name "Sum6" + SID "1000" + Ports [2, 1] + Position [485, 335, 505, 355] + ZOrder 51 + ShowName off + IconShape "round" + Inputs "|++" + InputSameDT off + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + } + Block { + BlockType RandomNumber + Name "yaw_noise" + SID "1001" + Position [545, 365, 575, 395] + ZOrder 46 + Variance "1.0783e-9" + SampleTime "6.1e-3" + } + Block { + BlockType Quantizer + Name "yaw_quantizer" + SID "1002" + Position [685, 330, 715, 360] + ZOrder 50 + QuantizationInterval "1.1e-3" + } + Block { + BlockType ZeroOrderHold + Name "yaw_sampling" + SID "1003" + Position [410, 330, 445, 360] + ZOrder 54 + SampleTime "6.1e-3" } Block { BlockType Outport - Name "accel_pitch" - SID "908::5" - Position [460, 101, 480, 119] - ZOrder -5 + Name "E_ro_camera" + SID "1004" + Position [800, 238, 830, 252] + ZOrder 43 IconDisplay "Port number" } Block { BlockType Outport - Name "accel_roll" - SID "908::22" - Position [460, 136, 480, 154] - ZOrder 13 + Name "yaw_camera" + SID "1005" + Position [800, 338, 830, 352] + ZOrder 55 Port "2" IconDisplay "Port number" } Line { - ZOrder 14 - SrcBlock "accel_reading" + ZOrder 1 + SrcBlock "E_ro_quantizer" SrcPort 1 - DstBlock " SFunction " + DstBlock "E_ro_camera" DstPort 1 } Line { - ZOrder 15 - SrcBlock "accel_roll_prev" + ZOrder 2 + SrcBlock "E_ro_noise" SrcPort 1 - DstBlock " SFunction " + Points [35, 0] + DstBlock "Sum1" + DstPort 1 + } + Line { + ZOrder 3 + SrcBlock "Sum3" + SrcPort 1 + DstBlock "Sum1" DstPort 2 } Line { - Name "accel_pitch" - ZOrder 16 - Labels [0, 0] - SrcBlock " SFunction " - SrcPort 2 - DstBlock "accel_pitch" + ZOrder 4 + SrcBlock "Sum1" + SrcPort 1 + DstBlock "E_ro_quantizer" DstPort 1 } Line { - Name "accel_roll" - ZOrder 17 - Labels [0, 0] - SrcBlock " SFunction " - SrcPort 3 - DstBlock "accel_roll" + ZOrder 5 + SrcBlock "E_ro_sampling" + SrcPort 1 + DstBlock "Sum3" + DstPort 2 + } + Line { + ZOrder 6 + SrcBlock "Ground1" + SrcPort 1 + Points [5, 0] + DstBlock "Sum3" DstPort 1 } Line { - ZOrder 18 - SrcBlock " Demux " + ZOrder 7 + SrcBlock "yaw_quantizer" SrcPort 1 - DstBlock " Terminator " + DstBlock "yaw_camera" DstPort 1 } Line { - ZOrder 19 - SrcBlock " SFunction " + ZOrder 8 + SrcBlock "Sum4" SrcPort 1 - DstBlock " Demux " + DstBlock "yaw_quantizer" + DstPort 1 + } + Line { + ZOrder 9 + SrcBlock "Sum6" + SrcPort 1 + DstBlock "Sum4" + DstPort 1 + } + Line { + ZOrder 10 + SrcBlock "yaw_noise" + SrcPort 1 + Points [35, 0] + DstBlock "Sum4" + DstPort 2 + } + Line { + ZOrder 11 + SrcBlock "yaw_sampling" + SrcPort 1 + DstBlock "Sum6" + DstPort 1 + } + Line { + ZOrder 12 + SrcBlock "Ground2" + SrcPort 1 + Points [5, 0] + DstBlock "Sum6" + DstPort 2 + } + Line { + ZOrder 13 + SrcBlock "yaw" + SrcPort 1 + DstBlock "yaw_sampling" + DstPort 1 + } + Line { + ZOrder 14 + SrcBlock "E_ro" + SrcPort 1 + DstBlock "E_ro_sampling" DstPort 1 } } @@ -4108,14 +4759,14 @@ Model { Name "3D Graphical Simulation" SID "911" Ports [2] - Position [2135, 1030, 2285, 1090] + Position [2005, 1075, 2155, 1135] ZOrder 287 Commented "on" RequestExecContextInheritance off Variant off Object { $PropName "MaskObject" - $ObjectID 36 + $ObjectID 38 $ClassName "Simulink.Mask" Display "port_label('input',1,'r_{o}','texmode','on')\nport_label('input',2,'\\Theta','texmode','on')" } @@ -4133,7 +4784,7 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "100" + ZoomFactor "60" Block { BlockType Inport Name "Displacement" @@ -4606,13 +5257,13 @@ Model { Name "3D Graphical Simulation1" SID "936" Ports [2] - Position [2445, 880, 2595, 940] + Position [2635, 815, 2785, 875] ZOrder 290 RequestExecContextInheritance off Variant off Object { $PropName "MaskObject" - $ObjectID 37 + $ObjectID 39 $ClassName "Simulink.Mask" Display "port_label('input',1, '\\Theta','texmode','on')\nport_label('input',2,'r_{o}','texmode','on')" } @@ -4630,7 +5281,7 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "175" + ZoomFactor "80" Block { BlockType Inport Name "Euler Angles\n" @@ -5122,19 +5773,66 @@ Model { DelayLength "1" InitialCondition "0" } + Block { + BlockType Demux + Name "Demux" + SID "984" + Ports [1, 3] + Position [1810, 1023, 1815, 1077] + ZOrder 294 + ShowName off + Outputs "3" + DisplayOption "bar" + } + Block { + BlockType Demux + Name "Demux1" + SID "1006" + Ports [1, 2] + Position [2280, 605, 2285, 660] + ZOrder 300 + ShowName off + Outputs "2" + DisplayOption "bar" + } Block { BlockType Reference Name "First-Order\nHold" SID "953" Ports [1, 1] - Position [2315, 845, 2350, 875] + Position [2530, 780, 2565, 810] ZOrder 292 LibraryVersion "1.388" DisableCoverage on SourceBlock "simulink/Discrete/First-Order\nHold" SourceType "First-Order Hold" ContentPreviewEnabled off - Ts "1" + Ts "6.1e-3" + } + Block { + BlockType Reference + Name "First-Order\nHold1" + SID "986" + Ports [1, 1] + Position [2530, 875, 2565, 905] + ZOrder 296 + LibraryVersion "1.388" + DisableCoverage on + SourceBlock "simulink/Discrete/First-Order\nHold" + SourceType "First-Order Hold" + ContentPreviewEnabled off + Ts "6.1e-3" + } + Block { + BlockType Mux + Name "Mux" + SID "1007" + Ports [3, 1] + Position [2455, 608, 2460, 682] + ZOrder 301 + ShowName off + Inputs "3" + DisplayOption "bar" } Block { BlockType Scope @@ -5192,8 +5890,8 @@ Model { MaxDataPoints 5000 SaveToWorkspace off SaveName ScopeData2 - YMin -10 - YMax 10 + YMin -1.18227 + YMax 0.1338 SampleInput off SampleTime -1 ZoomMode on @@ -5214,66 +5912,26 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [680 330 1240 750] - } - Block { - BlockType Scope - Name "Scope2" - SID "896" - Ports [1] - Position [2085, 1119, 2115, 1151] - ZOrder 277 - NumInputPorts "1" - Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints on - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData3 - YMin -5.34181 - YMax 48.07631 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat Array - Decimation 1 - List { - ListType AxesTitles - axes1 "%<SignalLabel>" - } - List { - ListType ScopeGraphics - FigureColor "[0.156862745098039 0.156862745098039 0.156862745098039]" - AxesColor "[0 0 0]" - AxesTickColor "[0.686274509803922 0.686274509803922 0.686274509803922]" - LineColors "[1 1 0;1 0 1;0 1 1;1 0 0;0 1 0;0 0 1]" - LineStyles "-|-|-|-|-|-" - LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" - MarkerStyles "none|none|none|none|none|none" - } - Location [2 84 960 1038] + Location [1 76 1921 1039] } Block { BlockType Scope Name "Scope3" SID "897" Ports [1] - Position [2255, 579, 2285, 611] + Position [2255, 534, 2285, 566] ZOrder 278 NumInputPorts "1" Open off TimeRange auto TickLabels OneTimeTick ShowLegends off - LimitDataPoints on + LimitDataPoints off MaxDataPoints 5000 SaveToWorkspace off SaveName ScopeData4 - YMin -0.05524 - YMax 0.02485 + YMin -1.66746 + YMax 0.20394 SampleInput off SampleTime -1 ZoomMode on @@ -5312,8 +5970,8 @@ Model { MaxDataPoints 5000 SaveToWorkspace off SaveName ScopeData5 - YMin -10 - YMax 10 + YMin -0.10821 + YMax 0.91739 SampleInput off SampleTime -1 ZoomMode on @@ -5334,7 +5992,7 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [680 330 1240 750] + Location [1 76 1921 1039] } Block { BlockType Scope @@ -5352,8 +6010,8 @@ Model { MaxDataPoints 5000 SaveToWorkspace off SaveName ScopeData6 - YMin -10 - YMax 10 + YMin -2.66218 + YMax 0.34207 SampleInput off SampleTime -1 ZoomMode on @@ -5374,14 +6032,14 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [680 330 1240 750] + Location [1 76 1909 1039] } Block { BlockType S-Function Name "Soft Real Time" SID "927" Ports [] - Position [1923, 985, 2010, 1016] + Position [2033, 1185, 2120, 1216] ZOrder 288 ShowName off Commented "on" @@ -5391,12 +6049,12 @@ Model { EnableBusSupport off Object { $PropName "MaskObject" - $ObjectID 38 + $ObjectID 40 $ClassName "Simulink.Mask" Display "color('red')\ndisp('Soft Real Time')\n" Object { $PropName "Parameters" - $ObjectID 39 + $ObjectID 41 $ClassName "Simulink.MaskParameter" Type "edit" Name "x" @@ -5409,7 +6067,7 @@ Model { BlockType Outport Name "euler_angles_filtered" SID "901" - Position [2340, 628, 2370, 642] + Position [2540, 638, 2570, 652] ZOrder 262 IconDisplay "Port number" } @@ -5417,7 +6075,7 @@ Model { BlockType Outport Name "euler_rates" SID "904" - Position [2340, 913, 2370, 927] + Position [2005, 903, 2035, 917] ZOrder 259 Port "2" IconDisplay "Port number" @@ -5426,7 +6084,7 @@ Model { BlockType Outport Name "current_position" SID "928" - Position [2340, 973, 2370, 987] + Position [2335, 963, 2365, 977] ZOrder 289 Port "3" IconDisplay "Port number" @@ -5545,7 +6203,7 @@ Model { Points [58, 0] Branch { ZOrder 221 - Points [0, 170] + Points [0, 160] DstBlock "euler_rates" DstPort 1 } @@ -5586,18 +6244,18 @@ Model { ZOrder 211 SrcBlock "euler_angles" SrcPort 1 - Points [30, 0] - Branch { - ZOrder 214 - Points [0, 60] - DstBlock "Scope2" - DstPort 1 - } + Points [23, 0] Branch { - ZOrder 213 + ZOrder 332 + Points [0, 70] DstBlock "3D Graphical Simulation" DstPort 2 } + Branch { + ZOrder 293 + DstBlock "Demux" + DstPort 1 + } } Line { ZOrder 189 @@ -5605,65 +6263,120 @@ Model { SrcPort 1 Points [16, 0] Branch { - ZOrder 219 - DstBlock "euler_angles_filtered" + ZOrder 327 + DstBlock "Demux1" DstPort 1 } Branch { ZOrder 216 Points [0, 225] - Branch { - ZOrder 242 - DstBlock "First-Order\nHold" - DstPort 1 - } - Branch { - ZOrder 230 - DstBlock "Delay" - DstPort 1 - } + DstBlock "Delay" + DstPort 1 } Branch { ZOrder 187 - Points [0, -40] + Points [0, -85] DstBlock "Scope3" DstPort 1 } } + Line { + ZOrder 243 + SrcBlock "First-Order\nHold" + SrcPort 1 + Points [50, 0] + DstBlock "3D Graphical Simulation1" + DstPort 1 + } Line { ZOrder 212 SrcBlock "E_ro" SrcPort 1 - Points [53, 0] + Points [196, 0] Branch { - ZOrder 227 - Points [0, -65] - Branch { - ZOrder 229 - Points [0, -23; 352, 0] - DstBlock "3D Graphical Simulation1" - DstPort 2 - } - Branch { - ZOrder 228 - DstBlock "current_position" - DstPort 1 - } + ZOrder 331 + Points [0, 120] + DstBlock "3D Graphical Simulation" + DstPort 1 } Branch { - ZOrder 225 - DstBlock "3D Graphical Simulation" + ZOrder 304 + DstBlock "\n\n " DstPort 1 } } Line { - ZOrder 243 - SrcBlock "First-Order\nHold" + ZOrder 305 + SrcBlock "Demux" + SrcPort 3 + Points [23, 0; 0, -55] + DstBlock "\n\n " + DstPort 2 + } + Line { + ZOrder 290 + SrcBlock "First-Order\nHold1" SrcPort 1 - Points [75, 0] + Points [30, 0; 0, -30] DstBlock "3D Graphical Simulation1" + DstPort 2 + } + Line { + ZOrder 333 + SrcBlock "Demux1" + SrcPort 1 + DstBlock "Mux" DstPort 1 } + Line { + ZOrder 334 + SrcBlock "Demux1" + SrcPort 2 + DstBlock "Mux" + DstPort 2 + } + Line { + ZOrder 335 + SrcBlock "\n\n " + SrcPort 2 + Points [195, 0; 0, -345] + DstBlock "Mux" + DstPort 3 + } + Line { + ZOrder 336 + SrcBlock "Mux" + SrcPort 1 + Points [21, 0] + Branch { + ZOrder 339 + Points [0, 150] + DstBlock "First-Order\nHold" + DstPort 1 + } + Branch { + ZOrder 338 + DstBlock "euler_angles_filtered" + DstPort 1 + } + } + Line { + ZOrder 306 + SrcBlock "\n\n " + SrcPort 1 + Points [70, 0] + Branch { + ZOrder 341 + Points [0, -80] + DstBlock "First-Order\nHold1" + DstPort 1 + } + Branch { + ZOrder 340 + DstBlock "current_position" + DstPort 1 + } + } } } Block { @@ -5677,7 +6390,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 40 + $ObjectID 42 $ClassName "Simulink.Mask" Display "port_label('input', 1, 'Setpoints', 'texmode', 'on');\nport_label('input', 2, '\\Theta_{filtered}', 'texmo" "de', 'on');\nport_label('input', 3, 'd\\Theta_{gyro}/dt', 'texmode', 'on');\nport_label('input', 4, '^{E}r_o', 'texmo" @@ -5699,7 +6412,7 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "150" + ZoomFactor "125" Block { BlockType Inport Name "setpoints" @@ -5783,7 +6496,7 @@ Model { Variant off Object { $PropName "MaskObject" - $ObjectID 41 + $ObjectID 43 $ClassName "Simulink.Mask" Display "port_label('output', 1, 'Setpoints', 'texmode', 'on');" } @@ -5801,7 +6514,7 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "250" + ZoomFactor "300" Block { BlockType Step Name "Step" @@ -7763,9 +8476,9 @@ Stateflow { isEML 1 script "function euler_angles_IMU = complimentaryFilter(accel_pitch, accel_roll, euler_angles_gyro, prev" "_euler_angles_IMU)\n\nLOOP_TIME = 6.1*10^-3;\n\nprev_phi = prev_euler_angles_IMU(1);\nprev_theta = prev_euler_an" - "gles_IMU(2);\npsi = 0;\n\nphi_dot_gyro = euler_angles_gyro(1);\ntheta_dot_gyro = euler_angles_gyro(2);\n\nphi = " - "0.98 * (prev_phi + phi_dot_gyro * LOOP_TIME ) + 0.02 * accel_roll;\ntheta = 0.98 * (prev_theta + theta_dot_gyro " - "* LOOP_TIME) + 0.02 * accel_pitch;\n\neuler_angles_IMU = [phi; theta; psi];\n" + "gles_IMU(2);\n\nphi_dot_gyro = euler_angles_gyro(1);\ntheta_dot_gyro = euler_angles_gyro(2);\n\nphi = 0.98 * (pr" + "ev_phi + phi_dot_gyro * LOOP_TIME ) + 0.02 * accel_roll;\ntheta = 0.98 * (prev_theta + theta_dot_gyro * LOOP_TIM" + "E) + 0.02 * accel_pitch;\n\neuler_angles_IMU = [phi; theta];\n" editorLayout "100 M4x1[10 5 700 500]" } } @@ -7818,7 +8531,7 @@ Stateflow { machine 1 props { array { - size "[3,1]" + size "[2,1]" } type { method SF_INHERITED_TYPE @@ -7922,7 +8635,7 @@ Stateflow { screen [1 1 3600 1200 1.180555555555556] treeNode [0 103 0 0] viewObj 102 - ssIdHighWaterMark 13 + ssIdHighWaterMark 15 decomposition CLUSTER_CHART type EML_CHART chartFileNumber 10 diff --git a/controls/model/Quadcopter_Model_R2016_A.slx b/controls/model/Quadcopter_Model_R2016_A.slx index 46b31b0d732e83111ddc4772d33ed009bf7e0aae..7f461495c2c37f501f258aed80ec8233b134740b 100644 Binary files a/controls/model/Quadcopter_Model_R2016_A.slx and b/controls/model/Quadcopter_Model_R2016_A.slx differ diff --git a/controls/model/Quadcopter_Model_R2016_B.slx b/controls/model/Quadcopter_Model_R2016_B.slx index fb47766685bfc085c01bce870a9e83e9b5a00901..4a522c3598e05d090a69937f4321bbae2bff06ee 100644 Binary files a/controls/model/Quadcopter_Model_R2016_B.slx and b/controls/model/Quadcopter_Model_R2016_B.slx differ