Go to Post And that's part of the game... The field is never reset! Muhahaha! - nighterfighter [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 01-07-2015, 00:05
jtrv's Avatar
jtrv jtrv is offline
github.com/jhtervay
AKA: Justin
FRC #2791 (Shaker Robotics)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Latham, NY
Posts: 148
jtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to all
DoubleSolenoid question

Alright, so i'm working on just re-writing our 2015 robot's code so that it's a lot cleaner and whatnot, so future students can see a good example of a good project.

my question - one that i ran into during build season but never tested - is this: if i instantiate a double solenoid object, then put it in the Value.kForward position manually in teleop, then turn the bot off and re-upload the code, will the code be able to recognize that it is in the Value.kForward position during disabled?

the order of code being run:

first time:
Code:
public void RobotInit(){
    piston = new DoubleSolenoid( ... , ...);
}
// then:
public void TeleopInit(){
   piston.setValue(Value.kForward);
}
// then i power off the bot while piston is in forward position, and this happens after i turn it on again and reupload code:
public void RobotInit(){
   piston = new DoubleSolenoid( ... , ...);
}
// then in disabledPeriodic
public void DisabledPeriodic(){
    if(piston.get() == Value.kForward)
        System.out.println("it's in the forward position");
    else
        System.out.println("it isn't or we don't know");
}
what would print in the example?
__________________
2791 (2012-2017)
Reply With Quote
  #2   Spotlight this post!  
Unread 01-07-2015, 03:09
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,099
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: DoubleSolenoid question

No, it would not remember the setting after a reboot. Any new solenoid object always initializes to kOff. So it would print "it isn't or we don't know".
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
Reply With Quote
  #3   Spotlight this post!  
Unread 01-07-2015, 08:22
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,654
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: DoubleSolenoid question

While the software wouldn't know, the hardware would probably still be in the same state. Double solenoids only change state when strobed, or when the little manual button is pressed - AND the supply port is pressurized. (Or they're taken apart,)
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-07-2015, 11:36
jtrv's Avatar
jtrv jtrv is offline
github.com/jhtervay
AKA: Justin
FRC #2791 (Shaker Robotics)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Latham, NY
Posts: 148
jtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to alljtrv is a name known to all
Re: DoubleSolenoid question

Quote:
Originally Posted by Thad House View Post
No, it would not remember the setting after a reboot. Any new solenoid object always initializes to kOff. So it would print "it isn't or we don't know".
Alright, thanks a bunch.

Quote:
Originally Posted by GeeTwo View Post
While the software wouldn't know, the hardware would probably still be in the same state. Double solenoids only change state when strobed, or when the little manual button is pressed - AND the supply port is pressurized. (Or they're taken apart,)
Yea, I was just wondering if the software would know. We always just had it reset itself to retracted in autonomous but it was a minor pain in the pits when nothing worked until we hit the extend button on the controller again.
__________________
2791 (2012-2017)
Reply With Quote
  #5   Spotlight this post!  
Unread 01-07-2015, 11:50
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,654
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: DoubleSolenoid question

Quote:
Originally Posted by jtrv View Post
Yea, I was just wondering if the software would know. We always just had it reset itself to retracted in autonomous but it was a minor pain in the pits when nothing worked until we hit the extend button on the controller again.
If you add an automatic reset in the initialize routines for teleop and test modes, this should resolve the issue. Because the valves are piloted, you may want to wait until the pressure switch is engaged so you know that the switch will occur.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #6   Spotlight this post!  
Unread 01-07-2015, 12:48
FrankJ's Avatar
FrankJ FrankJ is offline
Robot Mentor
FRC #2974 (WALT)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: Marietta GA
Posts: 1,931
FrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond repute
Re: DoubleSolenoid question

Quote:
Originally Posted by jtrv View Post
...
Yea, I was just wondering if the software would know. We always just had it reset itself to retracted in autonomous but it was a minor pain in the pits when nothing worked until we hit the extend button on the controller again.
The FRC legal valve is a bistable device. The code is open loop (no feed back) Without a sensor to confirm the valve position, the code doesn't know what position the valve is in. When using these valves, I always have the programer keep the solenoid energized if the valve position is important. (Yes they will generally stay in the last energized position.) Obliviously there is no way to keep the solenoid energized with the robot disabled.
__________________
If you don't know what you should hook up then you should read a data sheet

Last edited by FrankJ : 01-07-2015 at 13:50.
Reply With Quote
  #7   Spotlight this post!  
Unread 01-07-2015, 13:02
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,654
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: DoubleSolenoid question

Quote:
Originally Posted by FrankJ View Post
The FRC legal valve is a bistable device. The code is open loop (no feed back) Without a sensor to confirm the valve position, the code doesn't know what position the valve is in. When using these valves, I always have the programer keep the solenoid energized if the valve position is important. (Yes they will generally stay in the last energized position. Obliviously there is no way to keep the solenoid energized with the robot disabled.
The KoP valves are bistable devices. The only limitations I am aware of for FRC legality is:

Quote:
Originally Posted by R66
The only pneumatic system items permitted on 2015 FRC ROBOTS include the items listed below.
C. Solenoid valves with a maximum 1/8 in. NPT port diameter,
Automatic return valves which meet this requirement are also available at AndyMark and elsewhere. Especially if you're going to have your pneumatics in one position most of the time, this may be a good solution to your problem.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.

Last edited by GeeTwo : 01-07-2015 at 13:06.
Reply With Quote
  #8   Spotlight this post!  
Unread 01-07-2015, 13:48
FrankJ's Avatar
FrankJ FrankJ is offline
Robot Mentor
FRC #2974 (WALT)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2009
Location: Marietta GA
Posts: 1,931
FrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond reputeFrankJ has a reputation beyond repute
Re: DoubleSolenoid question

Quote:
Originally Posted by GeeTwo View Post
The KoP valves are bistable devices. The only limitations I am aware of for FRC legality is:..
We use the Automation Direct stuff. Works great. AD is a both a national & Georgia state First sponsor. Great company, good prices, fast shipping. (free 2 day for over $49)

Back to the point, for which I should have been more clear, was specifically for dual solenoid valves. You can buy a spring centered dual solenoid valves (mono stable). If you use one in FRC, the center section would have to be able to vent the discharge ports when system pressure is released. The spring return single solenoid valves also has to be able to vent the discharge ports when pressure is released. Not all do. All of this is not really relevant to what is essentially a control question. I generally prefer the single solenoid valves because they take one less output to do mostly the same thing.
__________________
If you don't know what you should hook up then you should read a data sheet
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 11:59.

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