![]() |
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. |
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) |
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----------------------------------------------Code:
relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */ |
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 |
Re: programming pneumatics
Quote:
You did have an OI connected via tether or radio, right? |
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? |
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!!! |
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? |
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. |
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! |
| All times are GMT -5. The time now is 23:53. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi