|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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");
}
|
|
#2
|
||||
|
||||
|
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".
|
|
#3
|
|||||
|
|||||
|
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,)
|
|
#4
|
||||
|
||||
|
Re: DoubleSolenoid question
Quote:
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. |
|
#5
|
|||||
|
|||||
|
Re: DoubleSolenoid question
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.
|
|
#6
|
||||
|
||||
|
Re: DoubleSolenoid question
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.
Last edited by FrankJ : 01-07-2015 at 13:50. |
|
#7
|
|||||
|
|||||
|
Re: DoubleSolenoid question
Quote:
Quote:
Last edited by GeeTwo : 01-07-2015 at 13:06. |
|
#8
|
||||
|
||||
|
Re: DoubleSolenoid question
Quote:
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|