Circuit Noise and Scope Help - Page 1
Forum section: electronics / projects

author: JonPyro
author_rank: Regular Contributor
timestamp: February 04, 2018, 03:11:05 pm
content: Hi All,As you can probably see I am new here and have been an enthusiastic electronic hobbyist for many years. Recently I decided to get a Rigol 1054z and now I am looking at different circuits to see whats going on visually, its all quite exciting and reminds me of my old college days using Picoscope.I built a simple motor driver circuit using a PIC 12f1840, it takes an ADC input from a potentiometer and copies this across to the duty cycle of a 15khz PWM output, steered to RA5 for convenience. I am using a cheap motor shield i bought on Amazon for a few quid, an IBT-2, a cheap Chinese H-Bridge and buffer circuit.Here is my circuit minus programmer lines:And this is a schematic I found on the web for the IBT-2 board:The IBT-2 board is connected to a 6V supply, separate to my PIC power supply, and the motor is a cheap 6v hobby motor so nothing high spec with a 0.22uf cap soldered across its pins to help reduce noise (was used on an old project).I attached my scope probe to the PWM out of the PIC to see the duty cycle.Turning my POT to around 30% the scope starts to show some noise:Would you agree that this is what motor noise looks like?Why is it faded compared to the rest of the trace?If we crank the POT to around 60% duty cycle something interesting happens, the motor starts to WAH clearly struggling to keep to a steady output speed and the scope shows this:My interpretation is that this is more severe noise, can someone confirm that this is correct because it is interested it has also dropped to 0V line as well now?My hypothesis is that the noise is now causing the PIC to reset hence the drop down on the scope and the WAH of the motor.Interestingly, if you change the timebase of the stopped trace the the noise disappears, this is the same shot as above with the timebase changed once on hold:Can anyone give me a reason why the Scope suddenly removes this from the plot, even if you change the timebase back the noise is now permanently gone?Another questions is that if the motors and H-bridges have a seperate power supply, why is there any noise present in the circuit, I assumed that would isolate them, can the H-bridges 'leak'?Sorry for so many questions but I do find this all very interesting and would like to know whether my beliefs are correct or maybe I am completely wrong!Thanks.

author: fourtytwo42
author_rank: Super Contributor
timestamp: February 04, 2018, 05:01:34 pm
content: You might get more help in the beginners sectionand also consider getting rid of the scope as it's obviosly upsetting youA dim trace means it doesnt happen on every trigger event, the relative brightness tells you the event frequency.You have said nothing about the physical wiring of your circuit nor how the scope probes are grounded and all that can radically alter both what you are seeing and a circuits behavior.Have fun

author: JonPyro
author_rank: Regular Contributor
timestamp: February 04, 2018, 05:29:04 pm
content: Quote from: fourtytwo42 on February 04, 2018, 05:01:34 pmYeah it was a difficult decision whether to post here or beginners, technically its a complete project just analysing it...maybe a mod or admin will be kind enough to move it to where they think it best!Quotehaha, NOOOOOOO!, I have had great fun watching RC circuits charge and discharge and comparing my maths to reality...thats when i discovered my capacitors have quite a large tolerance!QuoteThat is great to know, thank you.QuoteYou are quite right. The PIC circuit is on breadboard with jumper wires (~10cm) to a header block on the ibt-2. The scope probe is attached to a short flying lead (~2cm) directly off the track of the PIC PWM pin and it is grounded on a stubby lead (<1cm) to the 0v track on the breadboard power rails.

author: picandmix
author_rank: Frequent Contributor
timestamp: February 04, 2018, 05:32:03 pm
content: Think I would suggest you go back a few steps.First check you software is correct as those multi function i/o pins can be easily mixed up.Then disconnect your IBT board and scope your Pics PWM output to check you are getting a full swing of the duty cycle from 0 - 100%Also check your VDD and see if any ripple is present on that, so you have a reference to work from. ( source PSU or USB ?)Also scope your 6v motor supply, ( nothing connected ) to see how regulated that is .Does the motor run ok at 60~% with the scope disconnected ?

author: fourtytwo42
author_rank: Super Contributor
timestamp: February 04, 2018, 05:43:11 pm
content: Quote from: JonPyro on February 04, 2018, 05:29:04 pmAs you experiment more you will discover more. With fast edges ringing will occour due to the scope earth lead inductance, this can be solved by removing the spring tip, wrapping a bare wire around the probe tip ground sleeve such that only about 10mm is available to connect to ground directly next to the signal you are monitoring either at the driven or receiving end.You seem to have some other noise entering your scope, this could either be motor commutating noise or noise from a switch mode psu powering your project, another posobility is shoot through noise being generated by the half bridge drivers, 100pF seems a rather small decoupler for these.Using the probing techniques outlined above you should be able to find it. Another trick for checking noise entry into your test equipment is to short the probe tip directly to its own ground and then touch the ground of the circuit, you should get nothing unless you have a ground loop.Have fun

author: maginnovision
author_rank: Super Contributor
timestamp: February 04, 2018, 06:32:22 pm
content: I'd assume the noise (faded trace) is from you turning the pot and that's why it only happens once(doesn't return after changing timebase) If you aren't decoupling 100nf is a typical size cap to use, or check your datasheets. Try passing the pot signal to pic through an rc filter(4.7ohm resistor to pic decoupled by 100nf typical starting point)

author: JonPyro
author_rank: Regular Contributor
timestamp: February 04, 2018, 06:44:02 pm
content: Quote from: maginnovision on February 04, 2018, 06:32:22 pmNo noise shows on the trace when i move the POT when the motor is disconnected, sweeping the pot back and forth gives a nice clean square wave.Quote from: picandmix on February 04, 2018, 05:32:03 pmThat's working fine.Quoteyep you get a nice clean sweep from 0-100%, here is one shot of it:QuoteIt is a regulated switch mode supply switched to 9v going into a small power board i have made which contains a 78l05 5v regulator with decoupling (as per datasheet). At 1v it looks fine, hitting auto zooms in to this:QuoteIt is a 6v battery supply (AA)Quoteinteresting I have inadvertently changed where the scope probe is and it seems to be working fine with it attached and detached now, it can run to 100% and sound constant. So even with these spikes running all over the place the PIC chip doesn't seem to be resetting.Quote from: fourtytwo42 on February 04, 2018, 05:43:11 pmSo when the motor is not running everything is pretty steady, its only when it ramps up does the noise start to appear (pretty much as soon at is starts to turn the shaft the spikes start to appear).I assume the only way to lessen the noise is to try and run capacitors as close to the power rails of the ibt-2 as it seems obvious that the noise coming from that now, it would seem separate power supplies has offered little protection.

author: maginnovision
author_rank: Super Contributor
timestamp: February 04, 2018, 07:03:19 pm
content: If it is noise from a brushed DC motor you can also find an appropriate ferrite bead.

author: picandmix
author_rank: Frequent Contributor
timestamp: February 04, 2018, 08:07:28 pm
content: Do you have any decoupling on the Pics power rails ?100nf across Vdd and Ground close to the Pics pins and also try an electrolytic 10uf to 220uf across it as well and see what effect they have ?Not something I have tried but you could fit a diode in line with the PWM signal and also the Pics Vdd to the IBT board and see if that stops and noise. It is possible for power to be returned to the pic via an output pin, have seen it happen to circuits before when somethings gone wrong.

author: David Hess
author_rank: Super Contributor
timestamp: February 05, 2018, 07:20:45 pm
content: Quote from: JonPyro on February 04, 2018, 03:11:05 pmIt very well could be. The DC brushed motor commutation is asynchronous to the PWM signal.QuoteThe Rigol is simulating the index graded display of an analog oscilloscope. The motor noise is asynchronous to the signal you are triggering on and also infrequent compared to the fast PWM signal so it is dimmer just like it would be with an analog oscilloscope. The normal display you are seeing is actually produced from multiple acquisitions stacked on top of each other and some included motor noise and some did not.If you set the image persistence to zero, then the "background noise" should not be displayed but I do not know how Rigol handles that.QuoteThe level of the noise as seen by the oscilloscope is now high enough to cross the oscilloscope's trigger threshold so it can be displayed independently of the PWM signal. A second channel or external trigger or some form of trigger filtering like noise or high frequency reject is often used to avoid this situation.QuoteWhen you change the timebase while the DSO is stopped, it redraws the display from the acquisition memory and any persistence from previous acquisitions is lost.QuoteAssuming that a single point ground is used there should not be any however noise from the motor may be coupling into adjacent circuits both electrostatically and magnetically.Besides the motor, the power switches driving the motor should also be decoupled to minimize the loop area of the high current returns.

author: JonPyro
author_rank: Regular Contributor
timestamp: February 06, 2018, 03:39:22 pm
content: Quote from: picandmix on February 04, 2018, 08:07:28 pmI didnt have a great deal of time but i tried the 100nf and 220uf and a 1nf on the power pins and not alot changed (they weren't all ceramic so that might not help), also tried adding diodes and this is what the scope shows with the caps and diodes added:Thanks for the idea though.