Skip to content

Commit 4941079

Browse files
committed
A little bit more robust
1 parent 3571f74 commit 4941079

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/autotune.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function autotune(controller::WinchControllerState)
124124
x, info = bobyqa(simulate_sc, x0;
125125
xl = 0.75 .* x0,
126126
xu = 1.5 .* x0,
127-
rhobeg = minimum(x0)/4,
127+
rhobeg = maximum([1e-4, minimum(x0)/4]),
128128
npt=10,
129129
maxfun = 500
130130
)
@@ -142,11 +142,11 @@ function autotune(controller::WinchControllerState)
142142
elseif controller == wcsUpperForceLimit
143143
println("Autotuning upper force control...")
144144
# Define the parameters for the autotuning
145-
x0 = [wcs.pf_high, wcs.if_high] # initial guess for the speed controller gain
145+
x0 = [maximum([2e-5, wcs.pf_high]), wcs.if_high] # initial guess for the speed controller gain
146146
x, info = bobyqa(simulate_lfc, x0;
147147
xl = 0.25 .* x0,
148148
xu = 2.0 .* x0,
149-
rhobeg = minimum(x0)/4,
149+
rhobeg = maximum([2e-5, minimum(x0)/4]),
150150
maxfun = 500
151151
)
152152
else

0 commit comments

Comments
 (0)