Go to Post Coming between me and my Hawaiian shirts would be like trying to get between Dean and denim. - dlavery [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 25-02-2004, 11:54
KWalsh KWalsh is offline
Registered User
#1191
 
Join Date: Feb 2004
Location: Pittsburgh
Posts: 14
KWalsh is an unknown quantity at this point
More Programming Help!

How might I go about altering the default code so that the Pump is set to always on (or as last year, always forward) can someone help me? The pump wont even turn on...
  #2   Spotlight this post!  
Unread 25-02-2004, 12:08
Random Dude Random Dude is offline
Oregon State Head FTA
AKA: Chris
no team (Oregon Robotics Tournament & Outreach Program)
 
Join Date: Aug 2002
Rookie Year: 1998
Location: Oregon
Posts: 142
Random Dude will become famous soon enoughRandom Dude will become famous soon enough
Re: More Programming Help!

Quote:
Originally Posted by KWalsh
How might I go about altering the default code so that the Pump is set to always on (or as last year, always forward) can someone help me? The pump wont even turn on...

Actually, the relevant code is already in there. Just connect the pump to Relay 8, and the pressure switch to digital input 18.

The line of code that controlls the pump is

relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */
  #3   Spotlight this post!  
Unread 25-02-2004, 12:12
unclear_physics's Avatar
unclear_physics unclear_physics is offline
SW Engineer/Physicist
AKA: Richard Neese
#0147 (Deep Thunder)
Team Role: Engineer
 
Join Date: Jan 2004
Location: St. Petersburg, FL
Posts: 5
unclear_physics is an unknown quantity at this point
Re: More Programming Help!

Assuming that you use Relay 1 (you can change this depending on the relay that you use) and you put the red lead of the pump to the M+ leg of the relay and the black lead to the M- leg of the relay, issue the following command to turn on the pump all of the time:

relay1_rev = 1;
relay1_fwd = 0;

This must be in your version of the Default_Routine or whatever you use that gets called everytime thru the 26.2 msec loop.

If you want the pressure switch to control the pump, take a pwm cable, cut off the male end, and wire the signal line (white wire) to one side of the switch and the ground line (the black wire) to the other side of the switch. Don't connect the red wire. Just cut it back and electrical tape the end. Then plug the end with the female connector into a free digital input, say for example digital input 7. Then the following logic will turn the pump off when the switch closes at 115 PSI and turns it on when the switch opens at about 95 PSI:

if (!rc_dig_in07) // don't forget the exclamation point
{
relay1_rev = 1;
relay1_fwd = 0;
}

The exclamation point means the complement (or not). This is because the
pressure switch is normally opened and when the switch closes the value on
rc_dig_in07 will go to ground which is 0 in the code. And !0 = 1, so your pump turns on. When the switch opens, the value goes to 1, and !1 = 0, so
your pump turns off.

Hope this helps.
  #4   Spotlight this post!  
Unread 25-02-2004, 12:17
unclear_physics's Avatar
unclear_physics unclear_physics is offline
SW Engineer/Physicist
AKA: Richard Neese
#0147 (Deep Thunder)
Team Role: Engineer
 
Join Date: Jan 2004
Location: St. Petersburg, FL
Posts: 5
unclear_physics is an unknown quantity at this point
Re: More Programming Help!

By the way, your relay light should turn green when the pump is on. Also, make sure that your pressure switch isn't on the other side of the 60 PSI regulator or your pump will never turn on. Also, be a little careful of switching the leads on the pump because the pump might not like the wrong polarity (it wants +12v on the red wire) which could cause the pressure switch to "stick" inside until you put positive pressure on it.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming Compatition Angela06 Programming 30 08-04-2005 23:12
A few questions on programming the Control System Avarik Control System 21 08-02-2004 11:42
Pneumatics electrical wiring and programming archiver 2001 1 23-06-2002 23:10
Error found in programming for the pump and pressure switch sjharobotics Programming 4 06-02-2002 17:46
pbasic programming punarhero Programming 4 21-01-2002 23:32


All times are GMT -5. The time now is 07:41.

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