Go to Post Fun and adrenaline make you waaaaaaaay better at robotics. Proven fact. - Matt Krass [more]
Home
Go Back   Chief Delphi > Technical > Pneumatics
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-02-2014, 16:43
computronix computronix is offline
Registered User
FRC #4638
 
Join Date: Jan 2014
Location: Maryland
Posts: 1
computronix is an unknown quantity at this point
Smile Cannot turn on compressor programatically via Spike Relay

Hey guys,

We're having a lot of trouble getting the air compressor to turn on and regulate itself via a Spike Relay. Here's our setup:
  1. We have the DSC plugged into the cRIO and all three power lights are brightly lit
  2. The Spike Relay is plugged into the DSC on relay port 1 and the light is amber
  3. The pressure switch is also plugged into the DSC on DIO port 1
  4. The light on the Spike Relay does NOT turn green when it should be enabled, and the light next to the relay port on the DSC does NOT turn green when it should

Here is a link to our code, if you'd like to take a look. The compressor code is in the UpdatePressure class in the launcher package.

Any help would be appreciated. We've been working on this for two days with no luck. All we know is that the problem is between the DSC and the Spike Relay, but we can't figure out why.
  #2   Spotlight this post!  
Unread 08-02-2014, 16:57
ArzaanK ArzaanK is offline
Registered User
FRC #1325 (Inverse Paradox)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Mississauga, Ontario, Canada
Posts: 40
ArzaanK is an unknown quantity at this point
Re: Cannot turn on compressor programatically via Spike Relay

We were having a very similar issue earlier.

Our problem is that our ribbon cable was not in correctly. If you are using a ribbon cable, make sure to screw down both ends, (in the cRio module and Digital Side Car). This fixed our issue for us.
__________________
Arzaan Khairulla
Programmer/Driver
2013 Greater Toronto Regional East Winners with 1114 and 2056
2013 Galileo Division
  #3   Spotlight this post!  
Unread 08-02-2014, 17:08
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,544
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Cannot turn on compressor programatically via Spike Relay

I would not put the compressor in a command. It's designed to run in the background automatically. I would declare the compressor in your launcher subsystem, and call start in the constructor of that subsystem. You don't need any other code.
  #4   Spotlight this post!  
Unread 08-02-2014, 17:56
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 138
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: Cannot turn on compressor programatically via Spike Relay

You want this command to always run on the compressor so that it will always have full pressure and so that it will automatically shut off at the right time. To do this you need to set your UpdatePressure command as the default command for the compressor.

Here is an example from my team's code:

Compressor Subsystem
Code:
public class Compressor1 extends Subsystem {

    Compressor compressor = RobotMap.compressor1compressor;

    public void initDefaultCommand() {
        setDefaultCommand(new CompressorCommand());
    }
}
CompressorCommand
Code:
public class  CompressorCommand extends Command {
    Compressor compressor;
    
    public CompressorCommand() {
        requires(Robot.compressor1);
        compressor = RobotMap.compressor1compressor;
    }

    protected void execute() {
        
        if(!compressor.getPressureSwitchValue()){
            //Compressor NOT Full
            if(!compressor.enabled()){
                compressor.start();
            }
        }else{
            //Compressor Full
            compressor.stop();
        }
    }

    protected boolean isFinished() {
        return false;
    }

}
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 07:11.

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