Maybe someone out there can help out our all-rookie team.
We’re using the 2.4 code on our robot, unmodified. joystick is plugged into port 1 on the OI. We got the robot to move, but when we push the joystick forward, it goes left. when we push it right, it goes forward, when we push it down it goes right and left=reverse. What did we do wrong? did anyone else have this problem? I’d assume something is wrong with our X and Y values, but I searched and couldn’t find anything about this.
help appreciated, thanks.
On the dashboard, the values for the joysticks are outputting to PWM ports 1,5,11 and 12…looking at the code we thought that it should be outputting to 13-16. That’s puzzling us also.
From your description, is seems your PWM cables are reversed (ie, what you have connected to the victors controlling the right motors should be connected to the left motors and vice versa) AND your right motors are reverse wired (reverse the red and black leads at the output of the Victors connected to your right side motors. Don’t forget to do this to both or your right motors, if using the kit gearbox!). That should solve your problem. If it doesn’t, ask again.
Thanks, we’ll try that, though we’re still a little confused why the code is outputting the joystick values to PWM 1,5,11, and 12. Is that what it’s doing for everyone? When looking at the code it seemed like the motors should be plugged into 13-16. Needless to say, we’re very new at this.
We have found that it’s not a good idea to use PWMs 13-16, because if you’re using (timer) interrupts elsewhere in your code, those outputs can get a bit unpredictable. Anyway, what PWMs are your Victors connected to? And what code are you using (where you downloaded it from? IFI or www.kevin.org?)? A link would help.
I had written a whole big statement telling you about our problem, but as i was just about to send it, my programmer figured it out and got it working. thank you so much for your time.
The joystick values are copied to the low pwm outputs by the default code. Those are appropriate for dual-joystick “tank” control. For single-joystick control, the comments in default code version 2.4 do say to use pwm13-pwm16, but the actual code controls pwm11 and pwm12. (I assume the change was made because pwm13-pwm16 get a bit twitchy when there are a lot of interrupts going on.)
Great, just make sure he didn’t “fix it on programming”, because if anything goes wrong with your Victors or motors and you need to replace them, you’ll have to install them again exactly as they were, and, in the heat of the competition, it’ll be really really hard to, literally, make two wrongs a right.