Go to Post And your other point, "why a debate over a nonexistent rule?". Its summer, we're not building robots, and we're geeks. What else are we supposed to do? - EHaskins [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 Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 24-06-2014, 10:59
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Pneumatics system code

Ok, to do some quick troubleshooting:

First, for my sanity, please add brackets
Code:
// Solenoid
if (mainStick.getRawButton(1))
{
   spike.set(Relay.Value.kForward);
}
else {
  if (mainStick.getRawButton(2))
 {
   spike.set(Relay.Value.kReverse);
 }
}
If problem persists, comment out the code and use only
Code:
spike.set(Relay.Value.kForward);
If the spike LED is not solid Green, you have a wiring issue. Either your wire is bad or the spike is on the wrong port. If that does work, it becomes a code issue.
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
  #17   Spotlight this post!  
Unread 24-06-2014, 11:19
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: Pneumatics system code

"If the spike LED is not solid Green, you have a wiring issue. Either your wire is bad or the spike is on the wrong port. If that does work, it becomes a code issue."

We tried switching all the wires, but not change in the light.

Here is the updated code:

Code:
package edu.wpi.first.wpilibj.templates;
 
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Relay;
 
public class RobotTemplate extends SimpleRobot {
    
    RobotDrive chassis = new RobotDrive(1,2);
    Joystick mainStick = new Joystick(1);
    Jaguar jaguar = new Jaguar(3);
    Jaguar jag = new Jaguar(4);
    Compressor compressor = new Compressor(1, 1);
    Relay spike = new Relay(4);
    
    public void robotInit() {
        compressor.start();
    }

    public void autonomous(){ 
        chassis.setSafetyEnabled(false);
        chassis.drive (-0.5, 0.08);
        Timer.delay(2.0);
        chassis.drive (0, 0.0);
    }
    
    public void operatorControl() {
        chassis.setSafetyEnabled(true);
        while (isOperatorControl() && isEnabled()) {
            double speed = mainStick.getY();
            double rot = -mainStick.getX();
            chassis.arcadeDrive (speed, rot);
            if (mainStick.getRawButton(3)){
                jag.set(1);
                jaguar.set(-1);
            }
            else if (mainStick.getRawButton(4)){
                jaguar.set(-1);
                jag.set(1);
            }
            else{
                jaguar.set(0);
                jag.set(0);
            }

            // Solenoid
            {if (mainStick.getRawButton(7))
                spike.set(Relay.Value.kForward);}
        }
    }
}
  #18   Spotlight this post!  
Unread 24-06-2014, 11:27
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Pneumatics system code

Did you try it without any case statements around the relay set? I'm trying to remove the controller from this as well.

Code:
package edu.wpi.first.wpilibj.templates;
 
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Relay;
 
public class RobotTemplate extends SimpleRobot {
    
    RobotDrive chassis = new RobotDrive(1,2);
    Joystick mainStick = new Joystick(1);
    Jaguar jaguar = new Jaguar(3);
    Jaguar jag = new Jaguar(4);
    Compressor compressor = new Compressor(1, 1);
    Relay spike = new Relay(4);
    
    public void robotInit() {
        compressor.start();
    }

    public void autonomous(){ 
        chassis.setSafetyEnabled(false);
        chassis.drive (-0.5, 0.08);
        Timer.delay(2.0);
        chassis.drive (0, 0.0);
    }
    
    public void operatorControl() {
        chassis.setSafetyEnabled(true);
        while (isOperatorControl() && isEnabled()) {
            double speed = mainStick.getY();
            double rot = -mainStick.getX();
            chassis.arcadeDrive (speed, rot);

            // Solenoid
                spike.set(Relay.Value.kForward);
        }
    }
}
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
  #19   Spotlight this post!  
Unread 24-06-2014, 11:36
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: Pneumatics system code

I tried it with the new code that you posted but that did not work out either. No change in light on the spike or change in the system
  #20   Spotlight this post!  
Unread 24-06-2014, 11:38
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: Pneumatics system code

In this pic it looks an awful lot like the PWM cable into the Spike is backwards. Make sure the black wire is near the "B" on the casing. Also check the Digital Sidecar end of this wire, to make sure Black lines up with (-) (Red with + and White with SIG).

Edit: According to your code, it should be in Relay output 4. Also note: the socket in Spikes and Victors can be a little funny - make sure the connector is properly and snuggly seated all the way down into the socket.

The solid orange light on the spike means it's being commanded to do nothing, which is certainly the case if there is no proper signal coming in.

Last edited by Aren Siekmeier : 24-06-2014 at 11:48. Reason: more info
  #21   Spotlight this post!  
Unread 24-06-2014, 11:41
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Pneumatics system code

No I'm becoming puzzled. Can you check your digital Side Car to ensure all lights are operating correctly
http://wpilib.screenstepslive.com/s/...tem-components

Are you able to control the drive motors?
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
  #22   Spotlight this post!  
Unread 24-06-2014, 11:57
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: Pneumatics system code

Quote:
Originally Posted by compwiztobe View Post
In this pic it looks an awful lot like the PWM cable into the Spike is backwards. Make sure the black wire is near the "B" on the casing. Also check the Digital Sidecar end of this wire, to make sure Black lines up with (-) (Red with + and White with SIG).

Edit: According to your code, it should be in Relay output 4. Also note: the socket in Spikes and Victors can be a little funny - make sure the connector is properly and snuggly seated all the way down into the socket.

The solid orange light on the spike means it's being commanded to do nothing, which is certainly the case if there is no proper signal coming in.
I looked again at that picture. Definitely a wiring issue.

1. Your double solenoid valve is wired incorrectly. Each end of the valve is one solenoid, each of which has a red wire (+, positive) and a black wire (-, negative). Make sure these wires are connected to the spike exactly as shown in this diagram. Right now you are doing something totally different with those wires, which wouldn't work even if the Spike were working properly (it's not, due to 2 below). You should have a red wire on each of the M+ and M- terminals on the spike, and then both black wires should connect to the GND terminal on the Spike.

2. As I posted above, ensure all PWM cables (for lack of a better name - the grouped black, red, and white wires) are inserted in the right direction. In general: B means black; (-) means GND which is always black (or maybe brown or blue ... ) + means hot which is always red, and SIG is signal which is usually white.
  #23   Spotlight this post!  
Unread 24-06-2014, 11:58
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: Pneumatics system code

Ya all the motors are working.

Here is a pic of the sidecar at the moment:

http://i58.tinypic.com/ohrara.jpg

The relay lights don't seem to be steady or blinking, but everything else seems to be fine.

I also changed the port to 7 for the spike on request of my team.

Code:
package edu.wpi.first.wpilibj.templates;
 
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Relay;
 
public class RobotTemplate extends SimpleRobot {
    
    RobotDrive chassis = new RobotDrive(1,2);
    Joystick mainStick = new Joystick(1);
    Jaguar jaguar = new Jaguar(3);
    Jaguar jag = new Jaguar(4);
    Compressor compressor = new Compressor(1, 1);
    Relay spike = new Relay(7);
    
    public void robotInit() {
        compressor.start();
    }

    public void autonomous(){ 
        chassis.setSafetyEnabled(false);
        chassis.drive (-0.5, 0.08);
        Timer.delay(2.0);
        chassis.drive (0, 0.0);
    }
    
    public void operatorControl() {
        chassis.setSafetyEnabled(true);
        while (isOperatorControl() && isEnabled()) {
            double speed = mainStick.getY();
            double rot = -mainStick.getX();
            chassis.arcadeDrive (speed, rot);

            // Solenoid
                spike.set(Relay.Value.kForward);
        }
    }
}
  #24   Spotlight this post!  
Unread 24-06-2014, 12:15
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Pneumatics system code

If I'm seeing that right, I think I found the issue. The Spike must be plugged into the Relay Ports on the Side Car. You have it plugged into the PWM ports.
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
  #25   Spotlight this post!  
Unread 24-06-2014, 12:21
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: Pneumatics system code

I rewired the solenoid and spike to the way that was suggested, and we checked the PWM cables and still no fix, the light is still red.

Could it maybe be the code? Can someone check that and reply back.
  #26   Spotlight this post!  
Unread 24-06-2014, 12:24
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Pneumatics system code

Red or Orange? If Red, that means it's working (and the colors in the guide I consulted were backwards).
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
  #27   Spotlight this post!  
Unread 24-06-2014, 12:26
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: Pneumatics system code

We plugged the spike into the Relay ports. But the light is still orange in the spike. Any suggestions

Last edited by Team 4939 : 24-06-2014 at 12:29.
  #28   Spotlight this post!  
Unread 24-06-2014, 12:30
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: Pneumatics system code

When we connect the spike to the Digital I/O the solenoid lights up, but the spike's lights turn off.
  #29   Spotlight this post!  
Unread 24-06-2014, 12:46
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: Pneumatics system code

When we put it into the Digital I/O and we move the wire around the light on the spike changes from green, to orange, to red for 2 seconds, and when we push the wire in all the way the spike has no color. And all this is without me turning on the driver station. The spike does not work when we plug in to the PWM section, or the relay section of the sidecar. We don't know where to go from here. Any help would be appreciated.
  #30   Spotlight this post!  
Unread 24-06-2014, 12:49
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Pneumatics system code

It needs to be plugged into the Rleay section. Lets go from there. By plugging it into the DIO, you're setting it to reverse, as the reverse pin in the Spike is getting the 5V from the DIO. Lets try setting it to reverse in code while it's on the relay panel.

Code:
    public void operatorControl() {
        chassis.setSafetyEnabled(true);
        while (isOperatorControl() && isEnabled()) {
            double speed = mainStick.getY();
            double rot = -mainStick.getX();
            chassis.arcadeDrive (speed, rot);

            // Solenoid
                spike.set(Relay.Value.kReverse);
        }
    }
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
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 22:43.

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