Go to Post If Andy asked y'all to stand on your head, would you do that, too? ;) - Madison [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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 15-02-2014, 01:20
DSSRobotics DSSRobotics is offline
Registered User
FRC #5031
 
Join Date: Jan 2014
Location: Canada
Posts: 5
DSSRobotics is an unknown quantity at this point
Exclamation [Urgent] Compressor Problem either Programming or Wiring technical problems

We've been dealing with this problem for some time now. The compressor won't enabled when the robot is turned on even when the compressor code has been deployed.

Our current Java code is:

/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.Compressor;

import edu.wpi.first.wpilibj.DoubleSolenoid;
/*
import edu.wpi.first.wpilibj.Encoder;
*/
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Victor;

/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the SimpleRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class RobotTemplate extends SimpleRobot {

RobotDrive drive = new RobotDrive(1, 2);
Joystick leftStick = new Joystick(1);//input from leftstick

Compressor compressor = new Compressor(5, 5);

DoubleSolenoid armSolenoid = new DoubleSolenoid(1, 2);
boolean shiftinggears = true;
boolean ispress9 = false;

boolean shiftingarms = true;
boolean ispress10 = false;

DoubleSolenoid ShiftingSolenoid = new DoubleSolenoid(3, 4);
/*



Encoder leftEncoder = new Encoder(1, 2);
Encoder rightEncoder = new Encoder(3, 4);
*/

Victor vex3 = new Victor(7); // (Motor for arms)
Victor motor = new Victor(8); // Shooter

/**
* This function is called once each time the robot enters autonomous mode.
*/
public void robotInit() {
compressor.start();
armSolenoid.set(DoubleSolenoid.Value.kReverse);
ShiftingSolenoid.set(DoubleSolenoid.Value.kReverse );

}

public void disabled() {
compressor.stop();

}

public void autonomous() {

/*
while(leftEncoder.getDistance() < 12)
{
driveForward();

}

leftEncoder.reset();


while(leftEncoder > - 3 && rightEncoder < 3);
*/
for (int i = 0; i < 300; i++) {
drive.drive(0.2, 0);

}
drive.drive(0, 0);

}

/**
* This function is called once each time the robot enters operator control.
*/
public void operatorControl() {
while (isOperatorControl() && isEnabled()) {
double left = leftStick.getRawAxis(5);
double right = leftStick.getRawAxis(2);
compressor.start();
drive.tankDrive(-left, -right); // driving with two joysticks. Wall is in the back and Pick up is in the front

if (leftStick.getRawButton(10) && !ispress10) {

if (shiftingarms) {
armSolenoid.set(DoubleSolenoid.Value.kForward);
shiftingarms = false;

} else {
armSolenoid.set(DoubleSolenoid.Value.kReverse);
shiftingarms = true;
}
}
ispress10 = leftStick.getRawButton(10);

if (leftStick.getRawButton(9) && !ispress9) {

if (shiftinggears) {
ShiftingSolenoid.set(DoubleSolenoid.Value.kForward );
shiftinggears = false;

} else {
ShiftingSolenoid.set(DoubleSolenoid.Value.kReverse );
shiftinggears = true;
}
}
ispress9 = leftStick.getRawButton(9);

if (leftStick.getRawButton(6)) {

vex3.set(-1.0);
} else {
vex3.set(0);
}

}
if (shiftingarms) {
vex3.set(1.0);
} else {
vex3.set(0);
}
}

public void test() {
}
}
/**
* This function is called once each time the robot enters test mode.
*/

In addition, we had an experienced programmer and mentor inspect our program and wiring but, they said there were no problems. I'm not sure if the program or wiring has a problem. If the program is wrong or there's a problem with the wiring please correct and guide us! Everything is working except the compressors being enable when the robot is turned on. Please help us and Thanks! P.S compressor will only charge when the battery is manually connected which, we obviously do not want.

Last edited by DSSRobotics : 15-02-2014 at 01:29.
  #2   Spotlight this post!  
Unread 15-02-2014, 01:21
NWChen's Avatar
NWChen NWChen is offline
Alum
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: New York City
Posts: 205
NWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to behold
Re: [Urgent] Compressor Problem either Programming or Wiring technical problems

Why is your
Code:
//compressor.start();
commented out in robotInit()? You need this to enable the compressor.

The way you have it in operatorControl(), the compressor will start every time you iterate through your while loop. Try moving this statement outside of the loop.

Ensure that your pressure switch is in DIO port 5 and your compressor relay is in Relay port 5.

Last edited by NWChen : 15-02-2014 at 01:27.
  #3   Spotlight this post!  
Unread 15-02-2014, 01:25
DSSRobotics DSSRobotics is offline
Registered User
FRC #5031
 
Join Date: Jan 2014
Location: Canada
Posts: 5
DSSRobotics is an unknown quantity at this point
Re: [Urgent] Compressor Problem either Programming or Wiring technical problems

My bad we tested the code without compressor.start() being commented. Thank you I'll edit that part so it does not confuse other people.

Last edited by DSSRobotics : 15-02-2014 at 01:27.
  #4   Spotlight this post!  
Unread 15-02-2014, 01:29
Rynocorn's Avatar
Rynocorn Rynocorn is offline
Strategist and Designer
AKA: Ryan Jacobs
FRC #1466 (Webb Robotics)
Team Role: Mechanical
 
Join Date: Mar 2013
Rookie Year: 2010
Location: Knoxville
Posts: 125
Rynocorn is on a distinguished road
Re: [Urgent] Compressor Problem either Programming or Wiring technical problems

I know 0 code but we had the same issue and took 4.5 hours to fix it. Try downloading the example compressor code from first and running that- if it works, than you have a code issue. If not, it's electrical.

Our issue turned out to be a combination of electrical and coding. Simple problem is that the pwm from the small blue rectangle box (sorry brain art on the name) to the spike might be plugged in the wrong slot. Also the pwm can be slightly bent in the spike-ours was mangled-like someone got an arm stuck in a blender.

Also, try shorting the circuit while the code is enabled by taking a wire and connecting it to each side of the little sensor that measures when the compressor should turn off. If that makes it work, than your issue is with that little nameless guy.

After trying some of these tests, repost on here with your results.
__________________
My favorite parts: Surgical tubing, Grab catches, churro tubing, and waffle tread.
  #5   Spotlight this post!  
Unread 15-02-2014, 01:32
DSSRobotics DSSRobotics is offline
Registered User
FRC #5031
 
Join Date: Jan 2014
Location: Canada
Posts: 5
DSSRobotics is an unknown quantity at this point
Re: [Urgent] Compressor Problem either Programming or Wiring technical problems

I apologize we're a rookie team so could you tell me where the sample code is located? Thanks
  #6   Spotlight this post!  
Unread 15-02-2014, 21:23
DSSRobotics DSSRobotics is offline
Registered User
FRC #5031
 
Join Date: Jan 2014
Location: Canada
Posts: 5
DSSRobotics is an unknown quantity at this point
Re: [Urgent] Compressor Problem either Programming or Wiring technical problems

Thanks for all the responses and help. We finally got the compressors to work. Thanks again!
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 14:59.

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