|
6 | 6 | <!--
|
7 | 7 | This HTML was auto-generated from MATLAB code.
|
8 | 8 | To make changes, update the MATLAB code and republish this document.
|
9 |
| - --><title>Quadcopter Package Delivery</title><meta name="generator" content="MATLAB 9.12"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2022-03-12"><meta name="DC.source" content="quadcopter_package_delivery.m"><style type="text/css"> |
| 9 | + --><title>Quadcopter Package Delivery</title><meta name="generator" content="MATLAB 9.13"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2022-09-19"><meta name="DC.source" content="quadcopter_package_delivery.m"><style type="text/css"> |
10 | 10 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outine:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
|
11 | 11 |
|
12 | 12 | html { min-height:100%; margin-bottom:1px; }
|
|
67 | 67 |
|
68 | 68 |
|
69 | 69 |
|
70 |
| - </style></head><body><div class="content"><h1>Quadcopter Package Delivery</h1><!--introduction--><p>This example models a quadcopter that navigates a path to deliver a package. The body was designed in CAD and imported into Simscape Multibody. The electric motors capture the dynamics of the power conversion in an abstract manner to enable fast simulation. The package is released from the quadcopter when it reaches the final waypoint and the release criteria are met.</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Model</a></li><li><a href="#3">Quadcopter Subsystem</a></li><li><a href="#4">Body Subsystem</a></li><li><a href="#5">Motors Subsystem</a></li><li><a href="#6">Maneuver Controller</a></li><li><a href="#7">Simulation Results from Simscape Logging: Path 1</a></li><li><a href="#9">Simulation Results from Simscape Logging: Path 4</a></li><li><a href="#10">Simulation Results from Simscape Logging: Path 4 with Wind</a></li><li><a href="#11">Parameter Sweep: Package Mass</a></li><li><a href="#12">Parameter Sweep: Trajectory Speed</a></li><li><a href="#13">Simulation Results from Simscape Logging: Path 5, 6</a></li></ul></div><h2 id="1">Model</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_01.png" alt=""> <p><img vspace="5" hspace="5" src="quadcopter_package_deliver_mechExpAnim.png" alt=""> </p><h2 id="3">Quadcopter Subsystem</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_02.png" alt=""> <h2 id="4">Body Subsystem</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_03.png" alt=""> <h2 id="5">Motors Subsystem</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_04.png" alt=""> <h2 id="6">Maneuver Controller</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_05.png" alt=""> <h2 id="7">Simulation Results from Simscape Logging: Path 1</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_06.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_07.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_08.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_09.png" alt=""> <h2 id="9">Simulation Results from Simscape Logging: Path 4</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_10.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_11.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_12.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_13.png" alt=""> <h2 id="10">Simulation Results from Simscape Logging: Path 4 with Wind</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_14.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_15.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_16.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_17.png" alt=""> <h2 id="11">Parameter Sweep: Package Mass</h2><p>Using parallel computing we vary the mass of the package to see its effect on the quadcopter trajectory.</p><pre class="codeoutput">Elapsed Simulation Time Single Run: 34.9971 |
71 |
| -[12-Mar-2022 16:27:08] Checking for availability of parallel pool... |
72 |
| -Starting parallel pool (parpool) using the 'local' profile ... |
73 |
| - |
74 |
| -[12-Mar-2022 16:27:52] Running simulations... |
75 |
| -[12-Mar-2022 16:28:32] Completed 1 of 12 simulation runs |
76 |
| -[12-Mar-2022 16:28:48] Completed 2 of 12 simulation runs |
77 |
| -[12-Mar-2022 16:29:03] Completed 3 of 12 simulation runs |
78 |
| -[12-Mar-2022 16:29:26] Completed 4 of 12 simulation runs |
79 |
| -[12-Mar-2022 16:29:41] Completed 5 of 12 simulation runs |
80 |
| -[12-Mar-2022 16:30:03] Completed 6 of 12 simulation runs |
81 |
| -[12-Mar-2022 16:30:23] Completed 7 of 12 simulation runs |
82 |
| -[12-Mar-2022 16:30:43] Completed 8 of 12 simulation runs |
83 |
| -[12-Mar-2022 16:31:04] Completed 9 of 12 simulation runs |
84 |
| -[12-Mar-2022 16:31:24] Completed 10 of 12 simulation runs |
85 |
| -[12-Mar-2022 16:31:42] Completed 11 of 12 simulation runs |
86 |
| -[12-Mar-2022 16:31:51] Completed 12 of 12 simulation runs |
87 |
| -Elapsed Sweep Time Total: 238.00 |
88 |
| -Elapsed Sweep Time/(Num Tests): 19.83 |
| 70 | + </style></head><body><div class="content"><h1>Quadcopter Package Delivery</h1><!--introduction--><p>This example models a quadcopter that navigates a path to deliver a package. The body was designed in CAD and imported into Simscape Multibody. The electric motors capture the dynamics of the power conversion in an abstract manner to enable fast simulation. The package is released from the quadcopter when it reaches the final waypoint and the release criteria are met.</p><!--/introduction--><h2>Contents</h2><div><ul><li><a href="#1">Model</a></li><li><a href="#3">Quadcopter Subsystem</a></li><li><a href="#4">Body Subsystem</a></li><li><a href="#5">Motors Subsystem</a></li><li><a href="#6">Maneuver Controller</a></li><li><a href="#7">Simulation Results from Simscape Logging: Path 1</a></li><li><a href="#9">Simulation Results from Simscape Logging: Path 4</a></li><li><a href="#10">Simulation Results from Simscape Logging: Path 4 with Wind</a></li><li><a href="#11">Parameter Sweep: Package Mass</a></li><li><a href="#12">Parameter Sweep: Trajectory Speed</a></li><li><a href="#13">Simulation Results from Simscape Logging: Path 5, 6</a></li></ul></div><h2 id="1">Model</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_01.png" alt=""> <p><img vspace="5" hspace="5" src="quadcopter_package_deliver_mechExpAnim.png" alt=""> </p><h2 id="3">Quadcopter Subsystem</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_02.png" alt=""> <h2 id="4">Body Subsystem</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_03.png" alt=""> <h2 id="5">Motors Subsystem</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_04.png" alt=""> <h2 id="6">Maneuver Controller</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_05.png" alt=""> <h2 id="7">Simulation Results from Simscape Logging: Path 1</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_06.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_07.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_08.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_09.png" alt=""> <h2 id="9">Simulation Results from Simscape Logging: Path 4</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_10.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_11.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_12.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_13.png" alt=""> <h2 id="10">Simulation Results from Simscape Logging: Path 4 with Wind</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_14.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_15.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_16.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_17.png" alt=""> <h2 id="11">Parameter Sweep: Package Mass</h2><p>Using parallel computing we vary the mass of the package to see its effect on the quadcopter trajectory.</p><pre class="codeoutput">Elapsed Simulation Time Single Run: 19.7602 |
| 71 | +[19-Sep-2022 15:40:41] Checking for availability of parallel pool... |
| 72 | +Starting parallel pool (parpool) using the 'Processes' profile ... |
| 73 | +Connected to the parallel pool (number of workers: 6). |
| 74 | +[19-Sep-2022 15:41:14] Starting Simulink on parallel workers... |
| 75 | +[19-Sep-2022 15:41:21] Loading project on parallel workers... |
| 76 | +[19-Sep-2022 15:41:21] Configuring simulation cache folder on parallel workers... |
| 77 | +[19-Sep-2022 15:41:26] Transferring base workspace variables used in the model to parallel workers... |
| 78 | +[19-Sep-2022 15:41:27] Loading model on parallel workers... |
| 79 | +[19-Sep-2022 15:41:43] Running simulations... |
| 80 | +[19-Sep-2022 15:42:44] Completed 1 of 12 simulation runs |
| 81 | +[19-Sep-2022 15:42:45] Completed 2 of 12 simulation runs |
| 82 | +[19-Sep-2022 15:42:46] Completed 3 of 12 simulation runs |
| 83 | +[19-Sep-2022 15:42:49] Completed 4 of 12 simulation runs |
| 84 | +[19-Sep-2022 15:42:50] Completed 5 of 12 simulation runs |
| 85 | +[19-Sep-2022 15:42:51] Completed 6 of 12 simulation runs |
| 86 | +[19-Sep-2022 15:42:57] Completed 7 of 12 simulation runs |
| 87 | +[19-Sep-2022 15:43:00] Completed 8 of 12 simulation runs |
| 88 | +[19-Sep-2022 15:43:01] Completed 9 of 12 simulation runs |
| 89 | +[19-Sep-2022 15:43:02] Completed 10 of 12 simulation runs |
| 90 | +[19-Sep-2022 15:43:04] Completed 11 of 12 simulation runs |
| 91 | +[19-Sep-2022 15:43:05] Completed 12 of 12 simulation runs |
| 92 | +[19-Sep-2022 15:43:06] Cleaning up parallel workers... |
| 93 | +Elapsed Sweep Time Total: 52.00 |
| 94 | +Elapsed Sweep Time/(Num Tests): 4.33 |
89 | 95 |
|
90 |
| -Starting parallel pool (parpool) using the 'local' profile ... |
91 |
| -Connected to the parallel pool (number of workers: 2). |
92 |
| -Parallel pool using the 'local' profile is shutting down. |
93 |
| -</pre><img vspace="5" hspace="5" src="quadcopter_package_delivery_18.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_19.png" alt=""> <h2 id="12">Parameter Sweep: Trajectory Speed</h2><p>Using parallel computing we vary the target speed of the quadcopter and see if the quadcopter can follow the target path.</p><pre class="codeoutput">Elapsed Simulation Time Single Run: 57.3198 |
94 |
| -[12-Mar-2022 16:34:24] Checking for availability of parallel pool... |
95 |
| -Starting parallel pool (parpool) using the 'local' profile ... |
96 |
| -Connected to the parallel pool (number of workers: 2). |
97 |
| -[12-Mar-2022 16:35:43] Starting Simulink on parallel workers... |
98 |
| -[12-Mar-2022 16:36:00] Loading project on parallel workers... |
99 |
| -[12-Mar-2022 16:36:00] Configuring simulation cache folder on parallel workers... |
100 |
| -[12-Mar-2022 16:36:14] Transferring base workspace variables used in the model to parallel workers... |
101 |
| -[12-Mar-2022 16:36:20] Loading model on parallel workers... |
102 |
| -[12-Mar-2022 16:36:56] Running simulations... |
103 |
| -[12-Mar-2022 16:38:58] Completed 1 of 8 simulation runs |
104 |
| -[12-Mar-2022 16:38:59] Completed 2 of 8 simulation runs |
105 |
| -[12-Mar-2022 16:39:26] Completed 3 of 8 simulation runs |
106 |
| -[12-Mar-2022 16:39:29] Completed 4 of 8 simulation runs |
107 |
| -[12-Mar-2022 16:39:52] Completed 5 of 8 simulation runs |
108 |
| -[12-Mar-2022 16:39:58] Completed 6 of 8 simulation runs |
109 |
| -[12-Mar-2022 16:40:20] Completed 7 of 8 simulation runs |
110 |
| -[12-Mar-2022 16:40:27] Completed 8 of 8 simulation runs |
111 |
| -[12-Mar-2022 16:40:28] Cleaning up parallel workers... |
112 |
| -Elapsed Sweep Time Total: 177.00 |
113 |
| -Elapsed Sweep Time/(Num Tests): 22.12 |
114 |
| -Parallel pool using the 'local' profile is shutting down. |
115 |
| -</pre><img vspace="5" hspace="5" src="quadcopter_package_delivery_20.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_21.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_22.png" alt=""> <h2 id="13">Simulation Results from Simscape Logging: Path 5, 6</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_23.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_24.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_25.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_26.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_27.png" alt=""> <p class="footer">Copyright 2022 The MathWorks, Inc.<br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB® R2022a</a><br></p></div><!-- |
| 96 | +Parallel pool using the 'Processes' profile is shutting down. |
| 97 | +</pre><img vspace="5" hspace="5" src="quadcopter_package_delivery_18.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_19.png" alt=""> <h2 id="12">Parameter Sweep: Trajectory Speed</h2><p>Using parallel computing we vary the target speed of the quadcopter and see if the quadcopter can follow the target path.</p><pre class="codeoutput">Elapsed Simulation Time Single Run: 32.953 |
| 98 | +[19-Sep-2022 15:44:06] Checking for availability of parallel pool... |
| 99 | +Starting parallel pool (parpool) using the 'Processes' profile ... |
| 100 | +Connected to the parallel pool (number of workers: 6). |
| 101 | +[19-Sep-2022 15:44:29] Starting Simulink on parallel workers... |
| 102 | +[19-Sep-2022 15:44:36] Loading project on parallel workers... |
| 103 | +[19-Sep-2022 15:44:36] Configuring simulation cache folder on parallel workers... |
| 104 | +[19-Sep-2022 15:44:41] Transferring base workspace variables used in the model to parallel workers... |
| 105 | +[19-Sep-2022 15:44:42] Loading model on parallel workers... |
| 106 | +[19-Sep-2022 15:44:59] Running simulations... |
| 107 | +[19-Sep-2022 15:45:59] Completed 1 of 8 simulation runs |
| 108 | +[19-Sep-2022 15:46:00] Completed 2 of 8 simulation runs |
| 109 | +[19-Sep-2022 15:46:01] Completed 3 of 8 simulation runs |
| 110 | +[19-Sep-2022 15:46:01] Completed 4 of 8 simulation runs |
| 111 | +[19-Sep-2022 15:46:01] Completed 5 of 8 simulation runs |
| 112 | +[19-Sep-2022 15:46:02] Completed 6 of 8 simulation runs |
| 113 | +[19-Sep-2022 15:46:12] Completed 7 of 8 simulation runs |
| 114 | +[19-Sep-2022 15:46:13] Completed 8 of 8 simulation runs |
| 115 | +[19-Sep-2022 15:46:13] Cleaning up parallel workers... |
| 116 | +Elapsed Sweep Time Total: 54.00 |
| 117 | +Elapsed Sweep Time/(Num Tests): 6.75 |
| 118 | +Parallel pool using the 'Processes' profile is shutting down. |
| 119 | +</pre><img vspace="5" hspace="5" src="quadcopter_package_delivery_20.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_21.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_22.png" alt=""> <h2 id="13">Simulation Results from Simscape Logging: Path 5, 6</h2><img vspace="5" hspace="5" src="quadcopter_package_delivery_23.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_24.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_25.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_26.png" alt=""> <img vspace="5" hspace="5" src="quadcopter_package_delivery_27.png" alt=""> <p class="footer">Copyright 2022 The MathWorks, Inc.<br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB® R2022b</a><br></p></div><!-- |
116 | 120 | ##### SOURCE BEGIN #####
|
117 | 121 | %% Quadcopter Package Delivery
|
118 | 122 | %
|
|
131 | 135 |
|
132 | 136 | open_system('quadcopter_package_delivery')
|
133 | 137 |
|
134 |
| -set_param(find_system(bdroot,'FindAll','on','type','annotation','Tag','ModelFeatures'),'Interpreter','off'); |
| 138 | +set_param(find_system(bdroot,'MatchFilter',@Simulink.match.allVariants,'FindAll','on','type','annotation','Tag','ModelFeatures'),'Interpreter','off'); |
135 | 139 |
|
136 | 140 | %%
|
137 | 141 | %
|
|
0 commit comments