|
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.
|