![]() |
Pneumatic Coding Problem
Hello All FIRST Teams who read this.
My question goes out to the programmers. I was wondering if anyone knew a line of code that we could use to shut our compressor off once the pressure on the pressure guage reached 115psi and turned it back on if it dropped to around 30psi. our mapping is as follows: digital_io_out17 /Compressor/ digital_io_out18 /Pressure Guage/ If someoue could help us that would be great! Thanks alot guys //~!AaRoN!~ |
Re: Coding Problems?
Quote:
I presume you mean the digital pressure switch? If you are, this code is really obvious and I'm sure you'll figure it out if you just think about it. I'll give you a hint: if |
Re: Coding Problems?
if...:) yesh, that's what it is, lol... ok so..uhm, tell me if this is right?
if digital_io_out18 = 115; then..uhm...? lol sorry i'm not THE greatest with C... hmm..see i was looking through trying to find a list of acceptable codes in C for robotics but i coudn't seem to find a list so I'm tryin' to figure it out...but you can use then statements..correct..? Thanks |
Re: Coding Problems?
30psi? You wont be able to do much of anything with 30psi but if you really want it to kick in at 30psi you are going to have to use the pressure transducer and a few if statements. If you want to use the pressure switch it switches off at about 115 and back on down around 80-90 (I think). The code for it is in the default user_routines.c
|
Re: Coding Problems?
The line of code that you need is already in the default code. Connect the switch to digital I/O 18, and the compressor to relay 8. You CANNOT power the compressor with a digital I/O pin.
|
Re: Coding Problems?
Quote:
|
Re: Coding Problems?
Quote:
when you make an if statement you don't use a then statement like in BASIC. Take a couple hours and read some documentation. On this site is the official Programming reference PDFs they have code that is specific to the FIRST controller. the 2004 version is what you want there is no 2005 edition. look on page 19 in the gray code box it shows an if statement for an input and a pwm. http://www.ifirobotics.com/rc.shtml#Programming A genecic c programming book would be a worthwhile buy. Have fun you about to become a professional C programmer! |
Re: Pneumatic Coding Problem
lasoaaro,
There are a few quick things you need to be aware of: Your compressor should be hooked up to a "Relay" output, not a digital output. On your robot controller, you will see plugs labelled "Relay Outputs." These should be wired to a SPIKE Relay module, which in turn should be wired to your compressor. The SPIKE driving the compressor should NOT be wiring to a Digital Output as you have mentioned. Additionally, the Nason Pressure Switch should be wired directly to a Digital Input (not output as you stated - they are the same plugs, but you can configure them to be inputs OR outputs in software). Again you will see plugs marked "Digital In/Out" on the robot controller. Once everything is wired correctly, the correct code to use should be: Code:
I noticed you are located in Peterborough. I don't know if it's feasible to visit Toronto, however if you are having programming difficulties, contact the director for the Regional(s) that you are attending, and they will be able to hook you up with a veteran programmer to assist you, or to arrange a time to visit a nearby team for help. -SlimBoJones... Quote:
|
Re: Pneumatic Coding Problem
Why in the pneumatics manuel does it state
Quote:
Quote:
Quote:
This is the code that comes pre-programmed into the bot... so why in the manual does it deny it? |
Re: Pneumatic Coding Problem
this doesnt work for us any suggestions
|
Re: Pneumatic Coding Problem
Doesnt work??
Check List: 1) Pump hooked up to a spike relay, hooked up to relay header 8 2) Pressure switch wired between ground and signal on a pwm cable hooked to dig_in 18 3) no rogue programming activitys 4) bot turned on This should work fine, when the pneumatics get up to 115psi then it shuts off and resumes at 95psi, cant think of any reason why that wouldnt work... |
Re: Pneumatic Coding Problem
Quote:
For instance, our team needed digital input 18 for a multi-bit binary switch, the default pressure switch input was in the way (for deeper programming reasons), so we moved the pressure sensor to a different digital input. |
| All times are GMT -5. The time now is 17:13. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi