ESC794: Selected Topics in Engineering Science Model Predictive Control Homework 2

$30.00

Download Details:

  • Name: HW2-nhmqck.zip
  • Type: zip
  • Size: 6.32 MB

Category:

Description

Rate this product

1 Suppose a constant disturbance δ is assumed for the prediction horizon, resulting in the
single-output model
x(k + 1) = Adx(k) + Bdu(k)
y(k) = Cx(k) + Du(k) + δ
a. Obtain the pertinent prediction equations and show that the optimization cost function
becomes
J = ˆu
T
[H
T H + λI]ˆu + 2[x
T
k P
T − r
T + ∆T
]Huˆ
where ∆ is a column vector with all elements equal to δ.
b. For the nonlinear plant
x
+
1 = sin(x1)x2 + u
x
+
2 = cos(x1)x1
consider the problem of regulation to the origin under the constraint |u| ≤ 1/2 and
unit box constraints for the states. Use an MPC linearization approach with linearized
model updates at each control iteration (find Jacobians analytically). Take λ = 2,
ny = 5, and nu = 4.
Complete the provided code templates to run MPC simulations with and without disturbance compensation. Show summary plots with the predicted and closed-loop outputs,
with and without disturbance compensation. Re-tune the disturbance compensation
MPC to recover or exceed the performance of the first case. Note that some settings
may result in unfeasible OPCs at some iterations.
2 (mini-project) Consider the elevator control problem discussed in class. Your task is to
complete the provided code template to simulate closed-loop system operation with linear
predictions, as discussed in class. The objective is to move the elevator to a target position
using an optimal combination of motor power and motion performance, while maintaining
constraints on the cable tension, and car acceleration and velocity for passenger comfort.
The mathematical model in C-T can be derived as
Jty¨ +
a
2
Rm
y˙ = a
R
Rm
V − R
2
(mc − mw)g
where V is the control voltage and the parameters are as follows:
Parameter Units Value
Jt kg-m2 20
a N-m/A 12
Rm Ω 0.1
R m 1
mc kg 1000
mw kg 750
The tensions on the car and counterweight cables are given by
Tc = mc(¨y + g)
Tw = mw(g − y¨)
Assume the elevator starts at y0 = 0 and must stop at y = yf in a reasonable time. Motor
voltage must be within ±40 V and the elevator speed and acceleration must be limited by
±3 m/s and ±0.2g.
The current consumed by the motor is given by
im =
V − ay/R˙
Rm
Therefore the power P = V im is a quadratic function whose integral can be considered for
minimization over some horizon. The position control objective can be measured as an integral quadratic error, using e = y − yf .
Approach: Discretize the plant and use an incremental formulation. To eliminate gravity
bias, define
u = a
R
Rm
V − R
2
(mc − mw)g
To limit control bandwidth, we impose upper and lower bounds on ∆u of ±1000 V/s and
also include a weight on the running cost to penalize ∆u. The running cost will therefore
have the form
e
2 + λP + λu(∆u)
2
a. Using u as new control, obtain a continuous-time state-space representation where the
states are position and velocity. Discretize it with ZOH, with Ts = 0.05 s. Verify that
the discrete states have the same physical meaning as their continuous counterparts.
b. Use the incremental formulation and find the augmented matrices Ad and Bd. Write
code to find matrices Hpos, Ppos, Hvel and Pvel associated with position and velocity
predictions. Treat the extended state variable u as an output and write code to find its
corresponding prediction matrices Hu and Pu, all this for any ny, nu.
c. Show that the cost function becomes
J =
1
2

T
u S∆u + f
where
S = 2(H
T
posHpos +
λRm
a
2R2 H
T
u Hu −
λ
R2 H
T
u Hvel + λuI)
f = 2(−yˆ
T
f + x
T
a P
T
pos)Hpos +
2λRm
a
2R2
x
T
a P
T
u Hu+
2λmcwgRm
a
2 Hu −
λ
R2
x
T
a
(P
T
u Hvel + P
T
velHu) − λmcwgHvel
where xa is the augmented state feedback used in the solution of the OCP.
d. The acceleration constraints are more stringent than the cable tension constraints, so
only the former need to be considered. Find the C and D matrices for voltage V (treat
as an output which depends on the extended state u), velocity and acceleration. Use
that information to write code that builds the pertinent Hc matrix. Also find Cc based
on the desired constraints for ∆u. Build all pertinent vectors and matrices to complete
the data for the quadratic program.
c. Complete the provided code template to obtain closed-loop simulations.
d. For a 10-floor move (30 m), the elevator should not overshoot/undershoot by more than
8 cm and should make the trip in less than 12 seconds.
e. Tune the system for minimum energy consumption considering an up-down 30 m sequence of moves. Do some research on the actual power consumption of elevators. Note
that the model incurs energy consumption just to hold the elevator still. You should
not calculate energy consumption after the target floor has been reached.
f. Document all aspects of your solution to this project. You must submit running code,
with comments, as a single m-file.