Go to Post Shake Weights are the game piece. The world is free to end now. - Travis Hoffman [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-02-2014, 18:09
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
Double solenoid code

I've been trying to wrap my head around this code for two days now and I can't figure it out. I've got the declaration (DoubleSolenoid festo) and the port set ( festo(1, 2)) what is the code for teleop that gives me control of the solenoid, this is the only thing I can't get
__________________
Head of Computer Systems and Programming of Team 3307


Reply With Quote
  #2   Spotlight this post!  
Unread 10-02-2014, 21:43
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: Double solenoid code

http://wpilib.screenstepslive.com/s/...ders-solenoids should tell you what you need to know. Briefly, use the Set() method of the DoubleSolenoid class, passing it one of the constant values kOff, kForward, and kReverse.
Reply With Quote
  #3   Spotlight this post!  
Unread 11-02-2014, 12:36
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
Re: Double solenoid code

My line of code for Set() looks like this
Code:
festo.Set(kForward);
festo is the call for our DoubleSolenoid. When i try to build the code I get the following errors:
Code:
C:/windriver/workspace/SimpleTemplate/MyRobot.cpp: In member function `virtual void RobotDemo::OperatorControl()':
C:/windriver/workspace/SimpleTemplate/MyRobot.cpp:58: error: `kForward' undeclared (first use this function)
C:/windriver/workspace/SimpleTemplate/MyRobot.cpp:58: error: (Each undeclared identifier is reported only once for each function it appears in.)
Any idea why the Set() I am using is not working?
__________________
Head of Computer Systems and Programming of Team 3307


Reply With Quote
  #4   Spotlight this post!  
Unread 11-02-2014, 12:42
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Double solenoid code

Quote:
Originally Posted by Zach S. View Post
Any idea why the Set() I am using is not working?
Because kForward is a member of the DoubleSolenoid class. Use DoubleSolenoid::kForward
Reply With Quote
  #5   Spotlight this post!  
Unread 11-02-2014, 13:30
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
Re: Double solenoid code

Quote:
Originally Posted by RufflesRidge View Post
Because kForward is a member of the DoubleSolenoid class. Use DoubleSolenoid::kForward
Sorry, I am a bit new to C++ (recently switched from labview) where is it that I make the ::kForward, is it in the Teleop, or init?
__________________
Head of Computer Systems and Programming of Team 3307


Reply With Quote
  #6   Spotlight this post!  
Unread 11-02-2014, 13:47
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Double solenoid code

Quote:
Originally Posted by Zach S. View Post
Sorry, I am a bit new to C++ (recently switched from labview) where is it that I make the ::kForward, is it in the Teleop, or init?
In the set line that you posted, replace kForward with the text I posted above.
Reply With Quote
  #7   Spotlight this post!  
Unread 11-02-2014, 13:48
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
Re: Double solenoid code

Quote:
Originally Posted by RufflesRidge View Post
In the set line that you posted, replace kForward with the text I posted above.
Thanks, the code built correctly I will try this out on the bot today!
__________________
Head of Computer Systems and Programming of Team 3307


Reply With Quote
  #8   Spotlight this post!  
Unread 17-02-2014, 14:07
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
Re: Double solenoid code

Okay, tested the program but I still have an issue.

The code seems to be working, I can see the lights on the FESTO changing as I hit the button on the joystick, however, it seems that the solenoid will not fire. Is this a wiring or more code problem? And how can we get this fixed?
__________________
Head of Computer Systems and Programming of Team 3307


Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2014, 14:25
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: Double solenoid code

Is it a 12 volt or a 24 volt solenoid? Are you providing it with the voltage it requires?

Do you have enough pneumatic pressure supplied to it for the pilot valve to activate?
Reply With Quote
  #10   Spotlight this post!  
Unread 17-02-2014, 16:41
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
Re: Double solenoid code

Quote:
Originally Posted by Alan Anderson View Post
Is it a 12 volt or a 24 volt solenoid? Are you providing it with the voltage it requires?

Do you have enough pneumatic pressure supplied to it for the pilot valve to activate?
24 Volt, I have the wires running from the solenoid breakout board into the FESTO. And as for pressure we are building it up to 60 for testing, and nothing is firing.
__________________
Head of Computer Systems and Programming of Team 3307


Reply With Quote
  #11   Spotlight this post!  
Unread 17-02-2014, 21: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: Double solenoid code

Quote:
Originally Posted by Zach S. View Post
24 Volt, I have the wires running from the solenoid breakout board into the FESTO.
Just to be certain: Are you feeding the Solenoid Breakout's power input with 24 volts?
Reply With Quote
  #12   Spotlight this post!  
Unread 18-02-2014, 09:48
Zach S. Zach S. is offline
Registered User
FRC #3307 (Luray Robodawgs)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Luray
Posts: 30
Zach S. will become famous soon enough
Re: Double solenoid code

Quote:
Originally Posted by Alan Anderson View Post
Just to be certain: Are you feeding the Solenoid Breakout's power input with 24 volts?
Yes, we have a 20 amp fuse on it, should we be using a 30 amp?
__________________
Head of Computer Systems and Programming of Team 3307


Reply With Quote
  #13   Spotlight this post!  
Unread 18-02-2014, 09:59
cgmv123's Avatar
cgmv123 cgmv123 is offline
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,080
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Quote:
Originally Posted by Zach S. View Post
Yes, we have a 20 amp fuse on it, should we be using a 30 amp?
Running it through a breaker would only give it 12 volts. 24 volts has to come from the power supply at the bottom of the PDB.
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)

Reply With Quote
  #14   Spotlight this post!  
Unread 18-02-2014, 10:30
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: Double solenoid code

Quote:
Originally Posted by cgmv123 View Post
24 volts has to come from the power supply at the bottom of the PDB.
Right.

The cRIO only uses the first two terminals of the four on the 24v output of the Power Distribution Board. Use the second two to feed the Solenoid Breakout.

(The black connectors show a NC on the third terminal, but the PDB itself provides 24v there.)
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


All times are GMT -5. The time now is 14:09.

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