Go to Post It's not about the robot. It's about science, technology, engineering, and mathematics. - Ether [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 03-02-2005, 11:43
Matthew_H's Avatar
Matthew_H Matthew_H is offline
Ubergeek
#1028 (Ubergeeks)
Team Role: Mentor
 
Join Date: Feb 2003
Rookie Year: 2001
Location: Huntsville,AL
Posts: 105
Matthew_H will become famous soon enough
Send a message via AIM to Matthew_H Send a message via MSN to Matthew_H
Default code and the Compressor

We seem to be having a problem setting up the simple pressure switch and the compressor to allow the compressor to shut off when pressure reaches the 115psi. We have loaded the 2005 code and plugged in the the spike that controls the compressor to relay 8. The Pressure switch is placed on Digital IO 18 and it is set as input in the code. With this setup the compressor will not run even when there is no Pressure in the tanks.
We then loaded the 2004 default code we had from last year and the system worked.

Can anyone please point us in the correct direction and are there any other teams having this same problem?
__________________
Matthew

  #2   Spotlight this post!  
Unread 03-02-2005, 12: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,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: Default code and the Compressor

Both the v2.2 and v2.4 default code have this line in Default_Routine:
Code:
  relay8_fwd = !rc_dig_in18;  /* Power pump only if pressure switch is off. */
It sounds like you have it wired properly. If you have changed the code, I would look closely at it to make sure that line is actually being executed.
  #3   Spotlight this post!  
Unread 03-02-2005, 14:11
Matthew_H's Avatar
Matthew_H Matthew_H is offline
Ubergeek
#1028 (Ubergeeks)
Team Role: Mentor
 
Join Date: Feb 2003
Rookie Year: 2001
Location: Huntsville,AL
Posts: 105
Matthew_H will become famous soon enough
Send a message via AIM to Matthew_H Send a message via MSN to Matthew_H
Re: Default code and the Compressor

Quote:
Originally Posted by Alan Anderson
Both the v2.2 and v2.4 default code have this line in Default_Routine:
Code:
  relay8_fwd = !rc_dig_in18;  /* Power pump only if pressure switch is off. */
It sounds like you have it wired properly. If you have changed the code, I would look closely at it to make sure that line is actually being executed.

I have checked the code and it looks like the default values. I have even downloaded the default code and loaded the default hex into the controller. Is there an error in the code I am not aware of that I need to change.
__________________
Matthew

  #4   Spotlight this post!  
Unread 03-02-2005, 14:24
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: Default code and the Compressor

Your code is doing exactly what it is supposed to be doing....run when the switch is not set (i.e. pressure is below the threshold). It just so happens that the pressure switch has a cutoff of ~115 PSI. There's a discussion of this here.

If you really want to get your system pressure to 120 PSI, you can run the pump for a fixed number of cycles after the switch was set (i.e. pressure is above threshold) before giving it the command to shut off. We've used this method for the past few years, and it works just fine.
  #5   Spotlight this post!  
Unread 03-02-2005, 14:27
Matthew_H's Avatar
Matthew_H Matthew_H is offline
Ubergeek
#1028 (Ubergeeks)
Team Role: Mentor
 
Join Date: Feb 2003
Rookie Year: 2001
Location: Huntsville,AL
Posts: 105
Matthew_H will become famous soon enough
Send a message via AIM to Matthew_H Send a message via MSN to Matthew_H
Re: Default code and the Compressor

Quote:
Originally Posted by Dave Scheck
Your code is doing exactly what it is supposed to be doing....run when the switch is not set (i.e. pressure is below the threshold). It just so happens that the pressure switch has a cutoff of ~115 PSI. There's a discussion of this here.

If you really want to get your system pressure to 120 PSI, you can run the pump for a fixed number of cycles after the switch was set (i.e. pressure is above threshold) before giving it the command to shut off. We've used this method for the past few years, and it works just fine.

Our pump is not running when the pressure is below 115psi using the 2005 default code. We have gotten the pump to work with last years code which I can not find the difference.
__________________
Matthew

  #6   Spotlight this post!  
Unread 03-02-2005, 15:08
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: Default code and the Compressor

Misread your original post...I thought you weren't getting it charged up to 120...

So your code from last year works with your current compressor/switch setup, but your new code doesn't? And it is using the same dig in/relay?

Just throwing some blind suggestions out....

Have you tried using printfs to see the value of the switch? Does it change when the pressure reaches 115?

What happens if you hard code the value of relay8_fwd to 1? Does the compressor turn on?

How far away from the default code are you? If you want, you can send me your C file and I can take a look for anything out of the ordinary.
  #7   Spotlight this post!  
Unread 03-02-2005, 17:07
Matthew_H's Avatar
Matthew_H Matthew_H is offline
Ubergeek
#1028 (Ubergeeks)
Team Role: Mentor
 
Join Date: Feb 2003
Rookie Year: 2001
Location: Huntsville,AL
Posts: 105
Matthew_H will become famous soon enough
Send a message via AIM to Matthew_H Send a message via MSN to Matthew_H
Re: Default code and the Compressor

here is both this years default code (which doesn't work for us), and the default code from last year which does work.
Attached Files
File Type: zip code.zip (9.1 KB, 31 views)
__________________
Matthew

  #8   Spotlight this post!  
Unread 03-02-2005, 17:37
Bleric's Avatar
Bleric Bleric is offline
Registered User
#0624 (CRyptonite)
Team Role: Programmer
 
Join Date: Jan 2005
Location: Houston
Posts: 19
Bleric is on a distinguished road
Send a message via AIM to Bleric Send a message via MSN to Bleric
Re: Default code and the Compressor

Well, the code you posted should work. Strange...

Maybe you're reassigning relay8 in a different file, like user_routines_fast? Might do a search for relay8 in some other files, and see if you're setting it equal to something.
  #9   Spotlight this post!  
Unread 03-02-2005, 17:47
Matthew_H's Avatar
Matthew_H Matthew_H is offline
Ubergeek
#1028 (Ubergeeks)
Team Role: Mentor
 
Join Date: Feb 2003
Rookie Year: 2001
Location: Huntsville,AL
Posts: 105
Matthew_H will become famous soon enough
Send a message via AIM to Matthew_H Send a message via MSN to Matthew_H
Re: Default code and the Compressor

We havent changed any of the other files, yet.
__________________
Matthew

  #10   Spotlight this post!  
Unread 03-02-2005, 18:01
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: Default code and the Compressor

I diffed your 2005 code to the Default code released by FIRST and, as expected, it is identical.

This makes me believe that your compressor and/or pressure switch is wired incorrectly.

Try making the following modification and see what you see

Code:
 
relay5_rev = p1_sw_aux2;
relay6_fwd = p3_sw_aux1;
relay6_rev = p3_sw_aux2;
relay7_fwd = p4_sw_aux1;
relay7_rev = p4_sw_aux2;
relay8_fwd = !rc_dig_in18;  /* Power pump only if pressure switch is off. */
relay8_rev = 0;
   
/******************/
/* THIS CODE IS ADDED */
printf("Switch %d  Relay  %d\r",(int)rc_digin18,(int)relay8_fwd);
/******************/

   /*---------- PWM outputs Limited by Limit Switches  ------------------------*/
In the case that the switch always shows 0, your compressor is wired incorrectly. If the relay is showing green, doublecheck the compressor's connection to it. If the relay doesn't change color, check the PWM connection between the relay and relay port 8.

If you see that the switch is always reading 1, then your compressor will never turn on. If that is the case, your switch may be wired incorrectly or defective. To verify this, remove the ! from the line that sets relay8_fwd. If the compressor runs and shuts off at 115 psi, then there's some weirdness on why your switch is returning an inverted value. If the compressor never shuts off, doublecheck all connections between the switch and the RC.

Hopefully that helps...
  #11   Spotlight this post!  
Unread 03-02-2005, 18:34
Matthew_H's Avatar
Matthew_H Matthew_H is offline
Ubergeek
#1028 (Ubergeeks)
Team Role: Mentor
 
Join Date: Feb 2003
Rookie Year: 2001
Location: Huntsville,AL
Posts: 105
Matthew_H will become famous soon enough
Send a message via AIM to Matthew_H Send a message via MSN to Matthew_H
Re: Default code and the Compressor

It DOES work with the 2004 code. but does not work with the 2005. same wiring for both. but we cant find any real diffrence between them other than the camera stuff.
__________________
Matthew

  #12   Spotlight this post!  
Unread 03-02-2005, 21:08
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Re: Default code and the Compressor

Quote:
Originally Posted by Bleric
Maybe you're reassigning relay8 in a different file, like user_routines_fast? Might do a search for relay8 in some other files, and see if you're setting it equal to something.
The version of user_routines_fast I just looked at DOES set relay8 = 0 inside of user_routines_fast.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #13   Spotlight this post!  
Unread 04-02-2005, 08:37
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Default code and the Compressor

Matthew, et al,

I was planning to hook up a compressor this afternoon anyway. I will try the 2005 default code and report my observations.

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #14   Spotlight this post!  
Unread 04-02-2005, 09:14
Matthew_H's Avatar
Matthew_H Matthew_H is offline
Ubergeek
#1028 (Ubergeeks)
Team Role: Mentor
 
Join Date: Feb 2003
Rookie Year: 2001
Location: Huntsville,AL
Posts: 105
Matthew_H will become famous soon enough
Send a message via AIM to Matthew_H Send a message via MSN to Matthew_H
Re: Default code and the Compressor

Quote:
Originally Posted by Mike Betts
Matthew, et al,

I was planning to hook up a compressor this afternoon anyway. I will try the 2005 default code and report my observations.

Mike

We finally got it to work. We changed this the code below and it worked. Please explain why this worked.

Code:
relay8_fwd = !rc_dig_in18;  /* Power pump only if pressure switch is off. */
relay8_rev = 0;
Code:
relay8_rev = !rc_dig_in18;  /* Power pump only if pressure switch is off. */
relay8_fwd = 0;
__________________
Matthew

  #15   Spotlight this post!  
Unread 04-02-2005, 09:27
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Re: Default code and the Compressor

Quote:
Originally Posted by Matthew_H
We finally got it to work. We changed this the code below and it worked. Please explain why this worked.

Code:
relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */
relay8_rev = 0;
Matthew,

relay8_rev must have been initialized to 1 (or set to 1) somewhere in the code or possibly it was never initialized (an uninitialized variable is, by definition, undefined).

Anyway, congrats on getting it working...

Mike
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
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
Help On Coding 2K1 Controller GregTheGreat Programming 9 05-12-2003 18:35
Chassis Material/Construction sanddrag Technical Discussion 51 05-12-2003 12:59
New software?? mjt902 Programming 2 08-01-2003 10:40
PBASIC 2.5 answer from Parallax JasonS Programming 6 07-01-2003 19:21
Team 237 unleashes a "Beast" Elgin Clock Robot Showcase 5 27-03-2002 21:09


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

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