PWM - What is it, How does it work and how to detect it.

altendky

New member
Joined
Jan 12, 2018
Messages
1
Ok, so I read the original post and skipped straight here. Hopefully the misunderstanding has been addressed but in case not...

PWM control does not require that your eyeball or brain be the filter. You can filter the PWM'ed voltage with electronics and have a fairly steady current. This still offers efficiency improvements over analog control circuits and is a much simpler circuit once you have a microcontroller involved. So, PWM in the right circuit is actually a current control mechanism.

Now to guessing. I would expect that even good 'non-PWM' flashlights are still PWM controlled, just using electronics as a filter rather than your eyeballs.
 

User 0815

New member
Joined
Apr 12, 2018
Messages
2
The question is: Where do you put the limit oj what you call PWM free? The more sophisticated your hardware becomes the more lights will "flicker".
Use a clear LED (got mine out of an broken TV remote) hook it up to your scope of liking (software scope works fine as well)
Very basic scope will do:
moon_ripple.jpg

The low ripple one can see is due to the scope itself. Some lights do really have nasty strobing when pretending to be in low mode ;-)

Regards Peer
___________________________
Please delete below this line. ^^
P.S.: Is one of the mods so kind to fix the picture link of my other post, not shure why the pic does not show up any more, the share is valid? Due to my newbe state you will touch this post anyway - so please fix the other one. Thanks in advance.
For your convinience: https://www.candlepowerforums.com/v...t-use-NO-PWM&p=5198473&viewfull=1#post5198473
 

etc

Well-known member
Joined
Dec 19, 2004
Messages
5,536
Location
Northern Virginia
Interesting pics.

I've had 2 Malkoff M361s and didn't know they had PWM until I was told. It's impossible to see in daily usage due to the high enough frequency that's above human's perceptibility. I forget what the Hz is but it's high. I tried the shower trick to no avail.

I could only see the PWM in M361 when pointing it at at engine fan inside the engine bay. Actually that was very cool. I have no experience with cheaper lights. I heard Fenix had some in the cheaper models and a lower frequency at that.
 

Hondo

Well-known member
Joined
Oct 26, 2005
Messages
1,533
Location
SE Michigan
Ahh, the dreaded 100 Hz L0D! See my post #115 for that one in action. The only lights I have ever had that were that bad are the Photon Freedom, which is so cool otherwise, it gets a pass, and my Firefly III. That used the Flupic driver - I should someday try replacing that, and put in a 219 to replace the Lux III LED. But in its day, that thing was amazing, and I never even noticed the PWM. Just thought it was incredible to be able to program the levels I wanted.
 

Rattlebars

Member
Joined
Jan 26, 2007
Messages
19
Location
NE Ohio
Motorcycle heated clothing makers have been using PWM since the turn of the century (this one ;) ). I have used a PWM to power my homemade heated pants and a CC control for the homemade heated grips.

>CLICK ME<
 

xevious

Well-known member
Joined
Dec 29, 2007
Messages
1,022
Location
Hoboken, NJ
Looks like the OP post #1 images were all made with "http", so with "https" now required they don't display.
I've retrieved them and reloaded, so they can now be seen easily:

Battery with unlimited charge:
12e_146ead_1b25e52_oJ.jpg


Introduce PWM:

12f_146eac_4fbe8cf6_oJ.jpg


25% of the maximum, PWM input
130_146eab_dc7ffa_oJ.jpg


LOWER FREQUENCY PWM:
12f_146eac_4fbe8cf6_oJ.jpg


HIGHER FREQUENCY PWM:
131_146eaa_3c62842_oJ.jpg



Visible effect of PWM:
132_146ea9_d3698b59_oJ.jpg


hold it so you can see the light on the side of the reflector as such:
133_146ea8_afd1c9b9_oJ.jpg


wave it sideways like this:
134_146ea7_da949891_oJ.jpg


Bad PWM:
135_146ea6_198b9f1_oJ.jpg


Good PWM:
136_146ea5_d16b89d1_oJ.jpg


Zoom in, Good PWM:
137_146ea4_add3c831_oJ.jpg
 

jeff51

Active member
Joined
Apr 9, 2012
Messages
40
Location
Middle of Texas
Great thread! Spreading PWM awareness is a good thing.

Trying to find info on LED flicker or PWM – The searches bring up a lot of info aimed at gamers and LED refresh rates. These (I think) are not really applicable to flashlight LEDs.

While researching this I can across this article in Nature:
“Humans perceive flicker artifacts at 500Hz“
https://www.nature.com/articles/srep07861

Interesting reading - And the reference section sends one down a rabbit hole of other studies.

On another note, some time ago a study found that some air force pilots could identify the type of aircraft from an image flashed on a black screen for 1/250 of a second.
I have seen other references to this, so I assume it’s a real fact as opposed to an internet fact.

Detecting PWM by Ear
Most flashlight PWM takes place in the audio frequencies.
A novel way to detect (some) PWM is to hook a PV cell (Solar cell) to a speaker.
Or better still the input of an old powered computer speaker.

If someone has mentioned this before, my apologies I must have missed it in this thread.

Don’t use anything nice or with any real output power. Bad things could happen if too much DC voltage gets pushed at the speaker.
Placing a 100 Ohm to 5K Ohm resistor in parallel with the PV cell will help remove the offset DC voltage and protect the speakers’ electronics.

PV Cell I got for $3 someplace years ago



Computer Speaker - leftover from the Win 98 era.



Start with the volume control off and a florescent overhead light or a florescent desk lamp a good distance away. Turn on the speaker and increase the volume until you hear a low frequency tone.

That’s the light singing at 120Hz. Now turn off the room lights and fire up a LED with a known PWM. Listing to it sing.
Always start with the light pointed away from the PV cell to avoid over driving the speakers input.

Those with young ears should be able to detect PWMs in the 16KHz range up to maybe 19KHz range (for those with K9 genes).

Here is a video I made showing some different PWM frequencies and the lights ramping through the
PWM duty cycle. This leads to the video hosted on Flickr.
You can hear the lights sing at their PWM frequency. Start with the volume turned down – just in case.
The top window is the PWM Waveform.
The bottom is a Frequency Spectrum of the light.
Click to watch the video.




What’s happening.
First a headlamp with a PWM of about 1,2KHz (1200Hz).
The lamp ramps up and down the duty cycle.

Next is a Nitecore TUBE on low with a PWM of 500Hz.
Then the TUBE ramping at 3KHz through the duty cycle.
The TUBE changes it’s PWM to 3KHz (3000Hz) in ramping mode.
The last bit is the TUBE back at 500Hz on low.

Why Test?
I got interested in PWM after getting some lights with truly terrible PWM.
Using the finger wave method shows lights with lower PWMs.
The Photo-Wave method works for lights with higher PWMs but fails to detect lights with higher duty cycles or faster PWMs. It also makes my wife stare at me with that expression on her face (you know the one).

These methods don’t show what the frequency of the PWM actually is. I guess one could make a rotating disk spinning at a known speed and calculate the frequency from that.

Here are the lights in the video.
First a headlamp.

I reviewed here:
https://www.candlepowerforums.com/vb/showthread.php?460232-Review-A-pure-Flood-COB-18650

PWM on Low


This is the light on low 1.2KHz PWM with a short duty cycle.

PWM on Medium Ramp



Ramping up the duty cycle less “off time” is seen.

On high it’s just a white smear. I didn’t take a picture.
The high duty cycle hides the PWM.

Then my EDC Nitecore TUBE.


Which has the odd character of using a 500Hz PWM on low, then shifting to a 3000Hz PWM while ramping.
Clicking to high mode, there is no PWM.

TUBE on low


On low at 500Hz it’s easy to see the PWM


TUBE On low Ramp


At 3KHz you can still make out the PWM


TUBE High Ramp

It’s getting harder to make out the PWM with the longer duty cycle.


How visible is the PWM?
I find the key issue for me is related to the time the light spends in the off portion of the PWM cycle.



I got this camping lantern off Amazon. It has a PWM of 100Hz (yes really 0.1KHz).
On high the duty cycle is nearly 100%. And I don’t notice or am I bothered by the PWM.
I used the PV cell mentioned above and my ancient CRT Oscilloscope to look at the PWM.

Scope at High.


There is almost no off time during the duty cycle.


On Medium, with the same PWM Frequency, it is truly nasty.
Scope at Med.




On low – Good God, this is full on seizure mode.
Scope on Low.


Does no one ever look at these things before they go to production?

Here is the Sofirn BLF SP36


On Moonlight it has about a 4.8KHz PWM with a very low duty cycle.
SP69 Moonlight


I can make out the PWM in the photo


The SP36 switches to a 16KHz PWM while ramping
SP36 Ramping


I can’t detect any PWM in the photo. I guess I can’t more my arm fast enough.

I have several lights with PWMs in the 1K to 3K region. I can tell there is a PWM but it doesn’t bother me even at lower duty cycles.

Measuring PWM
I decided to see what I could do to measure PWM without spending any significant amount of $$ or needing special test equipment.
This lead me down a path of testing sensors and software packages to see what I could find that anyone with an interest in this could duplicate.

I think it would be better to branch off of this thread and start a new one since it is fairly involved.
It will take me a bit to put it together.
Perhaps the OP and the more experienced members could comment on this?

All the Best,
Jeff
 

jon_slider

Well-known member
Joined
Mar 31, 2015
Messages
4,314
I have several lights with PWMs in the 1K to 3K region. I can tell there is a PWM but it doesn’t bother me even at lower duty cycles.

Outstanding post! Great photos and info, make it a sticky.. LOL

I agree with your "doesnt bother me" standard of 500Hz from your Tube. Similar to the "not visible in actual use" standard. Others use the terms Good PWM (the kind they dont notice), and Bad PWM (the kind they Do notice). Different people have different degrees of awareness.

the "500Hz doesnt bother me" standard makes a lot more lights fair game :)
I mostly did not notice the 467Hz PWM in my HDS during actual use.

I cant recall the last time I saw a post from a Malkoff user about the 312Hz PWM.
I do see posts from people that notice the 200Hz PWM of the Maratac AA.

I do think it is interesting to know how fast a light is flickering and would like to watch your video. (it requires a log in, please use Youtube)


a couple NoPWM examples
atm Im carrying a SteplessInfiniteRotary w NoPWM and I cannot see the constant current flicker in actual use, even though I can photograph it.

For a NoPWM AAA light Im a fan of the Lumintop Tool and Maratac, post 2015 when the PWM circuit was abandoned.

can you confirm that your audio device cannot hear those lights sing a PWM song? And does your device also detect constant current flicker that can be photographed, but is not technically PWM?
 
Last edited:

jeff51

Active member
Joined
Apr 9, 2012
Messages
40
Location
Middle of Texas
John,
Thanks for the kind words. I'm new to the posting videos stuff, This is my first ever screen capture video and attempt to publish it. (It only took me 5 tries to get linking a simple photo right on the CPF).

The video link leads to a public Flicker page. It plays for me off of an android tablet and a couple of PCs with Firefox or Edge without asking for a login.
Weird. Supposed anybody should be able to watch it.

Is anyone else having problems watching the video?

I don't have a youtube account. I'll see if I can set one up.

The soundcard I used to make the A to D for the software is indeed capturing the audio and that's what is driving the audio portion of the video (that you can't see or hear!).

Some of the current controlled lights can show the ripple voltages sitting on top of the DC offset. It depends how fast the oscillation is.
I'll post a few pics after I get to work later today.

I think I will go ahead and make a branching thread to show what I've found out about doing this on the cheap.
It's easy to do, just there are bunch of "You can use this BUT...…" that needs to be covered.
And (as you can tell) I tend to be long winded when writing stuff.
All the Best,
Jeff
 

xevious

Well-known member
Joined
Dec 29, 2007
Messages
1,022
Location
Hoboken, NJ
Jeff, thanks for bumping this old topic and refreshing it with new material. Great stuff! :twothumbs

The only light I use these days that has noticeable PWM is a RovyVon Aurora A8. If I'm using it alone, not any other lights for a good long while, the PWM doesn't bother me all that much. But right after using lights with no visible PWM, the A8 is annoying as heck on the first 2 modes. It's otherwise a terrific light. I just avoid using low modes for long periods. I'm waiting to hear back from Ken if he'll have a V2 of the A8 out in the fall with no visible PWM.
 

jeff51

Active member
Joined
Apr 9, 2012
Messages
40
Location
Middle of Texas
Here are some shots of a light with faster PWM.

These images were captured off the setup I’ll be referring to when I get off my butt and put together the post about measuring PWM. This setup is AC coupled and it’s hard to tell if something is pushing a DC voltage.
Since this light is faster I used a linear scale on the frequency plot.

Jon, here is a type of light I think you were referring to.
Rayovac (2) AA “Indestructible” and it is pretty darned tough.

Rayovac AA on Left, Rayovac AAA Headlamp on Right


Rayovac on Low


Looks to be running a 12.5KHz PWM.
I believe this is a true PWM. When looking at it on a real scope with DC coupling - the off cycle is at 0 Volts.
Those with good ears might pick this up.

Rayovac AA on Low Close Up

This is what that waveform looks like on a CRT O-Scope.


Rayovac on High


At first I thought it was a 62.3KHz PWM (?).
If you can hear this there are bat research scientists who need your help.
I got a little smarter and now believe this is a ripple caused by the boost circuit.
On a real O-Scope with DC coupling there is a DC offset that the wave rides on.
The ripple is caused by the oscillator frequency? (that’s more of a question – than a statement).

I’m fairly clueless as to what actually is going on inside a driver. This site has helps with that if you find the right threads.

Here is (sort of) an illustration of the ripple riding a wave.

Office 120Hz + Tube 3KHz


The main wave are the overhead office lights putting out an ugly sinewave at 120Hz.
The Nitecore TUBE running a low duty cycle at 3KHz is also shining on the sensor. That is the secondary peak at 3K seen on the frequency spectrum.
This sum of signals is what some lights that are running constant current are doing. Except that instead of the 120Hz sinewave, there ripple is sitting on top of a DC offset.


For those who can’t see the video here is a shot of the Nitecore TUBE from my previous post.

TUBE at 500Hz on Low


It has a very short duty cycle as see in the phots in the previous post.
The Frequency scale is logarithmic.
You can see the harmonics running up the Freq. band indicating a really good square wave.

TUBE Medium Ramp


Here is the shift to 3KHz PWM. It’s running about a 50% duty cycle. This puts this light in the "Good" PWM range (at least for me).
I need to run some sort of tests to see where the PWM Frequency and Duty Cycle start to bug me.
The frequency scale is linear so you see harmonics running up at even intervals.

Just curious, are others not able to see the video in my first post?
Seems like it should work
I will try to get set up with YouTube though.

All the Best,
Jeff
 

jon_slider

Well-known member
Joined
Mar 31, 2015
Messages
4,314
I agree 3000Hz PWM falls in the "good pwm" (invisible) range

I can see the video, Jeff.
I'm on an old OSX and an old version of Firefox.
P

I am old OSX w Firefox too
when I go to the video link hosted on flicker I get this:
Jj87cOHl.png


followed by this:
JZvbEKkl.png

at which point I throw up my hands in distaste

flickr is just trying to make my life difficult..
Im guessing the only people that can see the video, have acceeded to the latest flicker password reorganization, and are logged in to their flickr account

the video does not seem available to mere plebeians
Im either a special case, or non compliant

from which I infer Peter must be presently up to date with a new password and must have a flickr acct, and must be logged in to it, to watch the video

so yeah
youtube please.. :)
 
Last edited:

KITROBASKIN

Well-known member
CPF Supporter
Joined
Mar 28, 2013
Messages
3,507
Location
New Mexico, USA
Thanks Jeff!
The originator of this thread has not logged in for about 3 years. This seems like a good place for your posts (if you ask me) but please put a link here to any thread you start that pertains to the information already presented.
 

jeff51

Active member
Joined
Apr 9, 2012
Messages
40
Location
Middle of Texas
Jon & CLF’ers (is that a word?)
Got a Youtube channel setup.
It’s ugly (like me) I need to do some learning to make it nicer.
The Audio is only on the left channel.

WARNING - Turn the volume down - screechy sounds in these videos.
The Videos:
This is the original Low Res Flicker video showing the Super Tiger headlamp and the Nitecore TUBE.




This the HD version of the headlamp.


And here is the Rayovac screaming at 12K and 64K.


Let me know if any of you have trouble seeing these.
All the Best,
Jeff
 
Last edited:
Top