diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8e53db85b2bd85578843ca3e3b47eb59afdeb927..13bc283c77c88eead0b0297c5069e468205ce552 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,10 @@ build: stage: build script: - - echo "It works." + - bash ci-build.sh # run tests using the binary built before test: stage: test script: - - bash test-ci.sh + - bash ci-test.sh diff --git a/ci-build.sh b/ci-build.sh new file mode 100644 index 0000000000000000000000000000000000000000..af6f06ee2b0ac51bbf2ca42d1819684979dd267e --- /dev/null +++ b/ci-build.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +PROJECT_ROOT=$(pwd) +export PROJECT_ROOT + +# Quad +bash quad/ci-build.sh || exit 1 diff --git a/test-ci.sh b/ci-test.sh similarity index 66% rename from test-ci.sh rename to ci-test.sh index 8278c93522978d69a943fbc608444196fe58b5ec..5542a1b99fad91c60197f1aa8189a780316b94ff 100644 --- a/test-ci.sh +++ b/ci-test.sh @@ -4,4 +4,4 @@ PROJECT_ROOT=$(pwd) export PROJECT_ROOT # Quad -bash quad/test-ci.sh || exit 1 +bash quad/ci-test.sh || exit 1 diff --git a/controls/MATLAB/momentOfInertia/J_calc_bifilar.m b/controls/MATLAB/momentOfInertia/J_calc_bifilar.m new file mode 100644 index 0000000000000000000000000000000000000000..9f52a69ec50752c0c2b2b644f1a5b373ccc74bcb --- /dev/null +++ b/controls/MATLAB/momentOfInertia/J_calc_bifilar.m @@ -0,0 +1,36 @@ +function J = J_calc_bifilar( m , g, D, L, t, n , varargin) +%UNTITLED Summary of this function goes here +% Detailed explanation goes here + +average_strings = {'average','mean','ave'}; +least_squares_strings = {'least squares','ls'}; + +mode = 0; +if ~isempty(varargin) + for k = 1:length(varargin) + if any(strcmpi(varargin{k},average_strings)) + mode = 0; + end + if any(strcmpi(varargin{k},least_squares_strings)) + mode = 1; + end + end +end + +if mode == 0 %averge + N = length(t); + Js = zeros(1,N); + for k = 1:N + Js(k) = m(k)*g*D(k)^2/(16*pi^2*L(k))*(t(k)/n(k))^2; + end + J = mean(Js); +end + +if mode == 1 %least squares + J = (16*pi^2*L./(m*g.*D.^2))\(t./n).^2 ; +end + + + +end + diff --git a/controls/MATLAB/momentOfInertia/J_calc_bifilar_script.m b/controls/MATLAB/momentOfInertia/J_calc_bifilar_script.m new file mode 100644 index 0000000000000000000000000000000000000000..5eb3ce5744009130baa1ca91115140fd5bb20889 --- /dev/null +++ b/controls/MATLAB/momentOfInertia/J_calc_bifilar_script.m @@ -0,0 +1,39 @@ + +% inches2meters = 0.0254 ; + +%% +% %Jxx +% m = 1.244*ones(5,1); +% D = (12+3/8)*inches2meters*ones(5,1); +% L = (81+3/4)*inches2meters*ones(5,1); +% t = [ 94.58 ; 93.91 ; 93.81 ; 94.16 ; 94.04 ] ; +% n = 50*ones(5,1); + +% %Jyy +% m = 1.244*ones(5,1); +% D = (12+3/8)*inches2meters*ones(5,1); +% L = (91+3/4)*inches2meters*ones(5,1); +% t = [ 103.31 ; 103.15 ; 103.31 ; 103.47 ; 103.13 ] ; +% n = 50*ones(5,1); + + +% %Jzz +% m = 1.244*ones(5,1); +% D = (19+3/16)*inches2meters*ones(5,1); +% L = (96+1/4)*inches2meters*ones(5,1); +% t = [ 96.64 ; 97.47 ; 97.75 ; 97.35 ; 97.78 ] ; +% n = 50*ones(5,1); + +load .\git_repos\microCART_17-18\controls\dataCollection\bifilar_inertia_2_18_2017\MicroCART_bifilar_Jxx_2_18_2017 ; +Jxx_a = J_calc_bifilar( m , g, D, L, t, n , 'average') +Jxx_ls = J_calc_bifilar( m , g, D, L, t, n , 'least squares') + +clear D L m n t +load .\git_repos\microCART_17-18\controls\dataCollection\bifilar_inertia_2_18_2017\MicroCART_bifilar_Jyy_2_18_2017 ; +Jyy_a = J_calc_bifilar( m , g, D, L, t, n , 'average') +Jyy_ls = J_calc_bifilar( m , g, D, L, t, n , 'least squares') + +clear D L m n t +load .\git_repos\microCART_17-18\controls\dataCollection\bifilar_inertia_2_18_2017\MicroCART_bifilar_Jzz_2_18_2017 ; +Jzz_a = J_calc_bifilar( m , g, D, L, t, n , 'average') +Jzz_ls = J_calc_bifilar( m , g, D, L, t, n , 'least squares') diff --git a/controls/dataCollection/bifilar_inertia_2_18_2017/MicroCART_bifilar_Jxx_2_18_2017.mat b/controls/dataCollection/bifilar_inertia_2_18_2017/MicroCART_bifilar_Jxx_2_18_2017.mat new file mode 100644 index 0000000000000000000000000000000000000000..48cb1e16636289e804e0c1200d9edd36a70fa57e Binary files /dev/null and b/controls/dataCollection/bifilar_inertia_2_18_2017/MicroCART_bifilar_Jxx_2_18_2017.mat differ diff --git a/controls/dataCollection/bifilar_inertia_2_18_2017/MicroCART_bifilar_Jyy_2_18_2017.mat b/controls/dataCollection/bifilar_inertia_2_18_2017/MicroCART_bifilar_Jyy_2_18_2017.mat new file mode 100644 index 0000000000000000000000000000000000000000..2842eacc1c1fa3724f45532d9bb9e76dc645e831 Binary files /dev/null and b/controls/dataCollection/bifilar_inertia_2_18_2017/MicroCART_bifilar_Jyy_2_18_2017.mat differ diff --git a/controls/dataCollection/bifilar_inertia_2_18_2017/MicroCART_bifilar_Jzz_2_18_2017.mat b/controls/dataCollection/bifilar_inertia_2_18_2017/MicroCART_bifilar_Jzz_2_18_2017.mat new file mode 100644 index 0000000000000000000000000000000000000000..0d71dc977e35ad7dd86cb73038c729e6f97e11f2 Binary files /dev/null and b/controls/dataCollection/bifilar_inertia_2_18_2017/MicroCART_bifilar_Jzz_2_18_2017.mat differ diff --git a/controls/dataCollection/bifilar_inertia_2_18_2017/info.txt b/controls/dataCollection/bifilar_inertia_2_18_2017/info.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/controls/model/modelParameters.m b/controls/model/modelParameters.m index 37f6b9b12cf17c951f9f626c0c895fd39687b4c2..e457e0332bd2705446dba5aa74145ebb9f26aeb0 100644 --- a/controls/model/modelParameters.m +++ b/controls/model/modelParameters.m @@ -1,11 +1,12 @@ % Model Parameters - m = 1.19; % Quadrotor + battery mass + m = 1.244; % Quadrotor + battery mass g = 9.81; % Acceleration of gravity - %Jxx = 0.0218; % Quadrotor and battery motor of inertia around bx (pitch) - %Jyy = 0.0277; % Quadrotor and battery motor of inertia around by (roll) - Jxx = 0.0277; - Jyy = 0.0218; - Jzz = 0.0332; % Quadrotor and battery motor of inertia around bz (yaw) +% Jxx = 0.0277; % Quadrotor and battery motor of inertia around bx (pitch) +% Jyy = 0.0218; % Quadrotor and battery motor of inertia around by (roll) +% Jzz = 0.0332; % Quadrotor and battery motor of inertia around bz (yaw) + Jxx = 0.0130; % Quadrotor and battery motor of inertia around bx (pitch) + Jyy = 0.0140; % Quadrotor and battery motor of inertia around by (roll) + Jzz = 0.0285; % Quadrotor and battery motor of inertia around bz (yaw) Jreq = 4.2012e-05; % Rotor and motor moment of inertia around axis of rotation Kt = 8.6519e-6; % Rotor thrust constant Kh = 0; % Rotor in-plane drag constant diff --git a/controls/model/test_model.slx b/controls/model/test_model.slx index 182f6644f67548ea7dab7135d8914658033a7ad7..805e43a9e1d83040c87b713476195126ca17d371 100644 Binary files a/controls/model/test_model.slx and b/controls/model/test_model.slx differ diff --git a/controls/model/test_model_R2015A.mdl b/controls/model/test_model_R2015A.mdl index bdec86fe72075d99163046fc48e26d1eb4ad7931..ce48e8a27d8d691a51c7680ee7430230795f463d 100644 --- a/controls/model/test_model_R2015A.mdl +++ b/controls/model/test_model_R2015A.mdl @@ -1,17 +1,18 @@ Model { Name "test_model_R2015A" Version 8.5 + MdlSubVersion 0 SavedCharacterEncoding "windows-1252" GraphicalInterface { NumRootInports 0 NumRootOutports 0 ParameterArgumentNames "" - ComputedModelVersion "1.1926" + ComputedModelVersion "1.2002" NumModelReferences 0 NumTestPointedSignals 0 } ScopeRefreshTime 0.035000 - OverrideScopeRefreshTime on + OverrideScopeRefreshTime off DisableAllScopes off DataTypeOverride "UseLocalSettings" DataTypeOverrideAppliesTo "AllNumericTypes" @@ -28,7 +29,7 @@ Model { $ObjectID 2 $ClassName "Simulink.WindowInfo" IsActive [1] - Location [-8.0, -8.0, 1936.0, 1056.0] + Location [69.0, 48.0, 1743.0, 940.0] Object { $PropName "ModelBrowserInfo" $ObjectID 3 @@ -43,28 +44,28 @@ Model { $PropName "ExplorerBarInfo" $ObjectID 4 $ClassName "Simulink.ExplorerBarInfo" - Visible [0] + Visible [1] } Array { Type "Simulink.EditorInfo" Dimension 2 Object { $ObjectID 5 - IsActive [0] + IsActive [1] ViewObjType "SimulinkTopLevel" LoadSaveID "0" - Extents [1755.0, 904.0] + Extents [1693.0, 762.0] ZoomFactor [1.25] - Offset [317.9000000000002, 148.73333824475606] + Offset [113.60000000000002, 92.0] } Object { $ObjectID 6 - IsActive [1] + IsActive [0] ViewObjType "SimulinkSubsys" - LoadSaveID "573" - Extents [1755.0, 904.0] - ZoomFactor [1.5] - Offset [135.31666666666638, 158.93095238095214] + LoadSaveID "658" + Extents [1693.0, 762.0] + ZoomFactor [1.0] + Offset [0.0, 0.0] } PropName "EditorsInfo" } @@ -74,13 +75,13 @@ Model { Creator "Andy" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%<Auto>" - LastModifiedBy "Andy" + LastModifiedBy "m87rich" ModifiedDateFormat "%<Auto>" - LastModifiedDate "Wed Feb 08 12:06:59 2017" - RTWModifiedTimeStamp 408456418 - ModelVersionFormat "1.%<AutoIncrement:1926>" + LastModifiedDate "Sun Feb 19 17:01:58 2017" + RTWModifiedTimeStamp 409366141 + ModelVersionFormat "1.%<AutoIncrement:2002>" ConfigurationManager "none" - SampleTimeColors off + SampleTimeColors on SampleTimeAnnotations off LibraryLinkDisplay "disabled" WideLines off @@ -119,7 +120,7 @@ Model { TryForcingSFcnDF off Object { $PropName "DataLoggingOverride" - $ObjectID 8 + $ObjectID 7 $ClassName "Simulink.SimulationData.ModelLoggingInfo" model_ "test_model_R2015A" overrideMode_ [0.0] @@ -184,16 +185,16 @@ Model { Type "Handle" Dimension 1 Simulink.ConfigSet { - $ObjectID 9 + $ObjectID 8 Version "1.15.0" Array { Type "Handle" Dimension 8 Simulink.SolverCC { - $ObjectID 10 + $ObjectID 9 Version "1.15.0" StartTime "0.0" - StopTime "10" + StopTime "20" AbsTol "auto" FixedStep "auto" InitialStep "auto" @@ -211,8 +212,8 @@ Model { SolverMode "SingleTasking" EnableConcurrentExecution off ConcurrentTasks off - Solver ode45 - SolverName ode45 + Solver "ode45" + SolverName "ode45" SolverJacobianMethodControl "auto" ShapePreserveControl "DisableAll" ZeroCrossControl "UseLocalSettings" @@ -225,7 +226,7 @@ Model { InsertRTBMode "Whenever possible" } Simulink.DataIOCC { - $ObjectID 11 + $ObjectID 10 Version "1.15.0" Decimation "1" ExternalInput "[t, u]" @@ -258,7 +259,7 @@ Model { Refine "1" } Simulink.OptimizationCC { - $ObjectID 12 + $ObjectID 11 Version "1.15.0" Array { Type "Cell" @@ -315,7 +316,7 @@ Model { AccelVerboseBuild off } Simulink.DebuggingCC { - $ObjectID 13 + $ObjectID 12 Version "1.15.0" RTPrefix "error" ConsistencyChecking "none" @@ -343,6 +344,7 @@ Model { IgnoredZcDiagnostic "warning" SolverPrmCheckMsg "none" InheritedTsInSrcMsg "warning" + DiscreteInheritContinuousMsg "warning" MultiTaskDSMMsg "error" MultiTaskCondExecSysMsg "error" MultiTaskRateTransMsg "error" @@ -403,7 +405,7 @@ Model { IntegerSaturationMsg "warning" } Simulink.HardwareCC { - $ObjectID 14 + $ObjectID 13 Version "1.15.0" ProdBitPerChar 8 ProdBitPerShort 16 @@ -443,7 +445,7 @@ Model { ProdEqTarget on } Simulink.ModelReferenceCC { - $ObjectID 15 + $ObjectID 14 Version "1.15.0" UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" CheckModelReferenceTargetMessage "error" @@ -458,8 +460,9 @@ Model { SupportModelReferenceSimTargetCustomCode off } Simulink.SFSimCC { - $ObjectID 16 + $ObjectID 15 Version "1.15.0" + SFSimOverflowDetection on SFSimEcho on SimCtrlC on SimIntegrity on @@ -470,7 +473,7 @@ Model { } Simulink.RTWCC { $BackupClass "Simulink.RTWCC" - $ObjectID 17 + $ObjectID 16 Version "1.15.0" Array { Type "Cell" @@ -496,8 +499,10 @@ Model { MakeCommand "make_rtw" GenerateMakefile on PackageGeneratedCodeAndArtifacts off + PackageName "" TemplateMakefile "grt_default_tmf" PostCodeGenCommand "" + Description "" GenerateReport off SaveLog off RTWVerbose on @@ -508,6 +513,13 @@ Model { TLCAssert off RTWUseLocalCustomCode off RTWUseSimCustomCode off + CustomSourceCode "" + CustomHeaderCode "" + CustomInclude "" + CustomSource "" + CustomLibrary "" + CustomInitializer "" + CustomTerminator "" Toolchain "Automatically locate an installed toolchain" BuildConfiguration "Faster Builds" IncludeHyperlinkInReport off @@ -538,7 +550,7 @@ Model { Type "Handle" Dimension 2 Simulink.CodeAppCC { - $ObjectID 18 + $ObjectID 17 Version "1.15.0" Array { Type "Cell" @@ -611,7 +623,7 @@ Model { } Simulink.GRTTargetCC { $BackupClass "Simulink.TargetCC" - $ObjectID 19 + $ObjectID 18 Version "1.15.0" Array { Type "Cell" @@ -701,17 +713,17 @@ Model { } Name "Configuration" CurrentDlgPage "Diagnostics" - ConfigPrmDlgPosition [ 195, 142, 1085, 882 ] + ConfigPrmDlgPosition [ 195, 142, 1085, 882 ] } PropName "ConfigurationSets" } Simulink.ConfigSet { $PropName "ActiveConfigurationSet" - $ObjectID 9 + $ObjectID 8 } Object { $PropName "DataTransfer" - $ObjectID 21 + $ObjectID 19 $ClassName "Simulink.GlobalDataTransfer" DefaultTransitionBetweenSyncTasks "Ensure deterministic transfer (maximum delay)" DefaultTransitionBetweenAsyncTasks "Ensure data integrity only" @@ -773,9 +785,11 @@ Model { BlockParameterDefaults { Block { BlockType BusCreator + Inputs "4" DisplayOption "none" OutDataTypeStr "Inherit: auto" NonVirtualBus off + InheritFromInputs on } Block { BlockType BusSelector @@ -842,6 +856,43 @@ Model { IgnoreLimit off StateMustResolveToSignalObject off RTWStateStorageClass "Auto" + ICPrevOutput "DiscIntNeverNeededParam" + ICPrevScaledInput "DiscIntNeverNeededParam" + } + Block { + BlockType DiscreteTransferFcn + NumeratorSource "Dialog" + Numerator "[1]" + DenominatorSource "Dialog" + Denominator "[1 0.5]" + InitialStatesSource "Dialog" + InitialStates "0" + InputProcessing "Elements as channels (sample based)" + ExternalReset "None" + InitialDenominatorStates "0" + FilterStructure "Direct form II" + SampleTime "-1" + a0EqualsOne off + NumCoefMin "[]" + NumCoefMax "[]" + DenCoefMin "[]" + DenCoefMax "[]" + OutMin "[]" + OutMax "[]" + StateDataTypeStr "Inherit: Same as input" + MultiplicandDataTypeStr "Inherit: Same as input" + NumCoefDataTypeStr "Inherit: Inherit via internal rule" + DenCoefDataTypeStr "Inherit: Inherit via internal rule" + NumProductDataTypeStr "Inherit: Inherit via internal rule" + DenProductDataTypeStr "Inherit: Inherit via internal rule" + NumAccumDataTypeStr "Inherit: Inherit via internal rule" + DenAccumDataTypeStr "Inherit: Inherit via internal rule" + OutDataTypeStr "Inherit: Inherit via internal rule" + LockScale off + RndMeth "Floor" + SaturateOnIntegerOverflow off + StateMustResolveToSignalObject off + RTWStateStorageClass "Auto" } Block { BlockType Gain @@ -950,6 +1001,8 @@ Model { FunctionName "system" SFunctionModules "''" PortCounts "[]" + SFunctionDeploymentMode off + EnableBusSupport off } Block { BlockType Saturate @@ -968,7 +1021,23 @@ Model { } Block { BlockType Scope - Floating off + ModelBased off + TickLabels "OneTimeTick" + ZoomMode "on" + Grid "on" + ShowLegends off + TimeRange "auto" + YMin "-5" + YMax "5" + SaveToWorkspace off + SaveName "ScopeData" + DataFormat "Array" + LimitDataPoints on + MaxDataPoints "5000" + Decimation "1" + SampleInput off + SampleTime "-1" + ScrollMode off } Block { BlockType Step @@ -987,6 +1056,7 @@ Model { TreatAsAtomicUnit off MinAlgLoopOccurrences off PropExecContextOutsideSubsystem off + CheckFcnCallInpInsideContextMsg off SystemSampleTime "-1" RTWSystemCode "Auto" RTWFcnNameOpts "Auto" @@ -1005,9 +1075,8 @@ Model { Opaque off MaskHideContents off SFBlockType "NONE" + Variant off GeneratePreprocessorConditionals off - PropagateVariantConditions off - TreatAsGroupedWhenPropagatingVariantConditions on ContentPreviewEnabled off IsWebBlock off } @@ -1037,8 +1106,8 @@ Model { } System { Name "test_model_R2015A" - Location [-8, -8, 1928, 1048] - Open off + Location [69, 48, 1812, 988] + Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" @@ -1051,21 +1120,20 @@ Model { ShowPageBoundaries off ZoomFactor "125" ReportName "simulink-default.rpt" - SIDHighWatermark "864" + SIDHighWatermark "904" Block { BlockType SubSystem Name " Sensors " SID "650" - Ports [6, 3] - Position [1300, 422, 1520, 658] + Ports [6, 4] + Position [1195, 272, 1415, 508] ZOrder 73 + ForegroundColor "yellow" ShowName off - Commented "on" RequestExecContextInheritance off - Variant off Object { $PropName "MaskObject" - $ObjectID 22 + $ObjectID 20 $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" @@ -1075,7 +1143,7 @@ Model { } System { Name " Sensors " - Location [-8, -8, 1928, 1048] + Location [69, 48, 1812, 988] Open off ModelBrowserVisibility off ModelBrowserWidth 200 @@ -1087,7 +1155,7 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "100" + ZoomFactor "125" Block { BlockType Inport Name "B_Omega" @@ -1100,7 +1168,7 @@ Model { BlockType Inport Name "euler_angles" SID "652" - Position [1720, 1043, 1750, 1057] + Position [1440, 1043, 1470, 1057] ZOrder 266 Port "2" IconDisplay "Port number" @@ -1118,7 +1186,7 @@ Model { BlockType Inport Name "E_ro" SID "654" - Position [1720, 963, 1750, 977] + Position [1440, 963, 1470, 977] ZOrder 268 Port "4" IconDisplay "Port number" @@ -1146,14 +1214,13 @@ Model { Name "3D Graphical Simulation" SID "698" Ports [2] - Position [2005, 1075, 2155, 1135] + Position [1725, 1075, 1875, 1135] ZOrder 287 Commented "on" RequestExecContextInheritance off - Variant off Object { $PropName "MaskObject" - $ObjectID 23 + $ObjectID 21 $ClassName "Simulink.Mask" Display "port_label('input',1,'r_{o}','texmode','on')\nport_label('input',2,'\\Theta','texmode','on')" } @@ -1199,7 +1266,6 @@ Model { ShowName off Inputs "3" DisplayOption "bar" - InheritFromInputs on } Block { BlockType BusCreator @@ -1211,7 +1277,6 @@ Model { ShowName off Inputs "3" DisplayOption "bar" - InheritFromInputs on } Block { BlockType BusCreator @@ -1223,7 +1288,6 @@ Model { ShowName off Inputs "3" DisplayOption "bar" - InheritFromInputs on } Block { BlockType BusSelector @@ -1336,11 +1400,10 @@ Model { Position [655, 92, 725, 138] ZOrder 5 ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off System { Name "MATLAB Function" Location [223, 338, 826, 833] @@ -1384,7 +1447,6 @@ Model { ZOrder 10 FunctionName "sf_sfun" PortCounts "[1 2]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -1464,7 +1526,7 @@ Model { Ports [2] Position [865, 76, 1055, 234] ZOrder -15 - LibraryVersion "1.36" + LibraryVersion "1.34" SourceBlock "vrlib/VR Sink" SourceType "Virtual Reality Sink" InstantiateOnLoad on @@ -1646,17 +1708,17 @@ Model { Ports [2] Position [2635, 815, 2785, 875] ZOrder 290 + Commented "on" RequestExecContextInheritance off - Variant off Object { $PropName "MaskObject" - $ObjectID 24 + $ObjectID 22 $ClassName "Simulink.Mask" Display "port_label('input',1, '\\Theta','texmode','on')\nport_label('input',2,'r_{o}','texmode','on')" } System { Name "3D Graphical Simulation1" - Location [-8, -8, 1928, 1048] + Location [108, 36, 1850, 976] Open off ModelBrowserVisibility off ModelBrowserWidth 200 @@ -1696,7 +1758,6 @@ Model { ShowName off Inputs "3" DisplayOption "bar" - InheritFromInputs on } Block { BlockType BusCreator @@ -1708,7 +1769,6 @@ Model { ShowName off Inputs "3" DisplayOption "bar" - InheritFromInputs on } Block { BlockType BusCreator @@ -1720,7 +1780,6 @@ Model { ShowName off Inputs "3" DisplayOption "bar" - InheritFromInputs on } Block { BlockType BusSelector @@ -1833,11 +1892,10 @@ Model { Position [655, 92, 725, 138] ZOrder 5 ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off System { Name "MATLAB Function" Location [223, 338, 826, 833] @@ -1881,7 +1939,6 @@ Model { ZOrder 10 FunctionName "sf_sfun" PortCounts "[1 2]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -1961,7 +2018,7 @@ Model { Ports [2] Position [865, 76, 1055, 234] ZOrder -15 - LibraryVersion "1.36" + LibraryVersion "1.34" SourceBlock "vrlib/VR Sink" SourceType "Virtual Reality Sink" InstantiateOnLoad on @@ -2145,14 +2202,13 @@ Model { ZOrder 275 ShowName off ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off Object { $PropName "MaskObject" - $ObjectID 25 + $ObjectID 23 $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_{Gyro}/dt', 'texmode', 'on');\ndisp('A_{EB}', 'texmode'," @@ -2210,7 +2266,6 @@ Model { ZOrder 14 FunctionName "sf_sfun" PortCounts "[2 2]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -2283,14 +2338,13 @@ Model { ZOrder 284 ShowName off ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off Object { $PropName "MaskObject" - $ObjectID 26 + $ObjectID 24 $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" @@ -2348,7 +2402,6 @@ Model { ZOrder 10 FunctionName "sf_sfun" PortCounts "[2 3]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -2444,14 +2497,13 @@ Model { ZOrder 274 ShowName off ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off Object { $PropName "MaskObject" - $ObjectID 27 + $ObjectID 25 $ClassName "Simulink.Mask" Display "port_label('input', 1, '\\theta_{accel}', 'texmode', 'on');\nport_label('input', 2, '\\phi_{accel}'" ", 'texmode', 'on');\nport_label('input', 3, '\\Theta_{Gyro}', 'texmode', 'on');\n%port_label('input', 4, '\\Theta" @@ -2519,7 +2571,6 @@ Model { ZOrder 10 FunctionName "sf_sfun" PortCounts "[3 2]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -2613,13 +2664,36 @@ Model { InputPortMap "u0" DelayLength "1" InitialCondition "0" + SampleTime "5e-3" + } + Block { + BlockType Delay + Name "Delay3" + SID "881" + Ports [1, 1] + Position [2055, 953, 2090, 987] + ZOrder 313 + InputPortMap "u0" + DelayLength "6" + SampleTime "0.01" + } + Block { + BlockType Delay + Name "Delay4" + SID "882" + Ports [1, 1] + Position [2100, 998, 2135, 1032] + ZOrder 314 + InputPortMap "u0" + DelayLength "6" + SampleTime "0.01" } Block { BlockType Demux Name "Demux" SID "732" Ports [1, 3] - Position [1810, 1023, 1815, 1077] + Position [1530, 1023, 1535, 1077] ZOrder 294 ShowName off Outputs "3" @@ -2636,6 +2710,27 @@ Model { Outputs "2" DisplayOption "bar" } + Block { + BlockType Demux + Name "Demux2" + SID "903" + Ports [1, 3] + Position [2275, 1038, 2280, 1092] + ZOrder 316 + ShowName off + Outputs "3" + DisplayOption "bar" + } + Block { + BlockType DiscreteIntegrator + Name "Discrete-Time\nIntegrator" + SID "877" + Ports [1, 1] + Position [1935, 732, 1970, 768] + ZOrder 309 + InitialConditionSetting "State (most efficient)" + SampleTime "5e-3" + } Block { BlockType Reference Name "First-Order\nHold" @@ -2643,7 +2738,8 @@ Model { Ports [1, 1] Position [2530, 780, 2565, 810] ZOrder 292 - LibraryVersion "1.388" + Commented "on" + LibraryVersion "1.356" DisableCoverage on SourceBlock "simulink/Discrete/First-Order\nHold" SourceType "First-Order Hold" @@ -2657,7 +2753,8 @@ Model { Ports [1, 1] Position [2530, 875, 2565, 905] ZOrder 296 - LibraryVersion "1.388" + Commented "on" + LibraryVersion "1.356" DisableCoverage on SourceBlock "simulink/Discrete/First-Order\nHold" SourceType "First-Order Hold" @@ -2673,10 +2770,9 @@ Model { ZOrder 272 ShowName off RequestExecContextInheritance off - Variant off Object { $PropName "MaskObject" - $ObjectID 28 + $ObjectID 26 $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')" @@ -2685,8 +2781,8 @@ Model { } System { Name "IMU\n\n\n\n\n\n" - Location [-8, -8, 1928, 1048] - Open off + Location [239, 71, 1982, 1011] + Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" @@ -2742,14 +2838,13 @@ Model { ZOrder 1 LibraryVersion "1.32" ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off Object { $PropName "MaskObject" - $ObjectID 29 + $ObjectID 27 $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" @@ -2836,7 +2931,6 @@ Model { FunctionName "sf_sfun" Parameters "g" PortCounts "[5 3]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -2944,66 +3038,102 @@ Model { } } } + Block { + BlockType Delay + Name "Delay" + SID "899" + Ports [1, 1] + Position [605, 193, 640, 227] + ZOrder 45 + InputPortMap "u0" + DelayLength "4" + } + Block { + BlockType Delay + Name "Delay1" + SID "900" + Ports [1, 1] + Position [605, 278, 640, 312] + ZOrder 46 + InputPortMap "u0" + DelayLength "4" + } + Block { + BlockType DiscreteTransferFcn + Name "Discrete\nTransfer Fcn" + SID "897" + Ports [1, 1] + Position [490, 187, 570, 233] + ZOrder 43 + InputPortMap "u0" + Numerator "[0.02469]" + Denominator "[1 -0.9752]" + SampleTime "5e-3" + } + Block { + BlockType DiscreteTransferFcn + Name "Discrete\nTransfer Fcn1" + SID "898" + Ports [1, 1] + Position [490, 272, 570, 318] + ZOrder 44 + InputPortMap "u0" + Numerator "[0.02469]" + Denominator "[1 -0.9752]" + SampleTime "5e-3" + } Block { BlockType DiscreteIntegrator Name "Discrete-Time\nIntegrator" SID "835" Ports [1, 1] - Position [725, 372, 760, 408] + Position [985, 372, 1020, 408] ZOrder 30 InitialConditionSetting "State (most efficient)" SampleTime "-1" - ICPrevOutput "DiscIntNeverNeededParam" - ICPrevScaledInput "DiscIntNeverNeededParam" } Block { BlockType DiscreteIntegrator Name "Discrete-Time\nIntegrator1" SID "837" Ports [1, 1] - Position [910, 342, 945, 378] + Position [1170, 342, 1205, 378] ZOrder 32 InitialConditionSetting "State (most efficient)" SampleTime "-1" - ICPrevOutput "DiscIntNeverNeededParam" - ICPrevScaledInput "DiscIntNeverNeededParam" } Block { BlockType DiscreteIntegrator Name "Discrete-Time\nIntegrator2" SID "839" Ports [1, 1] - Position [950, 247, 985, 283] + Position [1210, 247, 1245, 283] ZOrder 34 InitialConditionSetting "State (most efficient)" SampleTime "-1" - ICPrevOutput "DiscIntNeverNeededParam" - ICPrevScaledInput "DiscIntNeverNeededParam" } Block { BlockType DiscreteIntegrator Name "Discrete-Time\nIntegrator3" SID "841" Ports [1, 1] - Position [575, 437, 610, 473] + Position [835, 437, 870, 473] ZOrder 36 InitialConditionSetting "State (most efficient)" SampleTime "-1" - ICPrevOutput "DiscIntNeverNeededParam" - ICPrevScaledInput "DiscIntNeverNeededParam" } Block { BlockType Ground Name "Ground" SID "664" - Position [550, 340, 570, 360] + Position [810, 340, 830, 360] ZOrder 23 } Block { BlockType Ground Name "Ground1" SID "665" - Position [550, 145, 570, 165] + Position [810, 145, 830, 165] ZOrder 24 } Block { @@ -3019,25 +3149,12 @@ Model { Name "Scope" SID "836" Ports [1] - Position [805, 374, 835, 406] + Position [1065, 374, 1095, 406] ZOrder 31 - NumInputPorts "1" + Floating off + Location [680, 330, 1240, 750] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData1 - YMin -0.0001 - YMax 0.00021 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -3052,32 +3169,23 @@ 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] + YMin "-0.0001" + YMax "0.00021" + SaveName "ScopeData1" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope1" SID "838" Ports [1] - Position [990, 344, 1020, 376] + Position [1250, 344, 1280, 376] ZOrder 33 - NumInputPorts "1" + Floating off + Location [306, 114, 866, 534] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData2 - YMin -0.0001 - YMax 0.00021 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -3092,32 +3200,23 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [306 114 866 534] + YMin "-0.0001" + YMax "0.00021" + SaveName "ScopeData2" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope2" SID "840" Ports [1] - Position [1030, 249, 1060, 281] + Position [1290, 249, 1320, 281] ZOrder 35 - NumInputPorts "1" + Floating off + Location [680, 330, 1240, 750] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData3 - YMin -1.00000 - YMax 1.00000 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -3132,32 +3231,23 @@ 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] + YMin "-1.00000" + YMax "1.00000" + SaveName "ScopeData3" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope3" SID "842" Ports [1] - Position [655, 439, 685, 471] + Position [915, 439, 945, 471] ZOrder 37 - NumInputPorts "1" + Floating off + Location [306, 114, 866, 534] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData4 - YMin -1.00000 - YMax 1.00000 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -3172,32 +3262,23 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [306 114 866 534] + YMin "-1.00000" + YMax "1.00000" + SaveName "ScopeData4" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope4" SID "843" Ports [1] - Position [580, 389, 610, 421] + Position [840, 389, 870, 421] ZOrder 38 - NumInputPorts "1" + Floating off + Location [306, 114, 866, 534] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData5 - YMin -0.00912 - YMax 0.01325 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -3212,7 +3293,11 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [306 114 866 534] + YMin "-0.00912" + YMax "0.01325" + SaveName "ScopeData5" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope @@ -3221,23 +3306,10 @@ Model { Ports [1] Position [295, 359, 325, 391] ZOrder 40 - NumInputPorts "1" + Floating off + Location [306, 114, 866, 534] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData6 - YMin -1.00000 - YMax 1.00000 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -3252,14 +3324,18 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [306 114 866 534] + YMin "-1.00000" + YMax "1.00000" + SaveName "ScopeData6" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Sum Name "Sum" SID "666" Ports [2, 1] - Position [690, 285, 710, 305] + Position [950, 285, 970, 305] ZOrder 7 ShowName off IconShape "round" @@ -3273,7 +3349,7 @@ Model { Name "Sum1" SID "667" Ports [2, 1] - Position [690, 200, 710, 220] + Position [950, 200, 970, 220] ZOrder 8 ShowName off IconShape "round" @@ -3287,7 +3363,7 @@ Model { Name "Sum2" SID "668" Ports [2, 1] - Position [570, 285, 590, 305] + Position [830, 285, 850, 305] ZOrder 11 ShowName off IconShape "round" @@ -3301,7 +3377,7 @@ Model { Name "Sum3" SID "669" Ports [2, 1] - Position [570, 200, 590, 220] + Position [830, 200, 850, 220] ZOrder 12 ShowName off IconShape "round" @@ -3314,7 +3390,7 @@ Model { BlockType RandomNumber Name "accelerometer_noise" SID "670" - Position [630, 140, 660, 170] + Position [890, 140, 920, 170] ZOrder 2 Mean "zeros(3,1)" Variance "[ 3e-7 ; 3.3e-7 ; 7.2e-7 ] " @@ -3325,7 +3401,7 @@ Model { BlockType Quantizer Name "accelerometer_quantizer" SID "671" - Position [770, 195, 800, 225] + Position [1030, 195, 1060, 225] ZOrder 9 QuantizationInterval "2.4400e-04" } @@ -3333,7 +3409,7 @@ Model { BlockType ZeroOrderHold Name "accelerometer_sampling" SID "672" - Position [495, 195, 530, 225] + Position [755, 195, 790, 225] ZOrder 15 SampleTime "5e-3" } @@ -3341,7 +3417,7 @@ Model { BlockType RandomNumber Name "gyroscope_noise" SID "673" - Position [630, 315, 660, 345] + Position [890, 315, 920, 345] ZOrder 6 Mean "zeros(3,1)" Variance "[ 2.2e-8 ; 1.1e-7 ; 2.4e-8 ]" @@ -3352,7 +3428,7 @@ Model { BlockType Quantizer Name "gyroscope_qunatizer" SID "674" - Position [770, 280, 800, 310] + Position [1030, 280, 1060, 310] ZOrder 10 QuantizationInterval "1.1e-3" } @@ -3360,7 +3436,7 @@ Model { BlockType ZeroOrderHold Name "gyroscope_sampling" SID "675" - Position [495, 280, 530, 310] + Position [755, 280, 790, 310] ZOrder 16 SampleTime "5e-3" } @@ -3376,7 +3452,7 @@ Model { BlockType Outport Name "accelerometer" SID "677" - Position [840, 203, 870, 217] + Position [1100, 203, 1130, 217] ZOrder 29 IconDisplay "Port number" } @@ -3384,7 +3460,7 @@ Model { BlockType Outport Name "gyroscope" SID "678" - Position [840, 288, 870, 302] + Position [1100, 288, 1130, 302] ZOrder 21 Port "2" IconDisplay "Port number" @@ -3557,20 +3633,6 @@ Model { DstBlock "\n\n\n\n\n\n\n" DstPort 5 } - Line { - ZOrder 30 - SrcBlock "\n\n\n\n\n\n\n" - SrcPort 2 - DstBlock "gyroscope_sampling" - DstPort 1 - } - Line { - ZOrder 31 - SrcBlock "\n\n\n\n\n\n\n" - SrcPort 1 - DstBlock "accelerometer_sampling" - DstPort 1 - } Line { ZOrder 36 SrcBlock "Discrete-Time\nIntegrator" @@ -3620,16 +3682,50 @@ Model { DstBlock "accelerometer" DstPort 1 } + Line { + ZOrder 79 + SrcBlock "\n\n\n\n\n\n\n" + SrcPort 1 + DstBlock "Discrete\nTransfer Fcn" + DstPort 1 + } + Line { + ZOrder 80 + SrcBlock "\n\n\n\n\n\n\n" + SrcPort 2 + DstBlock "Discrete\nTransfer Fcn1" + DstPort 1 + } + Line { + ZOrder 81 + SrcBlock "Discrete\nTransfer Fcn" + SrcPort 1 + DstBlock "Delay" + DstPort 1 + } + Line { + ZOrder 82 + SrcBlock "Discrete\nTransfer Fcn1" + SrcPort 1 + DstBlock "Delay1" + DstPort 1 + } + Line { + ZOrder 83 + SrcBlock "Delay" + SrcPort 1 + DstBlock "accelerometer_sampling" + DstPort 1 + } + Line { + ZOrder 84 + SrcBlock "Delay1" + SrcPort 1 + DstBlock "gyroscope_sampling" + DstPort 1 + } } } - Block { - BlockType Integrator - Name "Integrator" - SID "776" - Ports [1, 1] - Position [1945, 735, 1975, 765] - ZOrder 307 - } Block { BlockType Mux Name "Mux" @@ -3646,14 +3742,13 @@ Model { Name "OptiTrack Camera System\n\n " SID "681" Ports [2, 2] - Position [1990, 946, 2230, 1039] + Position [1720, 906, 1950, 1039] ZOrder 299 ShowName off RequestExecContextInheritance off - Variant off Object { $PropName "MaskObject" - $ObjectID 30 + $ObjectID 28 $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" @@ -3661,7 +3756,7 @@ Model { } System { Name "OptiTrack Camera System\n\n " - Location [-8, -8, 1928, 1048] + Location [69, 48, 1812, 988] Open off ModelBrowserVisibility off ModelBrowserWidth 200 @@ -3673,7 +3768,7 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "175" + ZoomFactor "150" Block { BlockType Inport Name "E_ro" @@ -3700,7 +3795,7 @@ Model { Mean "zeros(3,1)" Variance "[ 7.9664e-10 ; 1.1928e-10 ; 5.0636e-10 ] " Seed "[0,1,2]" - SampleTime "5e-3" + SampleTime "0.01" } Block { BlockType Quantizer @@ -3716,7 +3811,7 @@ Model { SID "686" Position [410, 230, 445, 260] ZOrder 38 - SampleTime "5e-3" + SampleTime "0.01" } Block { BlockType Ground @@ -3794,8 +3889,9 @@ Model { SID "693" Position [545, 365, 575, 395] ZOrder 46 - Variance "1.0783e-9" - SampleTime "5e-3" + Mean "zeros(3,1)" + Variance "1.0783e-9*ones(3,1)" + SampleTime "0.01" } Block { BlockType Quantizer @@ -3811,7 +3907,7 @@ Model { SID "695" Position [410, 330, 445, 360] ZOrder 54 - SampleTime "5e-3" + SampleTime "0.01" } Block { BlockType Outport @@ -3941,23 +4037,10 @@ Model { Ports [1] Position [1385, 669, 1415, 701] ZOrder 270 - NumInputPorts "1" + Floating off + Location [680, 330, 1240, 750] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData1 - YMin -0.00277 - YMax 0.00209 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -3972,7 +4055,11 @@ 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] + YMin "-0.00277" + YMax "0.00209" + SaveName "ScopeData1" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope @@ -3981,23 +4068,10 @@ Model { Ports [1] Position [1385, 599, 1415, 631] ZOrder 271 - NumInputPorts "1" + Floating off + Location [10, 76, 1918, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData2 - YMin -2.04337 - YMax 0.22704 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -4012,7 +4086,11 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [1 76 1909 1039] + YMin "-2.04337" + YMax "0.22704" + SaveName "ScopeData2" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope @@ -4021,23 +4099,10 @@ Model { Ports [1] Position [2550, 534, 2580, 566] ZOrder 308 - NumInputPorts "1" + Floating off + Location [1, 76, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData7 - YMin -182.40701 - YMax 117.99145 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -4052,7 +4117,11 @@ 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] + YMin "-182.40701" + YMax "117.99145" + SaveName "ScopeData7" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope @@ -4061,23 +4130,10 @@ Model { Ports [1] Position [2255, 534, 2285, 566] ZOrder 278 - NumInputPorts "1" + Floating off + Location [1, 76, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData4 - YMin -0.05134 - YMax 0.44242 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat Array - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -4092,7 +4148,10 @@ 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] + YMin "-0.05134" + YMax "0.44242" + SaveName "ScopeData4" + LimitDataPoints off } Block { BlockType Scope @@ -4101,23 +4160,10 @@ Model { Ports [1] Position [1955, 469, 1985, 501] ZOrder 280 - NumInputPorts "1" + Floating off + Location [1, 76, 1909, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData5 - YMin -1.00000 - YMax 1.00000 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -4132,7 +4178,11 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [1 76 1909 1039] + YMin "-1.00000" + YMax "1.00000" + SaveName "ScopeData5" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope @@ -4141,23 +4191,10 @@ Model { Ports [1] Position [1955, 544, 1985, 576] ZOrder 281 - NumInputPorts "1" + Floating off + Location [1, 76, 1909, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData6 - YMin -1.00000 - YMax 1.00000 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -4172,29 +4209,31 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [1 76 1909 1039] + YMin "-1.00000" + YMax "1.00000" + SaveName "ScopeData6" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType S-Function Name "Soft Real Time" SID "742" Ports [] - Position [2033, 1185, 2120, 1216] + Position [2618, 735, 2705, 766] ZOrder 288 ShowName off Commented "on" FunctionName "sfun_time" Parameters "x" - SFunctionDeploymentMode off - EnableBusSupport off Object { $PropName "MaskObject" - $ObjectID 31 + $ObjectID 29 $ClassName "Simulink.Mask" Display "color('red')\ndisp('Soft Real Time')\n" Object { $PropName "Parameters" - $ObjectID 32 + $ObjectID 30 $ClassName "Simulink.MaskParameter" Type "edit" Name "x" @@ -4230,6 +4269,15 @@ Model { Port "3" IconDisplay "Port number" } + Block { + BlockType Outport + Name "camera_euler" + SID "904" + Position [2430, 1038, 2460, 1052] + ZOrder 317 + Port "4" + IconDisplay "Port number" + } Line { ZOrder 1 SrcBlock "IMU\n\n\n\n\n\n" @@ -4355,6 +4403,12 @@ Model { SrcBlock "euler_angles" SrcPort 1 Points [23, 0] + Branch { + ZOrder 210 + Points [0, -45] + DstBlock "OptiTrack Camera System\n\n " + DstPort 2 + } Branch { ZOrder 27 Points [0, 70] @@ -4411,18 +4465,11 @@ Model { } Branch { ZOrder 36 + Points [0, -30] DstBlock "OptiTrack Camera System\n\n " DstPort 1 } } - Line { - ZOrder 37 - SrcBlock "Demux" - SrcPort 3 - Points [23, 0; 0, -55] - DstBlock "OptiTrack Camera System\n\n " - DstPort 2 - } Line { ZOrder 38 SrcBlock "First-Order\nHold1" @@ -4449,9 +4496,9 @@ Model { ZOrder 41 SrcBlock "OptiTrack Camera System\n\n " SrcPort 2 - Points [195, 0; 0, -345] - DstBlock "Mux" - DstPort 3 + Points [70, 0; 0, 10] + DstBlock "Delay4" + DstPort 1 } Line { ZOrder 42 @@ -4480,18 +4527,9 @@ Model { ZOrder 45 SrcBlock "OptiTrack Camera System\n\n " SrcPort 1 - Points [43, 0] - Branch { - ZOrder 100 - Points [0, -80] - DstBlock "First-Order\nHold1" - DstPort 1 - } - Branch { - ZOrder 99 - DstBlock "current_position" - DstPort 1 - } + Points [48, 0; 0, 30] + DstBlock "Delay3" + DstPort 1 } Line { ZOrder 62 @@ -4508,47 +4546,89 @@ Model { DstPort 1 } Line { - ZOrder 73 + ZOrder 202 SrcBlock "Aeb\n\n\n\n\n\n\n\n\n\n" SrcPort 1 - DstBlock "Integrator" + DstBlock "Discrete-Time\nIntegrator" DstPort 1 } Line { - ZOrder 74 - SrcBlock "Integrator" + ZOrder 201 + SrcBlock "Discrete-Time\nIntegrator" SrcPort 1 - Points [15, 0; 0, -15] + Points [20, 0; 0, -15] DstBlock "Complimentary Filter\n\n\n\n\n\n\n\n" DstPort 3 } - } - } - Block { - BlockType SubSystem - Name "Actuation" - SID "436" - Ports [1, 6] - Position [950, 426, 1200, 654] - ZOrder 71 - ShowName off - RequestExecContextInheritance off - Variant off - Object { - $PropName "MaskObject" - $ObjectID 33 - $ClassName "Simulink.Mask" - Display "port_label('input', 1, 'Rotor Duty Cycles', 'texmode', 'on');\nport_label('output', 1, '^{B}Omega', 'texmo" - "de', 'on');\nport_label('output', 2, '\\Theta', 'texmode', 'on');\nport_label('output', 3, '^{B}v_o', 'texmode', 'on'" - ");\nport_label('output', 4, '^{E}r_o', 'texmode', 'on');\nport_label('output', 5, '^{B}dv_o/dt', 'texmode', 'on');\np" - "ort_label('output', 6, '^{B}g', 'texmode', 'on');\ndisp('Actuation', 'texmode', 'on'); " - } - System { - Name "Actuation" - Location [-8, -8, 1928, 1048] - Open off - ModelBrowserVisibility off - ModelBrowserWidth 200 + Line { + ZOrder 203 + SrcBlock "Delay3" + SrcPort 1 + Points [183, 0] + Branch { + ZOrder 100 + Points [0, -80] + DstBlock "First-Order\nHold1" + DstPort 1 + } + Branch { + ZOrder 99 + DstBlock "current_position" + DstPort 1 + } + } + Line { + ZOrder 211 + SrcBlock "Delay4" + SrcPort 1 + Points [81, 0; 0, 16] + Branch { + ZOrder 214 + Points [144, 0; 0, 14] + DstBlock "camera_euler" + DstPort 1 + } + Branch { + ZOrder 213 + Points [0, 34] + DstBlock "Demux2" + DstPort 1 + } + } + Line { + ZOrder 212 + SrcBlock "Demux2" + SrcPort 3 + Points [14, 0; 0, -415] + DstBlock "Mux" + DstPort 3 + } + } + } + Block { + BlockType SubSystem + Name "Actuation" + SID "436" + Ports [1, 6] + Position [850, 276, 1100, 504] + ZOrder 71 + ShowName off + RequestExecContextInheritance off + Object { + $PropName "MaskObject" + $ObjectID 31 + $ClassName "Simulink.Mask" + Display "port_label('input', 1, 'Rotor Duty Cycles', 'texmode', 'on');\nport_label('output', 1, '^{B}Omega', 'texmo" + "de', 'on');\nport_label('output', 2, '\\Theta', 'texmode', 'on');\nport_label('output', 3, '^{B}v_o', 'texmode', 'on'" + ");\nport_label('output', 4, '^{E}r_o', 'texmode', 'on');\nport_label('output', 5, '^{B}dv_o/dt', 'texmode', 'on');\np" + "ort_label('output', 6, '^{B}g', 'texmode', 'on');\ndisp('Actuation', 'texmode', 'on'); " + } + System { + Name "Actuation" + Location [108, 36, 1850, 976] + Open off + ModelBrowserVisibility off + ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" @@ -4557,12 +4637,12 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "60" + ZoomFactor "80" Block { BlockType Inport Name "Rotor Duty Cycles" SID "437" - Position [-20, 393, 10, 407] + Position [20, 393, 50, 407] ZOrder -1 IconDisplay "Port number" } @@ -4571,18 +4651,17 @@ Model { Name "Aeb\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" SID "446" Ports [2, 1] - Position [1395, 303, 1630, 452] + Position [1435, 303, 1670, 452] ZOrder 81 ShowName off ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off Object { $PropName "MaskObject" - $ObjectID 34 + $ObjectID 32 $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');" @@ -4639,7 +4718,6 @@ Model { ZOrder 14 FunctionName "sf_sfun" PortCounts "[2 2]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -4708,7 +4786,7 @@ Model { Name "Demux1" SID "449" Ports [1, 3] - Position [1830, 526, 1835, 574] + Position [1870, 526, 1875, 574] ZOrder 107 ShowName off Outputs "3" @@ -4737,7 +4815,7 @@ Model { Name "Demux2" SID "450" Ports [1, 3] - Position [1830, 301, 1835, 349] + Position [1870, 301, 1875, 349] ZOrder 109 ShowName off Outputs "3" @@ -4766,7 +4844,7 @@ Model { Name "Demux3" SID "451" Ports [1, 3] - Position [1830, 406, 1835, 454] + Position [1870, 406, 1875, 454] ZOrder 117 ShowName off Outputs "3" @@ -4795,7 +4873,7 @@ Model { Name "Demux4" SID "452" Ports [1, 3] - Position [1830, 161, 1835, 209] + Position [1870, 161, 1875, 209] ZOrder 115 ShowName off Outputs "3" @@ -4824,7 +4902,7 @@ Model { Name "Demux5" SID "453" Ports [1, 3] - Position [1830, 641, 1835, 689] + Position [1870, 641, 1875, 689] ZOrder 119 ShowName off Outputs "3" @@ -4853,18 +4931,17 @@ Model { Name "ESC System" SID "442" Ports [1, 1] - Position [55, 282, 290, 518] + Position [95, 282, 330, 518] ZOrder 36 ShowName off ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off Object { $PropName "MaskObject" - $ObjectID 35 + $ObjectID 33 $ClassName "Simulink.Mask" Display "port_label('input', 1, 'Rotor Duty Cycle', 'texmode', 'on');\nport_label('output', 1, 'Vb_{eff}', '" "texmode', 'on');\ndisp('ESC System');" @@ -4913,7 +4990,6 @@ Model { FunctionName "sf_sfun" Parameters "Pmax,Pmin,Vb" PortCounts "[1 2]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -4974,18 +5050,17 @@ Model { Name "Gravity\n\n" SID "443" Ports [0, 1] - Position [335, 664, 485, 786] + Position [375, 664, 525, 786] ZOrder 96 ShowName off ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off Object { $PropName "MaskObject" - $ObjectID 36 + $ObjectID 34 $ClassName "Simulink.Mask" Display "port_label('output', 1, '^EF_g', 'texmode', 'on');\nfprintf('Gravity');\n" } @@ -5032,7 +5107,6 @@ Model { FunctionName "sf_sfun" Parameters "g,m" PortCounts "[1 2]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -5093,7 +5167,7 @@ Model { Name "Integrator" SID "454" Ports [1, 1] - Position [730, 340, 760, 370] + Position [770, 340, 800, 370] ZOrder 49 InitialCondition "[omega_o, omega_o, omega_o, omega_o]" } @@ -5102,7 +5176,7 @@ Model { Name "Integrator1" SID "455" Ports [1, 1] - Position [1225, 445, 1255, 475] + Position [1265, 445, 1295, 475] ZOrder 53 InitialCondition "[0; 0; 0]" } @@ -5111,7 +5185,7 @@ Model { Name "Integrator2" SID "456" Ports [1, 1] - Position [1225, 325, 1255, 355] + Position [1265, 325, 1295, 355] ZOrder 54 InitialCondition "[0; 0; 0]" } @@ -5120,7 +5194,7 @@ Model { Name "Integrator3" SID "457" Ports [1, 1] - Position [1685, 590, 1715, 620] + Position [1725, 590, 1755, 620] ZOrder 98 InitialCondition "[0; 0; 0]" } @@ -5129,7 +5203,7 @@ Model { Name "Integrator4" SID "458" Ports [1, 1] - Position [1685, 365, 1715, 395] + Position [1725, 365, 1755, 395] ZOrder 77 InitialCondition "[0; 0; 0]" ContinuousStateAttributes "['phi' 'theta' 'psi']" @@ -5139,18 +5213,17 @@ Model { Name "Lbe\n\n\n\n\n\n" SID "444" Ports [2, 1] - Position [1395, 499, 1630, 706] + Position [1435, 499, 1670, 706] ZOrder 75 ShowName off ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off Object { $PropName "MaskObject" - $ObjectID 37 + $ObjectID 35 $ClassName "Simulink.Mask" Display "port_label('input', 1, '^Bv_o', 'texmode', 'on');\nport_label('input', 2, '\\Theta', 'texmode', 'on" "');\nport_label('output', 1, '^Ev_o', 'texmode', 'on');\ndisp('L_{EB}', 'texmode', 'on');" @@ -5207,7 +5280,6 @@ Model { ZOrder 20 FunctionName "sf_sfun" PortCounts "[2 2]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -5276,18 +5348,17 @@ Model { Name "Lbe\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" SID "447" Ports [2, 2] - Position [600, 694, 770, 816] + Position [640, 694, 810, 816] ZOrder 97 ShowName off ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off Object { $PropName "MaskObject" - $ObjectID 38 + $ObjectID 36 $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');" @@ -5345,7 +5416,6 @@ Model { FunctionName "sf_sfun" Parameters "m" PortCounts "[2 3]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -5437,18 +5507,17 @@ Model { Name "Motor System" SID "441" Ports [2, 1] - Position [420, 280, 640, 520] + Position [460, 280, 680, 520] ZOrder 48 ShowName off ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off Object { $PropName "MaskObject" - $ObjectID 39 + $ObjectID 37 $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" @@ -5506,7 +5575,6 @@ Model { FunctionName "sf_sfun" Parameters "If,Jreq,Kd,Kq,Kv,Rm" PortCounts "[2 2]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -5574,18 +5642,17 @@ Model { Name "Rotor System\n\n\n\n\n\n\n\n" SID "758" Ports [5, 2] - Position [945, 281, 1145, 519] + Position [985, 281, 1185, 519] ZOrder 122 ShowName off ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off Object { $PropName "MaskObject" - $ObjectID 40 + $ObjectID 38 $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" @@ -5672,7 +5739,6 @@ Model { FunctionName "sf_sfun" Parameters "Jreq,Jxx,Jyy,Jzz,Kd,Kt,m,rhx,rhy,rhz" PortCounts "[5 3]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -5786,25 +5852,12 @@ Model { Name "Scope" SID "459" Ports [1] - Position [350, 279, 380, 311] + Position [390, 279, 420, 311] ZOrder 46 - NumInputPorts "1" + Floating off + Location [188, 365, 512, 604] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData - YMin 5.92023 - YMax 7.92023 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -5819,32 +5872,22 @@ 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] + YMin "-1.3875" + YMax "12.4875" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope1" SID "460" Ports [1] - Position [740, 229, 770, 261] + Position [780, 229, 810, 261] ZOrder 50 - NumInputPorts "1" + Floating off + Location [1, 76, 1909, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends on - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData1 - YMin -10513.81558 - YMax 11401.07279 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -5859,32 +5902,24 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [1 76 1909 1039] + ShowLegends on + YMin "-10513.81558" + YMax "11401.07279" + SaveName "ScopeData1" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope10" SID "461" Ports [3] - Position [1935, 303, 1975, 347] + Position [1975, 303, 2015, 347] ZOrder 108 - NumInputPorts "3" + Floating off + Location [1, 76, 1909, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends on - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData1 - YMin -60.66007~-1.00000~-1.00000 - YMax 18.5091~1.00000~1.00000 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "3" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -5901,32 +5936,24 @@ Model { LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]" MarkerStyles "none|none|none|none|none|none" } - Location [1 76 1909 1039] + ShowLegends on + YMin "-60.66007~-1.00000~-1.00000" + YMax "18.5091~1.00000~1.00000" + SaveName "ScopeData1" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope11" SID "462" Ports [3] - Position [1935, 163, 1975, 207] + Position [1975, 163, 2015, 207] ZOrder 114 - NumInputPorts "3" + Floating off + Location [1, 76, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends on - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData3 - YMin -3.00603~-1.00000~-1.00000 - YMax 4.56766~1.00000~1.00000 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "3" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -5943,32 +5970,24 @@ 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] + ShowLegends on + YMin "-3.00603~-1.00000~-1.00000" + YMax "4.56766~1.00000~1.00000" + SaveName "ScopeData3" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope2" SID "463" Ports [1] - Position [890, 229, 920, 261] + Position [930, 229, 960, 261] ZOrder 51 - NumInputPorts "1" + Floating off + Location [1, 76, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData2 - YMin -88.20659 - YMax 679.8109 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -5983,32 +6002,23 @@ 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] + YMin "-88.20659" + YMax "679.8109" + SaveName "ScopeData2" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope3" SID "464" Ports [3] - Position [1935, 408, 1975, 452] + Position [1975, 408, 2015, 452] ZOrder 116 - NumInputPorts "3" + Floating off + Location [1, 76, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends on - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData2 - YMin -1.00000~-71.40595~-81.80792 - YMax 1.00000~93.1255~67.47699 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "3" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -6025,32 +6035,24 @@ 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] + ShowLegends on + YMin "-1.00000~-71.40595~-81.80792" + YMax "1.00000~93.1255~67.47699" + SaveName "ScopeData2" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope4" SID "465" Ports [3] - Position [1935, 643, 1975, 687] + Position [1975, 643, 2015, 687] ZOrder 118 - NumInputPorts "3" + Floating off + Location [1, 76, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends on - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData4 - YMin -1019.9483~-1019.9483~-1019.9483 - YMax 1049.2638~1049.2638~1049.2638 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "3" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -6067,32 +6069,24 @@ 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] + ShowLegends on + YMin "-1019.9483~-1019.9483~-1019.9483" + YMax "1049.2638~1049.2638~1049.2638" + SaveName "ScopeData4" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope6" SID "466" Ports [3] - Position [1935, 528, 1975, 572] + Position [1975, 528, 2015, 572] ZOrder 79 - NumInputPorts "3" + Floating off + Location [1, 76, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends on - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData4 - YMin -1.00000~-1.00000~-0.09265 - YMax 1.00000~1.00000~0.0667 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "3" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -6109,32 +6103,24 @@ 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] + ShowLegends on + YMin "-1.00000~-1.00000~-0.09265" + YMax "1.00000~1.00000~0.0667" + SaveName "ScopeData4" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope7" SID "467" Ports [1] - Position [535, 644, 565, 676] + Position [575, 644, 605, 676] ZOrder 99 - NumInputPorts "1" + Floating off + Location [1, 76, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData1 - YMin -1.45924 - YMax 13.13314 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -6149,32 +6135,23 @@ 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] + YMin "-1.45924" + YMax "13.13314" + SaveName "ScopeData1" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope8" SID "468" Ports [1] - Position [820, 629, 850, 661] + Position [860, 629, 890, 661] ZOrder 100 - NumInputPorts "1" + Floating off + Location [1, 76, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData2 - YMin -14.59237 - YMax 14.59237 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -6189,32 +6166,23 @@ 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] + YMin "-14.59237" + YMax "14.59237" + SaveName "ScopeData2" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope9" SID "469" Ports [1] - Position [1225, 229, 1255, 261] + Position [1265, 229, 1295, 261] ZOrder 102 - NumInputPorts "1" + Floating off + Location [1, 76, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData3 - YMin -9.72639 - YMax 9.72632 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -6229,13 +6197,17 @@ 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] + YMin "-9.72639" + YMax "9.72632" + SaveName "ScopeData3" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Outport Name "B_omega" SID "471" - Position [1815, 238, 1845, 252] + Position [1855, 238, 1885, 252] ZOrder 61 IconDisplay "Port number" } @@ -6243,7 +6215,7 @@ Model { BlockType Outport Name "euler_angles" SID "472" - Position [1870, 373, 1900, 387] + Position [1910, 373, 1940, 387] ZOrder 91 Port "2" IconDisplay "Port number" @@ -6252,7 +6224,7 @@ Model { BlockType Outport Name "B_vo" SID "473" - Position [1815, 468, 1845, 482] + Position [1855, 468, 1885, 482] ZOrder 58 Port "3" IconDisplay "Port number" @@ -6261,7 +6233,7 @@ Model { BlockType Outport Name "E_ro" SID "474" - Position [1830, 598, 1860, 612] + Position [1870, 598, 1900, 612] ZOrder 88 Port "4" IconDisplay "Port number" @@ -6270,7 +6242,7 @@ Model { BlockType Outport Name "B_vo_dot" SID "475" - Position [1830, 718, 1860, 732] + Position [1870, 718, 1900, 732] ZOrder 103 Port "5" IconDisplay "Port number" @@ -6279,7 +6251,7 @@ Model { BlockType Outport Name "B_g" SID "476" - Position [1830, 778, 1860, 792] + Position [1870, 778, 1900, 792] ZOrder 104 Port "6" IconDisplay "Port number" @@ -6730,19 +6702,18 @@ Model { Name "Communication System" SID "582" Ports [0, 1] - Position [510, 432, 565, 478] + Position [405, 282, 460, 328] ZOrder 70 RequestExecContextInheritance off - Variant off Object { $PropName "MaskObject" - $ObjectID 41 + $ObjectID 39 $ClassName "Simulink.Mask" Display "port_label('output', 1, 'Setpoints', 'texmode', 'on');" } System { Name "Communication System" - Location [-8, -8, 1928, 1048] + Location [126, 17, 1868, 957] Open off ModelBrowserVisibility off ModelBrowserWidth 200 @@ -6761,10 +6732,9 @@ Model { SID "583" Position [925, 390, 955, 420] ZOrder 32 - Time "0" Before "[0; 0; 0; 0]" After "[1; 0; 0; 0]" - SampleTime "0" + SampleTime "0.1" } Block { BlockType Outport @@ -6788,14 +6758,13 @@ Model { Name "Control System" SID "573" Ports [4, 1] - Position [645, 425, 900, 650] + Position [540, 275, 795, 500] ZOrder 69 ShowName off RequestExecContextInheritance off - Variant off Object { $PropName "MaskObject" - $ObjectID 42 + $ObjectID 40 $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" @@ -6803,7 +6772,7 @@ Model { } System { Name "Control System" - Location [-8, -8, 1928, 1048] + Location [69, 48, 1812, 988] Open off ModelBrowserVisibility off ModelBrowserWidth 200 @@ -6815,7 +6784,7 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "150" + ZoomFactor "125" Block { BlockType Inport Name "setpoints" @@ -6859,10 +6828,9 @@ Model { Position [395, 307, 530, 633] ZOrder 31 RequestExecContextInheritance off - Variant off Object { $PropName "MaskObject" - $ObjectID 43 + $ObjectID 41 $ClassName "Simulink.Mask" Display "port_label('input', 1, '^{E}r_{x,setpoint}', 'texmode', 'on');\nport_label('input', 2, '^{E}r_{y,se" "tpoint}', 'texmode', 'on');\nport_label('input', 3, '^{E}r_{z,setpoint}', 'texmode', 'on');\nport_label('input', " @@ -6876,7 +6844,7 @@ Model { } System { Name "Controller" - Location [-8, -8, 1928, 1048] + Location [69, 48, 1812, 988] Open off ModelBrowserVisibility off ModelBrowserWidth 200 @@ -6888,7 +6856,7 @@ Model { TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off - ZoomFactor "100" + ZoomFactor "125" Block { BlockType Inport Name "x_setpoint" @@ -6984,7 +6952,7 @@ Model { BlockType Inport Name "roll_rate" SID "633" - Position [425, 313, 455, 327] + Position [525, 313, 555, 327] ZOrder 71 Port "11" IconDisplay "Port number" @@ -6993,7 +6961,7 @@ Model { BlockType Inport Name "pitch_rate" SID "634" - Position [425, 468, 455, 482] + Position [525, 468, 555, 482] ZOrder 72 Port "12" IconDisplay "Port number" @@ -7007,29 +6975,73 @@ Model { Port "13" IconDisplay "Port number" } + Block { + BlockType Gain + Name "Gain1" + SID "891" + Position [810, 117, 860, 153] + ZOrder 151 + Gain "5e4" + ParamDataTypeStr "Inherit: Inherit via internal rule" + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + } + Block { + BlockType Gain + Name "Gain2" + SID "892" + Position [810, 237, 860, 273] + ZOrder 152 + Gain "5e4" + ParamDataTypeStr "Inherit: Inherit via internal rule" + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + } + Block { + BlockType Gain + Name "Gain3" + SID "893" + Position [810, 392, 860, 428] + ZOrder 153 + Gain "5e4" + ParamDataTypeStr "Inherit: Inherit via internal rule" + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + } + Block { + BlockType Gain + Name "Gain4" + SID "894" + Position [810, 542, 860, 578] + ZOrder 154 + Gain "5e4" + ParamDataTypeStr "Inherit: Inherit via internal rule" + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + } Block { BlockType Reference Name "PID Controller1" - SID "590" + SID "873" Ports [1, 1] - Position [260, 392, 300, 428] - ZOrder 32 - LibraryVersion "1.388" + Position [645, 392, 685, 428] + ZOrder 142 + LibraryVersion "1.356" SourceBlock "simulink/Continuous/PID Controller" SourceType "PID 1dof" ContentPreviewEnabled off - Controller "PID" - TimeDomain "Continuous-time" - SampleTime "-1" + Controller "P" + TimeDomain "Discrete-time" + SampleTime "5e-3" IntegratorMethod "Forward Euler" FilterMethod "Forward Euler" Form "Parallel" UseFilter on ControllerParametersSource "internal" - P "-4.09881115615483" - I "-0.786626898521519" - D "-2.54021507170204" - N "2907.76761508735" + P "0.015166894231541" + I "1575.82088970639" + D "504.111397357926" + N "244.660686071579" InitialConditionSource "internal" InitialConditionForIntegrator "0" InitialConditionForFilter "0" @@ -7138,22 +7150,22 @@ Model { Ports [1, 1] Position [260, 542, 300, 578] ZOrder 122 - LibraryVersion "1.388" + LibraryVersion "1.356" SourceBlock "simulink/Continuous/PID Controller" SourceType "PID 1dof" ContentPreviewEnabled off - Controller "PID" - TimeDomain "Continuous-time" - SampleTime "-1" + Controller "PD" + TimeDomain "Discrete-time" + SampleTime "0.01" IntegratorMethod "Forward Euler" FilterMethod "Forward Euler" Form "Parallel" - UseFilter on + UseFilter off ControllerParametersSource "internal" - P "9.8515811170609" - I "10.3080265333453" - D "1.32394710402659" - N "7.32609641947859" + P "1.69332227925298" + I "0.373031053213692" + D "0.0846661139626488" + N "17.8214030142826" InitialConditionSource "internal" InitialConditionForIntegrator "0" InitialConditionForFilter "0" @@ -7262,22 +7274,22 @@ Model { Ports [1, 1] Position [260, 117, 300, 153] ZOrder 123 - LibraryVersion "1.388" + LibraryVersion "1.356" SourceBlock "simulink/Continuous/PID Controller" SourceType "PID 1dof" ContentPreviewEnabled off Controller "PID" - TimeDomain "Continuous-time" - SampleTime "-1" + TimeDomain "Discrete-time" + SampleTime "0.01" IntegratorMethod "Forward Euler" FilterMethod "Forward Euler" Form "Parallel" - UseFilter on + UseFilter off ControllerParametersSource "internal" - P "-5.58*5" - I "-0.323" - D "-15.5*0.6" - N "1/0.00106" + P "-0.0153859651723572" + I "-0.000331343308727455" + D "-0.178612271980841" + N "5.79502261645411" InitialConditionSource "internal" InitialConditionForIntegrator "0" InitialConditionForFilter "0" @@ -7384,22 +7396,22 @@ Model { Name "PID Controller2" SID "832" Ports [1, 1] - Position [405, 541, 445, 579] + Position [645, 541, 685, 579] ZOrder 121 - LibraryVersion "1.388" + LibraryVersion "1.356" SourceBlock "simulink/Continuous/PID Controller" SourceType "PID 1dof" ContentPreviewEnabled off - Controller "P" - TimeDomain "Continuous-time" - SampleTime "-1" + Controller "PI" + TimeDomain "Discrete-time" + SampleTime "5e-3" IntegratorMethod "Forward Euler" FilterMethod "Forward Euler" Form "Parallel" UseFilter on ControllerParametersSource "internal" - P "-359098.201085257" - I "-77.7" + P "0.137082785475467" + I "1.78239822850373" D "2.32" N "1/0.0818" InitialConditionSource "internal" @@ -7505,27 +7517,27 @@ Model { } Block { BlockType Reference - Name "PID Controller4" - SID "854" + Name "PID Controller3" + SID "874" Ports [1, 1] - Position [405, 392, 445, 428] - ZOrder 128 - LibraryVersion "1.388" + Position [505, 392, 545, 428] + ZOrder 143 + LibraryVersion "1.356" SourceBlock "simulink/Continuous/PID Controller" SourceType "PID 1dof" ContentPreviewEnabled off - Controller "PD" - TimeDomain "Continuous-time" - SampleTime "-1" + Controller "P" + TimeDomain "Discrete-time" + SampleTime "5e-3" IntegratorMethod "Forward Euler" FilterMethod "Forward Euler" Form "Parallel" UseFilter on ControllerParametersSource "internal" - P "49.9288564716647" + P "1.37514874127105" I "35.1207902652377" - D "1.71644717082694" - N "5320.80923448602" + D "0.410623594074865" + N "40.0107970227961" InitialConditionSource "internal" InitialConditionForIntegrator "0" InitialConditionForFilter "0" @@ -7629,27 +7641,27 @@ Model { } Block { BlockType Reference - Name "PID Controller5" - SID "594" + Name "PID Controller4" + SID "876" Ports [1, 1] - Position [405, 237, 445, 273] - ZOrder 36 - LibraryVersion "1.388" + Position [260, 392, 300, 428] + ZOrder 145 + LibraryVersion "1.356" SourceBlock "simulink/Continuous/PID Controller" SourceType "PID 1dof" ContentPreviewEnabled off Controller "PD" - TimeDomain "Continuous-time" - SampleTime "-1" + TimeDomain "Discrete-time" + SampleTime "0.01" IntegratorMethod "Forward Euler" FilterMethod "Forward Euler" Form "Parallel" - UseFilter on + UseFilter off ControllerParametersSource "internal" - P "0.718*5" - I "0" - D "2.15" - N "100" + P "-0.00209477698719004" + I "-5.49963745752816e-05" + D "-0.116816668948546" + N "16.9491526069154" InitialConditionSource "internal" InitialConditionForIntegrator "0" InitialConditionForFilter "0" @@ -7753,27 +7765,27 @@ Model { } Block { BlockType Reference - Name "PID Controller7" - SID "596" + Name "PID Controller6" + SID "867" Ports [1, 1] - Position [545, 392, 585, 428] - ZOrder 133 - LibraryVersion "1.388" + Position [260, 237, 300, 273] + ZOrder 136 + LibraryVersion "1.356" SourceBlock "simulink/Continuous/PID Controller" SourceType "PID 1dof" ContentPreviewEnabled off Controller "PD" - TimeDomain "Continuous-time" - SampleTime "-1" + TimeDomain "Discrete-time" + SampleTime "0.01" IntegratorMethod "Forward Euler" FilterMethod "Forward Euler" Form "Parallel" - UseFilter on + UseFilter off ControllerParametersSource "internal" - P "18237.343549923" - I "1575.82088970639" - D "674.387075196541" - N "309.449971015086" + P "0.00209477698719004" + I "9.56340991394167e-06" + D "0.116816668948546" + N "16.9491526069154" InitialConditionSource "internal" InitialConditionForIntegrator "0" InitialConditionForFilter "0" @@ -7878,26 +7890,26 @@ Model { Block { BlockType Reference Name "PID Controller8" - SID "597" + SID "868" Ports [1, 1] - Position [545, 237, 585, 273] - ZOrder 39 - LibraryVersion "1.388" + Position [505, 237, 545, 273] + ZOrder 137 + LibraryVersion "1.356" SourceBlock "simulink/Continuous/PID Controller" SourceType "PID 1dof" ContentPreviewEnabled off Controller "P" - TimeDomain "Continuous-time" - SampleTime "-1" + TimeDomain "Discrete-time" + SampleTime "5e-3" IntegratorMethod "Forward Euler" FilterMethod "Forward Euler" Form "Parallel" UseFilter on ControllerParametersSource "internal" - P "20" - I "0" - D "0" - N "100" + P "1.37514874127105" + I "35.1207902652377" + D "0.2" + N "40.0107970227961" InitialConditionSource "internal" InitialConditionForIntegrator "0" InitialConditionForFilter "0" @@ -8002,26 +8014,26 @@ Model { Block { BlockType Reference Name "PID Controller9" - SID "829" + SID "869" Ports [1, 1] - Position [260, 237, 300, 273] - ZOrder 120 - LibraryVersion "1.388" + Position [645, 237, 685, 273] + ZOrder 138 + LibraryVersion "1.356" SourceBlock "simulink/Continuous/PID Controller" SourceType "PID 1dof" ContentPreviewEnabled off - Controller "PID" - TimeDomain "Continuous-time" - SampleTime "-1" + Controller "P" + TimeDomain "Discrete-time" + SampleTime "5e-3" IntegratorMethod "Forward Euler" FilterMethod "Forward Euler" Form "Parallel" UseFilter on ControllerParametersSource "internal" - P "0.7" - I "0.114" - D "0.596" - N "1/0.00195" + P "0.015166894231541" + I "1575.82088970639" + D "504.111397357926" + N "244.660686071579" InitialConditionSource "internal" InitialConditionForIntegrator "0" InitialConditionForFilter "0" @@ -8123,30 +8135,53 @@ Model { DifferentiatorOutMax "[]" DifferentiatorOutDataTypeStr "Inherit: Inherit via internal rule" } + Block { + BlockType Saturate + Name "Saturation1" + SID "887" + Ports [1, 1] + Position [410, 240, 440, 270] + ZOrder 147 + Commented "through" + InputPortMap "u0" + UpperLimit "20*pi/180" + LowerLimit "-20*pi/180" + } + Block { + BlockType Saturate + Name "Saturation2" + SID "888" + Ports [1, 1] + Position [410, 395, 440, 425] + ZOrder 148 + Commented "through" + InputPortMap "u0" + UpperLimit "20*pi/180" + LowerLimit "-20*pi/180" + } + Block { + BlockType Saturate + Name "Saturation3" + SID "889" + Ports [1, 1] + Position [410, 545, 440, 575] + ZOrder 149 + Commented "through" + InputPortMap "u0" + UpperLimit "20*pi/180" + LowerLimit "-20*pi/180" + } Block { BlockType Scope Name "Scope" SID "791" Ports [1] - Position [410, 649, 440, 681] + Position [510, 649, 540, 681] ZOrder 97 - NumInputPorts "1" + Floating off + Location [1, 76, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData1 - YMin -4.53199 - YMax 5.80666 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -8161,7 +8196,11 @@ 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] + YMin "-4.53199" + YMax "5.80666" + SaveName "ScopeData1" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope @@ -8170,23 +8209,10 @@ Model { Ports [1] Position [235, 649, 265, 681] ZOrder 106 - NumInputPorts "1" + Floating off + Location [10, 76, 1926, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData2 - YMin -6.26281 - YMax 31.28638 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -8201,7 +8227,11 @@ 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] + YMin "-0.00426" + YMax "0.00536" + SaveName "ScopeData2" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope @@ -8210,63 +8240,41 @@ Model { Ports [1] Position [265, 174, 295, 206] ZOrder 107 - NumInputPorts "1" + Floating off + Location [593, 266, 1926, 1046] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData5 - YMin -1.20714 - YMax 0.22148 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" } List { ListType ScopeGraphics - FigureColor "[0.156862745098039 0.156862745098039 0.156862745098039]" + FigureColor "[0.5 0.5 0.5]" AxesColor "[0 0 0]" - AxesTickColor "[0.686274509803922 0.686274509803922 0.686274509803922]" + AxesTickColor "[1 1 1]" 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 [1 76 1921 1039] + YMin "-0.14356" + YMax "1.29207" + SaveName "ScopeData5" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope3" SID "797" Ports [1] - Position [550, 334, 580, 366] + Position [650, 334, 680, 366] ZOrder 109 - NumInputPorts "1" + Floating off + Location [10, 76, 1926, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData1 - YMin -0.13447 - YMax 1.21019 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -8281,7 +8289,11 @@ 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] + YMin "-0.13447" + YMax "1.21019" + SaveName "ScopeData1" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope @@ -8290,23 +8302,10 @@ Model { Ports [1] Position [365, 334, 395, 366] ZOrder 110 - NumInputPorts "1" + Floating off + Location [10, 76, 1926, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData2 - YMin -0.08847 - YMax 0.24078 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -8321,7 +8320,11 @@ 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] + YMin "-0.2" + YMax "0.5" + SaveName "ScopeData2" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope @@ -8330,63 +8333,41 @@ Model { Ports [1] Position [240, 334, 270, 366] ZOrder 111 - NumInputPorts "1" + Floating off + Location [1, 49, 1921, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData3 - YMin -0.14703 - YMax 1.31859 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" } List { ListType ScopeGraphics - FigureColor "[0.156862745098039 0.156862745098039 0.156862745098039]" + FigureColor "[0.5 0.5 0.5]" AxesColor "[0 0 0]" - AxesTickColor "[0.686274509803922 0.686274509803922 0.686274509803922]" + AxesTickColor "[1 1 1]" 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 [1 76 1921 1039] + YMin "-0.035" + YMax "0.03" + SaveName "ScopeData3" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope Name "Scope6" SID "825" Ports [1] - Position [550, 484, 580, 516] + Position [650, 484, 680, 516] ZOrder 117 - NumInputPorts "1" + Floating off + Location [10, 76, 1926, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData1 - YMin -0.48276 - YMax 2.87086 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -8401,7 +8382,11 @@ 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] + YMin "-0.48276" + YMax "2.87086" + SaveName "ScopeData1" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope @@ -8410,23 +8395,10 @@ Model { Ports [1] Position [365, 484, 395, 516] ZOrder 118 - NumInputPorts "1" + Floating off + Location [10, 76, 1926, 1039] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData2 - YMin -0.04704 - YMax 0.39309 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -8441,7 +8413,11 @@ 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] + YMin "-0.04704" + YMax "0.39309" + SaveName "ScopeData2" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Scope @@ -8450,38 +8426,30 @@ Model { Ports [1] Position [245, 484, 275, 516] ZOrder 119 + Floating off + Location [2, 57, 1918, 1038] + Open on NumInputPorts "1" - Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData3 - YMin -81.1648 - YMax 21.11528 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 List { ListType AxesTitles axes1 "%<SignalLabel>" } List { ListType ScopeGraphics - FigureColor "[0.156862745098039 0.156862745098039 0.156862745098039]" + FigureColor "[0.5 0.5 0.5]" AxesColor "[0 0 0]" - AxesTickColor "[0.686274509803922 0.686274509803922 0.686274509803922]" + AxesTickColor "[1 1 1]" 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 [1 76 1921 1039] + TimeRange "20" + YMin "2200" + YMax "4300" + SaveName "ScopeData3" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Sum @@ -8516,7 +8484,7 @@ Model { Name "Sum2" SID "600" Ports [2, 1] - Position [490, 245, 510, 265] + Position [590, 245, 610, 265] ZOrder 42 ShowName off IconShape "round" @@ -8544,7 +8512,7 @@ Model { Name "Sum4" SID "603" Ports [2, 1] - Position [490, 400, 510, 420] + Position [590, 400, 610, 420] ZOrder 44 ShowName off IconShape "round" @@ -8613,7 +8581,7 @@ Model { BlockType Outport Name "height_controlled" SID "606" - Position [655, 128, 685, 142] + Position [925, 128, 955, 142] ZOrder -2 IconDisplay "Port number" } @@ -8621,7 +8589,7 @@ Model { BlockType Outport Name "y_controlled" SID "636" - Position [655, 248, 685, 262] + Position [925, 248, 955, 262] ZOrder 74 Port "2" IconDisplay "Port number" @@ -8630,7 +8598,7 @@ Model { BlockType Outport Name "x_controlled" SID "637" - Position [655, 403, 685, 417] + Position [925, 403, 955, 417] ZOrder 75 Port "3" IconDisplay "Port number" @@ -8639,7 +8607,7 @@ Model { BlockType Outport Name "yaw_controlled" SID "638" - Position [655, 553, 685, 567] + Position [925, 553, 955, 567] ZOrder 76 Port "4" IconDisplay "Port number" @@ -8648,7 +8616,7 @@ Model { ZOrder 283 SrcBlock "Sum" SrcPort 1 - DstBlock "PID Controller2" + DstBlock "Saturation3" DstPort 1 } Line { @@ -8831,103 +8799,188 @@ Model { DstPort 1 } Line { - ZOrder 207 - SrcBlock "Sum1" + ZOrder 434 + SrcBlock "Sum2" SrcPort 1 - DstBlock "PID Controller5" + DstBlock "PID Controller9" DstPort 1 } Line { - ZOrder 212 - SrcBlock "Sum2" + ZOrder 416 + SrcBlock "Sum6" SrcPort 1 - DstBlock "PID Controller8" + DstBlock "PID Controller6" DstPort 1 } Line { - ZOrder 216 - SrcBlock "PID Controller5" + ZOrder 461 + SrcBlock "Sum5" SrcPort 1 - DstBlock "Sum2" + DstBlock "PID Controller4" DstPort 1 } Line { - ZOrder 243 - SrcBlock "PID Controller9" + ZOrder 281 + SrcBlock "Sum7" SrcPort 1 - DstBlock "Sum1" + DstBlock "PID Controller11" DstPort 1 } Line { - ZOrder 244 - SrcBlock "Sum6" + ZOrder 285 + SrcBlock "Sum8" SrcPort 1 - DstBlock "PID Controller9" + DstBlock "PID Controller10" DstPort 1 } Line { - ZOrder 247 - SrcBlock "Sum5" + ZOrder 451 + SrcBlock "Sum4" SrcPort 1 DstBlock "PID Controller1" DstPort 1 } Line { - ZOrder 281 - SrcBlock "Sum7" + ZOrder 456 + SrcBlock "PID Controller1" SrcPort 1 - DstBlock "PID Controller11" + DstBlock "Gain3" DstPort 1 } Line { - ZOrder 285 - SrcBlock "Sum8" + ZOrder 459 + SrcBlock "Sum3" SrcPort 1 - DstBlock "PID Controller10" + DstBlock "Saturation2" DstPort 1 } Line { - ZOrder 349 - SrcBlock "Sum3" + ZOrder 462 + SrcBlock "PID Controller4" SrcPort 1 - DstBlock "PID Controller4" + DstBlock "Sum3" DstPort 1 } Line { - ZOrder 388 - SrcBlock "Sum4" + ZOrder 464 + SrcBlock "PID Controller9" SrcPort 1 - DstBlock "PID Controller7" + DstBlock "Gain2" DstPort 1 } Line { - ZOrder 401 - SrcBlock "PID Controller10" + ZOrder 473 + SrcBlock "PID Controller11" SrcPort 1 - DstBlock "Sum" + DstBlock "Gain1" + DstPort 1 + } + Line { + ZOrder 478 + SrcBlock "PID Controller2" + SrcPort 1 + DstBlock "Gain4" + DstPort 1 + } + Line { + ZOrder 482 + SrcBlock "Sum1" + SrcPort 1 + DstBlock "Saturation1" + DstPort 1 + } + Line { + ZOrder 486 + SrcBlock "Saturation2" + SrcPort 1 + DstBlock "PID Controller3" DstPort 1 } Line { - ZOrder 404 - SrcBlock "PID Controller7" + ZOrder 488 + SrcBlock "Gain1" + SrcPort 1 + DstBlock "height_controlled" + DstPort 1 + } + Line { + ZOrder 489 + SrcBlock "Gain2" + SrcPort 1 + DstBlock "y_controlled" + DstPort 1 + } + Line { + ZOrder 490 + SrcBlock "Gain3" SrcPort 1 DstBlock "x_controlled" DstPort 1 } Line { - ZOrder 408 - SrcBlock "PID Controller4" + ZOrder 491 + SrcBlock "Gain4" + SrcPort 1 + DstBlock "yaw_controlled" + DstPort 1 + } + Line { + ZOrder 492 + SrcBlock "PID Controller3" SrcPort 1 DstBlock "Sum4" DstPort 1 } Line { - ZOrder 409 - SrcBlock "PID Controller1" + ZOrder 493 + SrcBlock "Saturation3" SrcPort 1 - DstBlock "Sum3" + DstBlock "PID Controller2" + DstPort 1 + } + Line { + ZOrder 496 + SrcBlock "Saturation1" + SrcPort 1 + DstBlock "PID Controller8" DstPort 1 } + Line { + ZOrder 498 + SrcBlock "PID Controller10" + SrcPort 1 + DstBlock "Sum" + DstPort 1 + } + Line { + ZOrder 500 + SrcBlock "PID Controller8" + SrcPort 1 + DstBlock "Sum2" + DstPort 1 + } + Line { + ZOrder 501 + SrcBlock "PID Controller6" + SrcPort 1 + DstBlock "Sum1" + DstPort 1 + } + Annotation { + SID "901" + Name "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">" + "\n<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap" + "; }\n</style></head><body style=\" font-family:'Helvetica'; font-size:10px; font-weight:400; font-style:normal;" + "\">\n<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px;" + " -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>" + Position [264, 366, 266, 381] + InternalMargins [0, 0, 0, 0] + FixedHeight off + FixedWidth off + HorizontalAlignment "left" + VerticalAlignment "top" + Interpreter "rich" + } } } Block { @@ -8978,14 +9031,13 @@ Model { Name "MATLAB Function" SID "647" Ports [4, 1] - Position [715, 308, 915, 632] + Position [725, 308, 925, 632] ZOrder 35 ErrorFcn "Stateflow.Translate.translate" - PermitHierarchicalResolution "ParametersOnly" + PermitHierarchicalResolution "ExplicitOnly" TreatAsAtomicUnit on RequestExecContextInheritance off SFBlockType "MATLAB Function" - Variant off System { Name "MATLAB Function" Location [223, 338, 826, 833] @@ -9056,7 +9108,6 @@ Model { ZOrder 10 FunctionName "sf_sfun" PortCounts "[4 2]" - SFunctionDeploymentMode off EnableBusSupport on Port { PortNumber 2 @@ -9151,23 +9202,10 @@ Model { Ports [1] Position [1080, 564, 1110, 596] ZOrder 46 - NumInputPorts "1" + Floating off + Location [188, 365, 512, 604] Open off - TimeRange auto - TickLabels OneTimeTick - ShowLegends off - LimitDataPoints off - MaxDataPoints 5000 - SaveToWorkspace off - SaveName ScopeData4 - YMin 87500.00000 - YMax 212500.00000 - SampleInput off - SampleTime -1 - ZoomMode on - Grid on - DataFormat StructureWithTime - Decimation 1 + NumInputPorts "1" List { ListType AxesTitles axes1 "%<SignalLabel>" @@ -9182,7 +9220,11 @@ 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] + YMin "87500.00000" + YMax "212500.00000" + SaveName "ScopeData4" + DataFormat "StructureWithTime" + LimitDataPoints off } Block { BlockType Sum @@ -9247,6 +9289,7 @@ Model { Position [605, 375, 635, 405] ZOrder 40 Value "height_controlled_o" + SampleTime "5e-3" } Block { BlockType Constant @@ -9255,6 +9298,7 @@ Model { Position [605, 535, 635, 565] ZOrder 42 Value "x_controlled_o" + SampleTime "5e-3" } Block { BlockType Constant @@ -9263,6 +9307,7 @@ Model { Position [605, 455, 635, 485] ZOrder 41 Value "y_controlled_o" + SampleTime "5e-3" } Block { BlockType Constant @@ -9271,6 +9316,7 @@ Model { Position [605, 620, 635, 650] ZOrder 43 Value "yaw_controlled_o" + SampleTime "5e-3" } Block { BlockType Outport @@ -9528,34 +9574,76 @@ Model { DstPort 1 } Line { - ZOrder 186 + ZOrder 189 SrcBlock "Actuation" - SrcPort 2 - Points [9, 0; 0, 192; -583, 0; 0, -162] - DstBlock "Control System" - DstPort 2 + SrcPort 1 + DstBlock " Sensors " + DstPort 1 } Line { - ZOrder 187 + ZOrder 191 SrcBlock "Actuation" - SrcPort 1 - Points [2, 0; 0, 246; -590, 0; 0, -121] - DstBlock "Control System" + SrcPort 3 + DstBlock " Sensors " DstPort 3 } Line { - ZOrder 188 + ZOrder 192 SrcBlock "Actuation" SrcPort 4 - Points [23, 0; 0, 140; -604, 0; 0, -80] + DstBlock " Sensors " + DstPort 4 + } + Line { + ZOrder 193 + SrcBlock "Actuation" + SrcPort 5 + DstBlock " Sensors " + DstPort 5 + } + Line { + ZOrder 194 + SrcBlock "Actuation" + SrcPort 6 + DstBlock " Sensors " + DstPort 6 + } + Line { + ZOrder 195 + SrcBlock " Sensors " + SrcPort 3 + Points [9, 0; 0, 210; -903, 0; 0, -160] DstBlock "Control System" DstPort 4 } + Line { + ZOrder 196 + SrcBlock " Sensors " + SrcPort 2 + Points [16, 0; 0, 302; -924, 0; 0, -247] + DstBlock "Control System" + DstPort 3 + } + Line { + ZOrder 190 + SrcBlock "Actuation" + SrcPort 2 + DstBlock " Sensors " + DstPort 2 + } + Line { + ZOrder 208 + SrcBlock " Sensors " + SrcPort 4 + Points [2, 0; 0, 42; -903, 0; 0, -162] + DstBlock "Control System" + DstPort 2 + } } } #Finite State Machines # -# Stateflow 80000010 +# Stateflow 80000005 # # Stateflow { @@ -9564,29 +9652,29 @@ Stateflow { name "test_model_R2015A" created "03-Nov-2016 18:34:53" isLibrary 0 - sfVersion 80000006 firstTarget 145 + sfVersion 80000005 } chart { id 2 - machine 1 name "Actuation/Gravity\n\n" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 3 0 0] + firstTransition 8 + firstJunction 7 viewObj 2 + machine 1 ssIdHighWaterMark 7 decomposition CLUSTER_CHART type EML_CHART + firstData 4 chartFileNumber 1 disableImplicitCasting 1 eml { name "gravity" } - firstData 4 - firstTransition 8 - firstJunction 7 } state { id 3 @@ -9610,6 +9698,7 @@ Stateflow { id 4 ssIdNumber 5 name "E_Fg" + linkNode [2 0 5] scope OUTPUT_DATA machine 1 props { @@ -9624,12 +9713,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [2 0 5] } data { id 5 ssIdNumber 6 name "m" + linkNode [2 4 6] scope PARAMETER_DATA paramIndexForInitFromWorkspace 1 machine 1 @@ -9647,12 +9736,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [2 4 6] } data { id 6 ssIdNumber 7 name "g" + linkNode [2 5 0] scope PARAMETER_DATA machine 1 props { @@ -9669,16 +9758,15 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [2 5 0] } junction { id 7 position [23.5747 49.5747 7] chart 2 + linkNode [2 0 0] subviewer 2 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [2 0 0] } transition { id 8 @@ -9694,6 +9782,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 2 + linkNode [2 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 2 drawStyle SMART @@ -9702,34 +9791,33 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [2 0 0] } instance { id 9 - machine 1 name "Actuation/Gravity\n\n" + machine 1 chart 2 } chart { id 10 - machine 1 name "Actuation/Lbe\n\n\n\n\n\n" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 11 0 0] + firstTransition 16 + firstJunction 15 viewObj 10 + machine 1 ssIdHighWaterMark 11 decomposition CLUSTER_CHART type EML_CHART + firstData 12 chartFileNumber 2 disableImplicitCasting 1 eml { name "linear_body_earth_conversion" } - firstData 12 - firstTransition 16 - firstJunction 15 } state { id 11 @@ -9758,6 +9846,7 @@ Stateflow { id 12 ssIdNumber 7 name "B_vo" + linkNode [10 0 13] scope INPUT_DATA machine 1 props { @@ -9774,12 +9863,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [10 0 13] } data { id 13 ssIdNumber 11 name "euler_angles" + linkNode [10 12 14] scope INPUT_DATA machine 1 props { @@ -9796,12 +9885,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [10 12 14] } data { id 14 ssIdNumber 9 name "E_ro" + linkNode [10 13 0] scope OUTPUT_DATA machine 1 props { @@ -9818,16 +9907,15 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [10 13 0] } junction { id 15 position [23.5747 49.5747 7] chart 10 + linkNode [10 0 0] subviewer 10 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [10 0 0] } transition { id 16 @@ -9843,6 +9931,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 10 + linkNode [10 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 10 drawStyle SMART @@ -9851,34 +9940,33 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [10 0 0] } instance { id 17 - machine 1 name "Actuation/Lbe\n\n\n\n\n\n" + machine 1 chart 10 } chart { id 18 - machine 1 name " Sensors /3D Graphical Simulation1/MATLAB Function" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 19 0 0] + firstTransition 23 + firstJunction 22 viewObj 18 + machine 1 ssIdHighWaterMark 5 decomposition CLUSTER_CHART type EML_CHART + firstData 20 chartFileNumber 3 disableImplicitCasting 1 eml { name "eigenaxis_ucart" } - firstData 20 - firstTransition 23 - firstJunction 22 } state { id 19 @@ -9908,6 +9996,7 @@ Stateflow { id 20 ssIdNumber 4 name "u" + linkNode [18 0 21] scope INPUT_DATA machine 1 props { @@ -9921,12 +10010,12 @@ Stateflow { complexity SF_COMPLEX_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [18 0 21] } data { id 21 ssIdNumber 5 name "y" + linkNode [18 20 0] scope OUTPUT_DATA machine 1 props { @@ -9941,16 +10030,15 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [18 20 0] } junction { id 22 position [23.5747 49.5747 7] chart 18 + linkNode [18 0 0] subviewer 18 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [18 0 0] } transition { id 23 @@ -9966,6 +10054,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 18 + linkNode [18 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 18 drawStyle SMART @@ -9974,34 +10063,33 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [18 0 0] } instance { id 24 - machine 1 name " Sensors /3D Graphical Simulation1/MATLAB Function" + machine 1 chart 18 } chart { id 25 - machine 1 name "Actuation/ESC System" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 26 0 0] + firstTransition 33 + firstJunction 32 viewObj 25 + machine 1 ssIdHighWaterMark 18 decomposition CLUSTER_CHART type EML_CHART + firstData 27 chartFileNumber 4 disableImplicitCasting 1 eml { name "ESC" } - firstData 27 - firstTransition 33 - firstJunction 32 } state { id 26 @@ -10033,6 +10121,7 @@ Stateflow { id 27 ssIdNumber 4 name "rotor_duty_cycles" + linkNode [25 0 28] scope INPUT_DATA machine 1 props { @@ -10046,12 +10135,12 @@ Stateflow { complexity SF_COMPLEX_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [25 0 28] } data { id 28 ssIdNumber 5 name "Vb_eff" + linkNode [25 27 29] scope OUTPUT_DATA machine 1 props { @@ -10066,12 +10155,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [25 27 29] } data { id 29 ssIdNumber 16 name "Pmin" + linkNode [25 28 30] scope PARAMETER_DATA paramIndexForInitFromWorkspace 1 machine 1 @@ -10089,12 +10178,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [25 28 30] } data { id 30 ssIdNumber 17 name "Pmax" + linkNode [25 29 31] scope PARAMETER_DATA machine 1 props { @@ -10111,12 +10200,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [25 29 31] } data { id 31 ssIdNumber 18 name "Vb" + linkNode [25 30 0] scope PARAMETER_DATA paramIndexForInitFromWorkspace 2 machine 1 @@ -10134,16 +10223,15 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [25 30 0] } junction { id 32 position [23.5747 49.5747 7] chart 25 + linkNode [25 0 0] subviewer 25 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [25 0 0] } transition { id 33 @@ -10159,6 +10247,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 25 + linkNode [25 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 25 drawStyle SMART @@ -10167,34 +10256,33 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [25 0 0] } instance { id 34 - machine 1 name "Actuation/ESC System" + machine 1 chart 25 } chart { id 35 - machine 1 name "Actuation/Motor System" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 36 0 0] + firstTransition 47 + firstJunction 46 viewObj 35 + machine 1 ssIdHighWaterMark 16 decomposition CLUSTER_CHART type EML_CHART + firstData 37 chartFileNumber 5 disableImplicitCasting 1 eml { name "motor" } - firstData 37 - firstTransition 47 - firstJunction 46 } state { id 36 @@ -10229,6 +10317,7 @@ Stateflow { id 37 ssIdNumber 4 name "Vb_eff" + linkNode [35 0 38] scope INPUT_DATA machine 1 props { @@ -10242,12 +10331,12 @@ Stateflow { complexity SF_COMPLEX_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [35 0 38] } data { id 38 ssIdNumber 16 name "angular_velocity" + linkNode [35 37 39] scope INPUT_DATA machine 1 props { @@ -10264,12 +10353,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [35 37 39] } data { id 39 ssIdNumber 7 name "angular_acceleration" + linkNode [35 38 40] scope OUTPUT_DATA machine 1 props { @@ -10286,12 +10375,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [35 38 40] } data { id 40 ssIdNumber 9 name "Rm" + linkNode [35 39 41] scope PARAMETER_DATA paramIndexForInitFromWorkspace 5 machine 1 @@ -10309,12 +10398,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [35 39 41] } data { id 41 ssIdNumber 10 name "Kv" + linkNode [35 40 42] scope PARAMETER_DATA paramIndexForInitFromWorkspace 4 machine 1 @@ -10332,12 +10421,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [35 40 42] } data { id 42 ssIdNumber 11 name "Kq" + linkNode [35 41 43] scope PARAMETER_DATA paramIndexForInitFromWorkspace 3 machine 1 @@ -10355,12 +10444,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [35 41 43] } data { id 43 ssIdNumber 12 name "Kd" + linkNode [35 42 44] scope PARAMETER_DATA paramIndexForInitFromWorkspace 2 machine 1 @@ -10378,12 +10467,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [35 42 44] } data { id 44 ssIdNumber 13 name "If" + linkNode [35 43 45] scope PARAMETER_DATA machine 1 props { @@ -10400,12 +10489,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [35 43 45] } data { id 45 ssIdNumber 14 name "Jreq" + linkNode [35 44 0] scope PARAMETER_DATA paramIndexForInitFromWorkspace 1 machine 1 @@ -10423,16 +10512,15 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [35 44 0] } junction { id 46 position [23.5747 49.5747 7] chart 35 + linkNode [35 0 0] subviewer 35 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [35 0 0] } transition { id 47 @@ -10448,6 +10536,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 35 + linkNode [35 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 35 drawStyle SMART @@ -10456,34 +10545,33 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [35 0 0] } instance { id 48 - machine 1 name "Actuation/Motor System" + machine 1 chart 35 } chart { id 49 - machine 1 name "Actuation/Rotor System\n\n\n\n\n\n\n\n" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 50 0 0] + firstTransition 69 + firstJunction 68 viewObj 49 + machine 1 ssIdHighWaterMark 30 decomposition CLUSTER_CHART type EML_CHART + firstData 51 chartFileNumber 6 disableImplicitCasting 1 eml { name "rotor" } - firstData 51 - firstTransition 69 - firstJunction 68 } state { id 50 @@ -10500,35 +10588,38 @@ Stateflow { eml { isEML 1 script "function [B_omega_dot, B_vo_dot]= rotor(angular_acceleration, angular_velocity, B_Fg, B_omega, B_" - "vo, m, Kt, Kd, rhx, rhy, rhz, Jreq, Jxx, Jyy, Jzz)\n\nB_vo_dot = zeros(3,1);\nB_omega_dot = zeros(3,1);\n\n% Cre" - "ate J vector\nJ = [Jxx, 0 , 0 ; ...\n 0 , Jyy, 0 ; ...\n 0 , 0 , Jzz;];\n\n% Create r_hi vector\nr" - "h_0 = [-rhx; rhy; rhz];\nrh_1 = [rhx; rhy; rhz];\nrh_2 = [-rhx; -rhy; rhz];\nrh_3 = [rhx; -rhy; rhz];\n\n% Defin" - "e vector from body frame origin to center of mass\nbr_oc = [0; 0; 0];\n\n% Define 3x3 Identity Matrix\nI = eye(3" - ");\n\n% Create gamma vectors\ngamma_Ti = [0; 0; -1];\ngamma_omega_03 = [0; 0; -1]; %Rotors 0 and 3 use this gam" - "ma_omega vector\ngamma_omega_12 = [0; 0; 1]; %Rotors 1 and 2 use this gamma_omega vector\n\n% Define angular vel" - "ocities for each rotor\nw_0 = angular_velocity(1);\nw_1 = angular_velocity(2);\nw_2 = angular_velocity(3);\nw_3 " - "= angular_velocity(4);\n\n% Define angular acceleration for each rotor\nw_0_dot = angular_acceleration(1);\nw_1_" - "dot = angular_acceleration(2);\nw_2_dot = angular_acceleration(3);\nw_3_dot = angular_acceleration(4);\n\n% Defi" - "ne the rotor force in the z-direction from each rotor\nB_Fr_0 = Kt * w_0 * w_0 * gamma_Ti;\nB_Fr_1 = Kt * w_1 * " - "w_1 * gamma_Ti;\nB_Fr_2 = Kt * w_2 * w_2 * gamma_Ti;\nB_Fr_3 = Kt * w_3 * w_3 * gamma_Ti;\n\n% Sum up the rotor " - "forces in the z-direction from each vector to get the\n% total body force in the z-direction\nB_Fr = B_Fr_0 + B_" - "Fr_1 + B_Fr_2 + B_Fr_3;\n\n% Define the in-plane drag and induced torque produced by each rotor\n B_Q_d0 = -1 * " - "Kd * w_0 * w_0 * gamma_omega_03;\n B_Q_d1 = -1 * Kd * w_1 * w_1 * gamma_omega_12;\n B_Q_d2 = -1 * Kd * w_2 * w_2" - " * gamma_omega_12;\n B_Q_d3 = -1 * Kd * w_3 * w_3 * gamma_omega_03;\n\n% Sum up the total in-plane drag and indu" - "ced torque to get the total\n% in-plane drag and induced torque on the body\nB_Q_d = B_Q_d0 + B_Q_d1 + B_Q_d2 + " - "B_Q_d3;\n\n% Define the force lever arm torque created from the force produced by each\n% rotor in the z-directi" - "on\nB_Q_F0 = cross( rh_0, B_Fr_0 );\nB_Q_F1 = cross( rh_1, B_Fr_1 );\nB_Q_F2 = cross( rh_2, B_Fr_2 );\nB_Q_F3 = " - "cross( rh_3, B_Fr_3 );\n\nB_Q_F = B_Q_F0 + B_Q_F1 + B_Q_F2 + B_Q_F3;\n\n%Define the change in angular momentum t" - "orque produced by each rotor \nB_Q_L0 = -1 * Jreq * ( cross(B_omega, w_0 * gamma_omega_03) + w_0_dot * gamma_ome" - "ga_03 );\nB_Q_L1 = -1 * Jreq * ( cross(B_omega, w_1 * gamma_omega_12) + w_1_dot * gamma_omega_12 ); \nB_Q_L2 = -" - "1 * Jreq * ( cross(B_omega, w_2 * gamma_omega_12) + w_2_dot * gamma_omega_12 ); \nB_Q_L3 = -1 * Jreq * ( cross(B" - "_omega, w_3 * gamma_omega_03) + w_3_dot * gamma_omega_03 );\n\n% Sum up the total change in angular momentum tor" - "que produced by each rotor\nB_Q_L = B_Q_L0 + B_Q_L1 + B_Q_L2 + B_Q_L3;\n\n% Define the total rotor system torque" - " as the sum of the in-plane drag and\n% induced torque, force lever arm torque, and change in angular momentum\n" - "% torques\nB_Q = B_Q_d + B_Q_F + B_Q_L;\n\n% Define the body forces in the z-direction from each vector to get t" - "he\n% total body force in the z-direction\nB_F = B_Fr + B_Fg; \n\n% Define the body frame linear velocities\nB_v" - "o_dot = (m*I)^(-1) * ( B_F - cross( B_omega, m*(B_vo + cross(B_omega, br_oc)) ) );\n\n% Define the body frame an" - "gular velocities\nB_omega_dot = J ^(-1) * ( B_Q - cross(B_omega, J * B_omega) - cross(br_oc, B_F) );\n\n" + "vo, m, Kt, Kd, rhx, rhy, rhz, Jreq, Jxx, Jyy, Jzz)\n\n%B_vo_dot = zeros(3,1);\n%B_omega_dot = zeros(3,1);\n\n% C" + "reate J vector\nJ = [Jxx, 0 , 0 ; ...\n 0 , Jyy, 0 ; ...\n 0 , 0 , Jzz;];\n\n% Create r_hi vector\n" + "% rh_0 = [-rhx; rhy; rhz];\n% rh_1 = [rhx; rhy; rhz];\n% rh_2 = [-rhx; -rhy; rhz];\n% rh_3 = [rhx; -rhy; rhz];\n" + "rh_0 = [-rhx; rhy; -rhz];\nrh_1 = [rhx; rhy; -rhz];\nrh_2 = [-rhx; -rhy; -rhz];\nrh_3 = [rhx; -rhy; -rhz];\n\n% " + "Define vector from body frame origin to center of mass\nbr_oc = [0; 0; 0];\n\n% Define 3x3 Identity Matrix\nI = " + "eye(3);\n\n% Create gamma vectors\ngamma_Ti = [0; 0; -1];\n%gamma_omega_03 = [0; 0; -1]; %Rotors 0 and 3 use th" + "is gamma_omega vector\n%gamma_omega_12 = [0; 0; 1]; %Rotors 1 and 2 use this gamma_omega vector\ngamma_omega_03 " + "= [0; 0; 1]; %Rotors 0 and 3 use this gamma_omega vector\ngamma_omega_12 = [0; 0; -1]; %Rotors 1 and 2 use this" + " gamma_omega vector\n\n% Define angular velocities for each rotor\nw_0 = angular_velocity(1);\nw_1 = angular_vel" + "ocity(2);\nw_2 = angular_velocity(3);\nw_3 = angular_velocity(4);\n\n% Define angular acceleration for each roto" + "r\nw_0_dot = angular_acceleration(1);\nw_1_dot = angular_acceleration(2);\nw_2_dot = angular_acceleration(3);\nw" + "_3_dot = angular_acceleration(4);\n\n% Define the rotor force in the z-direction from each rotor\nB_Fr_0 = Kt * " + "w_0 * w_0 * gamma_Ti;\nB_Fr_1 = Kt * w_1 * w_1 * gamma_Ti;\nB_Fr_2 = Kt * w_2 * w_2 * gamma_Ti;\nB_Fr_3 = Kt * w" + "_3 * w_3 * gamma_Ti;\n\n% Sum up the rotor forces in the z-direction from each vector to get the\n% total body f" + "orce in the z-direction\nB_Fr = B_Fr_0 + B_Fr_1 + B_Fr_2 + B_Fr_3;\n\n% Define the in-plane drag and induced tor" + "que produced by each rotor\n B_Q_d0 = -1 * Kd * w_0 * w_0 * gamma_omega_03;\n B_Q_d1 = -1 * Kd * w_1 * w_1 * gam" + "ma_omega_12;\n B_Q_d2 = -1 * Kd * w_2 * w_2 * gamma_omega_12;\n B_Q_d3 = -1 * Kd * w_3 * w_3 * gamma_omega_03;\n" + "\n% Sum up the total in-plane drag and induced torque to get the total\n% in-plane drag and induced torque on th" + "e body\nB_Q_d = B_Q_d0 + B_Q_d1 + B_Q_d2 + B_Q_d3;\n\n% Define the force lever arm torque created from the force" + " produced by each\n% rotor in the z-direction\nB_Q_F0 = cross( rh_0, B_Fr_0 );\nB_Q_F1 = cross( rh_1, B_Fr_1 );\n" + "B_Q_F2 = cross( rh_2, B_Fr_2 );\nB_Q_F3 = cross( rh_3, B_Fr_3 );\n\nB_Q_F = B_Q_F0 + B_Q_F1 + B_Q_F2 + B_Q_F3;\n" + "\n%Define the change in angular momentum torque produced by each rotor \nB_Q_L0 = -1 * Jreq * ( cross(B_omega, w" + "_0 * gamma_omega_03) + w_0_dot * gamma_omega_03 );\nB_Q_L1 = -1 * Jreq * ( cross(B_omega, w_1 * gamma_omega_12) " + "+ w_1_dot * gamma_omega_12 ); \nB_Q_L2 = -1 * Jreq * ( cross(B_omega, w_2 * gamma_omega_12) + w_2_dot * gamma_om" + "ega_12 ); \nB_Q_L3 = -1 * Jreq * ( cross(B_omega, w_3 * gamma_omega_03) + w_3_dot * gamma_omega_03 );\n\n% Sum u" + "p the total change in angular momentum torque produced by each rotor\nB_Q_L = B_Q_L0 + B_Q_L1 + B_Q_L2 + B_Q_L3;" + "\n\n% Define the total rotor system torque as the sum of the in-plane drag and\n% induced torque, force lever ar" + "m torque, and change in angular momentum\n% torques\nB_Q = B_Q_d + B_Q_F + B_Q_L;\n\n% Define the body forces in" + " the z-direction from each vector to get the\n% total body force in the z-direction\nB_F = B_Fr + B_Fg; \n\n% De" + "fine the body frame linear velocities\nB_vo_dot = (m*I)^(-1) * ( B_F - cross( B_omega, m*(B_vo + cross(B_omega, " + "br_oc)) ) );\n\n% Define the body frame angular velocities\nB_omega_dot = J ^(-1) * ( B_Q - cross(B_omega, J * B" + "_omega) - cross(br_oc, B_F) );\n\n" editorLayout "100 M4x1[10 5 700 500]" } } @@ -10536,6 +10627,7 @@ Stateflow { id 51 ssIdNumber 6 name "B_omega_dot" + linkNode [49 0 52] scope OUTPUT_DATA machine 1 props { @@ -10552,12 +10644,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [49 0 52] } data { id 52 ssIdNumber 10 name "angular_acceleration" + linkNode [49 51 53] scope INPUT_DATA machine 1 props { @@ -10574,12 +10666,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 51 53] } data { id 53 ssIdNumber 11 name "angular_velocity" + linkNode [49 52 54] scope INPUT_DATA machine 1 props { @@ -10596,12 +10688,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 52 54] } data { id 54 ssIdNumber 30 name "B_Fg" + linkNode [49 53 55] scope INPUT_DATA machine 1 props { @@ -10618,12 +10710,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 53 55] } data { id 55 ssIdNumber 8 name "B_omega" + linkNode [49 54 56] scope INPUT_DATA machine 1 props { @@ -10640,12 +10732,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 54 56] } data { id 56 ssIdNumber 5 name "B_vo_dot" + linkNode [49 55 57] scope OUTPUT_DATA machine 1 props { @@ -10660,12 +10752,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [49 55 57] } data { id 57 ssIdNumber 7 name "B_vo" + linkNode [49 56 58] scope INPUT_DATA machine 1 props { @@ -10682,12 +10774,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 56 58] } data { id 58 ssIdNumber 12 name "m" + linkNode [49 57 59] scope PARAMETER_DATA paramIndexForInitFromWorkspace 6 machine 1 @@ -10705,12 +10797,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 57 59] } data { id 59 ssIdNumber 14 name "Kt" + linkNode [49 58 60] scope PARAMETER_DATA paramIndexForInitFromWorkspace 5 machine 1 @@ -10728,12 +10820,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 58 60] } data { id 60 ssIdNumber 13 name "Kd" + linkNode [49 59 61] scope PARAMETER_DATA paramIndexForInitFromWorkspace 4 machine 1 @@ -10751,12 +10843,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 59 61] } data { id 61 ssIdNumber 15 name "rhx" + linkNode [49 60 62] scope PARAMETER_DATA paramIndexForInitFromWorkspace 7 machine 1 @@ -10774,12 +10866,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 60 62] } data { id 62 ssIdNumber 16 name "rhy" + linkNode [49 61 63] scope PARAMETER_DATA paramIndexForInitFromWorkspace 8 machine 1 @@ -10797,12 +10889,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 61 63] } data { id 63 ssIdNumber 17 name "rhz" + linkNode [49 62 64] scope PARAMETER_DATA paramIndexForInitFromWorkspace 9 machine 1 @@ -10820,12 +10912,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 62 64] } data { id 64 ssIdNumber 18 name "Jreq" + linkNode [49 63 65] scope PARAMETER_DATA machine 1 props { @@ -10842,12 +10934,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 63 65] } data { id 65 ssIdNumber 19 name "Jxx" + linkNode [49 64 66] scope PARAMETER_DATA paramIndexForInitFromWorkspace 1 machine 1 @@ -10865,12 +10957,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 64 66] } data { id 66 ssIdNumber 20 name "Jyy" + linkNode [49 65 67] scope PARAMETER_DATA paramIndexForInitFromWorkspace 2 machine 1 @@ -10888,12 +10980,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 65 67] } data { id 67 ssIdNumber 21 name "Jzz" + linkNode [49 66 0] scope PARAMETER_DATA paramIndexForInitFromWorkspace 3 machine 1 @@ -10911,16 +11003,15 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [49 66 0] } junction { id 68 position [23.5747 49.5747 7] chart 49 + linkNode [49 0 0] subviewer 49 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [49 0 0] } transition { id 69 @@ -10936,6 +11027,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 49 + linkNode [49 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 49 drawStyle SMART @@ -10944,34 +11036,33 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [49 0 0] } instance { id 70 - machine 1 name "Actuation/Rotor System\n\n\n\n\n\n\n\n" + machine 1 chart 49 } chart { id 71 - machine 1 name "Actuation/Aeb\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 72 0 0] + firstTransition 77 + firstJunction 76 viewObj 71 + machine 1 ssIdHighWaterMark 6 decomposition CLUSTER_CHART type EML_CHART + firstData 73 chartFileNumber 7 disableImplicitCasting 1 eml { name "angular_body_earth_conversion" } - firstData 73 - firstTransition 77 - firstJunction 76 } state { id 72 @@ -10998,6 +11089,7 @@ Stateflow { id 73 ssIdNumber 4 name "B_omega" + linkNode [71 0 74] scope INPUT_DATA machine 1 props { @@ -11011,12 +11103,12 @@ Stateflow { complexity SF_COMPLEX_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [71 0 74] } data { id 74 ssIdNumber 5 name "euler_rates" + linkNode [71 73 75] scope OUTPUT_DATA machine 1 props { @@ -11031,12 +11123,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [71 73 75] } data { id 75 ssIdNumber 6 name "euler_angles" + linkNode [71 74 0] scope INPUT_DATA machine 1 props { @@ -11053,16 +11145,15 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [71 74 0] } junction { id 76 position [23.5747 49.5747 7] chart 71 + linkNode [71 0 0] subviewer 71 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [71 0 0] } transition { id 77 @@ -11078,6 +11169,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 71 + linkNode [71 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 71 drawStyle SMART @@ -11086,34 +11178,33 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [71 0 0] } instance { id 78 - machine 1 name "Actuation/Aeb\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + machine 1 chart 71 } chart { id 79 - machine 1 name "Actuation/Lbe\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 80 0 0] + firstTransition 87 + firstJunction 86 viewObj 79 + machine 1 ssIdHighWaterMark 13 decomposition CLUSTER_CHART type EML_CHART + firstData 81 chartFileNumber 8 disableImplicitCasting 1 eml { name "linear_earth_body_conversion" } - firstData 81 - firstTransition 87 - firstJunction 86 } state { id 80 @@ -11142,6 +11233,7 @@ Stateflow { id 81 ssIdNumber 7 name "E_Fg" + linkNode [79 0 82] scope INPUT_DATA machine 1 props { @@ -11158,12 +11250,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [79 0 82] } data { id 82 ssIdNumber 11 name "euler_angles" + linkNode [79 81 83] scope INPUT_DATA machine 1 props { @@ -11180,12 +11272,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [79 81 83] } data { id 83 ssIdNumber 9 name "B_Fg" + linkNode [79 82 84] scope OUTPUT_DATA machine 1 props { @@ -11202,12 +11294,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [79 82 84] } data { id 84 ssIdNumber 12 name "B_g" + linkNode [79 83 85] scope OUTPUT_DATA machine 1 props { @@ -11224,12 +11316,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [79 83 85] } data { id 85 ssIdNumber 13 name "m" + linkNode [79 84 0] scope PARAMETER_DATA machine 1 props { @@ -11246,16 +11338,15 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [79 84 0] } junction { id 86 position [23.5747 49.5747 7] chart 79 + linkNode [79 0 0] subviewer 79 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [79 0 0] } transition { id 87 @@ -11271,6 +11362,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 79 + linkNode [79 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 79 drawStyle SMART @@ -11279,34 +11371,36 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [79 0 0] } instance { id 88 - machine 1 name "Actuation/Lbe\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + machine 1 chart 79 } chart { id 89 - machine 1 name " Sensors /Complimentary Filter\n\n\n\n\n\n\n\n" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 90 0 0] + firstTransition 96 + firstJunction 95 viewObj 89 + visible 1 + machine 1 + subviewS { + } ssIdHighWaterMark 16 decomposition CLUSTER_CHART type EML_CHART + firstData 91 chartFileNumber 9 disableImplicitCasting 1 eml { name "complimentaryFilter" } - firstData 91 - firstTransition 96 - firstJunction 95 } state { id 90 @@ -11327,9 +11421,9 @@ Stateflow { ")\n\n% LOOP_TIME = 5*10^-3;\n% \n% prev_phi = prev_euler_angles_IMU(1);\n% prev_theta = prev_euler_angles_IMU(2)" ";\n% \n% phi_dot_gyro = euler_angles_gyro(1);\n% theta_dot_gyro = euler_angles_gyro(2);\n\n% phi = 0.98 * ( prev" "_phi + phi_dot_gyro * LOOP_TIME ) + 0.02 * accel_roll;\n% theta = 0.98 * ( prev_theta + theta_dot_gyro * LOOP_TI" - "ME) + 0.02 * accel_pitch;\nk_gyro = 1; \nk_accel = 1-k_gyro; \n\nphi = k_gyro * ( euler_angles_gyro(1) ) + k_acc" - "el * accel_roll;\ntheta = k_gyro * ( euler_angles_gyro(2) ) + k_accel * accel_pitch;\n\neuler_angles_IMU = [phi;" - " theta];\n" + "ME) + 0.02 * accel_pitch;\nk_gyro = 0.98; \nk_accel = 1-k_gyro; \n\nphi = k_gyro * ( euler_angles_gyro(1) ) + k_" + "accel * accel_roll;\ntheta = k_gyro * ( euler_angles_gyro(2) ) + k_accel * accel_pitch;\n\neuler_angles_IMU = [p" + "hi; theta];\n" editorLayout "100 M4x1[10 5 700 500]" } } @@ -11337,6 +11431,7 @@ Stateflow { id 91 ssIdNumber 4 name "accel_pitch" + linkNode [89 0 92] scope INPUT_DATA machine 1 props { @@ -11350,12 +11445,12 @@ Stateflow { complexity SF_COMPLEX_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [89 0 92] } data { id 92 ssIdNumber 13 name "accel_roll" + linkNode [89 91 93] scope INPUT_DATA machine 1 props { @@ -11372,12 +11467,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [89 91 93] } data { id 93 ssIdNumber 5 name "euler_angles_IMU" + linkNode [89 92 94] scope OUTPUT_DATA machine 1 props { @@ -11392,12 +11487,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [89 92 94] } data { id 94 ssIdNumber 6 name "euler_angles_gyro" + linkNode [89 93 0] scope INPUT_DATA machine 1 props { @@ -11414,16 +11509,15 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [89 93 0] } junction { id 95 position [23.5747 49.5747 7] chart 89 + linkNode [89 0 0] subviewer 89 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [89 0 0] } transition { id 96 @@ -11439,6 +11533,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 89 + linkNode [89 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 89 drawStyle SMART @@ -11447,34 +11542,33 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [89 0 0] } instance { id 97 - machine 1 name " Sensors /Complimentary Filter\n\n\n\n\n\n\n\n" + machine 1 chart 89 } chart { id 98 - machine 1 name " Sensors /IMU\n\n\n\n\n\n/\n\n\n\n\n\n\n" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 99 0 0] + firstTransition 109 + firstJunction 108 viewObj 98 + machine 1 ssIdHighWaterMark 15 decomposition CLUSTER_CHART type EML_CHART + firstData 100 chartFileNumber 10 disableImplicitCasting 1 eml { name "idealIMU" } - firstData 100 - firstTransition 109 - firstJunction 108 } state { id 99 @@ -11500,6 +11594,7 @@ Stateflow { id 100 ssIdNumber 4 name "B_vo_dot" + linkNode [98 0 101] scope INPUT_DATA machine 1 props { @@ -11513,12 +11608,12 @@ Stateflow { complexity SF_COMPLEX_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [98 0 101] } data { id 101 ssIdNumber 9 name "B_vo" + linkNode [98 100 102] scope INPUT_DATA machine 1 props { @@ -11535,12 +11630,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [98 100 102] } data { id 102 ssIdNumber 5 name "accelReading" + linkNode [98 101 103] scope OUTPUT_DATA machine 1 props { @@ -11555,12 +11650,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [98 101 103] } data { id 103 ssIdNumber 6 name "B_Omega" + linkNode [98 102 104] scope INPUT_DATA machine 1 props { @@ -11577,12 +11672,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [98 102 104] } data { id 104 ssIdNumber 7 name "B_g" + linkNode [98 103 105] scope INPUT_DATA machine 1 props { @@ -11599,12 +11694,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [98 103 105] } data { id 105 ssIdNumber 8 name "gyroReading" + linkNode [98 104 106] scope OUTPUT_DATA machine 1 props { @@ -11621,12 +11716,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [98 104 106] } data { id 106 ssIdNumber 10 name "r_oc" + linkNode [98 105 107] scope INPUT_DATA machine 1 props { @@ -11643,12 +11738,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [98 105 107] } data { id 107 ssIdNumber 12 name "g" + linkNode [98 106 0] scope PARAMETER_DATA machine 1 props { @@ -11665,16 +11760,15 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [98 106 0] } junction { id 108 position [23.5747 49.5747 7] chart 98 + linkNode [98 0 0] subviewer 98 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [98 0 0] } transition { id 109 @@ -11690,6 +11784,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 98 + linkNode [98 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 98 drawStyle SMART @@ -11698,34 +11793,33 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [98 0 0] } instance { id 110 - machine 1 name " Sensors /IMU\n\n\n\n\n\n/\n\n\n\n\n\n\n" + machine 1 chart 98 } chart { id 111 - machine 1 name " Sensors /3D Graphical Simulation/MATLAB Function" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 112 0 0] + firstTransition 116 + firstJunction 115 viewObj 111 + machine 1 ssIdHighWaterMark 5 decomposition CLUSTER_CHART type EML_CHART + firstData 113 chartFileNumber 11 disableImplicitCasting 1 eml { name "eigenaxis_ucart" } - firstData 113 - firstTransition 116 - firstJunction 115 } state { id 112 @@ -11755,6 +11849,7 @@ Stateflow { id 113 ssIdNumber 4 name "u" + linkNode [111 0 114] scope INPUT_DATA machine 1 props { @@ -11768,12 +11863,12 @@ Stateflow { complexity SF_COMPLEX_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [111 0 114] } data { id 114 ssIdNumber 5 name "y" + linkNode [111 113 0] scope OUTPUT_DATA machine 1 props { @@ -11788,16 +11883,15 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [111 113 0] } junction { id 115 position [23.5747 49.5747 7] chart 111 + linkNode [111 0 0] subviewer 111 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [111 0 0] } transition { id 116 @@ -11813,6 +11907,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 111 + linkNode [111 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 111 drawStyle SMART @@ -11821,34 +11916,33 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [111 0 0] } instance { id 117 - machine 1 name " Sensors /3D Graphical Simulation/MATLAB Function" + machine 1 chart 111 } chart { id 118 - machine 1 name " Sensors /Aeb\n\n\n\n\n\n\n\n\n\n" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 119 0 0] + firstTransition 124 + firstJunction 123 viewObj 118 + machine 1 ssIdHighWaterMark 6 decomposition CLUSTER_CHART type EML_CHART + firstData 120 chartFileNumber 12 disableImplicitCasting 1 eml { name "angular_body_earth_conversion" } - firstData 120 - firstTransition 124 - firstJunction 123 } state { id 119 @@ -11875,6 +11969,7 @@ Stateflow { id 120 ssIdNumber 4 name "gyro_reading" + linkNode [118 0 121] scope INPUT_DATA machine 1 props { @@ -11888,12 +11983,12 @@ Stateflow { complexity SF_COMPLEX_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [118 0 121] } data { id 121 ssIdNumber 5 name "euler_rates_IMU" + linkNode [118 120 122] scope OUTPUT_DATA machine 1 props { @@ -11908,12 +12003,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [118 120 122] } data { id 122 ssIdNumber 6 name "euler_angles_IMU" + linkNode [118 121 0] scope INPUT_DATA machine 1 props { @@ -11930,16 +12025,15 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [118 121 0] } junction { id 123 position [23.5747 49.5747 7] chart 118 + linkNode [118 0 0] subviewer 118 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [118 0 0] } transition { id 124 @@ -11955,6 +12049,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 118 + linkNode [118 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 118 drawStyle SMART @@ -11963,34 +12058,33 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [118 0 0] } instance { id 125 - machine 1 name " Sensors /Aeb\n\n\n\n\n\n\n\n\n\n" + machine 1 chart 118 } chart { id 126 - machine 1 name " Sensors /Calculate Pitch and Roll\n\n\n\n\n\n\n\n\n\n\n\n1" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 127 0 0] + firstTransition 133 + firstJunction 132 viewObj 126 + machine 1 ssIdHighWaterMark 10 decomposition CLUSTER_CHART type EML_CHART + firstData 128 chartFileNumber 13 disableImplicitCasting 1 eml { name "getPitchAndRoll" } - firstData 128 - firstTransition 133 - firstJunction 132 } state { id 127 @@ -12019,6 +12113,7 @@ Stateflow { id 128 ssIdNumber 4 name "accel_reading" + linkNode [126 0 129] scope INPUT_DATA machine 1 props { @@ -12032,12 +12127,12 @@ Stateflow { complexity SF_COMPLEX_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [126 0 129] } data { id 129 ssIdNumber 5 name "accel_pitch" + linkNode [126 128 130] scope OUTPUT_DATA machine 1 props { @@ -12052,12 +12147,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [126 128 130] } data { id 130 ssIdNumber 6 name "accel_roll" + linkNode [126 129 131] scope OUTPUT_DATA machine 1 props { @@ -12074,12 +12169,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [126 129 131] } data { id 131 ssIdNumber 7 name "accel_roll_prev" + linkNode [126 130 0] scope INPUT_DATA machine 1 props { @@ -12096,16 +12191,15 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [126 130 0] } junction { id 132 position [23.5747 49.5747 7] chart 126 + linkNode [126 0 0] subviewer 126 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [126 0 0] } transition { id 133 @@ -12121,6 +12215,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 126 + linkNode [126 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 126 drawStyle SMART @@ -12129,34 +12224,36 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [126 0 0] } instance { id 134 - machine 1 name " Sensors /Calculate Pitch and Roll\n\n\n\n\n\n\n\n\n\n\n\n1" + machine 1 chart 126 } chart { id 135 - machine 1 name "Control System/MATLAB Function" windowPosition [422 539.941 189 413] viewLimits [0 156.75 0 153.75] screen [1 1 3600 1200 1.180555555555556] treeNode [0 136 0 0] + firstTransition 143 + firstJunction 142 viewObj 135 + visible 1 + machine 1 + subviewS { + } ssIdHighWaterMark 11 decomposition CLUSTER_CHART type EML_CHART + firstData 137 chartFileNumber 14 disableImplicitCasting 1 eml { name "signal_mixer" } - firstData 137 - firstTransition 143 - firstJunction 142 } state { id 136 @@ -12185,6 +12282,7 @@ Stateflow { id 137 ssIdNumber 4 name "height_controlled" + linkNode [135 0 138] scope INPUT_DATA machine 1 props { @@ -12198,12 +12296,12 @@ Stateflow { complexity SF_COMPLEX_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [135 0 138] } data { id 138 ssIdNumber 7 name "y_controlled" + linkNode [135 137 139] scope INPUT_DATA machine 1 props { @@ -12220,12 +12318,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [135 137 139] } data { id 139 ssIdNumber 5 name "motorCommands" + linkNode [135 138 140] scope OUTPUT_DATA machine 1 props { @@ -12240,12 +12338,12 @@ Stateflow { frame SF_FRAME_NO } dataType "Inherit: Same as Simulink" - linkNode [135 138 140] } data { id 140 ssIdNumber 6 name "x_controlled" + linkNode [135 139 141] scope INPUT_DATA machine 1 props { @@ -12262,12 +12360,12 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [135 139 141] } data { id 141 ssIdNumber 8 name "yaw_controlled" + linkNode [135 140 0] scope INPUT_DATA machine 1 props { @@ -12284,16 +12382,15 @@ Stateflow { frame SF_FRAME_INHERITED } dataType "Inherit: Same as Simulink" - linkNode [135 140 0] } junction { id 142 position [23.5747 49.5747 7] chart 135 + linkNode [135 0 0] subviewer 135 ssIdNumber 3 type CONNECTIVE_JUNCTION - linkNode [135 0 0] } transition { id 143 @@ -12309,6 +12406,7 @@ Stateflow { } midPoint [23.5747 24.9468] chart 135 + linkNode [135 0 0] dataLimits [21.175 25.975 14.625 42.575] subviewer 135 drawStyle SMART @@ -12317,19 +12415,18 @@ Stateflow { } executionOrder 1 ssIdNumber 2 - linkNode [135 0 0] } instance { id 144 - machine 1 name "Control System/MATLAB Function" + machine 1 chart 135 } target { id 145 - machine 1 name "sfun" description "Default Simulink S-Function Target." + machine 1 linkNode [1 0 0] } } diff --git a/controls/model/test_model_R2015Ax.slx b/controls/model/test_model_R2015Ax.slx new file mode 100644 index 0000000000000000000000000000000000000000..feb8b73e27a6546344f8e37555adce78811d6436 Binary files /dev/null and b/controls/model/test_model_R2015Ax.slx differ diff --git a/quad/ci-build.sh b/quad/ci-build.sh new file mode 100644 index 0000000000000000000000000000000000000000..36ff958b187383adb5a1007f85e6bffa1f5b09d2 --- /dev/null +++ b/quad/ci-build.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +QUAD_ROOT=$PROJECT_ROOT/quad +export QUAD_ROOT + +# Build Quad code +cd $QUAD_ROOT/sw/modular_quad_pid/ +bash build.sh || exit 1 diff --git a/quad/test-ci.sh b/quad/ci-test.sh similarity index 81% rename from quad/test-ci.sh rename to quad/ci-test.sh index c35802b3984f5ba6dd4ba5984136340dec297e35..bb2cc16665d0687f7f3cdb553e2d39e8c1ff1b9c 100644 --- a/quad/test-ci.sh +++ b/quad/ci-test.sh @@ -3,9 +3,11 @@ QUAD_ROOT=$PROJECT_ROOT/quad export QUAD_ROOT +# Build Test Library cd $QUAD_ROOT/lib/test make || exit 1 +# Test UART buffer cd $QUAD_ROOT/sw/modular_quad_pid/test make || exit 1 ./test_uart_buff || exit 1 diff --git a/quad/sw/modular_quad_pid/.build_app.tcl b/quad/sw/modular_quad_pid/.build_app.tcl new file mode 100644 index 0000000000000000000000000000000000000000..ae51135bb7ea13e1f14bc28fda3da7f2c4751181 --- /dev/null +++ b/quad/sw/modular_quad_pid/.build_app.tcl @@ -0,0 +1,3 @@ +cd .. +sdk set_workspace . +sdk build_project -type app -name modular_quad_pid diff --git a/quad/sw/modular_quad_pid/.build_bsp.tcl b/quad/sw/modular_quad_pid/.build_bsp.tcl new file mode 100644 index 0000000000000000000000000000000000000000..6188f060ae618549d958ff723b7fc645778128c6 --- /dev/null +++ b/quad/sw/modular_quad_pid/.build_bsp.tcl @@ -0,0 +1,3 @@ +cd .. +sdk set_workspace . +sdk build_project -type bsp -name system_bsp diff --git a/quad/sw/modular_quad_pid/.create_bsp.tcl b/quad/sw/modular_quad_pid/.create_bsp.tcl new file mode 100644 index 0000000000000000000000000000000000000000..48668ef358b00c6a12098269411fe91a613053a1 --- /dev/null +++ b/quad/sw/modular_quad_pid/.create_bsp.tcl @@ -0,0 +1,3 @@ +cd .. +sdk set_workspace . +sdk create_bsp_project -name system_bsp -hwproject system_hw_platform -proc ps7_cortexa9_0 -os standalone diff --git a/quad/sw/modular_quad_pid/build.sh b/quad/sw/modular_quad_pid/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..16f728e1c52a93f5b3996876765b2cc12919dc7c --- /dev/null +++ b/quad/sw/modular_quad_pid/build.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +source /remote/Xilinx/2015.4/SDK/2015.4/settings64.sh + +echo "Building modular_quad_pid" + +if [ ! -d ../.metadata ]; then + # Haven't configured XSDK environment yet. Do that now + + ECLIPSE=/remote/Xilinx/2015.4/SDK/2015.4/eclipse/lnx64.o/eclipse + VM=/remote/Xilinx/2015.4/SDK/2015.4/tps/lnx64/jre/bin + WSPACE=$(dirname $0)/.. + HW=$WSPACE/system_hw_platform + BSP=$WSPACE/system_bsp + APP=$WSPACE/modular_quad_pid + + echo "Setting up dependencies for modular_quad_pid" + + # Import the system_hw_platform into the workspace + $ECLIPSE -vm $VM -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild \ + -import $HW \ + -data $WSPACE \ + -vmargs -Dorg.eclipse.cdt.core.console=org.eclipse.cdt.core.systemConsole || exit 1 + + # Create the BSP + xsct .create_bsp.tcl || exit 1 + + # Import the system_bsp and modular_quad_pid into workspace + $ECLIPSE -vm $VM -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild \ + -import $BSP \ + -import $APP \ + -data $WSPACE \ + -vmargs -Dorg.eclipse.cdt.core.console=org.eclipse.cdt.core.systemConsole || exit 1 + + # Build the BSP + xsct .build_bsp.tcl || exit 1 + +fi + +xsct .build_app.tcl || exit 1 diff --git a/quad/sw/modular_quad_pid/src/control_algorithm.c b/quad/sw/modular_quad_pid/src/control_algorithm.c index 63ba756137739578a39f2609048a3728027266c7..202e035b3740c87ec7513938bb853c62ddec5946 100644 --- a/quad/sw/modular_quad_pid/src/control_algorithm.c +++ b/quad/sw/modular_quad_pid/src/control_algorithm.c @@ -10,7 +10,8 @@ #include "control_algorithm.h" #include "communication.h" -#define ROLL_PITCH_MAX_ANGLE 0.3490 // 20 degrees +#define ROLL_PITCH_MAX_ANGLE 1.5708 // 90 degrees +#define PWM_DIFF_BOUNDS 30000 int control_algorithm_init(parameter_t * parameter_struct) { @@ -184,13 +185,13 @@ parameter_struct->pid_controllers[PITCH_ID].current_point = sensor_struct->pitch_angle_filtered; parameter_struct->pid_controllers[PITCH_ID].setpoint = - /*(user_defined_struct->flight_mode == AUTO_FLIGHT_MODE)? - (parameter_struct->pid_controllers[LOCAL_X_ID].pid_correction) + pitch_trim :*/ user_input_struct->pitch_angle_manual_setpoint; + (user_defined_struct->flight_mode == AUTO_FLIGHT_MODE)? + (parameter_struct->pid_controllers[LOCAL_X_ID].pid_correction) + pitch_trim : user_input_struct->pitch_angle_manual_setpoint; parameter_struct->pid_controllers[ROLL_ID].current_point = sensor_struct->roll_angle_filtered; parameter_struct->pid_controllers[ROLL_ID].setpoint = - /*(user_defined_struct->flight_mode == AUTO_FLIGHT_MODE)? - (parameter_struct->pid_controllers[LOCAL_Y_ID].pid_correction) + roll_trim :*/ user_input_struct->roll_angle_manual_setpoint; + (user_defined_struct->flight_mode == AUTO_FLIGHT_MODE)? + (parameter_struct->pid_controllers[LOCAL_Y_ID].pid_correction) + roll_trim : user_input_struct->roll_angle_manual_setpoint; //logging and PID computation @@ -232,15 +233,17 @@ memcpy(raw_actuator_struct->controller_corrected_motor_commands, user_input_struct->rc_commands, sizeof(int) * 6); // don't use the PID corrections if the throttle is less than about 10% of its range + // NOTE!!!!!!!!!!!!!!!!!!!!!! + // re-enable the check for AUTO_FLIGHT_MODE when autonomous is fully enabled if((user_input_struct->rc_commands[THROTTLE] > - 118000) || (user_defined_struct->flight_mode == AUTO_FLIGHT_MODE)) + 118000))// || (user_defined_struct->flight_mode == AUTO_FLIGHT_MODE)) { if(user_defined_struct->flight_mode == AUTO_FLIGHT_MODE) { //THROTTLE - raw_actuator_struct->controller_corrected_motor_commands[THROTTLE] = - ((int)(parameter_struct->pid_controllers[ALT_ID].pid_correction)) + sensor_struct->trims.throttle; + //raw_actuator_struct->controller_corrected_motor_commands[THROTTLE] = + // ((int)(parameter_struct->pid_controllers[ALT_ID].pid_correction)) + sensor_struct->trims.throttle; //ROLL raw_actuator_struct->controller_corrected_motor_commands[ROLL] = @@ -284,23 +287,23 @@ raw_actuator_struct->controller_corrected_motor_commands[THROTTLE] = 0; //BOUNDS CHECKING - if(raw_actuator_struct->controller_corrected_motor_commands[ROLL] > 20000) - raw_actuator_struct->controller_corrected_motor_commands[ROLL] = 20000; + if(raw_actuator_struct->controller_corrected_motor_commands[ROLL] > PWM_DIFF_BOUNDS) + raw_actuator_struct->controller_corrected_motor_commands[ROLL] = PWM_DIFF_BOUNDS; - if(raw_actuator_struct->controller_corrected_motor_commands[ROLL] < -20000) - raw_actuator_struct->controller_corrected_motor_commands[ROLL] = -20000; + if(raw_actuator_struct->controller_corrected_motor_commands[ROLL] < -PWM_DIFF_BOUNDS) + raw_actuator_struct->controller_corrected_motor_commands[ROLL] = -PWM_DIFF_BOUNDS; - if(raw_actuator_struct->controller_corrected_motor_commands[PITCH] > 20000) - raw_actuator_struct->controller_corrected_motor_commands[PITCH] = 20000; + if(raw_actuator_struct->controller_corrected_motor_commands[PITCH] > PWM_DIFF_BOUNDS) + raw_actuator_struct->controller_corrected_motor_commands[PITCH] = PWM_DIFF_BOUNDS; - if(raw_actuator_struct->controller_corrected_motor_commands[PITCH] < -20000) - raw_actuator_struct->controller_corrected_motor_commands[PITCH] = -20000; + if(raw_actuator_struct->controller_corrected_motor_commands[PITCH] < -PWM_DIFF_BOUNDS) + raw_actuator_struct->controller_corrected_motor_commands[PITCH] = -PWM_DIFF_BOUNDS; - if(raw_actuator_struct->controller_corrected_motor_commands[YAW] > 20000) - raw_actuator_struct->controller_corrected_motor_commands[YAW] = 20000; + if(raw_actuator_struct->controller_corrected_motor_commands[YAW] > PWM_DIFF_BOUNDS) + raw_actuator_struct->controller_corrected_motor_commands[YAW] = PWM_DIFF_BOUNDS; - if(raw_actuator_struct->controller_corrected_motor_commands[YAW] < -20000) - raw_actuator_struct->controller_corrected_motor_commands[YAW] = -20000; + if(raw_actuator_struct->controller_corrected_motor_commands[YAW] < -PWM_DIFF_BOUNDS) + raw_actuator_struct->controller_corrected_motor_commands[YAW] = -PWM_DIFF_BOUNDS; } else diff --git a/quad/sw/modular_quad_pid/src/iic_utils.c b/quad/sw/modular_quad_pid/src/iic_utils.c index 33a9228c2c66704cd2ed1ec8fda77b7260bbd522..cfa36829eefe5517c8647a183d8e87f75914f845 100644 --- a/quad/sw/modular_quad_pid/src/iic_utils.c +++ b/quad/sw/modular_quad_pid/src/iic_utils.c @@ -63,7 +63,7 @@ int iic0_mpu9150_start(){ // Set clock reference to Z Gyro iic0_mpu9150_write(0x6B, 0x03); // Configure Digital Low/High Pass filter - iic0_mpu9150_write(0x1A,0x06); // Level 4 low pass on gyroscope + iic0_mpu9150_write(0x1A,0x06); // Level 6 low pass on gyroscope // Configure Gyro to 2000dps, Accel. to +/-8G iic0_mpu9150_write(0x1B, 0x18); diff --git a/quad/sw/modular_quad_pid/src/initialize_components.c b/quad/sw/modular_quad_pid/src/initialize_components.c index 9f62885187110efd6fa4f779274491e39d59349e..4a179a2f9d789b4d7fe9cbf6c9b22c98c0bf450a 100644 --- a/quad/sw/modular_quad_pid/src/initialize_components.c +++ b/quad/sw/modular_quad_pid/src/initialize_components.c @@ -24,13 +24,9 @@ int protection_loops(modular_structs_t *structs) // wait until throttle is low and the gear switch is engaged (so you don't immediately break out of the main loop below) // also wait for the flight mode to be set to manual - while(rc_commands[THROTTLE] > 125000 || read_kill(rc_commands[GEAR]) || !read_flap(rc_commands[FLAP])) - read_rec_all(rc_commands); - - // wait until the ground station has connected to the quad and acknowledged that its ready to start - while (!structs->user_input_struct.receivedBeginUpdate) { + while(rc_commands[THROTTLE] > 125000 || read_kill(rc_commands[GEAR]) || !read_flap(rc_commands[FLAP])) { process_received(structs); - usleep(10000); + read_rec_all(rc_commands); } // let the pilot/observers know that the quad is now active diff --git a/quad/sw/modular_quad_pid/src/log_data.c b/quad/sw/modular_quad_pid/src/log_data.c index 2ab248cdda53c460527bf294e95a0091e5a47151..f49808bfe41b08122194e8e41055bb6a7a19733e 100644 --- a/quad/sw/modular_quad_pid/src/log_data.c +++ b/quad/sw/modular_quad_pid/src/log_data.c @@ -143,7 +143,7 @@ void printLogging(){ ); - strcat(buf,comments); + //strcat(buf,comments); strcat(buf,header); strcat(buf,units); diff --git a/website/content/files/DesignDocument2.pdf b/website/content/files/DesignDocument2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..47d0f3ddbbc7932a11648e67cb6e99fd7778713e Binary files /dev/null and b/website/content/files/DesignDocument2.pdf differ diff --git a/website/content/files/ProjectPlanVersion2.pdf b/website/content/files/ProjectPlanVersion2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6184e3cdca43aa993e65834e8c76a502ebe5a320 Binary files /dev/null and b/website/content/files/ProjectPlanVersion2.pdf differ diff --git a/website/content/files/ProjectPlanVersion3.pdf b/website/content/files/ProjectPlanVersion3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1fae9579d90ea554545736495eb1c32db097ac56 Binary files /dev/null and b/website/content/files/ProjectPlanVersion3.pdf differ diff --git a/website/content/pages/documents.md b/website/content/pages/documents.md index 0d4864f0eadef51c3e7567473d8d9badc32bfb4b..26e6e6b37d8a52dacb5dab80fb95313a320b1057 100644 --- a/website/content/pages/documents.md +++ b/website/content/pages/documents.md @@ -4,11 +4,14 @@ sortorder: 005 ## Project Plan -[Project Plan 1](/files/ProjectPlan1Template.docx.pdf) +[Project Plan 1](/files/ProjectPlan1Template.docx.pdf) +[Project Plan 2](/files/ProjectPlanVersion2.pdf) +[Project Plan 3](/files/ProjectPlanVersion3.pdf) ## Design Document -[Design Document 1](/files/DesignDocument1.docx.pdf) +[Design Document 1](/files/DesignDocument1.docx.pdf) +[Design Document 2](/files/DesignDocument2.pdf) ## Weekly Reports <iframe src="https://drive.google.com/embeddedfolderview?id=0BywzM7Q_7PUSeF8tdWpmMVN0eG8#list" width="100%" height="500" frameborder="0"></iframe>