Electrial Noise from Motor Issue?

joe paul

Senior Member
Hi Folks,

Very much appreciate all the help I have been getting here. Thank God for beginners luck, because yesterday I had nothing but issues. I have a bad HC-06 module, then the PicAxe was resetting itself, I guess, from electrical noise from the motor (once the motor got up to about mid speed), then trying by process of elimination to isolate the problem, I destroyed a whole day's work. So here is my issue -- seems the AXE002 (CHI030 ) board is more tolerant of the electrical noise than my copy of circuit built on perf-board. I have a little capacitor across the motor as well as the "snubber" diode. So, what I can do to really inhibit the electrical noise? I am using a separate power supply for the motor and a mosfet, the IRF 540-NS. Can someone direct me to something like filtering circuits?

Also, do others here have problems getting faulty components from China? The one HC-06 always seemed a little flakey but now doesn't send, although I can connect. Sometimes it wasn't turning on (status LED didn't flash). Any recommendations on sources for these things?

So I think I will just buy a couple more of those CHI030 boards. Does electrical noise create issues with the Bluetooth?


Thanks!

Take care, Joe.
 

premelec

Senior Member
Assuming a brushed dc or ac motor of any size a lot of noise is generated - put an AM radio near it and listen :) you may need more filtering than a small capacitor. As to Blue Tooth interference specifically - does the BT work fine with motor off and crap out with motor on? Does the PICAXE reset when you turn the motor on etc... isolation of problems is a large part of getting successful systems going... a general search on Internet will give you lots of stuff about filtering - inductors, capacitors, snubbers, shielded cages etc... etc. Keep at it - if your replica has longer leads fewer bypass capacitors etc that's likely the trouble. So many ways things can NOT work right :)
 

joe paul

Senior Member
Hi Premelec,

Yes, the chip does reset itself when the motor gets up to about mid speed. Seems more of an issue on my homemade board. Circuit o.k. with just a light. I am continuing to troubleshoot it.

Thanks!

Take care, Joe.
 

premelec

Senior Member
And I'll stick with my advice to not leave any pins floating... if you use filter inductors to the motor be sure they can handle the current [I don't know what motor you have - there's a huge range of sizes]. The current of the motor is likely highest when starting - it's a bit old things happen when getting up to speed - unless related to the sparking armature frequencies..
 

joe paul

Senior Member
Hi Premelec,

I just put 2 motors through their paces from the circuit built on the CHI030 board, and I think you have made a good observation because none of those input pins float. I have 2 output pins floating because I broke/bent pins from the Darlingtion array. And I never really paid attention to the caps on the board. So considering what you pay for parts, the readymade board is a bargain. I did put an extra cap across the leads as they attach to the tracks. The motors already have the tiny ceramic caps across the leads.

Thanks!

Take care, Joe.
 

premelec

Senior Member
It was noted in an earlier post that floating pins could cause higher current draw - that's a clue to possible glitches in variation in power supply currents causing transients in the power system. Basically my opinion is that good practice allows no pin to float and avoids a lot of possible problems... and sometimes it's no problem :)
 

joe paul

Senior Member
Hi Folks,

After a lot of head scratching, soldering, testing, and indigestion, I finally got one piece of the puzzle solved. Seems I started to get relay chatter; that was the first time with the PicAxe. (The relay is for reversing polarity to the track.) Thought it was perhaps the power supplies. Should have figured it was the lack of the extra capacitors on the circuit. I have filtered supplies, one a switching and the other the 12VDC, so seems the mighty capacitor was the cure. And the PicAxe chip can take a lot of abuse!!!!!!!!!! So perhaps that was the issue with the Bluetooth module, the "ripple." I will put a little cap on the relay also although I never had to do that with the Darlington array. Perhaps something with the little transistor.

Right now all the pins are floating except for B.6 and B.4, but I haven't done the full range testing with the HC-06 module and other things. I put an extra 0.1uf cap across the rails also.

So to sum up so far, I assume that the CHI030 board worked better than my homemade circuit on perf-board because of the caps. I will tie down the pins one at a time and see what happens. A few extra resistors can't hurt. The confusing thing was that the usual relay chatter that you get with ripple is more rapid and regular. The uncorrected chatter was irregular and slower, if that helps to identify the problem.

I still don't know if the noise is a factor. The Mosfet seems to be alright after all the soldering and unsoldering.

As always, thanks for the moral support and information. I will keep everyone posted!

Take care, Joe.

P.S. Just tied down the programming input pin and everything works really good -- still testing! J.
 
Last edited:

joe paul

Senior Member
Hi Folks,

Well, I got the project all stuffed into a trailing car and so far with my testing, only once did the chip reset itself, I guess due to the electrical noise. So as I understand from those who work with the commercial radio controlled train systems, the environment is full of electrical noise. But I think I am vulnerable with my own board and since some pins are still floating. If I like this way of controlling things, I will use a purchased board with no pins floating. The large capacitors used to filter and smooth the rectified AC take up a lot of room inside the ore car. The lantern is track powered and doesn't go through the circuit at all. Aside from the MOSFET, there is only a tiny relay to reverse motor polarity. I used a diode string of 12 diodes to cut rectified power from about 22 VDC to 16 VDC. When you rectify 16-18 VAC and filter it with a big cap, you get something like 22 VDC. The voltage regulator takes 12-24 VDC and yields 5 VDC for the Picaxe and Bluetooth transceiver. The motor in the handcar is rated at 18 VDC max, but usually needs about 10 volts. I am pulling a little bit of a load, so it needs more juice and more frequent lubrication. I am using the approx. 16-18 VAC on the rails because that is the standard for the 3 rail O gauge wireless control systems, and can be used with older and vintage 3 rail toy train power supplies / transformers.

Here is the vid:

[video=youtube_share;IPbbbPlePZ4]http://youtu.be/IPbbbPlePZ4[/video]


I will keep everyone posted on my stuff!

Thanks, everyone, for the tips and corrections!

Take care, Joe.
 

joe paul

Senior Member
Hi Rick,

I almost missed your question; for some reason I don't get notifications.

I just completed a page on my site: http://www.josephrampolla.com/PicAxeBluetooth.html Everything is there in a nutshell. I am happy to share and get advice. (Still doing some proof reading and refining.)

Code:
setfreq m8 

main: 

serin C.0, T9600_8,b0,b1 

if b1 = 48 then goto zero       ;48 to 57 is ASCII for "0" to "9" 
if b1 = 49 then goto one 
if b1 = 50 then goto two 
if b1 = 51 then goto three 
if b1 = 52 then goto four 
if b1 = 53 then goto five 
if b1 = 54 then goto six 
if b1 = 55 then goto seven 
if b1 = 56 then goto eight 
if b1 = 57 then goto nine 
if b0 = 99 then goto Direction       ;99 is ASCII for lowercase "c" 
if b0 = 109 then goto ZeroZero       ;109 is ASCII for lowercase "m" 
if b0 = 110 then goto ZeroReset       ;110 is ASCII for lowercase "n" 

goto main 

zero: 
pwmout B.6, OFF 
Let b2=0 
goto main 

one: 
pwmout B.6, 99, 200 
Let b2=1 
goto main 

two: 
pwmout B.6, 99, 250 
Let b2=2 
goto main 

three: 
pwmout B.6, 99, 275 
Let b2=3 
goto main 

four: 
pwmout B.6, 99, 300 
Let b2=4 
goto main 

five: 
pwmout B.6, 99, 325 
Let b2=5 
goto main 

six: 
pwmout B.6, 99, 350 
Let b2=6 
goto main 

seven: 
pwmout B.6, 99, 375 
Let b2=7 
goto main 

eight: 
pwmout B.6, 99, 400 
Let b2=8 
goto main 

nine: 
pwmout B.6, 99, 450 
Let b2=9 
Goto main 

Direction:      ; reverses leads to the tracks 
pwmout B.6, OFF 
pause 2000 
toggle B.4 
goto ZeroReset 


ZeroZero:       ;PMW OFF 

 pwmout B.6, OFF 

goto main 

zeroReset:       ; for release of STOP/direction button 

if b2=0 then goto Zero 
If b2=1 then goto One 
If b2=2 then goto Two 
If b2=3 then goto Three 
If b2=4 then goto Four 
if b2=5 then goto Five 
If b2=6 then goto Six 
If b2=7 then goto Seven 
If b2=8 then goto Eight 
If b2=9 then goto Nine 

 goto main
Good Luck!
Take care, Joe.
 
Last edited:

westaust55

Moderator
A word of advice that may help others who believe adding a capacitor across motor terminals will always be helpful.

Yes, for a simple on/off type controller by all means or where there is only one motor on a given supply and no electronics using the same supply then, add the capacitor.

I had a recent experience with PWM control of a 12 Vdc motors using a particular brand of motor controller. It would seem that some PWM type motor drivers are far better able to cope with a capacitor across the motor than others.

In simple terms:

For the particular brand that gave me grief, until the reason was identified with the aid of an oscilloscope, the 0.1 uF ceramic type capacitor across the nominal 12 Vdc motor was causing very high current draw briefly at each PWM turn on resulting in the supply voltage dipping significantly. This is on a 5 Amp supply with a motor only drawing around 0.1 Amps but the brief momentary high charging current caused the voltage to dip by at least 35 percent. Some other makes of PWM controller exhibited far less or no similar current draw and voltage fluctuations. The significant voltage dips were causing grief for other electronics connected to and monitoring the supply bus voltage for superimposed data signals.
This situation did not affect to operation of the motor itself but the “noise” at 15 kHz from the significant voltage dips on the power supply did create too much interference for other devices. Another make of PWM controller with a 20 kHz switching frequency generated only minor voltage dips (less than 10%) at the power supply bus.
In my case, removal of the 0.1 uF capacitors across the 12 Vdc motors solved the problem and all systems from all various makes are now operating successfully together with no voltage fluctuations on the supply bus.
 

joe paul

Senior Member
Hi Westaust55,

Thanks for the tip!!! The first time I ever used the little ceramic cap on a motor was for a project using a commercially produced electronic rail cleaner for model railroad track that uses high frequency AC to ionize the dirt on the rails and wheels. Up until then, I only used big electrolytic caps across a motor for a flywheel effect. I don't understand all of this very well; sort of self-taught with the electronics, with the help of kind people on forums like this. But if something works, I do it. Never thought to try to see if the removal of the cap improved things. I think I still had some ripple on the DC to the chip and that was my real issue. I tried so many variations when the chip was restarting, I lost track of what I did.

Thanks!

Take care, Joe.
 

eggdweather

Senior Member
During the switching transition the reactance of the capacitor would fall causing an effective increased load. The slower the edges of the PWM driver the better (less effect) and faster the worst the effect would be.

Derived from Xc=1/(2xPI*F*C) and a fourier analysis of the switching event would yield many high frequency (F) components and the reactance would vary throughout the transition - often called sub-transient reactance.
 

AllyCat

Senior Member
Hi,

I had a recent experience with PWM control of a 12 Vdc motors using a particular brand of motor controller. ...... the 0.1 uF ceramic type capacitor across the nominal 12 Vdc motor was causing very high current draw briefly at each PWM turn on ....
IMHO that's a major design fault with the "controller". ANY commercial PWM device should have a low-pass (L-C) filter mounted directly on the circuit board close to the output transistors, at least to avoid RFI (and maybe to work properly).

Having almost cut my teeth developing "serious" high frequency PWM systems almost 50 years ago, I'm horrified by what is still being done in the name of PWM (or "Class D"). As others have said above, a square wave contains many high frequency harmonics and to connect it directly to a "piece of wire" (aka an antenna) will nearly always create an (illegal) radio transmitter.

In those early days we had to contend with the apalling reputation of "Class D" created by Clive Sinclair's "X-10" audio amplifiers. Fortunately, at least the amplifiers themselves blew up and/or failed to meet specification, so were "binned" very rapidly. See particularly #9, #11 and #12 of this rather relevant discussion.

Cheers, Alan.
 

premelec

Senior Member
@AllyCat - www.hypex.nl seems to be successful in high power audiophile amps - that said I've found three burned out consumer class D units in the 40 watt range - I think class D and E are here to stay from the power efficiency point of view... and there are still people who love the glowing glass bottles! - they also provide heat for your house in winter... Cheap power inverters [12vdc to 110-220VAC] supposedly 'sine'out radiate particularly nasty stuff. Then there are Magic Sines of Don Lancaster's investigations to control harmonic content www.tinaja.com to whatever degree you want... or can stand the complexity of.
 
Last edited by a moderator:
Top