Go Down

Topic: False triggering IR light gate (Read 3 times) previous topic - next topic

Pokey


Quote
1. Transient on the power that supplies the IR emitter. You said you had tried isolating the power to the emitter - what do you mean by this? Do you mean you tried driving it from a separate battery or wall wart?


A wall wart at 5v. I tried 5v again this morning to no avail.

Quote
4. A transient in the ground wiring or power supply to the Arduino causing the Arduino to malfunction. However, you said that it can't be resetting. Have you checked that nothing observable happens if you press the reset button? Even if your code does nothing, output pins become floating after a reset until the pinMode call is made, also internal pullups get disabled until they are enabled again. Either of these could cause something to happen.


I have the interrupt programmed to set pin/LED 13 to high. When I start the motor pin 13 goes high, and when I press the reset button pin 13 goes low. If the Arduino were resetting LED 13 would turn off.

I tried disconnecting the ground between the 24v power supply and the rest of the circuit, as Riddick suggested, and the problem did NOT occur when starting the motor manually. So the problem is definitely on the 24v ground. I think this eliminates point 2 (I did try again connecting the sensors directly to an Arduino ground pin though without result) and 3 in your most recent post.

I would rather not have to use optical isolation because I want to get current feedback from the H-bridge. Is there anything else I might try, perhaps and inductor or more/different capacitors on the 24v H-bridge supply (I am just guessing...)?

Thanks.

Pokey

Quote
I tried disconnecting the ground between the 24v power supply and the rest of the circuit, as Riddick suggested, and the problem did NOT occur when starting the motor manually.


I spoke too soon! :smiley-eek: After doing some more testing, the interrupts still trigger when everything is disconnected between the H-bridge board and the Arduino.

RIDDICK

hm

maybe the cables between the arduino and the sensor act as an antenna?
what if u use really short cables?
or what if u put those cables far away from the motor?

or maybe it is like my fridge: the 24V PSU does something on the mains line that the 5V PSU picks up...?
what if u use batteries instead of the 5V PSU?
-Arne

Pokey

#23
Jan 21, 2012, 08:28 pm Last Edit: Jan 21, 2012, 08:31 pm by Pokey Reason: 1
Quote
maybe the cables between the arduino and the sensor act as an antenna?
what if u use really short cables?
or what if u put those cables far away from the motor?


I really think this may be it. I tried grounding the interrupt pins to the Arduino board, using a few inches of wire, and the problem did NOT occur. After doing a lot of searching and reading yesterday, I am beginning to think that my machine's frame itself may be acting as an antenna too (something that had never occurred to me before). It has a 5-foot long rectangular metal frame that is not grounded. (See attached overview photo.)

The machine consists of several motors (including two high-amp AC motors) and several DC motors. I was focusing on getting each component running individually which is why I was looking only at the 24v motor. I have now discovered that any sudden power draw on the AC lines going into the machine will trigger the interrupts.

I will try now:

1) Grounding the machine frame.

2) Installing twisted pair conductors for the sensors.

3) Installing 0.01uF capacitors on the sensor lines.

This is turning into quite a saga, but it is the way I learn things. When I started this project I had no idea how complicated electronics could be... :smiley-sad-blue:

Anyway enough rambling, I will let you know how it works.

Gratefully,

Pokey

dc42

Installing 0.01uF (or even 0.1uF) capacitors on the sensor lines may help, but make sure the ground sides of those capacitors are connected to Arduino ground as close to the Arduino as possible - preferably to an Arduino ground pin that is not the one you connect power in/out or output devices to. Otherwise the capacitors will transmit noise on the ground line from the power supply and/or devices you are controlling to the inputs, and make things worse.

Think of every ground or power supply wire as a potential inductor, which has a voltage appearing across it if the current through it changes suddenly.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Go Up