-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
390 changed files
with
606,202 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
%% This script initializes the lab | ||
% This file automatically runs when you open the project | ||
|
||
%% Show the info script | ||
open("Info.html") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
|
||
<!DOCTYPE html | ||
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | ||
<html><head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<!-- | ||
This HTML was auto-generated from MATLAB code. | ||
To make changes, update the MATLAB code and republish this document. | ||
--><title>Virtual Mechanism Guide</title><meta name="generator" content="MATLAB 9.10"><link rel="schema.DC" href="http://purl.org/dc/elements/1.1/"><meta name="DC.date" content="2021-09-03"><meta name="DC.source" content="MechGuide.m"><style type="text/css"> | ||
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} | ||
|
||
html { min-height:100%; margin-bottom:1px; } | ||
html body { height:100%; margin:0px; font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#000; line-height:140%; background:#fff none; overflow-y:scroll; } | ||
html body td { vertical-align:top; text-align:left; } | ||
|
||
h1 { padding:0px; margin:0px 0px 25px; font-family:Arial, Helvetica, sans-serif; font-size:1.5em; color:#d55000; line-height:100%; font-weight:normal; } | ||
h2 { padding:0px; margin:0px 0px 8px; font-family:Arial, Helvetica, sans-serif; font-size:1.2em; color:#000; font-weight:bold; line-height:140%; border-bottom:1px solid #d6d4d4; display:block; } | ||
h3 { padding:0px; margin:0px 0px 5px; font-family:Arial, Helvetica, sans-serif; font-size:1.1em; color:#000; font-weight:bold; line-height:140%; } | ||
|
||
a { color:#005fce; text-decoration:none; } | ||
a:hover { color:#005fce; text-decoration:underline; } | ||
a:visited { color:#004aa0; text-decoration:none; } | ||
|
||
p { padding:0px; margin:0px 0px 20px; } | ||
img { padding:0px; margin:0px 0px 20px; border:none; } | ||
p img, pre img, tt img, li img, h1 img, h2 img { margin-bottom:0px; } | ||
|
||
ul { padding:0px; margin:0px 0px 20px 23px; list-style:square; } | ||
ul li { padding:0px; margin:0px 0px 7px 0px; } | ||
ul li ul { padding:5px 0px 0px; margin:0px 0px 7px 23px; } | ||
ul li ol li { list-style:decimal; } | ||
ol { padding:0px; margin:0px 0px 20px 0px; list-style:decimal; } | ||
ol li { padding:0px; margin:0px 0px 7px 23px; list-style-type:decimal; } | ||
ol li ol { padding:5px 0px 0px; margin:0px 0px 7px 0px; } | ||
ol li ol li { list-style-type:lower-alpha; } | ||
ol li ul { padding-top:7px; } | ||
ol li ul li { list-style:square; } | ||
|
||
.content { font-size:1.2em; line-height:140%; padding: 20px; } | ||
|
||
pre, code { font-size:12px; } | ||
tt { font-size: 1.2em; } | ||
pre { margin:0px 0px 20px; } | ||
pre.codeinput { padding:10px; border:1px solid #d3d3d3; background:#f7f7f7; } | ||
pre.codeoutput { padding:10px 11px; margin:0px 0px 20px; color:#4c4c4c; } | ||
pre.error { color:red; } | ||
|
||
@media print { pre.codeinput, pre.codeoutput { word-wrap:break-word; width:100%; } } | ||
|
||
span.keyword { color:#0000FF } | ||
span.comment { color:#228B22 } | ||
span.string { color:#A020F0 } | ||
span.untermstring { color:#B20000 } | ||
span.syscmd { color:#B28C00 } | ||
span.typesection { color:#A0522D } | ||
|
||
.footer { width:auto; padding:10px 0px; margin:25px 0px 0px; border-top:1px dotted #878787; font-size:0.8em; line-height:140%; font-style:italic; color:#878787; text-align:left; float:none; } | ||
.footer p { margin:0px; } | ||
.footer a { color:#878787; } | ||
.footer a:hover { color:#878787; text-decoration:underline; } | ||
.footer a:visited { color:#878787; } | ||
|
||
table th { padding:7px 5px; text-align:left; vertical-align:middle; border: 1px solid #d6d4d4; font-weight:bold; } | ||
table td { padding:7px 5px; text-align:left; vertical-align:top; border:1px solid #d6d4d4; } | ||
|
||
|
||
|
||
|
||
|
||
</style></head><body><div class="content"><h1>Virtual Mechanism Guide</h1><p> | ||
<span style="font-family:Arial"> | ||
<span style="font-size:12pt"> | ||
<p> | ||
<a href="Info.html">🡄 Back to Virtual Controls Laboratory</a> | ||
</p> | ||
<h2> Getting started </h2> | ||
To get started with a virtual mechanism, perform the following. | ||
<ol style="margin-top:5px; margin-bottom:10px"> | ||
<li>Open a virtual model from the <a href="Info.html">Virtual Controls | ||
Laboratory</a> landing page (e.g., <a href="matlab:RotaryPendulum;">RotaryPendulum.slx</a>).</li> | ||
<li>▶ Run the Simulink model.</li> | ||
<li>Place the Mechanics Explorer window next to the Simulink window. </li> | ||
<li>Hide the Tree View Pane by clicking the small black arrow ◂.</li> | ||
<li>Select a Mechanics Explorer visualization pane and zoom in or out using the mouse scroll wheel.</li> | ||
<li>Change the controller setpoint using the reference dial to elicit a step response.</li> | ||
<li>View the response characteristics in the dashboard scope.</li> | ||
<li>Adjust the controller parameters and continue interacting.</li> | ||
<li>When you are finished, stop the model ■.</li> | ||
</ol> | ||
    <img src="../Images/MechanismGuide.png" style="width:90%;max-width:1600px;margin-bottom:0px;" alt="Illustration of steps 3-9"> | ||
<br> | ||
        <i> Illustration of steps 3-9 </i> | ||
<br> | ||
<br> | ||
<h2> Model structure </h2> | ||
Each model has three main components: | ||
<ol style="margin-top:5px; margin-bottom:0px"> | ||
<li>An interaction layer at the top level of the model. This includes | ||
dashboard blocks to interact with the controller and scopes to view | ||
essential signals. | ||
</li> | ||
<li> The Simulink model. This is also included in the top level of the | ||
model, just below the dashboards. The Simulink model implements | ||
the controller. The plant is also present in the Simulink model as a | ||
masked subsystem. | ||
</li> | ||
<li> The virtual mechanism. The mechanism is implemented using Simscape | ||
Multibody. You can double-click the mask of the virtual mechanism to | ||
adjust the physical parameters, such as the pendulum length. | ||
</li> | ||
</ol> | ||
These components are illustrated in the diagram below. | ||
    <img src="../Images/modelHierarchy.svg" style="width:100%;" alt="Model hierarchy diagram"> | ||
<br> | ||
</style> | ||
</style> | ||
</p><p>Copyright 2021 The MathWorks™, Inc.</p><p class="footer"><br><a href="https://www.mathworks.com/products/matlab/">Published with MATLAB® R2021a</a><br></p></div><!-- | ||
##### SOURCE BEGIN ##### | ||
%% Virtual Mechanism Guide | ||
% | ||
% <html> | ||
% <span style="font-family:Arial"> | ||
% <span style="font-size:12pt"> | ||
% <p> | ||
% <a href="Info.html">🡄 Back to Virtual Controls Laboratory</a> | ||
% </p> | ||
% <h2> Getting started </h2> | ||
% To get started with a virtual mechanism, perform the following. | ||
% <ol style="margin-top:5px; margin-bottom:10px"> | ||
% <li>Open a virtual model from the <a href="Info.html">Virtual Controls | ||
% Laboratory</a> landing page (e.g., <a href="matlab:RotaryPendulum;">RotaryPendulum.slx</a>).</li> | ||
% <li>▶ Run the Simulink model.</li> | ||
% <li>Place the Mechanics Explorer window next to the Simulink window. </li> | ||
% <li>Hide the Tree View Pane by clicking the small black arrow ◂.</li> | ||
% <li>Select a Mechanics Explorer visualization pane and zoom in or out using the mouse scroll wheel.</li> | ||
% <li>Change the controller setpoint using the reference dial to elicit a step response.</li> | ||
% <li>View the response characteristics in the dashboard scope.</li> | ||
% <li>Adjust the controller parameters and continue interacting.</li> | ||
% <li>When you are finished, stop the model ■.</li> | ||
% </ol> | ||
%     <img src="../Images/MechanismGuide.png" style="width:90%;max-width:1600px;margin-bottom:0px;" alt="Illustration of steps 3-9"> | ||
% <br> | ||
%         <i> Illustration of steps 3-9 </i> | ||
% <br> | ||
% <br> | ||
% <h2> Model structure </h2> | ||
% Each model has three main components: | ||
% <ol style="margin-top:5px; margin-bottom:0px"> | ||
% <li>An interaction layer at the top level of the model. This includes | ||
% dashboard blocks to interact with the controller and scopes to view | ||
% essential signals. | ||
% </li> | ||
% <li> The Simulink model. This is also included in the top level of the | ||
% model, just below the dashboards. The Simulink model implements | ||
% the controller. The plant is also present in the Simulink model as a | ||
% masked subsystem. | ||
% </li> | ||
% <li> The virtual mechanism. The mechanism is implemented using Simscape | ||
% Multibody. You can double-click the mask of the virtual mechanism to | ||
% adjust the physical parameters, such as the pendulum length. | ||
% </li> | ||
% </ol> | ||
% These components are illustrated in the diagram below. | ||
%     <img src="../Images/modelHierarchy.svg" style="width:100%;" alt="Model hierarchy diagram"> | ||
% <br> | ||
% </style> | ||
% </style> | ||
% </html> | ||
% | ||
% Copyright 2021 The MathWorks(TM), Inc. | ||
##### SOURCE END ##### | ||
--></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Copyright (c) 2021, The MathWorks, Inc. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
3. In all cases, the software is, and all modifications and derivatives of the software shall be, licensed to you solely for use in conjunction with MathWorks products and service offerings. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,110 @@ | ||
# Virtual-Controls-Laboratory | ||
Virtual labs and mechanisms for studying controls. | ||
# Virtual Controls Laboratory [](https://www.mathworks.com/matlabcentral/fileexchange/) | ||
**Curriculum Module** | ||
_Created with R2021a. Compatible with R2021a and later releases._ | ||
|
||
## Description ## | ||
The Virtual Controls Laboratory contains virtual models of several mechanisms commonly used in controls courses. These virtual mechanisms offer opportunities to visually analyze dynamic systems, identify system parameters, design and test controllers, among others. Instructions for four introductory labs are included. These labs are designed to give an intuitive introduction to basic controls concepts, such as feedback control. Students also have the opportunity to implement and test simple controllers in Simulink®. | ||
|
||
Get started with the Virtual Controls Laboratory by downloading and unzipping the repository. Then, double-click the project .prj file inside MATLAB®. From there, you can follow the landing page instructions to get started with the labs and virtual mechanisms. | ||
|
||
## Details ## | ||
|
||
### Virtual Mechanisms ### | ||
<table> | ||
<tr> | ||
<td width=290> | ||
<b>Cruise control</b> | ||
<br><code>CruiseControl.slx</code> | ||
<img src = "./SupportingFiles/gifs/vehiclecover.png" alt="Vehicle animation" width=250> | ||
</td> | ||
<td width=290> | ||
<b>DC motor</b> | ||
<br><code>DCMotorControl.slx</code> | ||
<img src = "./SupportingFiles/gifs/dcmotor.gif" alt="DC motor animation" width=250> | ||
</td> | ||
<td width=290> | ||
<b>Inverted pendulum</b> | ||
<br><code>InvertedPendulum.slx</code> | ||
<img src = "./SupportingFiles/gifs/invertedpendulum.gif" alt="Inverted pendulum animation" width=250> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td width=290> | ||
<b>Rotary pendulum</b> | ||
<br><code>RotaryPendulum.slx</code> | ||
<img src = "./SupportingFiles/gifs/rotarypendulum.gif" alt="Rotary pendulum animation" width=250> | ||
</td> | ||
<td width=290> | ||
<b>Ball and beam</b> | ||
<br><code>BallAndBeam.slx</code> | ||
<img src = "./SupportingFiles/gifs/ballbeam.gif" alt="Ball and beam animation" width=250> | ||
</td> | ||
<td width=290> | ||
<b>Ball and plate</b> | ||
<br><code>BallAndPlate.slx</code> | ||
<img src = "./SupportingFiles/gifs/ballplate.gif" alt="Ball and plate animation" width=250> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
|
||
### Labs ### | ||
**Lab 1: Cruise control `(Lab1_CruiseControl.mlx)`** | ||
A virtual lab that explores the basics of open-loop and feedback control. | ||
|
||
**Learning Goals:** | ||
- Compare and contrast open-loop and feedback control. | ||
- Implement a simple open-loop controller in Simulink. | ||
- Analyze the performance of an open-loop controller. | ||
- Implement a proportional controller in Simulink. | ||
- Analyze the performance of a proportional controller. | ||
|
||
## ## | ||
**Lab 2: Vehicle Transfer Function Model `(Lab2_VehicleModel.mlx)`** | ||
In this lab, students derive a transfer function model of a virtual vehicle. | ||
|
||
**Learning Goals:** | ||
- Derive the transfer function of a first order system. | ||
- Compare the transfer function and virtual vehicle responses. | ||
- Identify the model parameters for the virtual vehicle. | ||
|
||
## ## | ||
**Lab 3: Position Control `(Lab3_PositionControl.mlx)`** | ||
In this lab, students implement a PID controller to control the position of a virtual DC motor. | ||
|
||
**Learning Goals:** | ||
- Implement a PID controller. | ||
- Identify rise time, settling time, overshoot, and peak time. | ||
- Explain how changes to PID parameters affect the time-domain response. | ||
|
||
## ## | ||
**Lab 4: Position Control Analysis `(Lab4_PositionAnalysis.mlx)`** | ||
In this lab, students construct and analyze the closed-loop transfer function of a feedback controller. | ||
|
||
**Learning Goals:** | ||
- Construct a closed-loop transfer function. | ||
- Plot the step response of a closed-loop transfer function. | ||
- Identify the poles of a closed-loop transfer function. | ||
- Assess the stability of a closed-loop transfer function. | ||
|
||
## Suggested Prework ## | ||
[MATLAB Onramp](https://www.mathworks.com/learn/tutorials/matlab-onramp.html) – a free two-hour introductory tutorial that teaches the essentials of MATLAB. | ||
<br> | ||
[Simulink Onramp](https://www.mathworks.com/learn/tutorials/simulink-onramp.html) – a free three-hour introductory tutorial that teaches the essentials of Simulink. | ||
|
||
## Products ## | ||
MATLAB, Simulink, Control System Toolbox™, Simscape™, Simscape Multibody™, Simscape Driveline™ | ||
|
||
## License ## | ||
The license for this module is available in the [LICENSE.TXT](license.txt) file in this GitHub repository. | ||
|
||
## Educator Resources ## | ||
* [Featured Courseware](https://www.mathworks.com/academia/courseware/course-materials.html) | ||
* [Teach with MATLAB and Simulink](https://www.mathworks.com/academia/educators.html) | ||
* [MATLAB Grader](https://www.mathworks.com/products/matlab-grader.html) | ||
|
||
The lab solutions are available upon instructor request. If you would like to request solutions or have a question, contact the <a href="mailto:[email protected]">MathWorks online teaching team.</a> | ||
|
||
# # | ||
|
||
_Copyright 2021 The MathWorks, Inc._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Reporting Security Vulnerabilities | ||
|
||
If you believe you have discovered a security vulnerability, please report it to | ||
[[email protected]](mailto:[email protected]). Please see | ||
[MathWorks Vulnerability Disclosure Policy for Security Researchers](https://www.mathworks.com/company/aboutus/policies_statements/vulnerability-disclosure-policy.html) | ||
for additional information. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Oops, something went wrong.