Go to Post It's cool when good things happen to good people. :) - Rich Kressly [more]
Home
Go Back   Chief Delphi > Old Forum Archives > 2001
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 24-06-2002, 02:10
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
NEED HELP with Delay loop for compressor relay switch

Posted by Erik at 03/12/2001 11:54 AM EST


Engineer on team #381, Trenton Tornados, from Trenton High School and Princeton University.



I am trying to write a delay loop in the default program for the robot controller, and I would like to know if anyone can help me understand how to turn off the relay switch by setting it to 1 or 0. what I really want to know is how to put in a delay using a conditional statement I suppose. Code snippets would be much appreciated. I think I have the idea but here is my pseudocode:

delay VAR word
delay = 0;

mainloop{

when switch opens up then{
delay = delay + 1;
if delay
__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #2   Spotlight this post!  
Unread 24-06-2002, 02:10
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: NEED HELP with Delay loop for compressor relay switch

Posted by Scott Strickland at 03/12/2001 12:01 PM EST


Engineer on team #21, ComBBAT, from Astronaut & Titusville High School and Boeing/NASA.


In Reply to: NEED HELP with Delay loop for compressor relay switch
Posted by Erik on 03/12/2001 11:54 AM EST:



Not sure exactly if this is a help and I am not the programmer on the team...

We wanted our compressor to be off when we first started the match so our arm would stay up. At the end of the match we wanted it to stay down. To do this we programmed it so the compressor would come on when the button for actuating the cylinders is first pushed. As soon as the operator pushes the button (at the start of the match) the compressor comes on and the arm goes down. After that, whenever the operator pushes the button it actuates the cylinders.

Hope this helps, it may be easier than putting in an if/than statement.

Scott


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #3   Spotlight this post!  
Unread 24-06-2002, 02:10
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Try this...

Posted by Joe Johnson at 03/12/2001 12:57 PM EST


Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.


In Reply to: NEED HELP with Delay loop for compressor relay switch
Posted by Erik on 03/12/2001 11:54 AM EST:



pressure var rc_swX.bitX
pump_on var relayX.bitX
DELAY_COUNT CON 40
cnt var byte
'assumes delta_t is used

cnt = 0

mainloop:

'get data from master CPU

cnt = (cnt + delta_t) * (1 - pressure) MAX DELAY_COUNT
if (pressure = 1) or (cnt
__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #4   Spotlight this post!  
Unread 24-06-2002, 02:10
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: NEED HELP with Delay loop for compressor relay switch

Posted by Mike Gray at 03/12/2001 2:20 PM EST


Engineer on team HOT from Huron Valley Schools sponsored by GM Milford Proving Ground.


In Reply to: NEED HELP with Delay loop for compressor relay switch
Posted by Erik on 03/12/2001 11:54 AM EST:



Here's one way to do it. Simple, and uses only one byte.

First declare a new variable and initialize it:

compdelay var byte
compdelay=1

Set the upper limit constant
complimit con 30


Increment or decrement the variable as a function of rc_sw1 (or whatever input you use).

compdelay=compdelay+rc_sw1 - (1-rc_sw1) min 1 max
complimit

Then add a LOOKDOWN table to the main loop:
lookdown compdelay,
__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #5   Spotlight this post!  
Unread 24-06-2002, 02:10
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Question on Digital Pressure Switch

Posted by Adrian Wong at 03/12/2001 9:06 PM EST


Student on team #596, Hopkinton Hillers, from Hopkinton High School and Zymark & Computer Associates.


In Reply to: NEED HELP with Delay loop for compressor relay switch
Posted by Erik on 03/12/2001 11:54 AM EST:



Does it trip at a certain PSI (on/off) or does it turn on at a 'low' PSI and then turn off at a 'high' PSI?

I recall reading some material on this, but I can't remember the exact wording or the location of the document. It said something to the effect that the switch turns on when it hits a 'low' PSI, such as 110, and then turns off at a 'high' PSI, such as 120. The pressure can be adjusted, but the range between the high and low is the same.

Am I dreaming things up?


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #6   Spotlight this post!  
Unread 24-06-2002, 02:10
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
1 if low pressure 0 if high pressure

Posted by Joe Johnson at 03/12/2001 9:35 PM EST


Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.


In Reply to: Question on Digital Pressure Switch
Posted by Adrian Wong on 03/12/2001 9:06 PM EST:



The switch is just a simple on or off based on the
pressure screw setting (set to approx. 110psi as
shipped as I recall).

The switch does not turn off if very low, then on if in
a mid-range, then off again for higher.

As I recall, the switch provides the PBASIC with a 1
when below XXX psi and turns to a 0 when above that
psi. There is a slight hysterisis (spelling?) which
means that it turns off at say 110 psi but then does
not turn on again until it gets below 105 psi. In many
cases this is a very anoying feature, but in this case,
it is nice because the pump not sit and cycle off-on
at the make-break point.

In fact, I wish there was MORE hysterisis in the switch
and then all this talk about a delay in the PBASIC code
would be unnecessary.

Joe J.


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #7   Spotlight this post!  
Unread 24-06-2002, 02:10
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Re: 1 if low pressure 0 if high pressure

Posted by Adrian Wong at 03/12/2001 10:00 PM EST


Student on team #596, Hopkinton Hillers, from Hopkinton High School and Zymark & Computer Associates.


In Reply to: 1 if low pressure 0 if high pressure
Posted by Joe Johnson on 03/12/2001 9:35 PM EST:



: As I recall, the switch provides the PBASIC with a 1
: when below XXX psi and turns to a 0 when above that
: psi. There is a slight hysterisis (spelling?) which
: means that it turns off at say 110 psi but then does
: not turn on again until it gets below 105 psi. In many
: cases this is a very anoying feature, but in this case,
: it is nice because the pump not sit and cycle off-on
: at the make-break point.

Ah, this is exactly what I am talking about. Thanks! (Hysteresis, that was the word I was looking for to describe it.)

Thanks again!

(Note: Finally resolved the PBASIC code for triggering the air compressor to the following that uses an XOR logic to provide the operator with an override in case you'd want to conserve power when the compressor is on or need extra pressure for some odd reason -> relay3_fwd = rc_sw2 ^ p1_sw_top)


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #8   Spotlight this post!  
Unread 24-06-2002, 02:11
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
How many teams are using a delay?

Posted by Gary Bonner at 03/12/2001 9:12 PM EST


Other on team #433, Firebirds, from Mount Saint Joseph Academy and SCT Corp., FMC Corp..


In Reply to: NEED HELP with Delay loop for compressor relay switch
Posted by Erik on 03/12/2001 11:54 AM EST:



We were going to put a delay in our program, but the compressor didn't seem to cycle that much, so we didn't bother. Anybody else do it this way?


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #9   Spotlight this post!  
Unread 24-06-2002, 02:11
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Had one, took it out to save code space...

Posted by Joe Johnson at 03/12/2001 9:48 PM EST


Engineer on team #47, Chief Delphi, from Pontiac Central High School and Delphi Automotive Systems.


In Reply to: How many teams are using a delay?
Posted by Gary Bonner on 03/12/2001 9:12 PM EST:



I had a very elegant delay code that used all kinds of
cool CS type stuff. Then we ran out of code space.

The code was commented out before you could say, "I am
downloading new code, wait... ...okay, hit th robot
reset button" ;-)

Our pump code is the following line:

pump_on = pressure

where pump_on is an alias for the proper relay bit and
pressure is an alias for the proper robot controller
switch bit.

The code works fine as far as we can tell. It helps if
your pneumantics don't have any leaks (it tends to
cycle on/off more as it shuts off if you have leaks).

Joe J.



__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #10   Spotlight this post!  
Unread 24-06-2002, 02:11
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
Hysteresis band is good.

Posted by Mike Gray at 03/13/2001 7:41 AM EST


Engineer on team HOT from Huron Valley Schools sponsored by GM Milford Proving Ground.


In Reply to: How many teams are using a delay?
Posted by Gary Bonner on 03/12/2001 9:12 PM EST:



We didn't have a delay initially. We've blown two fuses at random intervals. My theory is that low battery voltage, coupled with starting the compressor against a pressure head, cause the 20A fuse to blow sometimes.

Adjusting the set point to 100psi didn't help.





__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
  #11   Spotlight this post!  
Unread 24-06-2002, 02:11
archiver archiver is offline
Forum Archival System
#0047 (ChiefDelphi)
 
Join Date: May 2001
Location: Pontiac, MI
Posts: 21,214
archiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond reputearchiver has a reputation beyond repute
We are.

Posted by Gregory Ross at 03/14/2001 5:23 PM EST


Engineer on team #330, Beach Bots, from Hope Chapel Academy and NASA/JPL.


In Reply to: How many teams are using a delay?
Posted by Gary Bonner on 03/12/2001 9:12 PM EST:



Since the compressor draws a lot of current when it starts up, and our drive motors draw a lot when we are turning, we have both a turn-off delay AND some logic to prevent the compressor from starting up when the robot is turning.


__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
 


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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Actual execution time measurement Dan Technical Discussion 5 24-03-2003 11:36
spike for pressure switch? Rob Colatutto Rules/Strategy 4 23-02-2003 15:42
Using a switch before autonomous operation KZos550 Programming 11 04-02-2003 19:12
1 or 2 phase switch archiver 2001 0 24-06-2002 00:48
Need help with 255 Variable Joseph F Programming 18 26-02-2002 14:49


All times are GMT -5. The time now is 09:49.

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