Demistifying the PWM Myth

Electronics related to CNC

Demistifying the PWM Myth

Postby twehr » Mon Sep 19, 2011 4:22 pm

Many of the forum readers pretty well understand how PWM works and the whole PWM, Power Supply, Tube, Output power continuum. But for anyone not fully up on the topic, or anyone just wanting to review the topic and perhaps pick up a suggestion or two on managing your laser power output, I put together (another longish) post over at the DIYLaser blog. :ugeek:
tim
--
"The answer is usually easy and obvious once you know what it is." tw

DIYLaser Blog
SemiHomemadeTools.com
twehr
 
Posts: 439
Joined: Mon May 24, 2010 4:49 pm

Re: Demistifying the PWM Myth

Postby steves » Mon Sep 19, 2011 5:44 pm

Tim

Thanks for all the info you share here.

I understand the basic concept of PWM, but have a couple questions for you or Bart about the actual in service implementation.

You mention that your laser is at max power at a current of 18mA - over what time scale is the max power a limit? Since PWM is either on at 5v or off, I'd expect you to be getting 25mA when it's on, and 0 when it's off. When you set it to 60% you'll get an average of 15mA, but peaks of 25ma.

Now, obviously, the current doesn't build instantaneously, and if the PWM cycling frequency is high enough it may not reach 25mA at all. But it seems to me if you could current limit your power supply to 18mA you wouldn't have to be concerned about overdriving your tube at any power setting or for any portion of the PWM cycle.

So the questions are:

1) What sort of time scale is the power limit applicable to? Is it OK to have the 'on' portion above max power as long as the overall average stays below the limit? Will the tube last longer if we limit the max current so that a 100% duty cycle equals the power rating of the tube?

Thanks,

Steve
steves
 
Posts: 18
Joined: Thu May 19, 2011 1:15 pm

Re: Demistifying the PWM Myth

Postby BenJackson » Mon Sep 19, 2011 6:01 pm

The laser PSU recommends a 20kHz PWM so presumably its frequency response is lower than that. I'm actually using PDM with EMC2 (like PWM but the pulses are evenly distributed rather than lumped into one pulse) so my frequency varies from about 4kHz up to 18kHz (all with about 25us pulses). I can put a scope on it if people are curious about what's going on.
BenJackson
 
Posts: 522
Joined: Fri Apr 15, 2011 6:13 pm

Re: Demistifying the PWM Myth

Postby twehr » Mon Sep 19, 2011 6:38 pm

steves wrote:Tim

Thanks for all the info you share here.

I understand the basic concept of PWM, but have a couple questions for you or Bart about the actual in service implementation.

You mention that your laser is at max power at a current of 18mA - over what time scale is the max power a limit? Since PWM is either on at 5v or off, I'd expect you to be getting 25mA when it's on, and 0 when it's off. When you set it to 60% you'll get an average of 15mA, but peaks of 25ma.

Now, obviously, the current doesn't build instantaneously, and if the PWM cycling frequency is high enough it may not reach 25mA at all. But it seems to me if you could current limit your power supply to 18mA you wouldn't have to be concerned about overdriving your tube at any power setting or for any portion of the PWM cycle.

So the questions are:

1) What sort of time scale is the power limit applicable to? Is it OK to have the 'on' portion above max power as long as the overall average stays below the limit? Will the tube last longer if we limit the max current so that a 100% duty cycle equals the power rating of the tube?

Thanks,

Steve


I probably did not make it clear in the blog. I'll go back and try to do so. In the mean time...

PWM only provided a reference signal for the laser power supply INput. It tells the lps how much power to put out. In an analog system, that is done with a steady dc voltage - 2v means output 40% of ps capability, and 3v means output 60%, etc. The ps then outputs that percent of its capability. In an ideal world, with a 40watt ps, the 2v input would be creating a corresponding 7.2 mA. When you input 5 volts, it would be outputting a corresponding 18 mA.

PWM does exactly the same thing, except it does it through pulse widths. If the frequency of the PWM is 20000 cycles per second. So in a given second, a 40% input would provide about 8000 cycles at 5v and 12000 cycles at 0v. (Not really working that way, but OK to think of it that way to get the picture in your head.) So the signal is 5v 40% of the time and 0v the other 60% of the time. The PS then interprets that signal and says, based on that input, I need to output the same amount I would if I had a 2v analog signal.

In other words, the PWM logic in the ps is converting the PWM signal into a corresponding analog signal. So the part of the ps that sends power to the tube is not really seeing 5v and 0v, it is seeing 2v and acting accordingly. (Again, may not be accurate description of reality but certainly is functionally the way it works.)

Time, as you are thinking of it, does not enter into the picture at all.

Did I muddy it up for you a little more? :lol:
tim
--
"The answer is usually easy and obvious once you know what it is." tw

DIYLaser Blog
SemiHomemadeTools.com
twehr
 
Posts: 439
Joined: Mon May 24, 2010 4:49 pm

Re: Demistifying the PWM Myth

Postby BenJackson » Mon Sep 19, 2011 7:26 pm

twehr wrote:In other words, the PWM logic in the ps is converting the PWM signal into a corresponding analog signal. So the part of the ps that sends power to the tube is not really seeing 5v and 0v, it is seeing 2v and acting accordingly. (Again, may not be accurate description of reality but certainly is functionally the way it works.)


It's highly unlikely that the PSU is interpreting the PWM logically. Doubly so because the input is an analog input. What's really going on is that the PWM is driving some kind of simple analog filter (probably a plain RC) which removes the high frequency component of the PWM and leaves the DC. That's why the frequency is important: The higher the PWM frequency the more of the on/off noise will be removed by the filter and the closer the output will be to a DC voltage. At a low enough frequency steve's description would be correct: The filter would not remove any of the on/off and the laser would pulse.

This is why doing laser power with PWM from Mach3 is suboptimal: If you run your kernel at 40kHz and have 10 PWM values your PWM frequency will only be 4kHz. If you have 100 PWM values it will be 400Hz at which point the pulsing problem is likely to show up.
BenJackson
 
Posts: 522
Joined: Fri Apr 15, 2011 6:13 pm

Re: Demistifying the PWM Myth

Postby twehr » Mon Sep 19, 2011 8:02 pm

BenJackson wrote:It's highly unlikely that the PSU is interpreting the PWM logically. Doubly so because the input is an analog input. What's really going on is that the PWM is driving some kind of simple analog filter (probably a plain RC) which removes the high frequency component of the PWM and leaves the DC.


That is why I added the disclaimers as to reality. I was only trying to separate, in his mind, any direct link between the PWM input and the resultant output.
tim
--
"The answer is usually easy and obvious once you know what it is." tw

DIYLaser Blog
SemiHomemadeTools.com
twehr
 
Posts: 439
Joined: Mon May 24, 2010 4:49 pm

Re: Demistifying the PWM Myth

Postby steves » Mon Sep 19, 2011 10:20 pm

Tim

I guess I didn't word my question accurately enough - my point is that when you call for 60% power through PWM you're calling for 100% power 60% of the time. If 100% power is too much for your laser, is that going to be a bad thing? I'd guess that if the PWM frequency is high enough and the tube's sensitivity to being overpowered is on the timescale of minutes, using 60% to get to your max power is fine. If a tube could be blown in milliseconds at 100% power, then 100% for 60% of the time is going to be a bad thing if you have a low PWM frequency. As Ben pointed out, your PWM freq might be as low as 400HZ.

That's why I was thinking an optimal solution would be to current limit the PSU's output to 100% power at a 100% duty cycle.

So I guess I'm really asking a question about the actual in practice behavior of the tubes versus a simple power calculation.

Can't touch the theory/practice subject without a favorite quote:

"The theorist invents his companions, as a naive Romeo imagined his ideal Juliet. The experimenter's lovers sweat, complain, and fart.” James Gleick

Steve
steves
 
Posts: 18
Joined: Thu May 19, 2011 1:15 pm

Re: Demistifying the PWM Myth

Postby twehr » Mon Sep 19, 2011 11:12 pm

steves wrote:Tim

I guess I didn't word my question accurately enough - my point is that when you call for 60% power through PWM you're calling for 100% power 60% of the time. If 100% power is too much for your laser, is that going to be a bad thing? I'd guess that if the PWM frequency is high enough and the tube's sensitivity to being overpowered is on the timescale of minutes, using 60% to get to your max power is fine. If a tube could be blown in milliseconds at 100% power, then 100% for 60% of the time is going to be a bad thing if you have a low PWM frequency. As Ben pointed out, your PWM freq might be as low as 400HZ.

That's why I was thinking an optimal solution would be to current limit the PSU's output to 100% power at a 100% duty cycle.

So I guess I'm really asking a question about the actual in practice behavior of the tubes versus a simple power calculation.

Can't touch the theory/practice subject without a favorite quote:

"The theorist invents his companions, as a naive Romeo imagined his ideal Juliet. The experimenter's lovers sweat, complain, and fart.” James Gleick

Steve


I believe you are over thinking this. You are not asking for 100% power 60% of the time. The circuitry internal the to ps sees both the analog method (3v) and the digital method (5v 60% of the time) as 60%. It NEVER passes that on the to output of the ps. So you are not putting out max power 60% of the time. You are putting out 60% power. Period. Don't make it any more complicated than that.
tim
--
"The answer is usually easy and obvious once you know what it is." tw

DIYLaser Blog
SemiHomemadeTools.com
twehr
 
Posts: 439
Joined: Mon May 24, 2010 4:49 pm

Re: Demistifying the PWM Myth

Postby r691175002 » Tue Sep 20, 2011 12:16 am

I think you are going to need to take a step back here.

Applying a PWM signal to the analog input is not really PWM control and is definitely suboptimal. At best I would call it hooking up a crappy DAC to the analog pin. Furthermore, the 20Khz number is completely meaningless if you hook up your signal to the analog line.

All of the laser power supplies also have a TTL (digital) input. This input was designed for PWM and is where the signal should be going. The analog current limiter remains attached to a potentiometer. You set the PWM to 100% duty cycle and adjust the potentiometer to the maximum current of the tube. The PWM signal controls bursts of 18 (or whatever your max is) milliamps.
Advantages of using real PWM is that power control is more linear, 100% is actually 100% and low powers are handled much better. On some controllers you can also adjust the frequency of the PWM which can cut with less charring or do things like dashed lines if the pulses are very slow.

This also ties into the question about overdriving for short periods of time. You should not exceed the current limit of the tube over any time span. Doing so may or may not be harmful but either way it is completely unnecessary and only has potential downsides. The power supply may be averaging out your pulses but you can't be sure, and again, it is completely unnecessary.

The full spectrum retinaengrave actually makes the best of both worlds - the new model has both a PWM output and a true analog output. I'm not convinced that it is necessary but I guess its cool.

TL;DR: The point of PWM and the number is that you are supposed to have discrete flashes from the laser. This is more efficient, repeatable, and control is more linear. Also pulsing reduces charring on some materials. This is because you get the advantage of high power instantly vaporizing the material, but since the laser turns off there is no excess radiant heat to brown the surrounding material.
r691175002
 
Posts: 242
Joined: Mon Dec 13, 2010 5:05 pm

Re: Demistifying the PWM Myth

Postby BenJackson » Tue Sep 20, 2011 12:55 am

r691175002 wrote:The point of PWM and the number is that you are supposed to have discrete flashes from the laser. This is more efficient, repeatable, and control is more linear. Also pulsing reduces charring on some materials. This is because you get the advantage of high power instantly vaporizing the material, but since the laser turns off there is no excess radiant heat to brown the surrounding material.


I'm sure that TTL PWM control of discrete pulses is much more linear in average watts but that's fairly meaningless in terms of cutting and engraving. With the analog power control I can draw a brown line on a piece of cardstock. With analog control set for 40W even a 1/20000th second pulse will punch a hole completely through the card. That's why controllers vary both the analog power and use pulsed cutting.

I've got pulsed cutting working with EMC2 and I can cut 5mm plywood with 25% duty cycle and 40W power which produces a much different cut than 100% duty cycle (continuous wave) at 10W. Similarly I can engrave at low power on cardstock but it's impractical to use full power because I can't move the X stage fast enough to avoid burning completely through.
BenJackson
 
Posts: 522
Joined: Fri Apr 15, 2011 6:13 pm

Next

Return to Electronics

Who is online

Users browsing this forum: No registered users and 9 guests

cron