Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   problem with the default code (http://www.chiefdelphi.com/forums/showthread.php?t=33485)

MarkVH 27-01-2005 07:12

problem with the default code
 
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 27-01-2005 08:51

Re: problem with the default code
 
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 27-01-2005 17:29

Re: problem with the default code
 
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 27-01-2005 17:55

Re: problem with the default code
 
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 27-01-2005 20:26

Re: problem with the default code
 
Thanks thats a relief.

Joe Ross 27-01-2005 21:19

Re: problem with the default code
 
Quote:

Originally Posted by MarkVH
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 27-01-2005 21:44

Re: problem with the default code
 
You can switch the X-axis in the default code by subtracting p1_x value from 255.

Example:
Code:

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

ConKbot of Doom 28-01-2005 00:04

Re: problem with the default code
 
Quote:

Originally Posted by MichaelGoldfarb
You can switch the X-axis in the default code by subtracting p1_x value from 255.

Example:
Code:

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.


All times are GMT -5. The time now is 02:48.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi