PDA

View Full Version : Noise



Lightfoot
03-21-2007, 02:12 PM
I have an electric motor (model train locomotive)·that I am intending to control with PWM from an SX.· The chip uses a serin statement from a UM232R USB to serial module.· When I switch that motor on, the data in the SX gets messed up and the UM232R stops responding.· Nothing but that motor introduces noise.· I have tried capacitors, short wire lengths, etc·and nothing works.·· However·the wires that attach to the lm338 regulator and rectifiers are long·aligator clips, could this cause it?· The logic is powered by a 7805·off the same rectifier as the motor.· I tried an independent rectifier for the logic·that helped a little but did not stop the problem.

thanks a bunch :)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

stamptrol
03-21-2007, 06:53 PM
Lightfoot,

For sure, that motor will be a noisy beast, not only from its brushes but from the connection at the rails, too. Drawing from the same source that feeds your electronics, it may also draw the voltage down enough to cause the chip to reset. You speak of two regulators; do you have a schematic?

I'd suggest powering the electronics with a completely separate, well filtered power supply. Make sure the negatives of both supplies are tied together, though. You'll probably also have to use the capacitiors as well.

Cheers,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·

Lightfoot
03-22-2007, 01:49 AM
Even if I use a seperate transformer, rectifier, and filter the same thing happens.



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Post Edited (Lightfoot) : 3/25/2007 4:19:36 AM GMT

stamptrol
03-22-2007, 02:38 AM
Lightfoot,

Intuitively, the brush noise, etc is of relatively high frequency. Therefore, it will take a much smaller cap value ( 0.1 down to 0.01 uF) to make much of a difference. Put those caps on the outputs of each regulator and also as close to the power terminals of the chips as you can get. Also review the reset pin on the chip to see if it should be pulled high or low.

Again, from experience, separated supplies may still be needed.

Regards,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·

PJ Allen
03-22-2007, 07:23 AM
Wondering about running the PWM from the SX into an opto-coupler (4N..) --·isolate the SX electronics from the train·voltage/s altogether·(no shared Grounds or anything else, here.)·

Even better, one of those hobby fibre-optic kits (with the plastic light "fibre"), you could get several feet of separation.


Post Edited (PJ Allen) : 3/22/2007 3:28:09 AM GMT

Lightfoot
03-25-2007, 06:59 AM
What optocoupler do you recommend I use?· I have a schematic for my plan (see attached).· The Absolute Maximum Voltage·Rating for the PWM and Direction pins·is 12 volts.· Is it a good idea to use 12 volts on these pins, or should I use a lower voltage, or put a resistor between the pins and optocoupler detector?· Note, the LED is not connected; however it will be attached to my logic ground and the output of the sx.

http://cache.national.com/ds/LM/LMD18200.pdf.·


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Post Edited (Lightfoot) : 3/25/2007 12:10:51 AM GMT

T Chap
03-25-2007, 08:06 AM
Have you tried putting a large cap near the 18200? Maybe 100uF - 470uF range. Also, you could try shielded cable on the serial connections. Make sure you have a .1, 10uF on the input and output of the 350, add .01's even. Without the optos, all GNDs should be tied with some good wire. I am wondering what the rating on the motor is, since you aren't doing any current limiting, you could be hitting the supply really hard on start up. I don't know if the opto is going to solve your problem, since the problem looks more liek a supply getting hit to hard, or noise hitting the com lines. A separate supply on the motor is a good idea, but connecdt all GNDs if no optos.

Post Edited (TChapman) : 3/25/2007 1:13:20 AM GMT

Lightfoot
03-25-2007, 09:55 AM
I like the opto coupler idea better.· I have a revised schematic.· The logic portion and the locomotive supply portion are completely seperate, their own grounds and everything.· The only connection is the optocouplers.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Post Edited (Lightfoot) : 3/25/2007 6:18:03 PM GMT

T Chap
03-25-2007, 01:13 PM
You are still having the same problem?

Lightfoot
03-25-2007, 03:53 PM
Haven't tried it yet, on paper it seems like it will work.· That noisy locomotive power supply·is isolated from·the logic circuits with high frequency noise.·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Phil Pilgrim (PhiPi)
03-26-2007, 12:42 AM
Lightfoot,

In your schematic, the photodiodes in the optocouplers are wired backwards. Also, the 100K resistors on the phototransistors probably ought to be a lot smaller. Even then, though, I doubt you're going to be happy with the PWM performance. The reason is that phototransistors, when used in voltage mode as you're doing, switch very slowly. I don't know what your PWM frequency is, but if it's over a few hundred Hertz, you won't see a clean squarewave on the output of OC1 — especially at the duty cycle extremes. You might take a look at a different kind of optocoupler. The H11L1, for example, has a built-in Schmitt trigger and switching times in the microsecond range.

-Phil

Lightfoot
03-26-2007, 01:03 AM
Here is the·revised locomotive supply portion of the·schematic, good thing you caught that, thanks.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Post Edited (Lightfoot) : 3/25/2007 6:17:36 PM GMT

Lightfoot
03-26-2007, 06:48 AM
I am using this command to PWM my HO trains.

'The rb bits specify the duty cycle.


PWM RA.0, rb, 1
In other applications I used this code to PWM.· My model train locomotives respond well to it.· Is this optocoupler fast enough?


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Post Edited (Lightfoot) : 3/26/2007 5:59:20 AM GMT

Phil Pilgrim (PhiPi)
03-26-2007, 09:29 AM
Be sure to add pullups (2.2K) to the H11L1 outputs. Even though they're logic-based, they're still open-collector.

-Phil

Lightfoot
03-26-2007, 12:56 PM
Am I OK with the switching speed?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Phil Pilgrim (PhiPi)
03-27-2007, 12:20 AM
You'll just have to try it. I don't know what your PWM frequency is, but you won't be able to do better without spending a lot more money on isolation solutions.

-Phil

T Chap
03-27-2007, 12:28 AM
If your PWM is too fast for the opto discussed above,here are some fiber optics parts that may or may not be faster than the opto mentioned(I didn't read up on the part you are looking at).

The fastest detector at this site is 155mbps, shown in the link. Scan around the site for the transmitter LED to match it.

www.i-fiberoptics.com/leds/IFD98.pdf (http://www.i-fiberoptics.com/leds/IFD98.pdf)