|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
programming pneumatics
hi, we are using mplab default code, so basically we can drive two cim motors so far with speed controllers.
we are trying to have the compresser turn on. what shoul we write or do with the relays to have the compresser always on? which relay output # ? can someone copy paste their code about the compresser turning on? as for the nason pressure switch, after we connect it to a digital port, then what?... thanks. |
|
#2
|
|||||
|
|||||
|
Re: programming pneumatics
With the switch connected to a digital INput (other side to ground), you write code like
If (Dig_In_x) equals 1 Set (Spike_Relay_X) to ON ElseIf (Spike_Relay_X) is OFF And check it every loop. DO NOT SET THE COMPRESSOR TO ALWAYS ON, you'll exceed a safe pressure and pop the release valve. You MUST control the compressor, inspectors look for this. (You need to write real code for this) |
|
#3
|
||||
|
||||
|
Re: programming pneumatics
In the default code there is an area that shows how to map out the relays pretty well.
Code:
/*---------- Buttons to Relays---------------------------------------------- *-------------------------------------------------------------------------- * This default code maps the joystick buttons to specific relay outputs. * Relays 1 and 2 use limit switches to stop the movement in one direction. * The & used below is the C symbol for AND */ relay1_fwd = p1_sw_trig & rc_dig_in01; /* FWD only if switch1 is not closed. */ relay1_rev = p1_sw_top & rc_dig_in02; /* REV only if switch2 is not closed. */ relay2_fwd = p2_sw_trig & rc_dig_in03; /* FWD only if switch3 is not closed. */ relay2_rev = p2_sw_top & rc_dig_in04; /* REV only if switch4 is not closed. */ relay3_fwd = p3_sw_trig; relay3_rev = p3_sw_top; relay4_fwd = p4_sw_trig; relay4_rev = p4_sw_top; relay5_fwd = p1_sw_aux1; relay5_rev = p1_sw_aux2; relay6_fwd = p3_sw_aux1; relay6_rev = p3_sw_aux2; relay7_fwd = p4_sw_aux1; relay7_rev = p4_sw_aux2; relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */ relay8_rev = 0; Code:
relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */ |
|
#4
|
||||
|
||||
|
Re: programming pneumatics
Hi all,
This is 2199's first year working with pnumatics. Yesterday we put our "pnumatics board" on last years robot for testing purposes. Prior to yesterday, we had been testing the the compressor and such directly off the battery (of course with fuses etc. so we didn't fry anything) so we know it works. We wired things up with a spike according to the code: Quote:
Can you tell us what we are missing? Thanks |
|
#5
|
|||||
|
|||||
|
Re: programming pneumatics
Quote:
You did have an OI connected via tether or radio, right? |
|
#6
|
|||||
|
|||||
|
Re: programming pneumatics
Did you check the fuse on the Spike or better yet replace it with a 20a snap-action breaker?
Did you set relay8_rev = 0 somewhere? |
|
#7
|
||||
|
||||
|
Re: programming pneumatics
To Alan Anderson,
The LED on the spike stayed orange the whole time. We inserted a printf statement to look at what was being sent out to the spike and we kept the programming cable on the robot and watched the terminal window. A 1 was sent to relay8_fwd. (1 is on 0 is off right?) Still, Nothing happened to the spike. To Mark McLeod, We did check the fuses and they were perfectlly fine. Yes, right under the Quote:
Quote:
Thanks!!! |
|
#8
|
|||||
|
|||||
|
Re: programming pneumatics
It sounds like your robot controller is disabled. Again, do you have an OI attached, either by tether or by radio? Do you have a disable switch connected to the competition port that's turned on by mistake?
What do the lights on the Robot Controller show you? |
|
#9
|
||||
|
||||
|
Re: programming pneumatics
Alan Anderson,
Actually, we have two ways to disabel our robot. When we were improving our one stick driving code earlier, we put in a failsafe to stop the robot to neutral (and it came in handy on several occasions needless to say). We have to hold down one of the buttons on the joystick to enable the robot to move. We also recently made a dongle for "emergency stop", "autonomous", and "regular driving". I'm very sure we enabled the robot through the dongle, but not sure about our origional failsafe. I am very sure the failsafe was only for the drive motors and our failsafe would have shown up on our teminal because we put a printf statement that would have indicated that it was disabled. I don't remember without looking at the code and/or the robot. I have been constantly emailing with the rest of the team and, after seeing some diagrams on wiring, they are also thinking the thing is wired incorrectly. Tomorrow the team will be figuring out why the pnumatics arn't working, and I'll bring the failsafe up. When we figure this out I'll obviously write to tell ya'll about what the problem was. Last edited by Aarnat : 01-02-2008 at 22:05. |
|
#10
|
||||
|
||||
|
Re: programming pneumatics
Hi all,
I found the problem. Some how the "relay8_rev = 0;" was deleted. I put it back in the code and the compressor and preasure switch are now working flawlessly! Thanks for the help! |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PROGRAMMING PNEUMATICS | Reaper40 | Pneumatics | 17 | 02-02-2008 07:55 |
| programming the pneumatics | Armando | Programming | 2 | 17-02-2007 21:47 |
| Programming Pneumatics? | itzrobz | Programming | 2 | 20-01-2007 00:30 |
| Programming of Pneumatics | Ben Piecuch | Programming | 3 | 18-02-2005 02:39 |
| Pneumatics Programming | KWalsh | Programming | 8 | 19-02-2004 09:17 |