Skip to content

Commit 853ce1e

Browse files
committed
small doc corrections in manual for NonLinMPC
1 parent e0b3c1a commit 853ce1e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ModelPredictiveControl"
22
uuid = "61f9bdb8-6ae4-484a-811f-bbf86720c31c"
33
authors = ["Francis Gagnon"]
4-
version = "0.5.3"
4+
version = "0.5.4"
55

66
[deps]
77
ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e"

docs/src/manual.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ The plant model is nonlinear:
155155
```math
156156
\begin{aligned}
157157
\dot{θ}(t) &= ω(t) \\
158-
\dot{ω}(t) &= -\frac{g}{L}\sin\big( θ(t) \big) - \frac{k}{m} ω(t) + \frac{m}{L^2}τ(t)
158+
\dot{ω}(t) &= -\frac{g}{L}\sin\big( θ(t) \big) - \frac{k}{m} ω(t) + \frac{1}{m L^2} τ(t)
159159
\end{aligned}
160160
```
161161

@@ -197,9 +197,9 @@ An [`UnscentedKalmanFilter`](@ref) estimates the plant state :
197197
estim = UnscentedKalmanFilter(model, σQ=[0.5, 2.5], σQ_int=[0.5])
198198
```
199199

200-
The standard deviation of the angular velocity ``ω`` is higher here (second value of `σQ`)
201-
since ``\dot{ω}(t)`` equation includes the friction coefficient ``k``, an uncertain
202-
parameter. The estimator tuning is tested on a simulated plant with a different ``k`` value:
200+
The standard deviation of the angular velocity ``ω`` is higher here (`σQ` second value)
201+
since ``\dot{ω}(t)`` equation includes an uncertain parameter: the friction coefficient
202+
``k``. The estimator tuning is tested on a plant simulated with a different ``k``:
203203

204204
```@example 2
205205
par_plant = (par[1], par[2], par[3] + 0.25, par[4])
@@ -209,20 +209,20 @@ res = sim!(estim, 30, [0.5], plant=plant, y_noise=[0.5]) # τ = 0.5 N m
209209
p2 = plot(res, plotu=false, plotx=true, plotx̂=true)
210210
```
211211

212-
The Kalman filter performance seems sufficient for control applications. As the motor torque
213-
is limited to -1.5 to 1.5 N m, we incorporate the manipulated input constraints in a
214-
[`NonLinMPC`](@ref):
212+
The Kalman filter performance seems sufficient for control. As the motor torque is limited
213+
to -1.5 to 1.5 N m, we incorporate the input constraints in a [`NonLinMPC`](@ref):
215214

216215
```@example 2
217216
mpc = NonLinMPC(estim, Hp=20, Hc=2, Mwt=[0.1], Nwt=[1.0], Cwt=Inf)
218217
mpc = setconstraint!(mpc, umin=[-1.5], umax=[+1.5])
219218
```
220219

221-
We test `mpc` performance on `plant` by imposing an angular setpoint of 180° (inverted position):
220+
We test `mpc` performance on `plant` by imposing an angular setpoint of 180° (inverted
221+
position):
222222

223223
```@example 2
224224
res = sim!(mpc, 30, [180.0], x̂0=zeros(mpc.estim.nx̂), plant=plant, x0=zeros(plant.nx))
225225
plot(res, plotŷ=true)
226226
```
227227

228-
The controller here seems robust enough to variations on ``k`` coefficients.
228+
The controller seems robust enough to variations on ``k`` coefficient.

0 commit comments

Comments
 (0)