@@ -87,7 +87,7 @@ The vectors `σQ` and σR `σR` are the standard deviations of the process and s
8787respectively. The value for the velocity `` ω `` is higher here (` σQ ` second value) since
8888`` \dot{ω}(t) `` equation includes an uncertain parameter: the friction coefficient `` K `` .
8989Also, the argument ` nint_u ` explicitly adds one integrating state at the model input, the
90- motor torque `` τ `` , with an associated standard deviation ` σQint_u ` of 0.1 N m. The
90+ motor torque `` τ `` , with an associated standard deviation ` σQint_u ` of 0.1 N m. The
9191estimator tuning is tested on a plant with a 25 % larger friction coefficient `` K `` :
9292
9393``` @example 1
@@ -108,12 +108,12 @@ As the motor torque is limited to -1.5 to 1.5 N m, we incorporate the input cons
108108a [ ` NonLinMPC ` ] ( @ref ) :
109109
110110``` @example 1
111- nmpc = NonLinMPC(estim, Hp=20, Hc=2, Mwt=[0.5], Nwt=[2.5])
111+ nmpc = NonLinMPC(estim, Hp=20, Hc=2, Mwt=[0.5], Nwt=[2.5], Cwt=Inf )
112112nmpc = setconstraint!(nmpc, umin=[-1.5], umax=[+1.5])
113113```
114114
115- We test ` mpc ` performance on ` plant ` by imposing an angular setpoint of 180° (inverted
116- position):
115+ The option ` Cwt=Inf ` disables constraint softening. We test ` mpc ` performance on ` plant ` by
116+ imposing an angular setpoint of 180° (inverted position):
117117
118118``` @example 1
119119using Logging; disable_logging(Warn) # hide
@@ -185,7 +185,7 @@ function JE(UE, ŶE, _ )
185185 τ, ω = UE[1:end-1], ŶE[2:2:end-1]
186186 return Ts*sum(τ.*ω)
187187end
188- empc = NonLinMPC(estim2, Hp=20, Hc=2, Mwt=[0.5, 0], Nwt=[2.5], Ewt=3.5e3, JE=JE)
188+ empc = NonLinMPC(estim2, Hp=20, Hc=2, Mwt=[0.5, 0], Nwt=[2.5], Cwt=Inf, Ewt=3.5e3, JE=JE)
189189empc = setconstraint!(empc, umin=[-1.5], umax=[+1.5])
190190```
191191
@@ -250,7 +250,7 @@ A [`SteadyKalmanFilter`](@ref) and a [`LinMPC`](@ref) are designed from `linmode
250250
251251``` @example 1
252252kf = SteadyKalmanFilter(linmodel; σQ, σR, nint_u, σQint_u)
253- mpc = LinMPC(kf, Hp=20, Hc=2, Mwt=[0.5], Nwt=[2.5])
253+ mpc = LinMPC(kf, Hp=20, Hc=2, Mwt=[0.5], Nwt=[2.5], Cwt=Inf )
254254mpc = setconstraint!(mpc, umin=[-1.5], umax=[+1.5])
255255```
256256
@@ -288,7 +288,7 @@ Constructing a [`LinMPC`](@ref) with `DAQP`:
288288``` @example 1
289289using JuMP, DAQP
290290daqp = Model(DAQP.Optimizer, add_bridges=false)
291- mpc2 = LinMPC(kf, Hp=20, Hc=2, Mwt=[0.5], Nwt=[2.5], optim=daqp)
291+ mpc2 = LinMPC(kf, Hp=20, Hc=2, Mwt=[0.5], Nwt=[2.5], Cwt=Inf, optim=daqp)
292292mpc2 = setconstraint!(mpc2, umin=[-1.5], umax=[+1.5])
293293```
294294
0 commit comments