Go to Post now now, there is no such thing as reading the manual too much. I read it every night just before I go to bed. - 663.keith [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 17-02-2005, 23:40
Ben Piecuch Ben Piecuch is offline
Bengineer
no team
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Providence, RI
Posts: 336
Ben Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond repute
Programming of Pneumatics

I searched and found a couple threads related to this, but no one gave any solid answers. Therefore...

We are trying to use a momentary switch on our control board, to control a pneumatic cylinder. We have tried both single and double solenoids, so far with no luck. What we are attempting to do is this.

The cylinder is in one position (extended or compressed.) The driver hits the momentary switch once, and the cylinder changes position to the opposite extreme and holds. To bring the cylinder back, the driver hits the momentary switch once again, and the cylinder returns and holds.

Pretty simple, but we have run into several issues including hysteresis, the cylinder not returning on the 2nd press of the button, etc... Unfortunately, I'm not the programmer, so I don't have the actual code we've been working with. Does someone out there have a simple way to execute this command?

Thanks,

Bengineer
GUS, Team 228
  #2   Spotlight this post!  
Unread 18-02-2005, 00:49
JoelP JoelP is offline
whats the P for? Pazhayampallil
FRC #1155 (Bronx Science Sciborgs)
Team Role: Leadership
 
Join Date: Dec 2004
Rookie Year: 2005
Location: bronx, new york
Posts: 62
JoelP is a jewel in the roughJoelP is a jewel in the roughJoelP is a jewel in the rough
Send a message via AIM to JoelP
Re: Programming of Pneumatics

What you have to do in the code is put in an if statement that will switch between the 2 positions on the pneumatics, but since the loop executes every 26ms(approx.) you'll also need to include a latch to prevent this.

The following code is similar to what my team did for this:
Code:
  if(p1_sw_top == 1 && button_latch==0) //button_latch is a variable to
// prevent the code from rapidly cycling through piston positions
  {
	if(relay1_rev==1)//if the relay is reversed it will switch to forward
	{
	  relay1_fwd=1;
	  relay1_rev=0;
	  button_latch=1;
	}
	else          //and vice versa
	{
	  relay1_fwd=0;
	  relay1_rev=1;
	  button_latch=1;//latches to prevent cycling
	}
  }
  else if(p1_sw_top == 0 && button_latch==1)
  {
	button_latch=0;//resets latch when you let go of the button
  }

Last edited by JoelP : 18-02-2005 at 00:52.
  #3   Spotlight this post!  
Unread 18-02-2005, 01:08
Ben Piecuch Ben Piecuch is offline
Bengineer
no team
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Providence, RI
Posts: 336
Ben Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond reputeBen Piecuch has a reputation beyond repute
Re: Programming of Pneumatics

Ah, the latch part is what we're missing. I couldn't figure out a way to implement something like that. However, your code is exactly what we're looking for. I'll try to 1st thing Friday afternoon, thanks!

Bengineer
GUS, Team 228
  #4   Spotlight this post!  
Unread 18-02-2005, 02:39
ktrussell ktrussell is offline
Registered User
AKA: Kenny Trussell
FRC #1057 (Blue Knights)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Sandersville, GA
Posts: 7
ktrussell is an unknown quantity at this point
Re: Programming of Pneumatics

You will need to make 'latch' a static variable if you are defining it inside a function so that it will retain its value between calls to the function. If you declare it outside a function (global to the file), it is by default static. I would assume you would declare 'latch' inside the function, though.
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 - Getting Started Mark McLeod Programming 80 16-04-2008 23:37
Robot Programming Education phrontist Programming 11 03-05-2004 07:32
Pneumatics Programming KWalsh Programming 8 19-02-2004 09:17
Programming PBASIC for pneumatics archiver 2001 2 23-06-2002 23:58
Pneumatics electrical wiring and programming archiver 2001 1 23-06-2002 23:10


All times are GMT -5. The time now is 19:16.

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