0% found this document useful (0 votes)
5 views2 pages

Module Template

This document outlines the procedures for conducting pre-laboratory and laboratory simulations of an underdamped second-order system using MATLAB. It includes steps for formulating a cost function for Model Predictive Control (MPC), tuning predictive weights, and visualizing the effects of damping on a pendulum system. Additionally, it poses guide questions to facilitate understanding of the simulation outcomes and the impact of control penalties.

Uploaded by

lambo09289286903
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Module Template

This document outlines the procedures for conducting pre-laboratory and laboratory simulations of an underdamped second-order system using MATLAB. It includes steps for formulating a cost function for Model Predictive Control (MPC), tuning predictive weights, and visualizing the effects of damping on a pendulum system. Additionally, it poses guide questions to facilitate understanding of the simulation outcomes and the impact of control penalties.

Uploaded by

lambo09289286903
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Republic of the Philippines

BATANGAS STATE UNIVERSITY


The National Engineering University
Alangilan Campus
Golden Country Homes, Alangilan Batangas City, Batangas, Philippines 4200
Tel Nos.: (+63 43) 425-0139 local 2121 / 2221
E-mail Address:[Link]@[Link] | Website Address: [Link]

CHAPTER 4 - UNDERDAMPED SECOND-ORDER SYSTEM

PRE-LABORATORY SIMULATION (MATLAB OFFLINE)


Procedures:

1.​ Open the script in MATLAB and locate Part 1 to formulate the finite-horizon cost
function for the Model Predictive Control (MPC) algorithm.
2.​ Inside the student_mpc_cost function, complete the for loop to accumulate the total
optimization cost J. Formulate the equation to sum the weighted squared errors using the
provided penalty variables: pendulum angle (Qth), cart position tracking error (Qx), and
control effort (R).
3.​ Run the script to compile your cost function and launch the interactive MPC Pendulum
digital twin dashboard.
4.​ Use the sliders in the control panel to dynamically tune the predictive weights for the
Angle Penalty, Position Penalty, and Control Penalty.
5.​ Observe the real-time effects of your weight tuning across the 3D inverted pendulum
physics render, the moving reference target, and the time-domain performance plots.

Guide Questions:

1.​ Using the interactive sliders, how does significantly increasing the Control Penalty (R)
change the cart's physical ability to aggressively catch and balance the falling pendulum?
2.​ Observing the real-time tracking plots, what happens to the cart's position error (its
ability to follow the moving target) when you prioritize the Angle Penalty (Qth) over the
Position Penalty (Qx)?
Republic of the Philippines
BATANGAS STATE UNIVERSITY
The National Engineering University
Alangilan Campus
Golden Country Homes, Alangilan Batangas City, Batangas, Philippines 4200
Tel Nos.: (+63 43) 425-0139 local 2121 / 2221
E-mail Address:[Link]@[Link] | Website Address: [Link]

LABORATORY SIMULATION (MATLAB ONLINE)


Procedures:

1.​ Open the script within your MATLAB Online workspace.


2.​ Review STEP 1 to observe how the natural frequency (ω𝑛 = 4;) and underdamped ratio (
ζunder = 0.15;) are initialized to model a highly oscillating pendulum.
3.​ Navigate to STEP 2 to complete Task A and Task B. You must assign the exact
mathematical value required for critical damping to the zeta_crit variable, then correctly
construct the den_crit array and the G_critically_damped transfer function object.
4.​ Move to STEP 3 to complete Task C and Task D. Write the necessary MATLAB
commands (using step(), hold on;, and standard plotting functions) to simulate and
visualize both the underdamped and critically damped systems on the exact same figure
for 5 seconds.
5.​ Run the script. Examine the MATLAB Command Window to confirm you successfully
passed the automated grader checks in STEP 4. Then, look at Figure 1 to physically
compare how the two mathematical damping states recover to the 0-degree vertical
position.

Guide Questions:

1.​ To successfully pass the first automated check in STEP 4, what exact numerical value
must you assign to ζcrit in STEP 2, and mathematically, what physical behavior does this
specific threshold prevent the pendulum from doing?
2.​ When coding the visualization in STEP 3, if you successfully write both step() commands
but accidentally forget to type the hold on; command between them, what exact visual
error will occur in the generated Figure window?

You might also like