Go to Post Wow I am old. How did that happen? - Paul Copioli [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-02-2009, 12:02
HarryScheiner HarryScheiner is offline
Mentor for Team 1358
FRC #1358 (MacArthur Generals)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2007
Location: New York
Posts: 18
HarryScheiner is an unknown quantity at this point
Trouble using Spike Relay

Our spike is not giving power to our motor. This is my code:

Code:
#include "WPILib.h"

/**
 * This is a demo program showing the use of the RobotBase class.
 * The SimpleRobot class is the base of a robot application that will automatically call your
 * Autonomous and OperatorControl methods at the right time as controlled by the switches on
 * the driver station or the field controls.
 */ 
class RobotDemo : public SimpleRobot
{
	RobotDrive myRobot; // robot drive system
	Joystick stickL; // LEFT joystick
	Joystick stickR; // RIGHT joystick
	Jaguar ballSucker; // Central ball aquiring mechanism
	Relay door; // Ball release mechanism

public:
	RobotDemo(void):
		myRobot(2, 1),	// these must be initialized in the same order
		stickL(1),		// as they are declared above.
		stickR(2),
		ballSucker(3),
		door(4)
	{
		GetWatchdog().SetExpiration(0.1);
	}

	/**
	 * Drive left & right motors for 2 seconds then stop
	 */
	void Autonomous(void)
	{
		GetWatchdog().SetEnabled(false);
		myRobot.Drive(0.5, 0.0); 	// drive forwards half speed
		Wait(2.0); 				//    for 2 seconds
		myRobot.Drive(0.0, 0.0); 	// stop robot
	}

	/**
	 * Runs the motors with arcade steering. 
	 */
	void OperatorControl(void)
	{
		GetWatchdog().SetEnabled(true);
		while (IsOperatorControl())
		{
			GetWatchdog().Feed();
			myRobot.TankDrive(stickR, stickL); // drive with tank style
			
			if (stickL.GetTrigger())	// If Left Joystick Trigger is HELD
				ballSucker.Set(-1.0);	
			else						// If Left Joystick Trigger is RELEASED
				ballSucker.Set(0.0);				

			if (stickR.GetTrigger())	// If Right Joystick Trigger is HELD
				door.Set(Relay::kForward);	
			else						// If Right Joystick Trigger is RELEASED
				door.Set(Relay::kOff);				
			
			Wait(0.005);				// wait for a motor update time
		}
	}
};

START_ROBOT_CLASS(RobotDemo);

The Jaguar for 'ballSucker' works fine, I changed it from the left trigger to the right trigger to make sure both triggers were working properly. Are we setting up the Relay wrong?

It might be a wiring problem, also. We were not sure where to plug in the spike's PWM cable on the digital sidecar. Right now it is plugged in to Relay port 4, but we have also tried the side for the Jaguars and it did not work. We tried turning the cables around, too.

Thanks,
-Team 1358
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2009, 12:24
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Trouble using Spike Relay

The relay outputs are correct for connecting to Spike relays.

There are LEDs adjacent to the relay pins on the Digital Sidecar. When you tell the door relay (#4) to turn on forward, its associated green LED should light. Does it?

Are the Digital Sidecar's 12v and 5v power LEDs lit? Is the RSL on steady?
Reply With Quote
  #3   Spotlight this post!  
Unread 11-02-2009, 17:08
HarryScheiner HarryScheiner is offline
Mentor for Team 1358
FRC #1358 (MacArthur Generals)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2007
Location: New York
Posts: 18
HarryScheiner is an unknown quantity at this point
Re: Trouble using Spike Relay

Thanks! It works now! Not really sure why, though
Reply With Quote
  #4   Spotlight this post!  
Unread 15-02-2009, 22:55
Travis Hoffman's Avatar Unsung FIRST Hero
Travis Hoffman Travis Hoffman is offline
O-H
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Engineer
 
Join Date: Sep 2001
Rookie Year: 2001
Location: Warren, Ohio USA
Posts: 4,047
Travis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond repute
Re: Trouble using Spike Relay

Quote:
Originally Posted by Alan Anderson View Post
The relay outputs are correct for connecting to Spike relays.

There are LEDs adjacent to the relay pins on the Digital Sidecar. When you tell the door relay (#4) to turn on forward, its associated green LED should light. Does it?

Are the Digital Sidecar's 12v and 5v power LEDs lit? Is the RSL on steady?
OK so answer me this - all sidecar LED's are green. Spike power is wired properly. Relay output light is turning on at the sidecar (using either the Compressor class or just a Relay class to turn the output on). Pump works fine when powered separately. RSL is solid orange when enabled. All this, but the pump doesn't enable. The Spike LED remains orange. I've swapped out the PWM cable, twice. No dice.

All bots are programmed in Wind River. The firmware matches the software installation.

This has happened today, twice, on two different robots (neither of which are mine). I'm not quite sure what to try next. Hopefully there is a "duh" I'm missing and someone can help me correct the problem. Should I bust out the "Persuader" and take the sidecar out behind the woodshed?
__________________

Travis Hoffman, Enginerd, FRC Team 48 Delphi E.L.I.T.E.
Encouraging Learning in Technology and Engineering - www.delphielite.com
NEOFRA - Northeast Ohio FIRST Robotics Alliance - www.neofra.com
NEOFRA / Delphi E.L.I.T.E. FLL Regional Partner
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2009, 00:15
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Trouble using Spike Relay

If the Digital Sidecar's Relay LED is working, but the Spike wired to the Relay pins associated with that LED is not, with two different sets of wires having been tried, I would tend to suspect the Spike as the source of the fault.
Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2009, 01:07
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
Re: Trouble using Spike Relay

Seconding the above--we had a Spike fail as well. It's a bit of a pain to troubleshoot(since the spike has no error codes like a speed controller), but your symptoms match ours exactly.
__________________
Get yer robot source code here!
Reply With Quote
  #7   Spotlight this post!  
Unread 16-02-2009, 01:15
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Trouble using Spike Relay

Harry,

You did not mention what type of motor you are trying to drive with the Spike. Have you checked the 20A fuse on the spike?

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
Reply With Quote
  #8   Spotlight this post!  
Unread 16-02-2009, 01:44
Travis Hoffman's Avatar Unsung FIRST Hero
Travis Hoffman Travis Hoffman is offline
O-H
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Engineer
 
Join Date: Sep 2001
Rookie Year: 2001
Location: Warren, Ohio USA
Posts: 4,047
Travis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond repute
Re: Trouble using Spike Relay

Quote:
Originally Posted by Alan Anderson View Post
If the Digital Sidecar's Relay LED is working, but the Spike wired to the Relay pins associated with that LED is not, with two different sets of wires having been tried, I would tend to suspect the Spike as the source of the fault.
One of the teams swapped their Spike out - same result.

Maybe I should hook it up to an IFI controller - maybe it misses mommy.....
__________________

Travis Hoffman, Enginerd, FRC Team 48 Delphi E.L.I.T.E.
Encouraging Learning in Technology and Engineering - www.delphielite.com
NEOFRA - Northeast Ohio FIRST Robotics Alliance - www.neofra.com
NEOFRA / Delphi E.L.I.T.E. FLL Regional Partner
Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2009, 14:01
X-Istence X-Istence is offline
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
X-Istence will become famous soon enoughX-Istence will become famous soon enough
Send a message via AIM to X-Istence Send a message via MSN to X-Istence
Re: Trouble using Spike Relay

What I found is that I had to use the following:

Code:
Relay * motorRelay;

motorRelay = new Relay(...)

motorRelay->SetDirection(Relay::kForwardOnly);
motorRelay->Set(Relay::kOn);
Without the set direction, or even by giving it a value like Relay::kForward it would not move.

After this everything worked just fine, not sure why.

However if you are saying your digital sidecar is showing the correct value, and yet the spike is not re-acting, I would not know, have you tried a different relay output?
__________________
My Blog!
Reply With Quote
  #10   Spotlight this post!  
Unread 17-02-2009, 14:08
Travis Hoffman's Avatar Unsung FIRST Hero
Travis Hoffman Travis Hoffman is offline
O-H
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Engineer
 
Join Date: Sep 2001
Rookie Year: 2001
Location: Warren, Ohio USA
Posts: 4,047
Travis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond repute
Re: Trouble using Spike Relay

Quote:
Originally Posted by X-Istence View Post
What I found is that I had to use the following:

Code:
Relay * motorRelay;
 
motorRelay = new Relay(...)
 
motorRelay->SetDirection(Relay::kForwardOnly);
motorRelay->Set(Relay::kOn);
Without the set direction, or even by giving it a value like Relay::kForward it would not move.

After this everything worked just fine, not sure why.

However if you are saying your digital sidecar is showing the correct value, and yet the spike is not re-acting, I would not know, have you tried a different relay output?
We determined the one failure WAS attributable to the Spike (never had that happen before!), but the problem on the robot where we swapped the Spike remains. I'll have the rookie team recheck their crimp connections and wiring....
__________________

Travis Hoffman, Enginerd, FRC Team 48 Delphi E.L.I.T.E.
Encouraging Learning in Technology and Engineering - www.delphielite.com
NEOFRA - Northeast Ohio FIRST Robotics Alliance - www.neofra.com
NEOFRA / Delphi E.L.I.T.E. FLL Regional Partner
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Relay (Spike) elbuo Electrical 2 09-02-2009 20:36
Spike relay question Zack Briggs Electrical 17 19-02-2008 14:48
using SPIKE relay module with Fisher Price motors 1574aviad Motors 4 27-01-2005 01:49
Spike Relay Input nwagers Electrical 3 16-07-2002 22:23


All times are GMT -5. The time now is 14:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi