View Single Post
  #3   Spotlight this post!  
Unread 22-01-2013, 13:56
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,572
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: 4 CIMs causing robot lockup

When you say you unplugged the CIM, did you unplug the CIM from the motor controller, or unplug the motor controllers PWM cable?

I don't see anything obviously wrong with your drive code, so I agree with Ether that it is likely an electrical issue.

One potential (but unrelated problem) with your code is your drivingStyleModifier toggle. Unless your driver can press the button and release it in less then 0.005 seconds, the driving style modifier will continually toggle. You'll want to remember the previous state of the button, and only toggle if the current state is true and the previous state was false.

Another potential (but unrelated problem) is your firing mechanism. If both buttons one and two are pressed, the relay will be set to forward and then very quickly be set to reverse. This isn't good for the hardware. You should use a if, else if, else structure to make sure that only one value is set for each iteration.
Reply With Quote