We go together like a Drill motor, reduced by 3.6:1, and a CIM motor.
Home
Go Back   Chief Delphi > FIRST > General Forum
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 16-02-2009, 11:35
T3H_K3YM45T3R's Avatar
T3H_K3YM45T3R T3H_K3YM45T3R is offline
Registered User
AKA: Christopher Robinson
FRC #1737 (Project X)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Excelsior Springs, Mo
Posts: 23
T3H_K3YM45T3R is an unknown quantity at this point
need help with compressor code

my team is having trouble with getting our compressor running. We have tried several different ways to program it, we have tried just the basic code like people have been posting on other threads like this and none of them have worked.

I'll try to get some screenshots of the code up in a little bit.
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2009, 12:27
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,113
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: need help with compressor code

Along with your code, please describe in detail how you have the compressor and pressure switch electrically connected to the control system. There are half a dozen ways to get it subtly wrong, and any number of ways to do it completely wrong.
Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2009, 12:45
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: need help with compressor code

C++ or LabView???

For C++, you need three lines of code:

// put as part of your robot class or global, not in function
Compressor *compressor;

// in constructor [alter Compressor() parameters to match your setup]
compressor = new Compressor( PressureSwitchChannel, CompressorRelayChannel );
compressor->Start();

If you have this in, you should see the green LED for the compressor relay light on the Sidecar. If lit, the compressor relay should be energized and the compressor should run. Also, the PressureSwitch digital input needs to be wired up correctly. Make sure port numbers are correct for both relay and pressure switch.

Two things to check:
1) Make sure you have a good PWM cable going to the compressor relay. They are notoriously bad.
2) Make sure the PWM cables are plugged in correctly. With the new digital sidecar, it is very easy to plug them in one pin off.

If the Relay LED on the sidecar that matches your compressor relay is green and the compressor is not running, a PWM cable issue is usually the problem.

Even if you have LabView (I can't help you there) all the non-code issues I mentioned are still valid.

Steve C.
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2009, 12:49
T3H_K3YM45T3R's Avatar
T3H_K3YM45T3R T3H_K3YM45T3R is offline
Registered User
AKA: Christopher Robinson
FRC #1737 (Project X)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Excelsior Springs, Mo
Posts: 23
T3H_K3YM45T3R is an unknown quantity at this point
Re: need help with compressor code

here is a link to an image of the code, sorry it's a link and not an attachment, it was the fastest way for me to get the whole thing up.

http://www.firstwiki.net/media/2/2d/1737_robot_code.jpg




now for the way we have the compressor and relay electrically connected: we have the main power connected to the "12v" side and the output is hooked up to the m+ and m- side of the spike. the pwm cable is plugged in with the black wire (ground) closest to the fuse on the spike. we have the pressure switch wired with a pwm cable, the signal (white) and the ground (black) with the red (power) not connected to anything, that cable is plugged into the 1st slot on the digital sidecar "Digital I/O" section.
The spike is plugged into the 1st relay spot on the digital sidecar.

we are sure that me have the spike wired correctly, if we take the pwm cable from the spike and place it in the DIO as apposed to the relay spot it will allow the compressor to run and keep filling until you remove the wire. also when we fill the tanks when it gets up to about 115-120psig you can see the pressure switch close on the main dashboard.

...and thanks for the help on this problem, Team 1737 is very grateful for it.
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2009, 13:01
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: need help with compressor code

ok, well, as far as i can see you are doing it right (at least if i followed those messy wires correctly), but im sorta baffled why you didnt use the enums to specify the dio, the slot, and the relay port. I think that may be where your problem is stepping in.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2009, 13:14
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,113
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: need help with compressor code

See all those red dots on your Compressor Open VI? They're telling you something. You can't always use an integer when an enumerated type is expected. Something is probably off by one from what you think you're telling it.

Delete those integer constants (remembering what they are, of course). Right-click on each input of the VI and choose "Create constant" from the pop-up menu. Then you can choose the correct relay number and module number and Digital I/O number from the enumerated constants that appear.
Reply With Quote
  #7   Spotlight this post!  
Unread 16-02-2009, 13:50
T3H_K3YM45T3R's Avatar
T3H_K3YM45T3R T3H_K3YM45T3R is offline
Registered User
AKA: Christopher Robinson
FRC #1737 (Project X)
Team Role: Programmer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Excelsior Springs, Mo
Posts: 23
T3H_K3YM45T3R is an unknown quantity at this point
Re: need help with compressor code

replacing the integers with the constants worked, thank you very much 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with code. hawk_11 Programming 6 06-02-2005 13:56
Help With Compressor Code fred Programming 6 21-01-2005 17:40
Need help with my code jaywion Programming 9 20-03-2004 11:32
hey need some help with writing a code please help me here magical hands Programming 9 01-01-2004 21:46
NEED HELP with Delay loop for compressor relay switch archiver 2001 10 24-06-2002 02:11


All times are GMT -5. The time now is 08:05.

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