Coding Relay with Compressor

Ok, Ive been working on getting the compressor working for 3 days now. Ive followed every example to get those relays to change colors from Orange to Green. This is my first year in FIRST (No Pun intended) and Im the team programmer. I use Labview.

Does it work if you use the Solenoid With Compressor Example?

Have you tested using the example program “Solenoid with Compressor”?

Use that program as a working baseline to look at the Relay LEDs on the Digital sidecar. If the Relay 1 LEDs are not lighting, then that argues strongly for a wiring problem with the pressure switch.

If the Relay LEDs do turn green, but the Spike light remains orange, then that argues strongly that there is a control cable problem between the Digital Sidecar and the Spike.

Ive only used the examples as references. How do you test one through an example?

Run it. Change the IP address first:

Make sure to run the Driver Station application in the Developer account where you are Running the example from.

We have had two days off this week,one for Presidents Day and the other was for a snow day that we didn’t use. Saturday we pretty much finalized the mechanincals and fixed some squawks from our test driving, so today I thought I could do some programming. I have been here since 9 am, its nearly 330 now and have done everything listed above to the best of my knowledge. All the lights were green, the robot works properly - well it moves properly - but the compressor still does not come on.

This is pretty discouraging, our goal in the next 5 days is to get the kicker cylinder to extend and retract, which would seem to need to inputs from a joystick since the buttons are either on or off, but if the compressor wont operate then the kicker part is pretty useless. Our other goal was to get the KOP motor we are using for our lifting arm to work, again a simple on-off set of inputs …well ok, forward / reverse, but again these are simply on or off conditions. At this rate it will be next year before I figure this out.

My kingdom for a simple explanation of how to do this. Have read the manuals and the online helps from one end to the other, but Id give the world for something simple and visual like a flow chart or Labview for Dummies. My hat is off to all of you who can grasp the programming side so quickly.

Mike

OK, we finally got it working!! As usual, the problem was our own. The key to making it work was to define the relay powering the compressor as a “Both directions”. When we had it set to “Forward Only” it just would not work.

Simple, but quite frustrating.

Compressor.JPG


Compressor.JPG

I believe that I have done that, but the Spike would not turn on.

I definitely wouldn’t call a bug in the library a problem of your own. Relay Set, aquire cache doesn't connect relay direction - NI Community

I really want to use an expletive right about now.:mad:

This is the kind of information that “should” be made known and be easily found, not buried only on NI’s web site.
Honestly, thank you for pointing this out Joe. Hopefully other teams that are struggling with this will find this info as well.

Ok I made a new code in Teleop with solenoids and Relay and compressors I cant tell if I did this right, and I just followed most of the examples around here and LabView.

Images of Teleop:
Compressor On, Solenoids Extended

Compressor On, Solenoids Retracted

Compressor Off, Solenoids Retracted

Why are you enabling and disabling the compressor based on a joystick button?

Unless you’re doing some fancy power-saving scheme, I don’t see a need to do anything besides opening and starting the compressor in Begin (and closing it in Finish). Everything involved with turning it on when the pressure switch calls for it will be taken care of for you behind the scenes.

Ok considering I have never programmed before(That whole code took me 3 weeks to learn, and that was just the Tank drive) I don’t understand what I should do with the Compressor.

I also have other questions such as the relays being in the right area. Ive done this on the Classmate, and then I gave up due to the tiny keyboard(Try typing at 60 wpm on that thing.)

If its easier for you do you want to contact through email?
[email protected]

Why??
Because there is always more than one way to skin a cat.

Besides, my students now know the logic and coding a bit better than if they let a library do the work for them. I agree it is simpler to have the library do the work, but thinking your way through this process makes the learning that much richer. Additionally, troubleshooting the problems we ran into also made them dig a lot deeper into the code than if it just worked and they didn’t know why.

Alright, Looking around on here, there seems to be one thing I didn’t notice. We cant get a RSL on. Both of our Sidecars do not have RSL leds on or doing anythign at all. Also 2 out of 3 power lights are on, the 6v and Bat are on, but 5v isnt.

Disconnect everything from the digital sidecar (including the 37) pin cable, so that just the power cable is plugged in. If you still only have some of the power leds, there is a problem with the digital sidecar. If all power LEDs are on, add each cable one at a time and see which one causes the 5v power LED to go out.

I changed the wiring to the PD board, now everything is on, EXCEPT FOR THE RSL LED!!!

Update: Got RSL led on, Now I gotta get the Relay to actually turn on. Should I upload pictures of my begin vi? And I deleted the Compressor being enabled by a joystick button. Do I need to use enable compressor for anything?

By the way, if you are going to develop on the classmate and your hands aren’t the right size, try connecting a USB keyboard. I like connecting a mouse as well.

Greg McKaskle