Go to Post FIRST isn't for wimps. It never has been. - JaneYoung [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-02-2012, 16:33
Twisted eric's Avatar
Twisted eric Twisted eric is offline
Registered User
FRC #0581
 
Join Date: Jan 2010
Location: San Jose
Posts: 54
Twisted eric is an unknown quantity at this point
Pneumatic Compressor not starting up Pneumatic Compressor not starting up

This is the third day I have been at this (working on pneumatics).

Now the compressor is attached to a spike, then the spike is connected to the power distribution board both 20amp breakers. The spike is connected to the digital sidecar in relay slot 1 (sig [a], pow[b], ground[-]). And the pressure switch is connected to Digital I/O 1 (Black on Nc, Red on C).

Code:
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Watchdog;

public class RobotTemplate extends SimpleRobot {

    private static final long TIME_DELAY = 1000; //in milliseconds
    Joystick leftStick = new Joystick(1);
    Joystick rightStick = new Joystick(2);
    Joystick three = new Joystick(3);
    Jaguar rightF = new Jaguar(2);
    Jaguar rightB = new Jaguar(1);
    Jaguar leftF = new Jaguar(3);
    public Jaguar leftB = new Jaguar(4);
    public Compressor fluffy = new Compressor(1, 1, 1, 1);
    DriverStation ds;
    Watchdog fenrir = Watchdog.getInstance();

  

    void drive() {
        if (leftStick.getRawButton(1)) {
            leftF.set(-1.0);
            rightB.set(1.0);
            leftB.set(1.0);
            rightF.set(-1.0);
        } else {
            if (rightStick.getRawButton(1)) {
                leftF.set(1.0);
                rightB.set(-1.0);
                leftB.set(-1.0);
                rightF.set(1.0);
            } else {
                leftF.set(leftStick.getY());
                rightB.set(rightStick.getY() * -1);
                leftB.set(leftStick.getY());
                rightF.set(rightStick.getY() * -1);

            }
        }

    }

    void com() {
        fenrir.feed();
        if (fluffy.getPressureSwitchValue()) {
            fluffy.setRelayValue(Relay.Value.kOff);
        } else {
            fluffy.setRelayValue(Relay.Value.kOn);

        }
    }

    public void autonomous() {
        fenrir.feed();
    }

    public void operatorControl() {
        while (true && isOperatorControl() && isEnabled()) {
            fenrir.feed();
            com();
            drive();
        }
    }
}
Here is he code I went over a ton of times and can't see anything wrong with it. Help please.

I know its also in the pneumatic's thread but more people are viewing this thread.
Reply With Quote
  #2   Spotlight this post!  
Unread 18-02-2012, 22:13
Bill_B Bill_B is offline
You cannot not make a difference
FRC #2170
 
Join Date: Jan 2010
Rookie Year: 2004
Location: Connecticut
Posts: 1,099
Bill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond reputeBill_B has a reputation beyond repute
Re: Pneumatic Compressor not starting up Pneumatic Compressor not starting up

Is the fuse in the spike still good? Note that a spike used to control the compressor is allowed to have a special self-resetting 20A fuse. I cannot comment on your code.
__________________
Nature's Fury FLL team 830 - F L eLements
FRC team 2170 - Titanium Tomahawks
Reply With Quote
  #3   Spotlight this post!  
Unread 19-02-2012, 13:28
Twisted eric's Avatar
Twisted eric Twisted eric is offline
Registered User
FRC #0581
 
Join Date: Jan 2010
Location: San Jose
Posts: 54
Twisted eric is an unknown quantity at this point
Re: Pneumatic Compressor not starting up Pneumatic Compressor not starting up

Ya it is I have tried 3 different spikes with different 20A fuses.
Reply With Quote
  #4   Spotlight this post!  
Unread 19-02-2012, 13:31
jase728 jase728 is offline
Registered User
AKA: Jase728
FRC #3210 (Falcons)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Hillsboro
Posts: 11
jase728 is an unknown quantity at this point
Re: Pneumatic Compressor not starting up Pneumatic Compressor not starting up

We had a problem like this, try another digital output port on the digital sidecar and change it in the code

also why are some of your vars declared public and some are not?
__________________
"In theory there is reality, but in reality there is no theory" - Erich Keane (FRC 2010 Build Season - Team 3210)
Reply With Quote
  #5   Spotlight this post!  
Unread 19-02-2012, 16:07
Twisted eric's Avatar
Twisted eric Twisted eric is offline
Registered User
FRC #0581
 
Join Date: Jan 2010
Location: San Jose
Posts: 54
Twisted eric is an unknown quantity at this point
Re: Pneumatic Compressor not starting up Pneumatic Compressor not starting up

Ok I declared all the var public. I have tried switching the PWM and in my code and it will not work.
Reply With Quote
  #6   Spotlight this post!  
Unread 19-02-2012, 16:31
jase728 jase728 is offline
Registered User
AKA: Jase728
FRC #3210 (Falcons)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Hillsboro
Posts: 11
jase728 is an unknown quantity at this point
Re: Pneumatic Compressor not starting up Pneumatic Compressor not starting up

hmm the code looks correct you could try removing the watch dog in the com method

can you drive the robot fine?
__________________
"In theory there is reality, but in reality there is no theory" - Erich Keane (FRC 2010 Build Season - Team 3210)
Reply With Quote
  #7   Spotlight this post!  
Unread 19-02-2012, 17:13
xraymypanda's Avatar
xraymypanda xraymypanda is offline
Cowboy programmer
AKA: Chris M
FRC #0599 (RoboDox)
Team Role: Programmer
 
Join Date: Dec 2011
Rookie Year: 2011
Location: Granada Hills,CA
Posts: 82
xraymypanda has a spectacular aura aboutxraymypanda has a spectacular aura about
Re: Pneumatic Compressor not starting up Pneumatic Compressor not starting up

Which Spike relays are you using? Are you using the new VexPro relays from this years KoP or the older IFI relays. For whatever reason, the old relays no longer work with WPILib functions this season. We just struggled with this problem for hours and found that the solution was using the VexPro Spike relay from this year's KoP.
__________________

2011: Head Scout
2012: (figure)Head Programmer
2013: Head Programmer, Chief Strategist, Outreach Executive, and Driver
Reply With Quote
  #8   Spotlight this post!  
Unread 19-02-2012, 19:00
Twisted eric's Avatar
Twisted eric Twisted eric is offline
Registered User
FRC #0581
 
Join Date: Jan 2010
Location: San Jose
Posts: 54
Twisted eric is an unknown quantity at this point
Re: Pneumatic Compressor not starting up Pneumatic Compressor not starting up

Well we figured it out the ribbon cable was first backwards and then did not get a full crimp on it when we re did it so now we are going to use last years and now everything works thank you every one for your help.
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 12:49.

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