@@ -87,7 +87,7 @@ The vectors `σQ` and σR `σR` are the standard deviations of the process and s
87
87
respectively. The value for the velocity `` ω `` is higher here (` σQ ` second value) since
88
88
`` \dot{ω}(t) `` equation includes an uncertain parameter: the friction coefficient `` K `` .
89
89
Also, 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
91
91
estimator tuning is tested on a plant with a 25 % larger friction coefficient `` K `` :
92
92
93
93
``` @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
108
108
a [ ` NonLinMPC ` ] ( @ref ) :
109
109
110
110
``` @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 )
112
112
nmpc = setconstraint!(nmpc, umin=[-1.5], umax=[+1.5])
113
113
```
114
114
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):
117
117
118
118
``` @example 1
119
119
using Logging; disable_logging(Warn) # hide
@@ -185,7 +185,7 @@ function JE(UE, ŶE, _ )
185
185
τ, ω = UE[1:end-1], ŶE[2:2:end-1]
186
186
return Ts*sum(τ.*ω)
187
187
end
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)
189
189
empc = setconstraint!(empc, umin=[-1.5], umax=[+1.5])
190
190
```
191
191
@@ -250,7 +250,7 @@ A [`SteadyKalmanFilter`](@ref) and a [`LinMPC`](@ref) are designed from `linmode
250
250
251
251
``` @example 1
252
252
kf = 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 )
254
254
mpc = setconstraint!(mpc, umin=[-1.5], umax=[+1.5])
255
255
```
256
256
@@ -288,7 +288,7 @@ Constructing a [`LinMPC`](@ref) with `DAQP`:
288
288
``` @example 1
289
289
using JuMP, DAQP
290
290
daqp = 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)
292
292
mpc2 = setconstraint!(mpc2, umin=[-1.5], umax=[+1.5])
293
293
```
294
294
0 commit comments