Go to Post John is the king of vague, but then again he looks much better at a distance than he does up close :D - Rich Kressly [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 12-01-2007, 10:24
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
Need Help With General Pneumatics

This year is the first year that our team has used pneumatics, so I have never had a need to look into how to program the system. I looked on the other forums, but they only gave disconnected pieces. Any help in this area would be great.
  #2   Spotlight this post!  
Unread 12-01-2007, 10:33
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Need Help With General Pneumatics

Pneumatics programming is pretty straightforward. The pneumatic solenoids and the compressor are connected through Spikes, which are in turn connected to the Relay pins on the RC. You will turn them on and off just like any other Spike, but you will want to talk to your pneumatics designer to figure out which combinations of on and off will give you the desired behavior. You will need to wire the pressure switch to a digital I/O, and then if that switch is triggered, you have to turn off the Spike that runs the compressor (per <R103>). If you have any more questions, feel free to ask.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #3   Spotlight this post!  
Unread 12-01-2007, 11:27
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Need Help With General Pneumatics

Also, to make pneumatics programming easier, I've whipped up a quick set of macros you can use in your project to control the relays.

Changing a relay's state requires you to set a 0 to one variable and a 1 to another, if you forget, they jam, not such a good thing, these macro's will automate the process a bit and neaten up your code.

Example of the old way:
Code:
	relay1_fwd = 1; // This sets relay 1
	relay1_rev = 0; // to forward

	relay2_fwd = 0; // This sets relay 2
	relay2_rev = 1; // to reverse

	relay3_fwd = 1; // This makes relay 3
	relay3_rev = 1; // get stuck!

	relay4_fwd = 0; // This sets relay 4
	relay4_rev = 0; // to off
Example of my way:
Code:
	RELAY1_FWD; // This sets relay 1 to forward

	RELAY2_REV; // This sets relay 2 to reverse

	// No way to get stuck!
	
	RELAY4_OFF; // This sets relay 4 to off
All you need to do is add
Code:
        #include "relays.h"
at the top of whatever file uses these macros, and that file is attached to this post: http://www.chiefdelphi.com/forums/sh...507#post455507

Good luck!
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #4   Spotlight this post!  
Unread 13-01-2007, 12:41
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
Re: Need Help With General Pneumatics

Thanks for the adivce. I really appreciate it. One problem we still have is that we've never used pneumatics, and so don't have a pneumatics person. However, I think we'll be able to figure out the wiring. The only remaining problem is the digital sensor thing. I tried to wir up the gear tooth sensor last year, and it coused the camera to freak out, something about it being a costant hardware interrupt or something. How would you make it so the signal doesn't kill the camera?
  #5   Spotlight this post!  
Unread 13-01-2007, 13:17
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: Need Help With General Pneumatics

Quote:
Originally Posted by Ryan O View Post
Thanks for the adivce. I really appreciate it. One problem we still have is that we've never used pneumatics, and so don't have a pneumatics person. However, I think we'll be able to figure out the wiring. The only remaining problem is the digital sensor thing. I tried to wir up the gear tooth sensor last year, and it coused the camera to freak out, something about it being a costant hardware interrupt or something. How would you make it so the signal doesn't kill the camera?
That sensors doesn't need to be on an interrupt, it can be polled. Just connect it to a digital input then every loop just have an if() statement check it, if the sensor is on, turn off the compressor. I think the default code has stuff for this towards the end for digital input 18 and relay 1, but I'm not sure.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #6   Spotlight this post!  
Unread 16-01-2007, 19:12
Eric Finn's Avatar
Eric Finn Eric Finn is offline
Registered User
FRC #0166 (Chop Shop)
Team Role: College Student
 
Join Date: May 2006
Rookie Year: 2005
Location: Merrimack, NH
Posts: 101
Eric Finn has a spectacular aura aboutEric Finn has a spectacular aura about
Send a message via AIM to Eric Finn
Re: Need Help With General Pneumatics

You don't even need an if statement, it can be done in a single line:

COMPRESSOR = 1 - PRESSURE_SENSOR;
where COMPRESSOR is the compressor's output, and PRESSURE_SENSOR is the pressure sensor input.
__________________
It always takes longer than you expect, even when you take into account Hofstadter's Law.
--Hofstadter's Law

  #7   Spotlight this post!  
Unread 24-01-2007, 20:57
Ryan O's Avatar
Ryan O Ryan O is offline
FRC Eclipse Plug-in Developer
no team (FRC Eclipse)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Plaistow
Posts: 111
Ryan O is an unknown quantity at this point
Send a message via AIM to Ryan O
Re: Need Help With General Pneumatics

Hi again, the programming itself is going well. However, today we tried to wire up teh compressr and sensor to test the code to turn the compressor on and off, and as you probaly can guess it didn't work (I hate Murphy). Here's the code and what happened:

In two header files, the following was written:

#define Comp_fwd relay5_fwd
#define Comp_rev relay5_rev

#define P_Sensor rc_dig_in18

#define ON 1
#define OFF 0


in a .c file, with the subroutine being called sucessfully from default routine, and default routine definately being called:


void Pressure_Upkeep(void)
{
if((LD_Sensor == NOT_TRIPPED) && (P_Sensor == NOT_TRIPPED)) {
Comp_fwd = ON; Comp_rev = OFF;
}
else
{
Comp_fwd = OFF;
Comp_rev = OFF;
}
}


The spike was wired as the following:
Ground wire(black) to small metal plate on board
12V wire(red) to 20 amp fuse on the same board
M- wire(black) to black compressor wire
M+ wire(red) to red compressor wire
pwm cable from spike to relay 5, directions checked and correct
pressure sensor wired and connected to digital input 18, direction correct


The results were:
The spike's LED was on and solid orange
the compressor remained off

Variations:
The sensor was unplugged to test for false reading: no change
a different spike was used to test for faulty hardware: no change

It is unlikely that the sensor was tripped, since the pneumatic circuit had just been constructed and had not yet been pressureized, and the sensor does not trip until 115psi

Does anyone know what could be causing this?
  #8   Spotlight this post!  
Unread 24-01-2007, 21:31
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: Need Help With General Pneumatics

Ryan,

I don't know what an "LD_sensor" is and I don't know what you defined "NOT_TRIPPED" as...

Have you looked at the default code from IFI? The compressor control is a single line of code:

Code:
relay8_fwd = !rc_dig_in18;  /* Power pump only if pressure switch is off. */
Why are you making it more difficult?

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
General Pneumatics Drok00 Pneumatics 8 11-01-2005 23:35
General Help With Programming lt744 Programming 2 02-12-2004 17:09
hey need some help with writing a code please help me here magical hands Programming 9 01-01-2004 21:46
Need help with C++ Tton Programming 7 04-11-2003 19:15
HELP! Problem with General Dimension in Inventor 5. sanddrag Inventor 12 21-09-2003 21:46


All times are GMT -5. The time now is 20:45.

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