trovato..
tu hai usato questi valori:
#define Postsx 5 // out rear servo sx endpoint if inverted with postdx it reverse
#define Postdx 175 //-- out rear servo dx endpoint if inverted with postsx it reverse
#define Max_gain 100 //-- gain steering reduction by throttle if reverse add -
e nel calcolo fai questo:
Gain = map(Gaspulse, Neutral, Maxspeed, 0, Max_gain); // al max speed gain vale 100
quando gain e' 100 succede che questo calcolo :
NewPos = map(Rxpulse, Antsx, Antdx, (Postsx + Gain), (Postdx - Gain));
diventa:
NewPos = map(Rxpulse, Antsx, Antdx, (5+100), (175 - 100));
NewPos = map(Rxpulse, Antsx, Antdx, (105), (75));
se Gain vale 50 diventa:
NewPos = map(Rxpulse, Antsx, Antdx, (5+50), (175 - 50));
NewPos = map(Rxpulse, Antsx, Antdx, (55), (125));
inverti il senso???
Prova con questo:
NewPos = map(Rxpulse, Antsx, Antdx, (Postsx + Gain\2), (Postdx - Gain\2));
Il massimo gain deve essere
(Postsx - Postdx) \ 2 circa...
Sms
|