Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   DoubleSolenoid question (http://www.chiefdelphi.com/forums/showthread.php?t=137649)

jtrv 01-07-2015 00:05

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?

Thad House 01-07-2015 03:09

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".

GeeTwo 01-07-2015 08:22

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,)

jtrv 01-07-2015 11:36

Re: DoubleSolenoid question
 
Quote:

Originally Posted by Thad House (Post 1488627)
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 (Post 1488630)
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.

GeeTwo 01-07-2015 11:50

Re: DoubleSolenoid question
 
Quote:

Originally Posted by jtrv (Post 1488647)
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.

FrankJ 01-07-2015 12:48

Re: DoubleSolenoid question
 
Quote:

Originally Posted by jtrv (Post 1488647)
...
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.

GeeTwo 01-07-2015 13:02

Re: DoubleSolenoid question
 
Quote:

Originally Posted by FrankJ (Post 1488656)
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.

FrankJ 01-07-2015 13:48

Re: DoubleSolenoid question
 
Quote:

Originally Posted by GeeTwo (Post 1488659)
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.


All times are GMT -5. The time now is 10:21.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi