Pneumatics programming help needed


We’re excited to be preparing for our first offseason event in the history of our team, and need a little bit of help with understanding and fixing some code for our pneumatic lift. We have a double solenoid that powers a large air cylinder. The problem is that when enable the robot tethered to the computer, the cylinder automatically raises the lift in teleop before be push the button to raise it.

It also will not come down when we push the button to lower it. I don’t think anything has changed on the robot since our regional. I’m taking over someone else’s code (I’m a Labview newbie) and am trying to understand it. I’ve attached a couple of pictures below of the and

If anyone can help understand where or if it is mis-wired, I would really appreciate it! Thanks!:smiley:

I don’t immedietly see the problem in the snippets you provided, could you please post other regions of interest?

(P.S. printscreen is your friend)

Have you tried pushing the button to raise it after it’s raised?

In addition to your programming, be sure to check the wiring and plumbing of your pneumatics; if couple of hoses were swapped, you could probably get this behavior.

I’d look at the wiring and tubing first as those could easily have changed since your last competition, while the code at face value seems okay.

  • I assume the False case’s are completely empty? Any reference at all to the solenoid in the False cases would break the code. There are safer ways to structure this, but leave that for future improvements.

  • Divide and conquer - If the code is working correctly then the PCM will show a red led on the solenoid 0 or solenoid 1 outputs. If these toggle when the buttons are pushed then your code is fine. If they do not toggle then the code is the problem.

  • If the code seems to be the problem also check the PCM to see that the status light on it is not blinking red. Red means the CAN wires are not properly connecting it to the roboRIO. It receives the code commands over CAN.

  • If the PCM LEDs are changing from Solenoid 0 to Solenoid 1 and vice versa when the buttons are pushed, then look next at your double solenoid where it also generally has indicator lights when one side or the other is activated to see that they are working correctly. If the PCM LEDs are glowing but the double solenoids are not then check the wiring between the PCM and solenoid.

  • If the double solenoid lights are changing, but the pressure is not, then check the voltage required by the solenoid and make sure the PCM jumper is set for 12v or 24v as necessary.

*]If the PCM jumper is set correctly, then check that the solenoid wires are in the correct red/black orientation connected to the PCM outputs.

Thanks to everyone for the help so far. That’s a great list of things to check this week.

Here are the screenshots (figured it out!) of the code. One of the buttons causes air to release a little at a time really randomly but the cylinder doesn’t pull in, while the other one doesn’t do anything when we push it. We had the hoses and connections checked by two different engineers who thought everything was in the right order, but they are new potential mentors and haven’t worked on a robot before.

Thanks again for helping!:smiley: :smiley:

What’s in the False Case for the solenoids?
The symptom sounds like you have code in there (bad).

I attached the false case. I didn’t know that there was something hiding in there even though I probably should have. If I want nothing to happen when the button is not pressed, the false case should be empty, correct?

I also read that the on/off is for the single solenoid and that double solenoid use forward/reverse, and so could that be causing the strange behavior?

Remove everything from the False Cases and it should work.

There are two issues.

  1. The On/Off doesn’t work with a double solenoid
    *]Both cases are executing at the same time, so they are clobbering each other. It will work if the False cases are empty and both buttons are not pressed at the same time.
    A better technique is to only set the solenoid in a single place outside both cases.

Thank you so much! We will try that this week and I will let you know what happens!

This is SOP for double solenoids on the Lunatecs. Reference goes outside the cases, cases are wired to their respective forward/backward buttons. False cases are empty.



Thank you again. Removing the code in the false case fixed the problem.

I have another question, though. Is there any way to use a read switch to stop the cylinder in a middle position (someplace between fully open and fully closed)? The manual says its not recommended, but has anyone got it to work? If so, do you have any code examples you can share?:smiley:

You can’t really “stop” a cylinder at an arbitrary middle point. There are three-position pneumatic cylinders, but they are three specific positions.

It is possible to remove pressure from both sides of the cylinder so that it isn’t being pushed to one side or the other by the air. At the same time, however, it isn’t going to resist being moved by external forces.