PDA

View Full Version : problem with the default code


MarkVH
01-27-2005, 06:12 AM
I ran into a problem with the default code from IFI. The drive pwm out puts are the same for each side when the joystick is moved only in the Y-axis where that should be the case for the X-axis.

Alan Anderson
01-27-2005, 07:51 AM
X axis is left and right. Y axis is front and back. When you move the joystick along the Y axis, you want the robot to move straight forward or backward. That requires controlling the motors on both sides identically.

The default code is doing what it is designed to do, and it is correct.

MarkVH
01-27-2005, 04:29 PM
yes that I realize. Right now I have one side wired backward so it will go straight. I know that is not FIRST legal.

CyberWolf_22
01-27-2005, 04:55 PM
What do you mean wired backward. If you mean the M+ to the black wire coming off the motor and the red to the M- this is completely legal we have done it in first many times before.

MarkVH
01-27-2005, 07:26 PM
Thanks thats a relief.

Joe Ross
01-27-2005, 08:19 PM
yes that I realize. Right now I have one side wired backward so it will go straight. I know that is not FIRST legal.

Rule <R72> specifies the colors only for constant polarity circuits, which the output of the victor is not. When you are going forward there is 12v on the M+ and ground on the M-. When you are going backwards, there is ground on the M+ and 12v on the M-.

MichaelGoldfarb
01-27-2005, 08:44 PM
You can switch the X-axis in the default code by subtracting p1_x value from 255.

Example:
Limit_Mix(2000 + p1_y + (255 - p1_x) - 127);

ConKbot of Doom
01-27-2005, 11:04 PM
You can switch the X-axis in the default code by subtracting p1_x value from 255.

Example:
Limit_Mix(2000 + p1_y + (255 - p1_x) - 127);
You would need to invert the whole thing if the robot is driving correctly and you have the motors "backwards" not just invert the x-axis.

But I say leave the wires "backwards" and let the processor have a few extra cycles for other things. Heck, the victors aren't labeled this year, so just put your own lables on them, and have the N+ and M- switched on those to prevent confusion.