Go to Post If you never takes steps to solve problems you cannot just complain that they exist. - Wayne C. [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 30-03-2005, 15:48
evilhunter evilhunter is offline
Registered User
#1674
 
Join Date: Jan 2005
Location: Onekama
Posts: 9
evilhunter is an unknown quantity at this point
help programmig doble solenoids

Ok i have one more question on the programing the double solinoid

this is what i have

relay1_fwd = p3_sw_trig; //lower arm extend double solenoid
relay1_rev = p3_sw_top; //lower arm retract double solenoid
relay2_fwd = p3_sw_aux1; //upper arm extent double solenoid
relay2_rev = p3_sw_aux2; //upper arm retract double solenoid
//relay3_fwd
//relay3_rev
//relay4_fwd
//relay4_rev
relay5_fwd = p4_sw_aux1 //lift plate up festo solenoid
relay5_rev = p4_sw_aux2 // lift plate down festo solenoid

ok will this work or will it cuase it to keep going one way and back the other way. If so how would i code this. Thanks
  #2   Spotlight this post!  
Unread 30-03-2005, 16:20
dm0ney's Avatar
dm0ney dm0ney is offline
Will Code For Food (Food Optional)
AKA: Deepak Mishra
None #0217 (The ThunderChickens)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Shelby Twp., MI
Posts: 48
dm0ney will become famous soon enough
Send a message via AIM to dm0ney
Re: help programmig doble solenoids

Quote:
Originally Posted by evilhunter
Ok i have one more question on the programing the double solinoid

this is what i have

relay1_fwd = p3_sw_trig; //lower arm extend double solenoid
relay1_rev = p3_sw_top; //lower arm retract double solenoid
relay2_fwd = p3_sw_aux1; //upper arm extent double solenoid
relay2_rev = p3_sw_aux2; //upper arm retract double solenoid
//relay3_fwd
//relay3_rev
//relay4_fwd
//relay4_rev
relay5_fwd = p4_sw_aux1 //lift plate up festo solenoid
relay5_rev = p4_sw_aux2 // lift plate down festo solenoid

ok will this work or will it cuase it to keep going one way and back the other way. If so how would i code this. Thanks
If you set them equal to each other, it will fire only if the button is pressed continuously. If you instead put them into if statements, all will resolve!
Please note, the festo is not a double, red code reflects change.

Code:
if(p3_sw_trig) 
{
relay1_fwd = 1;
relay1_rev = 0;
}
if(p3_sw_top) 
{
relay1_fwd = 0;
relay1_rev = 1;
}

if(p3_sw_aux1) 
{
relay2_fwd = 1;
relay2_rev = 0;
}
if(p3_sw_aux2) 
{
relay2_fwd = 0;
relay2_rev = 1;
}

if(p4_sw_aux1) relay5_fwd = 1;
if(p4_sw_aux2) relay5_fwd = 0;
Another way to decrease the amount of triggers used and make it easier for the operator, have the same button do both actions by

a) setting flags and then using if statements
b) declaring a bool, using logical operators
c) writing an abs function and using a
Code:
relay = abs(relay - 1);
__________________

Alumni
Team #217, The ThunderChickens



Student, Class of 2009
California Institute of Technology



Last edited by dm0ney : 30-03-2005 at 16:26.
  #3   Spotlight this post!  
Unread 30-03-2005, 23:50
evilhunter evilhunter is offline
Registered User
#1674
 
Join Date: Jan 2005
Location: Onekama
Posts: 9
evilhunter is an unknown quantity at this point
Re: help programmig doble solenoids

will this code still make the festo work properly. Thank you guys for all the help
  #4   Spotlight this post!  
Unread 31-03-2005, 09:52
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: help programmig doble solenoids

Quote:
Originally Posted by evilhunter
will this code still make the festo work properly.
You're not giving enough information for us to know what you think "work properly" means.

A double solenoid will switch states when a control signal is applied, and will stay in its current state when the signal is removed. If you wire it properly and simply copy OI button inputs to RC relay outputs, you can use one button to make the solenoid switch one way, and another button to make it switch the other way.

A Festo solenoid will sit in one state when the control signal is absent, and will go to the other state only while the signal is applied. If you wire it properly and simply copy OI button inputs to RC relay outputs, you can use one button to hold the solenoid on; releasing that button will make the solenoid turn off again.

The code posted by dm0ney does not simply copy OI button inputs to RC relay outputs. It interprets OI button inputs as desired actions and controls the RC relay outputs to cause those actions. If you don't press both buttons simultaneously, the double solenoid part of the code has the same effect as your code. The Festo part turns it on when p4_sw_aux1 is pressed and leaves it on when the button is released, and it turns it off when p4_sw_aux2 is pressed and leaves it off when the button is released.
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
Are your solenoids firing on their own? Mr. Lim Pneumatics 7 23-02-2005 04:19
have a question to ask about Double Solenoids to one spike programming davelu Programming 3 22-02-2005 09:52
How does your team wire your Double Solenoids? Doug G Pneumatics 14 17-02-2005 23:25
solenoids from last year Antonio Pneumatics 6 29-01-2003 22:59
solenoids zarb Electrical 1 28-01-2002 23:19


All times are GMT -5. The time now is 00:17.

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