Does anyone know if setting a DoubleSolenoid to kOff closes both valves? I wanted to use that in conjunction with some flow control valves to provide more minute control over the position of the piston.
No, it does not (but keep reading). A “double” solenoid is mechanically the same as a “single” solenoid (e.g. it has one valve). The difference is only in how that valve is actuated.
A “single” solenoid has one electromagnetic coil, which when energized, actuates the valve in one direction; when de-energized, a spring return pulls the valve back in the other direction.
A “double” solenoid, on the other hand, has two electromagnetic coils, combined with passive magnetic latches. Energizing one coil actuates the valve in that direction. De-energizing that coil (once the valve has actually transitioned) results in no valve movement due to the magnetic latch. Energizing the other coil actuates the valve to the other direction.
In software, the Solenoid and DoubleSolenoid classes essentially follow this methodology. The Solenoid class commands a single coil (e.g. output), while the DoubleSolenoid commands two coils (outputs). Note that the DoubleSolenoid class is basically a convenience class… it’s possible to do the same thing with two Solenoid classes. In the DoubleSolenoid class, the effect of kOff is to de-energize both outputs (coils). If the two outputs are connected to a double solenoid valve, this results in no movement of the valve (presuming the previously energized coil was energized for a sufficiently long period of time to actuate the valve to the new position).
It is possible to pulse width modulate a solenoid coil (by alternatively energizing and de-energizing the coil) to “flutter” the valve and effectively result in an intermediate amount of air flow. This was done by a number teams in 2014 to control their pneumatic shot force, although it may be more difficult to achieve in the PCM compared to the cRio. I think this is most easily done with a single solenoid as you can rely on the spring return rather than energizing the opposite coil.
So is a single solenoid just “open or closed”?
Yes, there’s no such thing as an in-between steady state position with a “normal” (single-stage) pneumatic actuator; there are only two steady state positions. To give an example, let’s look at the Bimba original air line cylinder. This cylinder has two input ports, one at each end of the body, and can either be fully extended or fully retracted based on which input is connected to pressurized air (typically 60 psi in FRC). The other input must be vented to room pressure in order for the cylinder to move (if you apply 60 psi to both inputs, there’s no force being applied!).
To make this happen, a typical valve used in FRC actually has 5 ports:
- Pressurized air inlet (usually labeled “P”)
- Output A (usually labeled “A”)
- Exhaust A (usually labeled “EA”)
- Output B (usually labeled “B”)
- Exhaust B (usually labeled “EB”)
Let’s call the two steady states “Dir A” (e.g. extended) and “Dir B” (e.g. retracted). Note this is notional… you can make extended Dir B and retracted Dir A based on how you hook the valve outputs up to the actuator inputs.
In “Dir A”:
- The Pressurized air inlet is connected to Output A
- Output B is connected to Exhaust B
In “Dir B”:
- The pressurized air inlet is connected to Output B
- Output A is connected to Exhaust A
By connecting a 5-port valve’s Output A and Output B to each input port of the cylinder, the valve actuates the cylinder either fully extended or fully retracted by routing pressurized air to one side of the cylinder and routing the other side to room pressure (exhaust). Switching the direction of the valve results in moving the cylinder in the other direction.
As previously stated, the only difference between a “double” solenoid and a “single” solenoid is how you command the direction of operation of the valve.
- “Single” solenoid has one coil. Coil=0 –> Dir A, Coil=1 –> Dir B
- “Double” solenoid has two coils (let’s call them “Coil A” and “Coil B”). Energizing coil A moves the valve to Dir A; energizing coil B moves the valve to Dir B.
I also want to mention that multi-stage cylinders do exist; they work by having one or more inputs per stage, but each stage only has two steady state conditions (either fully extended or fully retracted).
So does the spring return in a single connect the output to the exhaust port?
A single solenoid valve is also 5-ported. So there are still 2 outputs and 2 exhaust ports. When the coil is energized, one output (A) is connected to its exhaust port (EA) and the other output (B) to the pressurized air (P). When the coil is not energized, the spring in the valve results in the valve being in the other (default) position, thus connecting the other output (B) to its exhaust port (EB) and output A will be connected to the pressurized air (P).
Note this should not be confused with the operation of a spring return cylinder (actuator), which has only a single input port on the cylinder itself. It’s possible to use either a “double” or a “single” solenoid with a spring return cylinder.