Go to Post Finding those students and giving them a lift up out of the sea of apathy that is constantly trying to drown them is one of the reasons I am in my profession. - Ben Mitchell [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 16-01-2012, 18:41
ksafin's Avatar
ksafin ksafin is offline
Registered User
AKA: Kirill Safin
FRC #3992 (Eagles Robotics Xperience)
Team Role: Leadership
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Delray Beach, FL
Posts: 498
ksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant future
Spike Relay?

We're using the spike relay between our PDB and Compressor, and trying to turn it on by switching the relay to on or off.

By default, when we turn the robot on, the relay doesn't allow the current to flow and power the compressor.

To allow it to do so, and for the compressor to turn on, do we set the relay to kOn or kOff?
Reply With Quote
  #2   Spotlight this post!  
Unread 16-01-2012, 19:05
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: Spike Relay?

Quote:
Originally Posted by ksafin View Post
We're using the spike relay between our PDB and Compressor, and trying to turn it on by switching the relay to on or off.

By default, when we turn the robot on, the relay doesn't allow the current to flow and power the compressor.

To allow it to do so, and for the compressor to turn on, do we set the relay to kOn or kOff?
There is a class called compressor... it does this for you.

Code:
Compressor compressor = new Compressor(1,2); // 1 is your relay port and 2 is your pressure switch digital input


//then in your robot init just put 
compressor.start();
Reply With Quote
  #3   Spotlight this post!  
Unread 16-01-2012, 22:29
ksafin's Avatar
ksafin ksafin is offline
Registered User
AKA: Kirill Safin
FRC #3992 (Eagles Robotics Xperience)
Team Role: Leadership
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Delray Beach, FL
Posts: 498
ksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant futureksafin has a brilliant future
Re: Spike Relay?

I was aware and tried to use Compressor, but it wasn't working.

TBH, nothing is working.

I'm going to make a post on the tech forum to see if I did some pneumatics wrong.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2012, 23:12
bakerjohn42's Avatar
bakerjohn42 bakerjohn42 is offline
Team 3171 - Co-Captain
AKA: John Baker
FRC #3171 (Hurricane P.R.I.D.E.)
Team Role: Driver
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Westhampton Beach, NY
Posts: 10
bakerjohn42 is an unknown quantity at this point
Re: Spike Relay?

Use kForward. that should do it.
Reply With Quote
  #5   Spotlight this post!  
Unread 18-01-2012, 10:08
steinra's Avatar
steinra steinra is offline
(KG7KEO)
AKA: Randy Steiner
FRC #5461 (V.E.R.N.)
Team Role: Coach
 
Join Date: Nov 2008
Rookie Year: 2007
Location: Meridian, Idaho
Posts: 56
steinra is on a distinguished road
Re: Spike Relay?

You probably already know this, but just a reminder the robot has to be enabled for the compressor to turn on. In disabled state they will not run motors or relays.
__________________
Randy Steiner
2014-2015 FIRST Team 5461 - Coach
2011-2014 FIRST Team 4106 - Head Mentor
2007-2011 FIRST Team 1891 - Mentor
Reply With Quote
  #6   Spotlight this post!  
Unread 27-01-2012, 20:04
kingkurry kingkurry is offline
Registered User
FRC #4067
 
Join Date: Jan 2012
Location: Maryland
Posts: 20
kingkurry is an unknown quantity at this point
Re: Spike Relay?

How would one actually program the spike relay to control a motor? Can someone give us some current example code? Just some short code to show us what methods to use to get it to move forwards, backwards and to stop.
Reply With Quote
  #7   Spotlight this post!  
Unread 27-01-2012, 20:08
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Spike Relay?

Quote:
Originally Posted by kingkurry View Post
How would one actually program the spike relay to control a motor? Can someone give us some current example code? Just some short code to show us what methods to use to get it to move forwards, backwards and to stop.
Page 37
http://firstforge.wpi.edu/sf/docman/...tation/doc1196
Reply With Quote
  #8   Spotlight this post!  
Unread 29-01-2012, 00:22
kingkurry kingkurry is offline
Registered User
FRC #4067
 
Join Date: Jan 2012
Location: Maryland
Posts: 20
kingkurry is an unknown quantity at this point
Re: Spike Relay?

Any chance someone could show us documentation or example code for java? None of us know c++ sadly.
Reply With Quote
  #9   Spotlight this post!  
Unread 01-02-2012, 21:52
BurtGummer BurtGummer is offline
Electrical/Mechanical/Programming
FRC #3020
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Southern CA
Posts: 89
BurtGummer will become famous soon enoughBurtGummer will become famous soon enough
Re: Spike Relay?

I don't know how much you know or don't know, so I'll cover what I can.

First be sure you created the compressor object. The parameters should be the Pressure switch channel and the relay channel that you are using on your breakouts on the cRIO. Then turning the compressor on or off is as simple as calling the start and and stop methods. From what I recall, the compressor will need to have the start() method called to turn it on in the first place ( I've done this in the initialization code for autonomous and teleOp). You can also turn it on and off using buttons or timers as well. It will automatically turn off once the pressure switch detects the system is at pressure.

Code wise:
Code:
Compressor compressor = new Compressor(1,1);  // Creates the object.  Make sure the parameters of (1,1) relate to the pressure switch and relay channels.  

compressor.start();  // Start the compressor

compressor.stop();  // Stop the compressor
Again, you will usually want to put the compressor.start() in the initialization code for the robot so it starts automatically without user intervention (unless, of course, you want to manually start it).
__________________
I'm a mentor looking for a home in Southern California! I know Java, C++, electrical and mechanical.

Need Java or C++ help? Send me a PM!
Reply With Quote
  #10   Spotlight this post!  
Unread 03-02-2012, 09:02
java4first java4first is offline
(Java) Programming Mentor
AKA: Stu
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 2011
Location: Goffstown, NH
Posts: 56
java4first is an unknown quantity at this point
Re: Spike Relay?

I just struggled with that last night ;-) Remember, I'm a software guy - but here's the list of problems I had with our I&T chassis, so maybe they'll help you.

(1) Make sure there is a fuse in the power distribution panel port you have the relay wired to. When you power on the robot, the LED on the Spike should be glowing brightly.

(2) The PWM goes from the Spike to one of the Relay ports on the digital side car.

(3) We made a PWM cable with the connector to plug into one of the DIO ports on the digital sidecar and left the black and white wires stripped on the other end.

(4) Make sure you do the constructor to the Compressor in the right order (the WPI documentation text enumerates them one way, and the actual argument order is reversed).

(5) Make sure you call start() after creating the instance.

(6) Short the two wires to the DIO together and the compressor will run (simulates low pressure). Separate them and the compressor will stop.

If you are sending the data to the default Dashboard that comes with the NI install, you should see the appropriate lights on the GPIO and the Relay 'LEDs'.
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


All times are GMT -5. The time now is 10:41.

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