|
Here's what I was thinking today in relation to the whole problem of maxing out too quickly on the diagonal throws-
The points outside the unit circle don’t appear to mean anything. All of the acceleration is done within the radius of the circle in any direction. When the joystick reaches the outside barrier of the circle, one of the motors is going to be going at full. The purpose of the MIN and MAX in the code is to ensure the PWMs are not fed false data. They accept input from 0-254… but the distance traveled to the corner of the joystick box is going to be longer than the distance of the throw straight up or straight back. If this were any different, the acceleration would be inconsistent. It seems to me that this unit circle idea must be central to any code written dealing with the acceleration of the motors. Basically the PWM has accelerated to its full speed after it travels a distance of 127. This happens at (x,y) = (sqrt(2)/2, sqrt(2)/2), (on 45 degree angles off the 127-axis) because the joystick is traveling in the diagonal motion... it has gone the equivalent of the distance between (127, 127) (127, 254) before it reaches the upper-right-hand corner (254, 254). The same goes for any of the extremes.
|