Log in

View Full Version : Still Having Pneumatics Problems


anthonygraff24
06-02-2014, 16:52
I am using the FESTO VAVE-L1-1VH3-LP double solenoid. We have the solenoid wired so that the 24v port on the power distribution board connects to the wago on the crio breakout for pneumatics (Module NI9472 with Red Pneumatics Breakout). The solenoid wires are then plugged into double prong wires, ports 1 and 2 on the breakout. Red going to red and black going to black for each pair. When we use our joystick to actuate the piston we get a orange light for each button. We also get the green lights on the cRIO module to light up. The piston does not do anything. For reference, here is our code related to the Solenoid:

DoubleSolenoid piston = new DoubleSolenoid(1,2);
//Constructor

while(rightStick.getRawButton(4))
piston.set(DoubleSolenoid.Value.kForward);
while(rightStick.getRawButton(5))
piston.set(DoubleSolenoid.Value.kReverse);
while(!rightStick.getRawButton(4)&&!rightStick.getRawButton(5))
piston.set(DoubleSolenoid.Value.kOff);

Any and all help would be greatly appreciated!! :D :D :D :D :D

Ikillee
11-02-2014, 15:37
I'm not a programmer but here's a link related to pneumatic wiring if the problem is with electronics. My team was wondering how to wire the solenoid to the solenoid breakout. I guess your post confirmed it was a wago connector we needed.

http://www.chiefdelphi.com/forums/showthread.php?t=125707

Oblarg
11-02-2014, 15:50
Caveat: While I know java, I'm not a robot programmer so I might be completely wrong about this.

That said, it seems like a really bad idea to use while loops in that way, as it makes it impossible for any code to execute at the same time as your solenoid commands. Moreover, since there is always one of your conditions that is true, you will in general never be able to execute any code other than that specific set of solenoid commands. Using different buttons for forward and backward commands on a double solenoid seems bad practice, too, without some sort of way to handle the case where both buttons are pressed at once, though I do not know off the top of my head what the behavior would be in this situation without something explicitly handling it in code, I could imagine it might be unfortunate (ironically, the fact that you're going to get caught in a loop with your given code handles this problem by itself as the forward and backward commands can't execute simultaneously, but upon revising it it'd rear its head).

magnets
11-02-2014, 15:55
Caveat: While I know java, I'm not a robot programmer so I might be completely wrong about this.

That said, it seems like a really bad idea to use while loops in that way, as it makes it impossible for any code to execute at the same time as your solenoid commands. Moreover, since there is always one of your conditions that is true, you will in general never be able to execute any code other than that specific set of solenoid commands. Using different buttons for forward and backward commands on a double solenoid seems bad practice, too, without some sort of way to handle the case where both buttons are pressed at once, though I do not know off the top of my head what the behavior would be in this situation without something explicitly handling it in code, but I could imagine it might be unfortunate (ironically, the fact that you're going to get caught in a loop with your given code handles this problem by itself as the forward and backward commands can't execute simultaneously, but upon revising it it'd rear its head).

You're right. The robot program is one big loop. To get it to work, you'll need to change those while loops to if/then/else.