View Full Version : Coding Relay with Compressor
Poke2201
15-02-2010, 20:43
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.
Alan Anderson
15-02-2010, 23:45
Does it work if you use the Solenoid With Compressor Example?
Mark McLeod
15-02-2010, 23:48
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.
Poke2201
16-02-2010, 01:23
Ive only used the examples as references. How do you test one through an example?
Alan Anderson
16-02-2010, 08:49
Ive only used the examples as references. How do you test one through an example?
Run it. Change the IP address first:
Note: In order to run this example, you will need to change the IP address of the cRIO in the Solenoid With Compressor Example project. You can do this by right-clicking on RT CompactRIO Target in the project, selecting Properties, and modifying the IP Address setting in the General Category to match that of your cRIO.
Mark McLeod
16-02-2010, 08:53
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
billbo911
16-02-2010, 21:05
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.
Poke2201
16-02-2010, 21:57
I believe that I have done that, but the Spike would not turn on.
Joe Ross
16-02-2010, 22:37
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.
I definitely wouldn't call a bug in the library a problem of your own. http://decibel.ni.com/content/thread/6131
billbo911
16-02-2010, 22:54
I definitely wouldn't call a bug in the library a problem of your own. http://decibel.ni.com/content/thread/6131
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.
Poke2201
16-02-2010, 23:51
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
http://i49.tinypic.com/2r2n4hz.jpg
Compressor On, Solenoids Retracted
http://i48.tinypic.com/16m1w7s.jpg
Compressor Off, Solenoids Retracted
http://i47.tinypic.com/npmo9f.jpg
Alan Anderson
17-02-2010, 00:48
[SIZE="5"]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.
Why are you defining an explicit relay for the compressor instead of using the Open Compressor vi? It's a lot less of a hassle to let the library code deal with reading the pressure switch and running the compressor as needed.
Alan Anderson
17-02-2010, 00:51
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.
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.
Poke2201
17-02-2010, 00:58
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?
j_arucan@yahoo.com
billbo911
17-02-2010, 01:26
Why are you defining an explicit relay for the compressor instead of using the Open Compressor vi? It's a lot less of a hassle to let the library code deal with reading the pressure switch and running the compressor as needed.
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.
Poke2201
17-02-2010, 19:22
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.
Joe Ross
17-02-2010, 19:53
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.
Poke2201
17-02-2010, 20:10
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?
Greg McKaskle
18-02-2010, 06:28
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
Mark McLeod
18-02-2010, 10:06
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?
What did you do to get the RSL back?
Just post the Begin.vi itself instead of a picture. It's easier to check that way. Ther's always something off the edge of the photo that can't be seen and should be.
You only need to use Compressor Start.
Compressor Enabled is only there to let you check if the compressor is on or not. It doesn't take any action. It's like getting the value of a button off a joystick Get.
umangv620
18-02-2010, 18:11
(kinda off topic)According to my knowledge, FIRST does not support windows 7 with LabView. But if it works for you, great!
Poke2201
18-02-2010, 18:35
Alright Ill post our code on it, I followed your examples in the begin.vi though
Poke2201
18-02-2010, 19:25
Begin vi.
Poke2201
19-02-2010, 18:31
Solenoid and compressor vi. doesn't work, watch dog times out too fast
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.