Author Topic: Strange PWM behavior  (Read 5677 times)

0 Members and 1 Guest are viewing this topic.

Offline Bobblank77Topic starter

  • Contributor
  • Posts: 14
Strange PWM behavior
« on: October 16, 2014, 07:13:36 am »
Hi, I've been watching the EEV blog for a while now but this is my first time on the forums. I've really enjoyed Dave's videos and I am quite excited to join this community!

I've been trying to swap some LEDs on my keyboard but when I used a multimeter to measure the forward voltage across the existing LEDs I got a max value of 2.3v which I believe was much too low to drive the blue LEDs which were installed by the manufacturer. I also probed the LEDs with an oscilloscope and I got a very strange waveform (see attachment/picture). I expected to see a square wave like when I measured the PWM signal from arduino but it turned out to be some weird thing I don't even know how to explain. Has anyone ever seen this before?

I also checked the oscilloscope (same settings) with a 1khz square wave (shown in the last pic). So I don't think it's my scope that's messed up

All advice/wisdom sharing is appreciated. Thanks!

Also, has anyone heard of a blue/white led that can run off of a low voltage (1v-2v ish) without using a step up converter?
 

Offline owiecc

  • Frequent Contributor
  • **
  • Posts: 317
  • Country: dk
    • Google scholar profile
Re: Strange PWM behavior
« Reply #1 on: October 16, 2014, 07:20:13 am »
It looks like you are not connecting your probe ground terminal properly or measuring with AC coupling. Switch to DC coupling and connect the ground probe terminal to the groud of your keyboard.
 

Offline Bobblank77Topic starter

  • Contributor
  • Posts: 14
Re: Strange PWM behavior
« Reply #2 on: October 16, 2014, 07:53:24 am »
Oooh. You got me. Turns out my oscope was on AC coupling. I'll try it again on DC coupling tomorrow. But even on AC coupling, wouldn't I expect to see a square wave rather than what was displayed on the screen? Sorry, i'm still very new to a lot of this.


Thanks a lot!
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Strange PWM behavior
« Reply #3 on: October 16, 2014, 08:36:33 am »
If I have my coupling in AC while running a PWM signal it dances up and down but only when the duty cycle changes.

At a constant duty cycle it stays put
 

Offline mrkev

  • Regular Contributor
  • *
  • Posts: 225
  • Country: cz
Re: Strange PWM behavior
« Reply #4 on: October 16, 2014, 05:31:30 pm »
Oooh. You got me. Turns out my oscope was on AC coupling. I'll try it again on DC coupling tomorrow. But even on AC coupling, wouldn't I expect to see a square wave rather than what was displayed on the screen? Sorry, i'm still very new to a lot of this.


Thanks a lot!
Funny thing is that you can clearly see from both photos you've posted that you had DC coupling at CH1 and you were switched on CH1...
I would say dodgy ground connection and you are actually getting good old 50Hz added to your signal...
 

Offline Bobblank77Topic starter

  • Contributor
  • Posts: 14
Re: Strange PWM behavior
« Reply #5 on: October 16, 2014, 08:16:54 pm »
Quote
Funny thing is that you can clearly see from both photos you've posted that you had DC coupling at CH1 and you were switched on CH1...
I would say dodgy ground connection and you are actually getting good old 50Hz added to your signal...

There was actually another selector switch on the other side of the oscilloscope which was set to AC coupling. I'm not exactly sure what each of those switches do but the other was def. switched to AC coupling.
As a side note, when I changed the time/div I saw the same waveform pictured but repeating several times. Not sure what this means
 

Offline mrkev

  • Regular Contributor
  • *
  • Posts: 225
  • Country: cz
Re: Strange PWM behavior
« Reply #6 on: October 16, 2014, 11:11:10 pm »
It could also be the ground connection. Your oscilloscope is grounded by mains plug, your arduino could be in fact grounded too by its power source. There could be some cap from the output to the mains ground or just some parasitic capacity to the live or neutral. From that picture, I would say that you are getting 50Hz from somewhere. It could be whole bunch of things from bad connection (f.e. broken wire in probe), some loop that is going from the place of measurement back to osc. by mains, etc. Do you use separate power source, or 5V USB plug to the computer for powering that board up?
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Strange PWM behavior
« Reply #7 on: October 17, 2014, 12:07:57 am »
You could just unhook the ground clips, put the scope in A-B mode and use two probes (without ground clips) so that the scope ground doesn't affect the reading.


Edit: by looking at the picture here: (i'll fix the image in a minute, tablet not cooperating, fixed)

from:
https://www.eevblog.com/forum/beginners/what-is-a-hameg-hm650-and-kikusui-cos-5060-worth-what-does-ch3-do/

You can pull ch-2 position to get the inverse and then do ch1+ch2 with the Add button. I think.

But maybe you are already doing that? can you show your probes and how you are using them?
« Last Edit: October 17, 2014, 12:28:02 am by miguelvp »
 

Offline Bobblank77Topic starter

  • Contributor
  • Posts: 14
Re: Strange PWM behavior
« Reply #8 on: October 17, 2014, 03:49:43 am »
Okay, so I remeasured everything with the scope on DC coupling and I got the same result. I definitely connected grounds on the keyboard and the oscope (see my pic with the probe). And to double check again I measured a PWM signal from an arduino hooked to the same powered USB hub as the keyboard and I got a square wave with a duty cycle of 50%.

I wasn't able to get your plan with the 2 probes and inverting the second channel to work because the scope wouldn't trigger correctly.

Additionally, I probed the microcontroller controlling the transistors controlling the LEDS and I got a square wave with a frequency of about 900Hz (the same frequency measured at the LEDs) and ~100mV amplitude.
 

Offline owiecc

  • Frequent Contributor
  • **
  • Posts: 317
  • Country: dk
    • Google scholar profile
Re: Strange PWM behavior
« Reply #9 on: October 17, 2014, 02:18:18 pm »
Can you put the probe ground lead on Arduino GND terminal, probe tip at keyboard ground and post the picture of the waveform?

Alternatively you can turn off everything from power and check the resistance between keyboard's and Arduino's ground.
 

Offline nali

  • Frequent Contributor
  • **
  • Posts: 697
  • Country: gb
Re: Strange PWM behavior
« Reply #10 on: October 17, 2014, 02:59:43 pm »
The Arduino signal is a logic level output being actively pulled high & low - that LED signal looks like it's being driven high then going into a high impedance state.

So the slow decay after the main pulse is probably an artifact of capacitance discharged by the scope probe, and the higher frequency squarewave some stray pickup from a nearby signal.

PS the AC/DC coupling switch on the RH side of the 'scope is for the trigger...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf