Go to Post I am definitely as much a student as any one of the kids on the team. - Hieb [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 15-01-2014, 17:37
sukhjinder564's Avatar
sukhjinder564 sukhjinder564 is offline
Registered User
FRC #0564
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2011
Location: New York
Posts: 11
sukhjinder564 is an unknown quantity at this point
Compressor Not Starting

Hello,

My name is Sukhjinder and I am a programmer for team 564. We recently tried to run a pneumatics board setup consisting of a compressor, spike, pressure switch, and a solenoid.

We code in Java, and I have thoroughly researched how to make a compressor object and start it even though it is the simplest of things.

I contruct a compressor object as follows:

Compressor comp = new Compressor(pressureSwitch, Spike Relay);

The two parameters represent the channel of the pressureSwitch and Relay.

In order to start the compressor, I just call comp.start();



Now assuming that the electrical components of the pneumatics are done correctly, this should run, am I correct? (And yes I am on the most recent updates and am getting communication)


I was looking at other constructors for the compressor object, and saw another constructor that required 4 parameters to be passed over.

The constructor would look like:

Compressor comp = new Compressor(pressureSwitchSlot, PressureSwitchChannel, RelaySlot, RelayChannel)


What I dont understand here is what the constructor means by "Slot". What is the difference between slot and channel, since the Pressure switch and relay are only plugged into the digital sidecar?
  #2   Spotlight this post!  
Unread 15-01-2014, 18:16
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: Compressor Not Starting

To answer your last question first. Slot is where the card is in the cRIO. Slot 2 would be the digital slot if I recall correctly for the 4 slot cRio. It allows for you the deal with in the old chassis or the new one, 2 digital cards.

Your code looks right, the question is what part of the robot class are you putting it in?

Also, remember to enable the robot for it to start as well from the drivers station.

Randy
__________________
Randy Steiner
2014-2015 FIRST Team 5461 - Coach
2011-2014 FIRST Team 4106 - Head Mentor
2007-2011 FIRST Team 1891 - Mentor
  #3   Spotlight this post!  
Unread 15-01-2014, 18:46
sukhjinder564's Avatar
sukhjinder564 sukhjinder564 is offline
Registered User
FRC #0564
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2011
Location: New York
Posts: 11
sukhjinder564 is an unknown quantity at this point
Re: Compressor Not Starting

I am creating a constructor for my class in Java, and initializing the compressor in there. The comp.start() is called within robotInit(). We tested with an enabled robot.

Ex:

public class 564code extends IterativeRobot{


Compressor comp;

public 564code(){

comp= new Compressor(pressureSwitch, Relay);


}



public void robotInit(){

comp.start();

}
  #4   Spotlight this post!  
Unread 15-01-2014, 20: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: Compressor Not Starting

OK, so there are two things you can try.

First just validate the relay works.

Create a Relay object on the relay port you have set up.

Then in the init just set it on. You can even use another relay channel as the digital side card will light up when the relay activates.

Relay r1 = new Relay( 1 );


r1.setDirection( kForward ) (may need Relay.kForward)

If that turns your compressor on then you know that part is working.

The other check you can do is validate you are getting single changes on the digital in.

DigitalInput di1 = new DigitalInput( 1 );



In the periodic routine for teleop print it out.

System.out.println( "digital 1 : " + di1.get() );


Then run and see if you connect the two terminals together on the pressure relay does the value change.

If both of those are working then I am not sure why it may not be working.

There is a teleopInit() you can add to the Iterative Robot class that will run once going into teleop mode, you can try the comp.start(); there.

So by running the relay directly you do not have the pressure sensor safety net, so either leave the relief valve open or only run it for a short time.


Randy
__________________
Randy Steiner
2014-2015 FIRST Team 5461 - Coach
2011-2014 FIRST Team 4106 - Head Mentor
2007-2011 FIRST Team 1891 - Mentor
  #5   Spotlight this post!  
Unread 15-01-2014, 21:21
nuttle nuttle is offline
Registered User
AKA: Allen Nuttle
FRC #4080
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: United States
Posts: 104
nuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud of
Re: Compressor Not Starting

Use the LEDs on the DSC and the Spike -- does a little green light come on next to where you have plugged in the cable to the Spike? If so, does the LED on the Spike turn green? The compressor will only run (in the right direction) if both of these are green.

The other thing to check is the voltage between the GND (-) and the SIG pin on the digital input that is connected to the pressure switch. You should be able to see the state of this input using the driver station (as well as the state of the relay output)...
  #6   Spotlight this post!  
Unread 15-01-2014, 23:25
MrBydlon's Avatar
MrBydlon MrBydlon is offline
Registered User
AKA: Jeremy Bydlon
FRC #3313 (Mechatronics)
Team Role: Coach
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Alexandria, MN
Posts: 86
MrBydlon has much to be proud ofMrBydlon has much to be proud ofMrBydlon has much to be proud ofMrBydlon has much to be proud ofMrBydlon has much to be proud ofMrBydlon has much to be proud ofMrBydlon has much to be proud ofMrBydlon has much to be proud ofMrBydlon has much to be proud ofMrBydlon has much to be proud of
Re: Compressor Not Starting

We had this same problem and spent a good chunk of time troubleshooting.

We kept everything the same except switched out the Vex Pro Spike Relay for an older Innovation FIRST Spike Relay. It has worked like a charm since then.

We had the same issue last year (took a student with a better memory than me to remember that) and we have no idea why...

Everything about the system stays the same, wiring, data, programming, everything, except the Spike.

Anyway, don't know if that's exactly the problem but thought I'd share.

BTW, we program in java and just do
"Compressor comp = new Compressor(pressureSwitch, Spike Relay)"
__________________

Head Coach
FRC Team 3313 Mechatronics
Alexandria, MN

2014 10,000 Lakes: Chairman's Award Winner
2014 10,000 Lakes: Winner with 2052 and 2227
2014 Lake Superior: Finalist and Engineering Excellence

Website Twitter Facebook YouTube
  #7   Spotlight this post!  
Unread 17-01-2014, 09:48
sukhjinder564's Avatar
sukhjinder564 sukhjinder564 is offline
Registered User
FRC #0564
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2011
Location: New York
Posts: 11
sukhjinder564 is an unknown quantity at this point
Re: Compressor Not Starting

We tried running the relay by itself; and the light on the relay is glowing in an orange color. If I am not mistaken, that means there is no signal to the relay, right?
  #8   Spotlight this post!  
Unread 17-01-2014, 10:45
nuttle nuttle is offline
Registered User
AKA: Allen Nuttle
FRC #4080
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: United States
Posts: 104
nuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud of
Re: Compressor Not Starting

Correct -- is there a green light on the DSC next to the relay port where the cable to the Spike is plugged?
  #9   Spotlight this post!  
Unread 17-01-2014, 13:55
sukhjinder564's Avatar
sukhjinder564 sukhjinder564 is offline
Registered User
FRC #0564
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2011
Location: New York
Posts: 11
sukhjinder564 is an unknown quantity at this point
Re: Compressor Not Starting

There is no green light. There is actually no light at all
  #10   Spotlight this post!  
Unread 17-01-2014, 14:39
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: Compressor Not Starting

Have you been able to drive the robot? I am wondering if you are not getting a light on the Digital Side Card next to the relay block if your cable may be inverse. There have been some in the past that had the connectors on wrong.

Also make sure you have three green power lights on the Digital Side Car.

Attached an image where you can see the light change when you toggle the relay.

Can you share the code where you tried just the relay? The full class if possible.

Thanks!

Randy
Attached Thumbnails
Click image for larger version

Name:	am-0866-221_relay.jpg
Views:	32
Size:	93.3 KB
ID:	15853  
__________________
Randy Steiner
2014-2015 FIRST Team 5461 - Coach
2011-2014 FIRST Team 4106 - Head Mentor
2007-2011 FIRST Team 1891 - Mentor
  #11   Spotlight this post!  
Unread 17-01-2014, 14:57
BBray_T1296's Avatar
BBray_T1296 BBray_T1296 is offline
I am Dave! Yognaut
AKA: Brian Bray
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Rockwall, TX
Posts: 947
BBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond reputeBBray_T1296 has a reputation beyond repute
Re: Compressor Not Starting

Have you checked the automotive fuse in the Spike Relay? It could be burnt out
__________________
If molecular reactions are deterministic, are all universes identical?

RIP David Shafer: you will be missed


  #12   Spotlight this post!  
Unread 17-01-2014, 15:19
nuttle nuttle is offline
Registered User
AKA: Allen Nuttle
FRC #4080
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: United States
Posts: 104
nuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud ofnuttle has much to be proud of
Re: Compressor Not Starting

If there's no light on the DSC, start there -- the fuse or anything else on the Spike are downstream from the DSC. Look at the picture in the above post and send the code for your relay test.

Does the light on the DSC near where you plug in the robot signal light flash? When you enable the robot, what does this light do?
  #13   Spotlight this post!  
Unread 17-01-2014, 18:04
sukhjinder564's Avatar
sukhjinder564 sukhjinder564 is offline
Registered User
FRC #0564
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2011
Location: New York
Posts: 11
sukhjinder564 is an unknown quantity at this point
Re: Compressor Not Starting

The problem has been resolved today. What I decided to do was specify the module number (in the code) of the cRIO to which the digital sidecar was plugged into and it all worked like a charm. For some peculiar reason, we had 2 digital slots in our 8-slot cRIO.

Now my next question is: what are the default locations for modules within a 4-slot cRIO?
  #14   Spotlight this post!  
Unread 17-01-2014, 18:32
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Compressor Not Starting

Quote:
Originally Posted by sukhjinder564 View Post
The problem has been resolved today. What I decided to do was specify the module number (in the code) of the cRIO to which the digital sidecar was plugged into and it all worked like a charm. For some peculiar reason, we had 2 digital slots in our 8-slot cRIO.

Now my next question is: what are the default locations for modules within a 4-slot cRIO?
Glad you got it working.

Basically the slots are Analog, Digital, Solenoid, then one additional module of any type. You can see that outlined here:

http://wpilib.screenstepslive.com/s/...control-system
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Closed Thread


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 03:26.

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