70/* TODO make this saturation continuous using a hyperbolic tan function*/
71for (i = 0; i < 4; i++){
72if(f[i] < 0.0){
73 TRACE(5, ("Got a negative force, f[%i]=%f, rounding to zero.\nThis should not generally happen - your controller might be too agressively tuned.\n", i, f[i]));
74 f[i] = 0.0;
75 }
76 }
77
78/* Precomputation of parameters*/
79 adtb = a/(2.0*b);
80
81/* Compute the duty cycles */
82for (i = 0; i < 4; i++ ) dutyCycles->pData[i] = - adtb + sqrt(adtb*adtb + f[i]/b);