|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Compressor won't start
For some reason, our compressor won't start when the code deploys fine, and we have the compressor and pressure gauge switch hooked up correctly ( I think). The compressor should start soon as the robot is turned on correct? The compressor for us doesn't even start even if we enable teleops in the DS. Any help will be appreciated. I may be missing a simple step, so if anybody has an idea, please give suggestions. Here is the code btw:
Code:
#include "WPILib.h"
#include "Vision/AxisCamera2010.h"
#include "Vision/HSLImage.h"
#include "PIDController.h"
#include "Gyro.h"
#include "Target.h"
#include "DashboardDataSender.h"
//#define MINIMUM_SCORE 0.01
/**
* This is a demo program showing the use of the RobotBase class.
* The SimpleRobot class is the base of a robot application that will automatically call your
* Autonomous and OperatorControl methods at the right time as controlled by the switches on
* the driver station or the field controls.
*/
bool moveState = false;
class RobotDemo : public SimpleRobot
{
RobotDrive myRobot; // robot drive system
Joystick stick; // only joystick
Jaguar leftMotors;
Jaguar rightMotors;
Compressor compressor;
Relay relay;
//DashboardDataSender *dds;
//Gyro *gyro;
//PIDOutput *pidOutput;
public:
RobotDemo(void):
myRobot(3, 4), // these must be initialized in the same order
stick(1), // as they are declared above.
leftMotors(1),
rightMotors(2),
compressor(4,2)
{
//start the compressor
compressor.Start();
AxisCamera &camera = AxisCamera::getInstance();
//dds = new DashboardDataSender();
//gyro = new Gyro(1);
//pidOutput = new SamplePIDOutput(myRobot);
GetWatchdog().SetExpiration(0.1);
}
/**
* Drive left & right motors for 2 seconds then stop
*/
void Autonomous(void)
{
GetWatchdog().SetEnabled(false);
myRobot.Drive(0.5, 0.0); // drive forwards half speed
Wait(2.0); // for 2 seconds
myRobot.Drive(0.0, 0.0); // stop robot
}
/**
* Runs the motors with arcade steering.
*/
void OperatorControl(void)
{
GetWatchdog().SetEnabled(true);
while (IsOperatorControl())
{
GetWatchdog().Feed();
//myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
if(stick.GetRawButton(1))
{
moveState = 0;
}
if(stick.GetRawButton(3))
{
moveState = 1;
}
if(moveState == false)
{
//do nothing
}
if(moveState == true)
{
leftMotors.Set(-stick.GetY());
rightMotors.Set(stick.GetZ());
Wait(0.005);
}
// Create and set up a camera instance. first wait for the camera to start
// if the robot was just powered on. This gives the camera time to boot.
//Wait(10.0);
//printf("Getting camera instance\n");
}
}
};
START_ROBOT_CLASS(RobotDemo);
ken |
|
#2
|
||||
|
||||
|
Re: Compressor won't start
As far as I know, the WPILib kills any and all attempts to supply power to *anything* when the Watchdog hasn't been fed, or the robot is disabled. Try setting the compressor to start when Teleop is enabled.
Good luck. ![]() |
|
#3
|
|||
|
|||
|
Re: Compressor won't start
I tried the method above and no success. I have also connected to the netconsole, and there seems to be no errors. I need help guys xP
|
|
#4
|
|||
|
|||
|
Re: Compressor won't start
Are you sure it's not a wiring problem? Is the Spike powered by +12V and connected to the correct Relay output? Is there a breaker in the distribution board? Is the sidecar powered? Does the compressor turn on if it's connected direct to +12V? The code seems fine to me.
The pressure switch shouldn't be a problem, because the compressor will turn on even if that's disconnected. |
|
#5
|
|||
|
|||
|
Re: Compressor won't start
I'm quite sure everything is wired correctly. The solenoids etc are currently not wired, but the compressor is attached to the spike relay. the spike has power and the pwm is in relay 1. The pressure guage is plugged into digital 1. If it helps I tried using the GetPressureSwitchValue() function, and I only get the readings of 0 or 1, unless that is normal. We tried running the compressor directly from the battery to see if the readings will change, but no change.
|
|
#6
|
|||
|
|||
|
Re: Compressor won't start
Quote:
Code:
compressor(4,2) |
|
#7
|
|||
|
|||
|
Re: Compressor won't start
Quote:
I know you can run the compressor using the relay class, but I also know that using the compressor class simplifies things a lot, so I want to avoid that. |
|
#8
|
|||
|
|||
|
Re: Compressor won't start
Quote:
The software turns the compressor on even if the pressure switch is not wired. It's one less thing to go wrong when you are first testing, but you must use the pressure switch after things are working. Leave the selected digital port unconnected for now, just to be sure it's not preventing the compressor from turning on. As you suggested, I would try using the Relay class next. Something like this, untested: Code:
Relay *m_relay_1; ... m_relay_1 = new Relay(1); m_relay_1->SetDirection(Relay::kForwardOnly); m_relay_1->Set(Relay::kOn); |
|
#9
|
|||
|
|||
|
Re: Compressor won't start
Quote:
|
|
#10
|
|||
|
|||
|
Re: Compressor won't start
ok, I just tried it and the compressor did not run. Is it suppose to run when I turn on the robot or when I enable teleops? It did not work either way anyways. I'm assuming there is a problem with the wiring then?
|
|
#11
|
|||
|
|||
|
Re: Compressor won't start
bump. I still can't get the compressor running :3. Should the relay port on the sidecar's LED (the 2 things on the side), should one of them be on when the compressor is in operation? I remember it being on berfore, but is not on right now.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compressor won't start | Alex_2487 | C/C++ | 6 | 12-02-2009 16:41 |
| Wind River won't start | radau | C/C++ | 6 | 19-01-2009 23:09 |
| Won't Download! | diaperrash89 | Programming | 4 | 25-10-2007 23:02 |
| Running just the compressor (was: free compressor) | sciguy125 | Pneumatics | 15 | 06-02-2006 18:23 |
| Help! My 2003 Bot compressor won't shut off | Jack21 | Control System | 10 | 11-02-2004 12:24 |