View Full Version : Digital Inputs interfering with each other
Edit2: This problem has probably been solved, all you heroic problem solvers can go save some other team at the last moment.
Edit: When I say compressor in the below paragraph, I am talking about the pressure switch. Sorry for the bad writing, I guess it comes off as me saying the compressor is wired directly to the RC. This is not the case.
Basically, the title is my problem.
We have our digital inputs set up like this:
1: Right infrared sensor
2: Middle infrared sensor
3: Left infrared sensor
5: A little pressure switch (just installed)
6: Compressor pressure switch (was working)
Before we installed the little pressure switch, we were having problems, but it made them worse. Before, when the compressor switch was on (value=0), none of the infrared sensors would pick up anything. Once the compressor switch turned off (value=1), they would act normally. When we put on this little switch, things got worse. The compressor switch would still go on (value=0) and off (value=1) normally, but whenever the switch was pressed, it would cause rc_dig_in06 to change to 0, causing the compressor to turn on. rc_dig_in06 would operate in complete opposition to rc_dig_in05. So, in an effort to debug the problem, we moved the compressor switch to rc_dig_in10, while monitoring rc_dig_in06. When we put the compressor on the 10th one, it would continue to act in opposition of the switch, while rc_dig_in06 was acting quite normally, in that it was always 1, never changing (as it had nothing hooked up to it)
In summary, here is our wierdness:
1. rc_dig_in01 = rc_dig_in02 = rc_dig_in03 = 1 when the compressor is running, but act properly when it is off.
2. Compressor pressure switch = !little switch (that's a NOT operator). When compressor switch is moved to different input, problems persist.
3. When the switch is taken off, all is well (although problem #1 persists)
Our compressor pressure switch is wired so that we have the yellow and white wires (signal and middle of PWM cable) on one side, and the black wire on the other side. We never quite figured out how we were supposed to wire it, but that configuration seemed to be working fine.
Kevin Karan
23-02-2004, 08:33
woh, dont run spikes on the digital in/outs! run them on the relays!
velocipenguin
23-02-2004, 08:52
Our compressor pressure switch is wired so that we have the yellow and white wires (signal and middle of PWM cable) on one side, and the black wire on the other side. We never quite figured out how we were supposed to wire it, but that configuration seemed to be working fine.
That won't work. The RC digital inputs have an internal pullup to 5 volts, so you need to connect switches between the signal and ground pins.
Kevin Karan
23-02-2004, 09:05
I wouldent be suprised if the entire problem was due to the huge power drain on your controler. You may have even damaged it. The way you power the pump is via a spike/relay. You wire the pump so its powered by the spike and then you wire a control wire to a relay output.
I wouldent be suprised if the entire problem was due to the huge power drain on your controler. You may have even damaged it. The way you power the pump is via a spike/relay. You wire the pump so its powered by the spike and then you wire a control wire to a relay output.
No, no. The compressor is powered properly, from the breaker panel. The pressure switch, that turns off at 115psi, and turns on at 95psi is wired to the RC. Then, a signal goes out the relay output to the spike.
In the interest of clarification, here is a simplified picture of our wiring
http://www.imageshack.us/files1/rc.PNG
Not pictured: Breaker Panel, fuses, etc. Assume that the compressor receives it's power properly.
Edit:
That won't work. The RC digital inputs have an internal pullup to 5 volts, so you need to connect switches between the signal and ground pins.
I'll pass that on. So we shouldn't have all three wires connected, only 2?
KenWittlief
23-02-2004, 09:17
Im not sure what you might have wrong with your wiring - some things to check:
1. switches only need to be connected between the ground pin and the signal pin - the black and white wires on the pwm cables if thats what you are using which goto the outside pins on the 3 pin digital input connector. If you connect a switch across the red and black wires (+5V and Gnd) that would tend to make the whole digital input section wack out.
2. the IR sensors - are you talking about the banner sensors (yellow and black box with 4 wires) or the little 3 pin photodetector for tracking the beacon? The photodetectors dont goto the digital inputs - they must be used with interrupt because they pulse on and off when they see the beacon (low for 1 or 2mS and high for 9 or 8 mS) - they have to be on the interrupts pins so the transisition from H to L can be captured - if you have them on digital inputs and try to read them then sometimes you will see the H and sometimes you will see the L, even when it IS locked on the beacon.
3. carefully check all your wires and make sure a power wire is not loose in a terminal somewhere, and make sure someone didnt knock off a pwm wire to a spike and plug it in backwards.
Im not sure what you might have wrong with your wiring - some things to check:
1. switches only need to be connected between the ground pin and the signal pin - the black and white wires on the pwm cables if thats what you are using which goto the outside pins on the 3 pin digital input connector. If you connect a switch across the red and black wires (+5V and Gnd) that would tend to make the whole digital input section wack out.
2. the IR sensors - are you talking about the banner sensors (yellow and black box with 4 wires) or the little 3 pin photodetector for tracking the beacon? The photodetectors dont goto the digital inputs - they must be used with interrupt because they pulse on and off when they see the beacon (low for 1 or 2mS and high for 9 or 8 mS) - they have to be on the interrupts pins so the transisition from H to L can be captured - if you have them on digital inputs and try to read them then sometimes you will see the H and sometimes you will see the L, even when it IS locked on the beacon.
3. carefully check all your wires and make sure a power wire is not loose in a terminal somewhere, and make sure someone didnt knock off a pwm wire to a spike and plug it in backwards.
Thank you. That's awesome, we were plugging the compressor switch into all 3 at once (problem #1 ahoy!). For the IR sensors, I am talking about the black photodetectors. I wasn't aware that I had to use them with the interrupts, and it's a bit late now to change it. What I did is I made a little workaroud. I found that the sensor always knew when it was off, but knew about 50% of the time that it was on. So, I made some code that would 'remember' that it was recently on for about 7 cycles of the control loop. This actually works great, as long as the saudering on our photodetectors holds up. Thank you for all your help.
And I just re-read my original post, and it is perfectly forgiveable to believe that we had wired our compressor to our RC. Wow, I need a writing class.
KenWittlief
23-02-2004, 09:48
ok now which pressure sensor are you using?
FIRST supplied you with two - one that is analog and has three wires coming out of it
and one that is simply a switch - it has two screws to attach terminals - this is the one you want for the digital inputs - if thats the one you are using I cant imagine how you attached three wires to it
no wait, there are some things I dont want to know :c)
ok now which pressure sensor are you using?
FIRST supplied you with two - one that is analog and has three wires coming out of it
and one that is simply a switch - it has two screws to attach terminals - this is the one you want for the digital inputs - if thats the one you are using I cant imagine how you attached three wires to it
no wait, there are some things I dont want to know :c)
Wow, your sig was either tailored to respond to my post, or that's kinda creepy.
We were using a switch with 3 terminals. It didn't look like the in-out part of the switch was deep enough to be analog (it may have been from some of the scrap electronics we have), but I guess that's part of the problem we have. On one hand, our robot is entirely student fabricated by monetary necessity, and will actually chinup easily and quickly, but electronically, it is quite basic. See whine below.
<whine subject='programming' tone='unhappy'>
The more I come on to this site, the more I realize that our school does not have a strong electronics team. I live 2 hours away from the team (I'm the programming mentor, and was the programmer last year), and it doesn't seem that anyone has been doing this type of research when I'm away. The programmer would program stuff, but nobody tried to hook up the photodetectors, nobody tried to figure out how to wire stuff to the RC, nobody thought about this stuff unless I was around. Oh well, maybe this year's seemingly inevitable weak autonomous mode, combined with last years non-existing autonomous mode will encourage more attention to be paid to the programming side of things.
I admit that I'm guilty of not knowing a thing about interrupts (and actually avoiding learning about them), but I've only been up to the robot 3 weekends over the build period (I've had swim meets on the other 2 weekends, and we didn't have a meeting on the first weekend, we were waiting for supplies), so I should definetely not be go-to guy on basically anything. Unfortunately, it appears next year will be even worse, as I won't be around to help (will have a school term for january-april), and there aren't many up-and-coming programmers to replace our graduating one this year.
</whine>
Edit: Ken, did you guys go to the Canadian Regional last year? I think we may have been allies on one of our first matches.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.