Strange Auto Problem

Hey all,
Whenever activate autonomous mode, the robot’s left side motors spin, and no matter what I try, nothing seems to stop them. Also, it appears that that is the only side that I can drive in auto mode, because whenever I try to drive the other side (by itself), it doesn’t move. We’ve checked the electrical system, and it is all hooked up correctly, so do you have any suggestions? Any help would be appreciated.

-Nick

Are you using PWM13-16? Those outputs have some idiosyncracies, so I try to avoid them altogether. Without being able to see your code, I would guess that either you deleted the call to Generate_Pwms(), or there’s something else that is affecting those PWMs (lengthy interrupt handlers, perhaps).

If you post your auto code and the code where you map your joysticks to pwms one of us can probably find the problem, without them is may be a shot in the dark.

jgannon: So, I moved the pwm cables from 13-16 and placed them on 3-6 (just to choose a set of numbers), and the problem was the same. I hadn’t deleted the Generate_Pwms line, and I’m not using interrupts. Also, the motors have a bizzare behavior. No matter what pwm I plug the speed controllers into, the left side motors spin. I have tried everything I can think of to get them to stop, but they WON’T. I am at my wit’s end.

JamesBrown: The code I am using is the code provided on the Innovations FIRST website. I haven’t changed anything except what pwm’s to output to, and as I said above, even if I run the default code with pwm11 and 12 or whatever, the motors still spin, and I am back at square one.

Ok try this plug the motors into pwms 1 and 2 left into 1 and right into 2.
Add this to define t

static unsigned int t;
then paste this into user routines fast where is says add your autonomous code here,
t++;

if (t < 5)
{
pwm01 = 127;
pwm02 = 127;
pwm03 = 127;
pwm04 = 127;
}

else if (t < 179)
{
pwm01 = 254;
pwm02 = 0;
pwm03 = 254;
pwm04 = 0;
}
else if (t < 353)
{
pwm01 = 0;
pwm02 = 254;
pwm03 = 0;
pwm04 = 254;
}
else
{
pwm01 = 127;
pwm02 = 127;
pwm03 = 127;
pwm04 = 127;
}

then run the bot in autonomous. It should move forward and then backwards, If this works than try using joysticks in ports 1 and 2 to control the two sides of the drive, assign them to PWMs like this,

pwm01 = (p1_y/2)+64;
pwm02 = ((254-p2_y)/2)+64;

port 1 should drive left side and port two should drive the right.

If this all works then there shouldnt be a problem if it doesnt you have a few choices, first choice redownload the default code version 2.4 and try again, Upload your code for some one on here to look at, Your problem could be a misplaced / of a missing value. Or your thid choice double check your wiring and make sure your victors are set up properly.

James

We at WATSON are proud to say our Auto mode works now, well at least better then it did when NotQuiteFree, our programmer, posted this. The reason the left side was moving was the pwm neutral count was off by 12 (it didn’t stop unless one side was 139 and the other 115.) I am not sure why it was doing that but, the problem was solved and we had a good showing at our Scrimmage today. Thanks to all who helped

Nate Edwards

It sounds to me like your Victors are miscalibrated. I would suggest reading the Victor user guide, and using the recalibration method suggested therein.