|
|
|
| We go together like a Drill motor, reduced by 3.6:1, and a CIM motor. |
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
need help with compressor code
my team is having trouble with getting our compressor running. We have tried several different ways to program it, we have tried just the basic code like people have been posting on other threads like this and none of them have worked.
I'll try to get some screenshots of the code up in a little bit. |
|
#2
|
|||||
|
|||||
|
Re: need help with compressor code
Along with your code, please describe in detail how you have the compressor and pressure switch electrically connected to the control system. There are half a dozen ways to get it subtly wrong, and any number of ways to do it completely wrong.
|
|
#3
|
|||
|
|||
|
Re: need help with compressor code
C++ or LabView???
For C++, you need three lines of code: // put as part of your robot class or global, not in function Compressor *compressor; // in constructor [alter Compressor() parameters to match your setup] compressor = new Compressor( PressureSwitchChannel, CompressorRelayChannel ); compressor->Start(); If you have this in, you should see the green LED for the compressor relay light on the Sidecar. If lit, the compressor relay should be energized and the compressor should run. Also, the PressureSwitch digital input needs to be wired up correctly. Make sure port numbers are correct for both relay and pressure switch. Two things to check: 1) Make sure you have a good PWM cable going to the compressor relay. They are notoriously bad. 2) Make sure the PWM cables are plugged in correctly. With the new digital sidecar, it is very easy to plug them in one pin off. If the Relay LED on the sidecar that matches your compressor relay is green and the compressor is not running, a PWM cable issue is usually the problem. Even if you have LabView (I can't help you there) all the non-code issues I mentioned are still valid. Steve C. |
|
#4
|
||||
|
||||
|
Re: need help with compressor code
here is a link to an image of the code, sorry it's a link and not an attachment, it was the fastest way for me to get the whole thing up.
http://www.firstwiki.net/media/2/2d/1737_robot_code.jpg now for the way we have the compressor and relay electrically connected: we have the main power connected to the "12v" side and the output is hooked up to the m+ and m- side of the spike. the pwm cable is plugged in with the black wire (ground) closest to the fuse on the spike. we have the pressure switch wired with a pwm cable, the signal (white) and the ground (black) with the red (power) not connected to anything, that cable is plugged into the 1st slot on the digital sidecar "Digital I/O" section. The spike is plugged into the 1st relay spot on the digital sidecar. we are sure that me have the spike wired correctly, if we take the pwm cable from the spike and place it in the DIO as apposed to the relay spot it will allow the compressor to run and keep filling until you remove the wire. also when we fill the tanks when it gets up to about 115-120psig you can see the pressure switch close on the main dashboard. ...and thanks for the help on this problem, Team 1737 is very grateful for it. ![]() |
|
#5
|
||||
|
||||
|
Re: need help with compressor code
ok, well, as far as i can see you are doing it right (at least if i followed those messy wires correctly), but im sorta baffled why you didnt use the enums to specify the dio, the slot, and the relay port. I think that may be where your problem is stepping in.
|
|
#6
|
|||||
|
|||||
|
Re: need help with compressor code
See all those red dots on your Compressor Open VI? They're telling you something. You can't always use an integer when an enumerated type is expected. Something is probably off by one from what you think you're telling it.
Delete those integer constants (remembering what they are, of course). Right-click on each input of the VI and choose "Create constant" from the pop-up menu. Then you can choose the correct relay number and module number and Digital I/O number from the enumerated constants that appear. |
|
#7
|
||||
|
||||
|
Re: need help with compressor code
replacing the integers with the constants worked, thank you very much for your help.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help with code. | hawk_11 | Programming | 6 | 06-02-2005 13:56 |
| Help With Compressor Code | fred | Programming | 6 | 21-01-2005 17:40 |
| Need help with my code | jaywion | Programming | 9 | 20-03-2004 11:32 |
| hey need some help with writing a code please help me here | magical hands | Programming | 9 | 01-01-2004 21:46 |
| NEED HELP with Delay loop for compressor relay switch | archiver | 2001 | 10 | 24-06-2002 02:11 |