Go to Post "Yes, I'd like to Super Size my speed controller combo and add a jumbo distribution block, please." "You want fries with that?" - Travis Hoffman [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 02-12-2004, 15:47
fred's Avatar
fred fred is offline
More Grizzle
None #0341 (Daisy)
Team Role: Programmer
 
Join Date: Jan 2003
Location: Ambler
Posts: 132
fred is on a distinguished road
Help With Compressor Code

Hey! Our team is in need of code that will run a tank drive and a compressor for pneumatics. Any help and code would be appreciated, since we are new at pneumatics stuff. Thanks in advance.
__________________
"The distance between genius and insanity is measured only by success."

-Anonymous
  #2   Spotlight this post!  
Unread 02-12-2004, 16:12
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: Help With Compressor Code

The suggested code is simply to read a digital input from a pressure switch and copy its value out to a Spike wired up to the compressor. The pressure switch supplied in last year's kit of parts has two set points, turning on at about 95 PSI and off at about 115, so you don't have to worry about fancy programming unless you really want to.

I believe the default code wants the compressor on relay 8 and the switch on digital input 18, but don't take my word for it without checking first.

The default code is also already set up for tank drive. I don't remember which joystick inputs or pwm outputs it wants. Read the comments in the code; they are very helpful.
  #3   Spotlight this post!  
Unread 02-12-2004, 17:23
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Help With Compressor Code

if you dont want to just use the default code and would rather write it yourself to fully learn how it works, you can do something like this..

Put a line in the default routine that will call a function that will check the compressors pressure (whether the pressure switch is on or off).

If the switch's input goes high, turn on the compressor. Then when there is enough pressure the switch will change states and you can turn the compressor off.

In our program, we made "Compressor" an alias for a relay output (Relay 3 in our case), and "CompSwitch" an alias for the digital input the pressure switch was on. You can code these lines in the "user_routines.h" file with the syntax
Code:
#alias NewName    OldName
Our Compressor checking function looked like this.
Code:
void CheckComp(void)
{
	if(CompSwitch == 1)
	{
		Compressor  = 1;
	}
	else
	{
		Compressor = 0;
	}
}
  #4   Spotlight this post!  
Unread 04-12-2004, 19:16
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Help With Compressor Code

I didn't know #alias was a valid preprocessor directive. I thought it would be
Code:
#define NewName OldName
  #5   Spotlight this post!  
Unread 21-01-2005, 17:16
EOC's Avatar
EOC EOC is offline
Registered User
AKA: Eric Curry
None #1208 (Metool Brigade)
Team Role: Coach
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Illinois
Posts: 200
EOC has a brilliant futureEOC has a brilliant futureEOC has a brilliant futureEOC has a brilliant futureEOC has a brilliant futureEOC has a brilliant futureEOC has a brilliant futureEOC has a brilliant futureEOC has a brilliant futureEOC has a brilliant futureEOC has a brilliant future
Re: Help With Compressor Code

I tried checking the default code and I couldn't find the compressor code. Where is it exactly? I'm new at this.
  #6   Spotlight this post!  
Unread 21-01-2005, 17:32
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Help With Compressor Code

Quote:
Originally Posted by EOC
I tried checking the default code and I couldn't find the compressor code. Where is it exactly? I'm new at this.
Line 353 of the newest version of user_routines.c. Its only one line so its easy to miss. Requires the compressor to be connected to relay output 8 and the pressure switch to digital input 18.

Code:
relay8_fwd = !rc_dig_in18;  /* Power pump only if pressure switch is off. */
  #7   Spotlight this post!  
Unread 21-01-2005, 17:40
M. Hicken's Avatar
M. Hicken M. Hicken is offline
Where am I?
AKA: I AM PACO
#0219 (Team Impact)
Team Role: Driver
 
Join Date: Jan 2004
Rookie Year: 2002
Location: Washington, NJ
Posts: 158
M. Hicken is a jewel in the roughM. Hicken is a jewel in the roughM. Hicken is a jewel in the rough
Send a message via AIM to M. Hicken
Re: Help With Compressor Code

I hate to be the search NAZI but please attempt to read through the search results. I started a thread almost identical to this one last week.

Sorry for ranting, but i see the mod's point


Marcus
__________________
If duct tape isnt the answer you're looking for, you're asking the wrong question

There is no such thing as a stupid question, there are just a lot of inquisitive idiots
Personal rookie year: 2002
Team Impact 219: 1998
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 04:33.

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