|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Help with Solenoid Code In Java?
looking for some help. we're reprogramming our bot from last year in java to practice for next season.
I've run into a problem with our pneumatic system. I can turn on the compressor on but our code to switch the solenoids doesn't seem to do anything. Note that our pneumatics are not completely hooked up mechanically but we should still be able to hear the solenoids click if they were switching right? We have the double solenoids that Festo provided in the Kit of parts last year. Looking through the Java packages I found both a "Solenoid" package and a "DoubleSolenoid" package. I wasn't sure which one to use so I tried both but both do not work. If anybody has any insight that would be greatly welcomed. All of our code is online at http://code.google.com/p/sail-octopirates-first-3502/ Note, code for both packages is in there, one of them has been commented out. Thanks a bunch!! |
|
#2
|
||||||
|
||||||
|
Re: Help with Solenoid Code In Java?
Quote:
Are the lights on the NI 9472 module lighting up? That should be sufficient to tell you that your code is working. There is 1 light for each solenoid output. |
|
#3
|
|||
|
|||
|
Re: Help with Solenoid Code In Java?
we've done some more troubleshooting but still are not getting the right results. here's what we've figured out.
we called festo and found out that we had our solenoid configured wrong. we had the connections for the air tubes in the wrong places. anyhow, now we know that the solenoids are right because we can manually apply voltage to them and have them switch correctly. we also have our pneumatics fully hooked up mechanically now and we know it holds pressure. so then we tried the code again. when the robot is turned on, one of the lights on the solenoid turns on. this is before we ever enable the driver station. after enabling and waiting for it to get up to pressure, we try to switch it but no go. did some more investigating on the solenoid breakout. there is no voltage coming out of any of the slots / pin pairs (1 through 8) except for the one that gives us lights. this should be normal right? as in only voltage should go to one side of the double solenoid at a time. so it must be our code right? but once we get this double solenoid working, we actually want to add in another one. is there a way to code so that the solenoid breakout gives power to 2 slots / pin pairs at a time? befuddled. |
|
#4
|
||||||
|
||||||
|
Re: Help with Solenoid Code In Java?
Quote:
It does sound like the code. Have you tried simplifying your code so you aren't dependent on your joystick code, to help isolate the problem? I don't see anything obviously wrong, but I'm not a java expert. |
|
#5
|
|||
|
|||
|
Re: Help with Solenoid Code In Java?
try making it grip.set(true)
also make sure that you're not putting the solenoids in the digital sidecar, but on the solenoid breakout and on the ports you identified in the code |
|
#6
|
|||
|
|||
|
Re: Help with Solenoid Code In Java?
We figured it out! After much research into the wpilibj files, it turns out we just had the 9472 module plugged into the wrong slot. (although we did try to define the slot in the code before and it didn't work either). our code is working great now and we've even been able to get two double solenoid valves working.
of course after we figured that out, i noticed that the driver station even says "slot 8" for the solenoids. never noticed that before. whew! and just in case anyone else is looking for the info, the default slots in the cRio are: slot 8 for the 9472 module, slot 1 for the analog module, and slot 4 for the digital module. thanks for everyone's help! |
|
#7
|
||||||
|
||||||
|
Re: Help with Solenoid Code In Java?
Alternate slots are 7 for the 9472, 2 for the analog module, and 6 for the digital module. Any other module in any other slot won't work.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|