View Single Post
  #1   Spotlight this post!  
Unread 14-01-2012, 15:20
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Cannot drive more than 3 jaguars at once

We're having issues getting our 2011 robot to run.

We've got our digital sidecar in slot 2, as the instructions say.

If we use the SimpleTemplate sample, it will drive the Jaguars on PWM 1 and 2 (green lights and the motors turn).

If we modify the SimpleTemplate sample to drive PWMs 3 and 4, it will happily drive those motors (green lights and the motors turn).

If we modify the SimpleTemplate sample to use the RobotDrive constructor that takes PWMs 1, 2, 3, and 4 (as our 2011 robot used 4 drive motors), it fails to send signals to any Jaguar - they give us a slow orange blink.

If we remove the RobotDrive class and manually declare Jaguars attached to various PWMs, it will only work if we use 3 or fewer Jaguars. As soon as we construct the 4th Jaguar (whether or not we call the Set() function on it), the program fails to send a signal to the Jaguars.

To summarize:
-All 4 Jaguars have power and PWMs going to them - we can successfully drive any of them if we set our program to use those PWMs.
-As soon as we attempt to use 4 motors, whether via RobotDrive or via Jaguar class instances, it fails.
-We get no error messages in the console
-If we put a printf in the main operator control loop, it gets called continuously, indicating that the loop is running properly.

I noticed some "syncgroup" parameters in the Jaguar class header that default to 0 - is there something we're supposed to do with that?

Here's the 4-Jaguar code that fails - can someone try it on their robot and confirm whether it works or not?
Code:
#include "WPILib.h"

class RobotDemo : public SimpleRobot
{
	Joystick stick; // only joystick

	Jaguar frontRight;
	Jaguar backRight;
	Jaguar frontLeft;
	Jaguar backLeft;
public:
	RobotDemo(void):
		frontRight(1),
		backRight(2),
		frontLeft(3),
		backLeft(4),
		stick(1)		// as they are declared above.
	{
	}

	void Autonomous(void)
	{
	}

	void OperatorControl(void)
	{
		while (IsOperatorControl())
		{
			frontLeft.Set(0.3);
			frontRight.Set(0.3);
			backLeft.Set(0.3);
			backRight.Set(0.3);
			
			Wait(0.005);				// wait for a motor update time
		}
	}
};

START_ROBOT_CLASS(RobotDemo);

Last edited by Bongle : 14-01-2012 at 15:24.
Reply With Quote