Author Topic: Circuit Noise and Scope Help  (Read 4412 times)

0 Members and 1 Guest are viewing this topic.

Offline JonPyroTopic starter

  • Regular Contributor
  • *
  • Posts: 50
  • Country: gb
Circuit Noise and Scope Help
« on: February 04, 2018, 03:11:05 pm »
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.


« Last Edit: February 04, 2018, 03:14:40 pm by JonPyro »
 

Offline fourtytwo42

  • Super Contributor
  • ***
  • Posts: 1183
  • Country: gb
  • Interested in all things green/ECO NOT political
Re: Circuit Noise and Scope Help
« Reply #1 on: February 04, 2018, 05:01:34 pm »
You might get more help in the beginners section :) and also consider getting rid of the scope as it's obviosly upsetting you  ;D
A 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 :)
 

Offline JonPyroTopic starter

  • Regular Contributor
  • *
  • Posts: 50
  • Country: gb
Re: Circuit Noise and Scope Help
« Reply #2 on: February 04, 2018, 05:29:04 pm »
You might get more help in the beginners section :)

Yeah 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!

Quote
and also consider getting rid of the scope as it's obviosly upsetting you  ;D

haha, 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!

Quote
A dim trace means it doesnt happen on every trigger event, the relative brightness tells you the event frequency.

That is great to know, thank you.

Quote
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 :)

You 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.
 

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: Circuit Noise and Scope Help
« Reply #3 on: February 04, 2018, 05:32:03 pm »
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  ?

 

Offline fourtytwo42

  • Super Contributor
  • ***
  • Posts: 1183
  • Country: gb
  • Interested in all things green/ECO NOT political
Re: Circuit Noise and Scope Help
« Reply #4 on: February 04, 2018, 05:43:11 pm »
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.
As 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 :)
 

Offline maginnovision

  • Super Contributor
  • ***
  • Posts: 1963
  • Country: us
Re: Circuit Noise and Scope Help
« Reply #5 on: February 04, 2018, 06:32:22 pm »
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)
« Last Edit: February 04, 2018, 06:35:04 pm by maginnovision »
 

Offline JonPyroTopic starter

  • Regular Contributor
  • *
  • Posts: 50
  • Country: gb
Re: Circuit Noise and Scope Help
« Reply #6 on: February 04, 2018, 06:44:02 pm »
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)

No 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.

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.
That's working fine.

Quote
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%
yep you get a nice clean sweep from 0-100%, here is one shot of it:



Quote
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 ?)
It 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:


Quote
Also scope your 6v motor supply, ( nothing connected ) to see how regulated that is.

It is a 6v battery supply (AA)

Quote
Does the motor run ok at 60~% with the scope disconnected?

interesting 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.

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.

So 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.
 

Offline maginnovision

  • Super Contributor
  • ***
  • Posts: 1963
  • Country: us
Re: Circuit Noise and Scope Help
« Reply #7 on: February 04, 2018, 07:03:19 pm »
If it is noise from a brushed DC motor you can also find an appropriate ferrite bead.
 

Offline picandmix

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: Circuit Noise and Scope Help
« Reply #8 on: February 04, 2018, 08:07:28 pm »
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.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16549
  • Country: us
  • DavidH
Re: Circuit Noise and Scope Help
« Reply #9 on: February 05, 2018, 07:20:45 pm »
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?

It very well could be.  The DC brushed motor commutation is asynchronous to the PWM signal.

Quote
Why is it faded compared to the rest of the trace?

The 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.

Quote
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.

The 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.

Quote
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?

When 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.

Quote
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'?

Assuming 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.
 
The following users thanked this post: JonPyro

Offline JonPyroTopic starter

  • Regular Contributor
  • *
  • Posts: 50
  • Country: gb
Re: Circuit Noise and Scope Help
« Reply #10 on: February 06, 2018, 03:39:22 pm »
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.

I 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.

« Last Edit: February 06, 2018, 03:41:00 pm by JonPyro »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf