|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Does anyone know how to program in mplab the compressor and pressure switch, compressor at relay7_fwd and the pressure switch connected at rc_dig_in02??? I need the compressor to go on and then stop once it has reached its max pressure. SOMEONE PLEASE HELP ME!!!!
|
|
#2
|
||||
|
||||
|
Re: COMPRESSOR & PRESSURE SWITCH HELP...
One line of code:
/* Power pump only if pressure switch is off. */ relay7_fwd = !rc_dig_in02; Put it in both the teleop code (usually Default_Routine) in in autonomous if you are doing autonomous (in User_Autonomous_Code()) Brian Last edited by SuperBK : 15-02-2008 at 08:29. |
|
#3
|
|||
|
|||
|
Re: COMPRESSOR & PRESSURE SWITCH HELP...
The Nason pressure switch is a normally closed switch, which means it will normally pull your digital input to 0, except once it reaches 120psi, it will switch to 1. All you do to run the compressor knowing that, is set whichever relay you have it connected to, to the opposite of the input.
In your case, I believe this is: Code:
relay7_fwd = !rc_dig_in02; |
|
#4
|
||||
|
||||
|
still nothing someone please help
|
|
#5
|
|||
|
|||
|
Re: COMPRESSOR & PRESSURE SWITCH HELP...
We used the digital input #7 to do our because of the different way that the digital IOs work. You should look at a wiring diagram of the digital IOs and determine witch is best for you.
|
|
#6
|
|||||
|
|||||
|
Re: COMPRESSOR & PRESSURE SWITCH HELP...
Add
Code:
relay7_rev = 0; These answers assume you are using MPLAB w/IFI or Watson default code. What are you using? Tell us what is happening. --Is the compressor turning on, but not off? --What color is the compressor Spike light? --Is your pressure switch wired with only the ground and signal lines (black & white usually), NOT the red wire? --Is the Spike fuse replaced with a 20a snap-action breaker? |
|
#7
|
||||
|
||||
|
Re: COMPRESSOR & PRESSURE SWITCH HELP...
First a clarification question - do you have the compressor hooked up through a spike to relay 7?
Next, check a few things: - does your compressor run if you hook it up straight to the 12V battery? - Can you get the compressor to run through the system (ignoring the pressure switch for right now)? Just set relay7_fwd = 1; and see if it turns it on (make sure the hoses are disconnected so you don't blow something up) - Can you get a reading from the pressure switch? throw in a printf("pressure switch = %d\r\n", rc_dig_in02); somewhere, hook up the hoses, and manually control the compressor to see it run through the full range 0-120psi and back down. Watch the input from the pressure switch on the terminal window, and see how it changes as the pressure changes. Assuming all of that works out, you should be able to see pretty clearly how to wire in the pressure switch to turn on/off the compressor. |
|
#8
|
|||
|
|||
|
Re: COMPRESSOR & PRESSURE SWITCH HELP...
The code that has been given by myself and others WILL work. So if that code has been flashed into your robot, you must make sure that your compressor is working, and that the pwm cables and spikes and everything are set up properly. There is some point in the system that is not working, and its not the code.
|
|
#9
|
|||
|
|||
|
Re: COMPRESSOR & PRESSURE SWITCH HELP...
The connection between the male PWM cable and the
socket in the spike is a frequent source of problems. If you have inspected the code and find it to be in proper order, you can try another spike and/or pwm cable. You should also carefully check that the pwm cable is seating all the way into the socket on the spike. Eugene |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programing the compressor and pressure switch in easy C | Mr Monte 83 | Programming | 1 | 30-01-2008 15:39 |
| [OCCRA]: Problem with the compressor, pressure switch, or Bosch relay. | BrittanyV | OCCRA | 3 | 16-10-2006 15:42 |
| Urgent need for Nason pressure switch!! PLEASE HELP! | haverfordfords | Pneumatics | 12 | 18-02-2005 02:04 |
| HELP US PLEASE?!?!(pressure switch code) | kingpin3787 | General Forum | 1 | 21-02-2004 15:13 |
| NEED HELP with Delay loop for compressor relay switch | archiver | 2001 | 10 | 24-06-2002 02:11 |