View Single Post
  #26   Spotlight this post!  
Unread 21-01-2014, 21:59
John's Avatar
John John is offline
Registered User
AKA: John Gillespie
FRC #1153 (Roborebels)
Team Role: Mechanical
 
Join Date: Sep 2011
Rookie Year: 2009
Location: Walpole MA
Posts: 71
John is just really niceJohn is just really niceJohn is just really niceJohn is just really niceJohn is just really nice
Re: We Need Serious Robot Help!

Quote:
Originally Posted by AGPapa View Post
This is almost certainly the problem.

You only need to have one drive system, the default arcade drive code works fine for your application and did not need to be changed.

I've attached a photo if you don't want to download Chris's code.
The code is the a problem. You are commanding the same motor to go forward and reverse at once, making it not move.

This is actually not a direct result of using two drive systems (they cannot fight each other, drive one only uses PWM 1 and drive two PWM 2). The problem is because you have configured the left and right motors on each drive to feed to the same PWM, and then inverted one of them.

So your code works like this (when you go forward).
-->Get joystick value (1)
-->Set leftmotor to inverted joystick value (-1)
-->Set rightmotor to noninverted joystick value (1)
-->Left motor is PWM 1, set PWM 1 to value of -1
-->Right motor is PWM 1, set PWM 1 to value of 1

Nothing ever happens because you make the motors go full forward and full backward as fast as the code can execute.

Use Chris's code, but modify it for 4 talons (or use y-cables)

Last edited by John : 21-01-2014 at 22:07. Reason: I should not have presumed that this is the only problem.
Reply With Quote