diff --git a/lib/pilotage.lua b/lib/pilotage.lua index 61a05fc..3db789e 100644 --- a/lib/pilotage.lua +++ b/lib/pilotage.lua @@ -30,6 +30,11 @@ local SIGNE_TANGAGE, SIGNE_ROULIS = -1, -1 function Pilotage.nouveau(conf, etat, materiel, Pid, journal) local p = {} local VMAX = conf.VITESSE_RSC_MAX + + local function borner(v, mini, maxi) + if v < mini then return mini elseif v > maxi then return maxi end + return v + end local gains = etat.pid or conf.PID local pidMontee = Pid.nouveau(gains.montee, -VMAX, VMAX, 20) @@ -181,11 +186,6 @@ function Pilotage.nouveau(conf, etat, materiel, Pid, journal) altPrec, vFiltre = nil, 0 end - local function borner(v, mini, maxi) - if v < mini then return mini elseif v > maxi then return maxi end - return v - end - -- applique base + trim + corrections d'assiette aux 4 helices. -- `adapter` (booleen): en quasi-stationnaire, le trim absorbe -- lentement la composante statique des corrections (CG decale par