I was recently programming one of teams robots and they use all 8 motor ports on a pic microcontroller and whenever it would enter into autonomous mode none of the motors would move and once operator control started you had no control. I removed 2 motors from the controller with 6 left in and it began to work. How would I be able to overcome this and use all 8 motor ports. This has never happened to us before.
Well, without more information it’s hard to tell what happened. From what you describe, I would check to see if any of those two motors were causing a short. What did you change between the times that it didn’t work, and the ones that it did? Can you clarify this statement:
The phrasing makes it seem like you’re differentiating between autonomous and operator control mode, but the motors worked in neither one? What about your code, could that have been the source of the problems?
it was most certainly not our code because we tried that code by removing the 2 motors and it worked so we plugged those 2 back in and removed another two and it worked. They do not work in either mode. The only thing we changed was how many motors were plugged in. Also I should also mention that all other ports/ sensor ports were empty at the time so it was only the motors. We had been charging the battery for about an hour and tried a new one and it still didn’t work so it wasn’t the battery. Unfortunately this happened at the end of our competition yesterday. It was working fine before that.
Interesting problem for a PIC. Maybe if you gave us more details about the robot, motor assignment, and type of motors, it would help.
For example, a tank-drive squarebot geared for speed at 1:10, with 4 motors on each side, but half of the motors on each side set to go the wrong direction might act exactly as you describe.
Is the change in behavior happen at the same time as a code reload?
If so, then it is probably your code. Posting your code would help.
I agree with Jgraber, if you can pull any 2 motors out and the rest work, and… the fault occurred after an update (no matter how benign) the problem is probably related to the update. more details are definately needed. especially what was the ‘working’ configuration and what changed for the current configuration which is now not working.
This began happening after our 4th match and I hadn’t changed or
re downloaded my code, however is my program in operator control and I have no autonomous:
void OperatorControl ( unsigned long ulTime )
while ( 1 ) // Insert Your RC Code Below
Tank4 ( 1 , 3 , 2 , 1 , 4 , 3 , 2 , 0 , 1 , 0 , 1 ) ; // drive
MotorRcControl ( 2 , 5 , 5 , 0 ) ; // 4-bar
MotorRcControl ( 2 , 5 , 6 , 1 ) ; // 4-bar
MotorRcControl ( 1 , 6 , 7 , 0 ) ; // intake
MotorRcControl ( 1 , 6 , 8 , 1 ) ; // intake
As you can see above we have a 4 motor drive, a 4 bar linkage and an intake with 2 motors. Also we are using 3 wire motors as we cannot afford to upgrade all of our motors. We have 2 4" omni’s on the front and 2 4" wheels on the back run through a direct drive. The 4-bar is powered by a 1:7 gear ratio and the intake is modeled after team 39’s elevation intake using 2 motors.
The only configuration change there was was going from 8 motors(nothing worked) to 6 motors(everything worked). Also we did this many of the motors so it was not just the motors.
You are using a second Joystick, just for the 4-bar lift?
Why do you always do 6 or 8 motors, and never 7?
When there are 6 working motors, which ones are they?
Do the LED lights on the front of the PIC look any different in working vs non-working conditions?
Do you have elastic to help lift your 4-bar arm?
EasyC V4 (not your version, I know) shows default tank4 setup does not use any invert direction settings, but you have the right side motors inverted. Maybe your joystick is set to Reverse for channel 2 to compensate.
Keep trying the Sciencey method: Make a Hypothesis and test it…
- When none of the motors work, then something common is affecting all of them. Commonalities are Battery, Joystick, Joystick-field-disable, crystal, PIC PTC 4A fuse.
The 4A PTC seems the most likely since working 6 motors fixes all others.
? What things can make the PTC go open?
– 1 or more shorted motor
– 1 or more motors geared together but driving opposite ways (stalled)
– 1 or more stalled motor due to broken plastic gears inside, (not uncommon in sudden competition based failures, on arm or drive motors)
If you have already done obvious things like check for 1 or 2 bad motors,
or one or two bad motor ports, you haven’t described it in enough detail.
I have another team meeting tomorrow so I will look into this. Also the code where we use a second joystick for the 4-bar was a mistake it looks like some of the guys on the team have been messing with the code.