Go to Post On a side note... "Think outside the robot." - I kinda like that. I'll have to use that in a meeting someday.... - Not2B [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 02-10-2009, 03:16 PM
Alex_2487 Alex_2487 is offline
Registered User
AKA: Alex Korpi
no team
Team Role: Alumni
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Sayville, New York
Posts: 31
Alex_2487 is an unknown quantity at this point
Send a message via AIM to Alex_2487
Compressor won't start

i'm using this code and everytihng works on our robot but the compressor won't start. here is my code any help would be appreciated. thanks in advanced

Quote:
//************************************************** *************************
//2009 Sayville High School Robotics Code
//Uses a 2 motor tank drive system with 2 sim motors wired to jaguars
//has a front roller using a cut in half fisherprice motor wired to a victor
//has a beater bar system power by 1 sim motor wired to a victor
//has a compressor which uses standard compressor class to run during match
//has 2 solenoid that on run together with a pully system used to dump balls
//drive joysticks are standard usb joysticks fron kit of parts
//third joystick is used to control frontroller,beatbars,and both solenoids
//************************************************** ***********************
//INPUTS
//
//left drive motor(jaguar) - pwm1
//right drive motor(jaguar) - pwm2
//beater bars(victor) - pwm3
//front roller(victor) - pwm4
//Compressor1 - spike relay(relay1),pressure switch (digitalinput1)
//Solenoid 1 -solenoid 1
//Solenoid 2 - solenoid 2
//Left Joystick - USB 1
//Right Joystick - USB 2
//************************************************** ***********************
//NOTES
//
//victor can only run as slow as 10%
//jaguars can run as slow as 3%
//drive function is (speed,turn)
//setleftmotorrightmotorspeed function is (leftmotor,rightmotor)
//instead of speeds being 0 to 255(binary) speed has been normalized to be -1.0 to 1.0
//************************************************** **********************

#include "WPILib.h" // include the WPI robotics library

class RobotDemo : public SimpleRobot //class being used is simple robot
//Global Varaibles
{
RobotDrive myRobot; //Robot Drive defines the 2 drive motors
Joystick LeftJoystick; // Defines Leftjoystick
Joystick RightJoystick; // Defines RightJoystick
Joystick ThirdJoystick; // Defines Thirdjoystick
Compressor *Compressor1; // Defines compressor
Solenoid *Solenoid1,*Solenoid2; // Defines Both soleoinds
Victor *FrontRoller, *BeaterBars; // Defines FrontRoller and BeaterBars

public:


RobotDemo(void): // inizalation code
myRobot(1, 2), // drive motors are in pwm 1 and 2
LeftJoystick(1), // leftjoystick in usb port 1
RightJoystick(2), // rightjoystick in usb port 2
ThirdJoystick(3) // thirdjoystick in usb port 3
{
GetWatchdog().SetExpiration(100);
Compressor1 = new Compressor(1, 1); // compressor spike is in realy 1 and pressure switch is in digital input 1
Compressor1->Start(); // compressor will run when not fill during autonomous and operator control mode
Solenoid1 = new Solenoid(1); // solenoid1 is in solenoid module port 1
Solenoid2 = new Solenoid(2); // solenoid2 is in solenoid module port 2
FrontRoller = new Victor(3); // front roller motor in pwm 3
BeaterBars = new Victor(4); // beater bar motor in pwm 4
}

void Autonomous(void) //start of autonomous
{
GetWatchdog().SetEnabled(false); //watchdog is disabled durning autonomous
myRobot.SetLeftRightMotorSpeeds(1.0, 1.0);
Wait(2.0);
myRobot.SetLeftRightMotorSpeeds(-1.0, 1.0);
Wait(2.0);
myRobot.SetLeftRightMotorSpeeds(1.0,0.0);
Wait(2.0);
myRobot.SetLeftRightMotorSpeeds(0.0,0.0);
}


void OperatorControl(void) //start operator control
{
GetWatchdog().SetEnabled(true); // watchdog is enabled during operator control mode
while (IsOperatorControl())
{
GetWatchdog().Feed();
myRobot.TankDrive(LeftJoystick,RightJoystick); //2 Motor Tank Drive
{
{
if (ThirdJoystick.GetRawButton (1)==1 ) //if leftjoystick button 1(trigger) is click
{
Solenoid1->Set(true); // then solenoid1 will be out
Solenoid2->Set(true); // and solenoid2 will be out
}
else // if button 1(trigger) is not pressed
{
Solenoid1->Set(false); // solenoid1 will be in
Solenoid2->Set(false); // and solenoid2 will be in
}
}
{
if (ThirdJoystick.GetRawButton (3)==1 ) {
BeaterBars->Set(0.0); }
else
{
BeaterBars->Set(1.0); }
}
{
if (ThirdJoystick.GetRawButton (5)==1 ) {
FrontRoller->Set(0.0); }
else
{
FrontRoller->Set(1.0); }
}
}
}
}
};

START_ROBOT_CLASS(RobotDemo); // start robot class and starup library(run program)
__________________
Events
2009 SBPLI Long Island Regional
2008 Deer Park Invitational, Championships- Galileo Division, SBPLI Long Island Regional
Awards
2009 Long Island Semifinalists
2008 Deer Park Invitational Finalist (353,1546), Long Island Regional Champion (2010,102),Highest Rookie Seed, Rookie Inspiration, Best Website, Website Excellence Award
2009 Record(2487): 5-9-1
2008 Record(2487): 23-10-3
Overall Record(2487): 27-19-4
www.wbsts.com/gnomes.html
Reply With Quote
  #2   Spotlight this post!  
Unread 02-10-2009, 03:28 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Compressor won't start

Try putting a manual switch on Digital Input 1 to rule out a problem with the pressure switch.

You do have the compressor's Spike connected to the Relay 1 pins on the Digital Sidecar, right? Watch the LEDs for that relay output to see if they are changing as you expect.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-10-2009, 03:42 PM
Alex_2487 Alex_2487 is offline
Registered User
AKA: Alex Korpi
no team
Team Role: Alumni
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Sayville, New York
Posts: 31
Alex_2487 is an unknown quantity at this point
Send a message via AIM to Alex_2487
Re: Compressor won't start

Quote:
Originally Posted by Alan Anderson View Post
Try putting a manual switch on Digital Input 1 to rule out a problem with the pressure switch.

You do have the compressor's Spike connected to the Relay 1 pins on the Digital Sidecar, right? Watch the LEDs for that relay output to see if they are changing as you expect.
We have the spike connected to relay 1 on the sidecard. i'll take a look at the lights and try using a manual switch. also the compressor works when plugged into a battery.
__________________
Events
2009 SBPLI Long Island Regional
2008 Deer Park Invitational, Championships- Galileo Division, SBPLI Long Island Regional
Awards
2009 Long Island Semifinalists
2008 Deer Park Invitational Finalist (353,1546), Long Island Regional Champion (2010,102),Highest Rookie Seed, Rookie Inspiration, Best Website, Website Excellence Award
2009 Record(2487): 5-9-1
2008 Record(2487): 23-10-3
Overall Record(2487): 27-19-4
www.wbsts.com/gnomes.html
Reply With Quote
  #4   Spotlight this post!  
Unread 02-12-2009, 12:26 PM
Alex_2487 Alex_2487 is offline
Registered User
AKA: Alex Korpi
no team
Team Role: Alumni
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Sayville, New York
Posts: 31
Alex_2487 is an unknown quantity at this point
Send a message via AIM to Alex_2487
Re: Compressor won't start

the led lights on the relay change when u use a switch instead of the pressure switch but the compressor still wont start.
__________________
Events
2009 SBPLI Long Island Regional
2008 Deer Park Invitational, Championships- Galileo Division, SBPLI Long Island Regional
Awards
2009 Long Island Semifinalists
2008 Deer Park Invitational Finalist (353,1546), Long Island Regional Champion (2010,102),Highest Rookie Seed, Rookie Inspiration, Best Website, Website Excellence Award
2009 Record(2487): 5-9-1
2008 Record(2487): 23-10-3
Overall Record(2487): 27-19-4
www.wbsts.com/gnomes.html
Reply With Quote
  #5   Spotlight this post!  
Unread 02-12-2009, 01:28 PM
Kruuzr Kruuzr is offline
Mentor - electrical, software
AKA: Steve Cote
FRC #1922 (Ozram)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Henniker, NH
Posts: 33
Kruuzr has a spectacular aura aboutKruuzr has a spectacular aura about
Re: Compressor won't start

Make sure that the PWM cable for the spike relay is not plugged in 1 pin off on the digital sidecar. If you don't shave off the little tab on the side of the new PWM cables, it is almost impossible to plug them in right. And even if you do shave it off, it's an easy mistake. Let's just say I'm telling you this from experience

Also, make sure you have the polarity of the power wires going into the compressor spike correct. If the LED on the DSC lights and the compressor doesn't come on, it's either a)bad DSC, 2)bad/wrongly installed PWM cable, 3) bad/miswired Spike.

Steve C.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-12-2009, 04:03 PM
Alex_2487 Alex_2487 is offline
Registered User
AKA: Alex Korpi
no team
Team Role: Alumni
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Sayville, New York
Posts: 31
Alex_2487 is an unknown quantity at this point
Send a message via AIM to Alex_2487
Re: Compressor won't start

all the lights on the spike don't turn on. we are having the same promblem with our solenoids too. we wired them to spike like last years.
__________________
Events
2009 SBPLI Long Island Regional
2008 Deer Park Invitational, Championships- Galileo Division, SBPLI Long Island Regional
Awards
2009 Long Island Semifinalists
2008 Deer Park Invitational Finalist (353,1546), Long Island Regional Champion (2010,102),Highest Rookie Seed, Rookie Inspiration, Best Website, Website Excellence Award
2009 Record(2487): 5-9-1
2008 Record(2487): 23-10-3
Overall Record(2487): 27-19-4
www.wbsts.com/gnomes.html
Reply With Quote
  #7   Spotlight this post!  
Unread 02-12-2009, 04:41 PM
Alex_2487 Alex_2487 is offline
Registered User
AKA: Alex Korpi
no team
Team Role: Alumni
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Sayville, New York
Posts: 31
Alex_2487 is an unknown quantity at this point
Send a message via AIM to Alex_2487
Re: Compressor won't start

thanks for all the help. it turns out the relay ports on our digital sidecard didnt work and we had a bad fuse
__________________
Events
2009 SBPLI Long Island Regional
2008 Deer Park Invitational, Championships- Galileo Division, SBPLI Long Island Regional
Awards
2009 Long Island Semifinalists
2008 Deer Park Invitational Finalist (353,1546), Long Island Regional Champion (2010,102),Highest Rookie Seed, Rookie Inspiration, Best Website, Website Excellence Award
2009 Record(2487): 5-9-1
2008 Record(2487): 23-10-3
Overall Record(2487): 27-19-4
www.wbsts.com/gnomes.html
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind River won't start radau C/C++ 6 01-19-2009 11:09 PM
Won't Download! diaperrash89 Programming 4 10-25-2007 11:02 PM
It won't build anymore cgront Programming 3 02-02-2007 05:26 PM
Running just the compressor (was: free compressor) sciguy125 Pneumatics 15 02-06-2006 06:23 PM
Help! My 2003 Bot compressor won't shut off Jack21 Control System 10 02-11-2004 12:24 PM


All times are GMT -5. The time now is 10:55 AM.

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