while it works, I think the calculation for pitch in the motor code is wrong. It says:
Code: Select all
#ifdef TRI
motor[0] = rcCommand[THROTTLE] + axisPID[PITCH]*4/3 ; //REAR
motor[1] = rcCommand[THROTTLE] - axisPID[ROLL] - axisPID[PITCH]*2/3 ; //RIGHT
motor[2] = rcCommand[THROTTLE] + axisPID[ROLL] - axisPID[PITCH]*2/3 ; //LEFT
For pitch movement, this gives equal thrust factor part for rear and combined front motors (just opposite direction to induce pitch movement).
Now this would create movement around geometrical middle of roll-axis (rear motor and projection of front motors on roll axis, to be precise).
But what we want is the rotation point to be at the center of gravity. That is at 2/3 from rear motor, not 1/2!
This means that with current code we pitch around a point that lies behind the COG, right?
If this force distribution should be based on geometry and rotation point should be the COG, then the code must read
Code: Select all
#ifdef TRI
motor[0] = rcCommand[THROTTLE] + axisPID[PITCH]*4/6 ; //REAR
motor[1] = rcCommand[THROTTLE] - axisPID[ROLL] - axisPID[PITCH]*1/6 ; //RIGHT
motor[2] = rcCommand[THROTTLE] + axisPID[ROLL] - axisPID[PITCH]*1/6 ; //LEFT
What do you think?
Hamburger