Go to Post There are only 4 seasons of the year my friend, build season, competition season, post-season and pre-season. - Tom Schindler [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 30-01-2010, 13:10
iTHOS=awesome iTHOS=awesome is offline
Registered User
FRC #1258
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Seattle
Posts: 16
iTHOS=awesome is an unknown quantity at this point
Send a message via MSN to iTHOS=awesome
Solenoid Breakouts?

Our electronics team has decided to use the solenoid (sp?) breakout on the cRio this year. My question is ... how do you define a solenoid (sp?) and control it in C++?
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 31-01-2010, 01:03
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Solenoid Breakouts?

Quote:
Originally Posted by iTHOS=awesome View Post
Our electronics team has decided to use the solenoid (sp?) breakout on the cRio this year. My question is ... how do you define a solenoid (sp?) and control it in C++?
You use the (big surprise... spoiler alert...) Solenoid class. Pass the channel (and optionally the module slot) to the constructor. Then call Set to set the value. Probably the simplest class in the library.

I'm guessing you posted this before looking at the library. Or did you have a specific question that you forgot to include?
Reply With Quote
  #3   Spotlight this post!  
Unread 03-02-2010, 21:29
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Re: Solenoid Breakouts?

I tried getting this to work today; I managed to get a green light on the solenoid breakout, but after defining the solenoid objects, using the Set() function did nothing.


Our code looks something like this.

Solenoid *solenoidOne;
Solenoid *solenoidTwo;

solenoidOne = new Solenoid(1);
solenoidTwo = new Solenoid(2);


Into operator code...

if(joystick->GetTrigger()) {
solenoidOne->Set(true);
solenoidTwo->Set(false);
}
else {
solenoidOne->Set(false);
solenoidTwo->Set(true);
}


I might be doing something completely wrong here. This our first year using pneumatics with the new control system, so I'm a bit confused. The code manages to get into the if statement, but the solenoid commands do nothing. Is there anything glaringly wrong that you can see?
Reply With Quote
  #4   Spotlight this post!  
Unread 03-02-2010, 22:04
ehochstein's Avatar
ehochstein ehochstein is offline
Coach, Volunteer & Mentor
AKA: Evan Hochstein
FTC #5943 (ESGM)
Team Role: Coach
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Bloomington, Minnesota
Posts: 933
ehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant futureehochstein has a brilliant future
Re: Solenoid Breakouts?

We were having the same problem today on our robot, does your solenoid have little buttons you can press to release pressure also? If so try pressing them and if it works it means you have your solenoid wired correctly.
__________________
Minnesota FIRST Senior Mentor | 2013-?

Stratasys Applications Engineering Technician | 2016-?

2009 Regional Win – 2470 @ 10k Lakes (Thanks 2826 and 1714)
2013 WFFA Recipient – 2470 @ 10K Lakes
2016 Ri3D: 'Snow Problem Reveal

The opinions expressed above are the personal opinions of the author and do not necessarily represent the views and opinions of any organization the author is affiliated with.
Reply With Quote
  #5   Spotlight this post!  
Unread 03-02-2010, 22: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,112
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: Solenoid Breakouts?

Quote:
Originally Posted by KRibordy View Post
...the solenoid commands do nothing.
Before we do any detailed debugging, did you remember to Enable the robot?
Reply With Quote
  #6   Spotlight this post!  
Unread 04-02-2010, 19:49
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Re: Solenoid Breakouts?

Yes. Everything else ran fine, (except for the stuttering caused by the watchdog glitch) including the jaguars and camera feed. We just plugged the solenoid breakout into the cRIO and then ran two wires from the solenoid breakout, one to each end of the solenoid assembly. Again, we haven't used the new system to control pneumatics, so I may be missing a critical step here.
Reply With Quote
  #7   Spotlight this post!  
Unread 04-02-2010, 22:55
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,112
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: Solenoid Breakouts?

Quote:
Originally Posted by KRibordy View Post
Yes. Everything else ran fine, (except for the stuttering caused by the watchdog glitch) including the jaguars and camera feed. We just plugged the solenoid breakout into the cRIO and then ran two wires from the solenoid breakout, one to each end of the solenoid assembly. Again, we haven't used the new system to control pneumatics, so I may be missing a critical step here.
Which slot did you plug the module into? The code expects it in slot 8 by default. Do you have the compressor working? Most solenoid valves won't do anything without air pressure. Have you observed whether or not the green lights on the cRIO digital output module are changing when you press the trigger?
Reply With Quote
  #8   Spotlight this post!  
Unread 05-02-2010, 16:47
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Re: Solenoid Breakouts?

I'm pretty sure we didn't have it in slot eight; we were running the compressor off an external battery, so that code wouldn't be the problem. Why would the cRIO digital output be affected? We're running the solenoids from the solenoid breakout, right?


EDIT: We hooked the solenoid breakout to the 9472 module in slot eight. We connected the two cables to either side of the solenoid and used the code above...but nothing worked.

The buttons on the solenoid do work for switching, but the trigger does not.

Last edited by KRibordy : 05-02-2010 at 17:42.
Reply With Quote
  #9   Spotlight this post!  
Unread 05-02-2010, 22:32
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,112
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: Solenoid Breakouts?

Quote:
Originally Posted by KRibordy View Post
I'm pretty sure we didn't have it in slot eight; we were running the compressor off an external battery, so that code wouldn't be the problem. Why would the cRIO digital output be affected? We're running the solenoids from the solenoid breakout, right?
The solenoid breakout had better be on the digital output module, or it won't do anything.

Quote:
EDIT: We hooked the solenoid breakout to the 9472 module in slot eight. We connected the two cables to either side of the solenoid and used the code above...but nothing worked.
You're providing power to the solenoid breakout, right? The voltage needs to match what the solenoid expects, either 12 or 24 volts, following the power diagram on the FIRST web site.

When you say "nothing worked", does that include no green lights on the output module?
Reply With Quote
  #10   Spotlight this post!  
Unread 09-02-2010, 20:37
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Re: Solenoid Breakouts?

We solved our problem; it turned out to be a multitude of different problems with our code. I changed the code from using "true" and "false" to using "0" and "1" and also moved the module to slot eight. By removing all of our code except the solenoid commands, we were able to get the solenoid to switch back and forth between the two outputs every few seconds. Thanks!
Reply With Quote
  #11   Spotlight this post!  
Unread 20-02-2010, 21:14
superstretch superstretch is offline
Registered User
FRC #0417
 
Join Date: Feb 2010
Location: Mt Sinai
Posts: 7
superstretch is an unknown quantity at this point
Re: Solenoid Breakouts?

shouldn't using true/false or 1/0 not make a difference?
Reply With Quote
  #12   Spotlight this post!  
Unread 21-02-2010, 13:09
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Re: Solenoid Breakouts?

That probably didn't; we changed a few things to make it work. But it works now, so I'm not worried.
Reply With Quote
Reply


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
multiple solenoid breakouts Wendy Holladay Electrical 2 26-01-2010 09:10
2 SOLENOID BREAKOUTS? Legal? BaByGrL Pneumatics 1 19-01-2010 14:04
Solenoid Question RookieWookiez Pneumatics 2 18-01-2010 18:35
how many analog breakouts do we actually need? team2192 Electrical 6 16-01-2010 11:25
Programming a Solenoid Brigander Pneumatics 4 17-02-2007 14:06


All times are GMT -5. The time now is 12:36.

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