M3 blocks changing PoKeys PWM

Discussions and file drops for Auggie
Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Re: M3 blocks changing PoKeys PWM

Post by Joakim »

Art:

I my setup, the laser power slider and S word is controlling PWM #2. That is the way I configured it.
Replacing PWM #4 back with the potentiometer will engrave using the output on PWM #2.

I don't know that much about laser power supplies, but I was of the impression that the potentiometer just gave a DC input between 0 and 5V to set a current limit for the tube. That input react very slowly and I read that it is recommended to use a 20kHz for that DAC.
If I measure the input voltage, it must be below 3.5 to limit current to max 17mA and give the tube long life.

Need to read some more on laser power supplies and how they work...

How are the other K40 Auggie users power supplies wired up. I did a quick forum scan, but it only gets partial setups. When I get my laser working, I will draw a schematic and put it up for others.
That testing you did on another K40, was that with TTL to ground and only sending signal to the input from the potentiometer?

There is still the question, why are changing PWM value locked after M3 - I understand that the Real-time PWM used for laser pulsing is locked, but how about the others. They could be used for other tasks at the same time, not relating to laser output?

Joakim
Attachments
K40 PWM Setup.jpg
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: M3 blocks changing PoKeys PWM

Post by ArtF »

J:

>>That testing you did on another K40, was that with TTL to ground and only sending signal to the input from the potentiom eter?
>>There is still the question, why are changing PWM value locked after M3 - I understan d that the Real-time PWM used for laser pulsing is locked, but how about the others. They could be used for other tasks at the same time, not relating to laser output?

  The other K40 was the one run by YaNvrNo. There he has the TTL gounded, and uses the PWM only into the place the analogue pot went.
Yes, he sets it to 20Khz, the TTL simply gets grounded. It is fast enough for the engravings he shows on the forum so it seems plenty fast.

  The other channels will work, but cannot be changed during realtime PWM mode.  This is because setting the PWM duty causes a reset which can cause a false fire signal. As a result, all PWM commands are locked out during realtime PWM active mode. In the case of a laser,
only 1 PWM should be needed.


  Again, there is no wrong way, whatever works is right, but I think it may explain why its locking out. In order for Realttime PWM to work,
it has to disable calls to the PWM settings for other channels, otherwise it can trigger spurious fires.. so thats may be why you find it locks
out.. youd need to disable rtPWM mode before you could use the two channels together..


GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: M3 blocks changing PoKeys PWM

Post by GlennD »

I am also running as YaNvrNo on my K40.
Not at a point i can spend much time playing with the laser unfortunately.

Working on an automation project for a 5 axis, multi head router almost makes up for it though. :)

Glenn
Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Re: M3 blocks changing PoKeys PWM

Post by Joakim »

Art:
Thank you for the explanation - that clear up a lot of things!  :D

I have been reading a little more from power supply descriptions and it seem like I have mixed up the two ways the laser can be driven: Continuous and pulse driven mode.
From the Chinese descriptions it is hard to get head and tail on how things are working and how they are expected to be used...

In continuous mode it is right to talk about a current setting and using TTL to turn laser on and off.
In pulsed mode the PWM is nearly everything, current can be set, but must be a dc value to not interfere with the PWM control.

I will properly revert my PWM current control back to manual to have it for mirror calibration with three markings: Low, medium and high (5, 10 and 15mA). Some cuttings in thin material like paper can benefit the very low power setting.
That would also give me full optical isolation as there is an optical input for the PWM on the power supply.

One have to make mistakes to learn new stuff... and don't forget to ask stupid questions too...  ;)

I understand the need for locking PWM updates during real-time usage of the laser PWM, but didn't know  that all PWM channels had to be locked to ensure correct operation. Now I know.

Playing around with PWM functions I found that the value in SetPWM() is a percent, but the value from the GetPWM() is in seconds. It would be nice if both values was i percent.

Code: Select all

SetPWM(channel, value);
value = GetPWM(channel);
GlennD:
Thank you for joining with your experience. I read in the forum, that you and YaNvrNo was experimenting with the potentiometer input and thought it was for current control and not the main PWM, my mistake.

Joakim
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: M3 blocks changing PoKeys PWM

Post by ArtF »

J:

>>In pulsed mode the PWM is nearly everythin g, current can be set, but must be a dc value to not interfere with the PWM control.

  PWM at 20Khz is basically a DC value to the circuits. I would recommend just using PWM into the analogue input, and tie
the TTL to ground. PWM is enough to do all the control, really nothing else is needed.

Art
Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Re: M3 blocks changing PoKeys PWM

Post by Joakim »

Art:
I plan to use the optical isolated input that the original Mosidraw board used and the analog potentiometer. The optical isolated input can be used without any modifications - using the analog input for PWM can result in over current if voltage gets to high and I have no electrical protection (It is a cheap Chinese power supply).
The optical input is designed to be used for engravings, the Mosidraw board used this input.

If I let the potentiometer be at the highest level the end result should be the same.
And it is still handy to have manual fire and low power when calibrating...

I can always switch to using the analog input at a later time if this configuration gives trouble.

Joakim
Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Re: M3 blocks changing PoKeys PWM

Post by Joakim »

Another benefit of this configuration is that I am not bound by the 20kHz requirement for current control. I could use a lower PWM frequency as the current is managed by a DC voltage from the potentiometer.

When browsing the net for cut/engraving settings I often see a recommended frequency - often wondered what that ment... Anyone have an explanation for this?

Joakim
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: M3 blocks changing PoKeys PWM

Post by ArtF »

J:

    The frequencies they talk about are thr firing frequency. Its about two different laser setups.. 


My laser for example, has one input, TTL, it has no pot or power setting. When it shoots, it shots at full
power, but at 5khz. The PWM is a 5Khz signal, so each time it fires, it fires 100% current, but for a variable
time from 0 - 200us per shot. The net effect of this is "average" power. if you shoot 100% but only 10% of the
time, you get an effective 10% power. the faster you do this, the smoother the average. Some makers
then allowed the operation to vary in frequency. I could set my 5khz to 2khz for example.

  Much of this is because of the responce of various lasers. Mione has a rise time of about 100uS, so if pulsed
at 5khz, there is just enough time for its power to hit 100% before the pulse is turned off. This allows the
gas to recover some and the next pulse can then achieve the same power. If I were to pulse at 2Khz, Id get
actually higher power as the recovery time is longer and the amplitude would get higher, faster. 

  The timing of the shots has a lot to do with instantaneous power vs average power.

  As to frequency of 20Khz, there really is no such limit. It depends on what input your feeding the PWM.
If you feed PWM into the analogue pot input, any frequency is good, the higher the better. (The pot
after all can be considered to have a frequency of infinity..). The PWM here is not really used for anything
other than generating an "average" voltage. Rather then a pot feeding 2.5Volts from 5volts,
the PWM feeds 5volts at 20 khz at 1/2 duty cycle, the result being an average of 2.5volts. No difference.

In the TTL input, its similar but not the same. Here we trigger the power supply to feed, and to feed at a maximum
ma as set by the analogue pot. There is little information on how it works, and Ive never seen a schematic
of the high voltage supplies. BUT, there arent too many ways of controlling MA in a plasma circuit. That I do
have some experience in. In fact one of only ways I can think of, if one cannot control the electron count with a
filament, is to control the HV at a frequency. To pulse it on and off at a frequency where the average current is
15ma or whatever you have set with the pot.

    Heres what my conclusion is as to how it works inside a chinese laser hv supply, I could be wrong, but
all the evidence Ive seen points to this conclusion..

  You have a pot input with an analogue value on it. This is fed internally to a voltage to frequency
chip that shoots the HV transformer at a frequency that is proportional to  the desired average MA.

  This frequency is generated all the time when a voltage is applied to the pot pin, but controlled
by a gate.

You also have a TTL input, which is a simple switch , it turns on that gate that allows the
above frequency to feed the HV transformer.  If its on, and a voltage is causing the
volt-freq circuit to run, you get laser proportional to the pot voltage.

      The TTL therefore controls the length of any shot. It will have an inherent min on
time and shutoff time based on its own electronics and the ability of the tube to dissipate
its stored HV.

  If one ties the TTL to ground, thus turning on the switch, and simply pulses PWM
to the analogue pin, the same effect is seen, but now the electronics of the PWM input
, its volt->freq convertor and such will control the minimum on/off times of the laser.

    In essence then, there is no real difference in how one does it, other than the
on/off time variance one may see using one method over the other. BUT, you never really
need both, so one PWM is enough. If using the POT on the board, all will work the same,
just a different form of smoothing. We fool ourselves when we use the concept of
"power level" in this regard I think, what we're really controlling is on-time, and the effect
of a gas recovery rate, which is important only in that it affects any linearity of
power responce. (Typically a nonlinear power curve );

  If you dont allow the gas in the tube to recover, it will eventually get depleted. There are chemical
interactions in the gas which must have time to occur, so the 18ma or 22ma limit is basically that,
a timing that allows recovery.

  So whether you use the TTL input or the PWM input to control the supply its basically the same.

  I could be all wet on this, I have no detailed schematic, but observing my 3 lasers and what
happens with the K40 as they get hooked up has led me to the above mental model of how
it all works. Seems to work for me so far. :)

Art













Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Re: M3 blocks changing PoKeys PWM

Post by Joakim »

Art:

Thank you for explaining the inner workings of the power supply and CO[sub]2[/sub] gas lasers. I sounds right to me!
High voltage in transformers can only be generated with an AC input or pulses, as we know it from switch mode power supplies.
The voltage and current on one side of the transformer is proportional with voltage and current on the other side. That make sense if the current control is handles with PWM or pulse frequency modulation (pulse length constant) internally in the power supply.

If we send a PWM signal to the current control pin, it takes over the job of setting the current for the power supply, bypassing it to the transformer - could be confirmed by connecting an oscilloscope on the primary winding of the transformer.

Having the TTL as an on/off gate seems as the most logical way to have the supply to work both in "DC" and PWM mode.

I see the trouble in my current configuration, pulsing TTL and having a DC value on the potentiometer input. That input voltage is internally converted to a "unknown" frequency / pulse modulation to feed to the transformer. At the same time I am chopping that signal through the gate (TTL) with a high PWM frequency to turn the laser beam on/off.
These two frequencies are mixed and may give unexpected end results...
It is like driving both inputs with PWM signals, and one of them is unknown.

For now, I will keep the analog input from the potentiometer and see if it gives trouble. Just received the ordered 6N136 fast optocouplers from eBay, I was planing to use at the potentiometer input. They could now come in use :)

As I remember, both GlennD and YaNvrNo are switching the potentiomenter input between 0 and 5V, not between the two other inputs from the potentiometer plug.
This is important as the PWM signal must be limited to avoid burning the tube with too much current.
Earlier I have measured that the DC on that input must not exceed 3.5V (15 mA).

I found this technical article on CO[sub]2[/sub] lasers http://www.repairfaq.org/sam/laserco2.htm by  Samuel M. Goldwasser. Be aware it is technical, but it answers a lot of questions on how CO[sub]2[/sub] lasers work.

It helps a lot, having an good inner model of the workings...

Joakim
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: M3 blocks changing PoKeys PWM

Post by ArtF »

Hi J:

>>These two frequencies are mixed and may give unexpected end results.. .
>> It is like driving both inputs with PWM signals, and one of them is unknown.

  Yes, this was my problem with it, using 2 PWMs would seem to have a sync problem, though it still works..

>>For now, I will keep the analog input from the potentiom eter and see if it gives trouble. Just received the ordered 6N136 fast optocoupl >>ers from eBay, I was planing to use at the potentiom eter input.

  Sounds good.

>>As I remember, both GlennD and YaNvrNo are switching the potentiom enter input between 0 and 5V, not between the two other inputs from the potentiometer plug. This is important as the PWM signal must be limited to avoid burning the tube with too much current.
Earlier I have measured that the DC on that input must not exceed 3.5V (15 mA).

  True, the average DC shouldne exceed a set alue, though 15ms is low, Id suspect 20ma is more reasonable an upper limit for a K40.
Feeding the analog input with 5 volt PWM is fine, youd just need to not exceed the duty cycle where the voltage averages that 3.5-4 volts..

  A much safer way is to use the PWM of the pokeys to fire a transistor as Glen does, where you could feed the pot voltage to the transistor so that 100% PWM is only 3.5Volts average DC, thus keeping current to within limits. Some have claimed the pot voltage
imput is too slow, but tests on YaNvrNo's show that to be untrue, he runs at 20Khz on the pot input line, 0-5voltPWM, and
has done engravings that show timing isnt an issue. It IS possible to tell Auggie with MaxPWM to limit the current anyway, if set to 80% for example, the DC voltage on the pot input will never exceed 4 volts , so the current is properly limited.

  Most of your tests in the K40 have been done on that setupo, using PWMMin and PWMMax to find the best range for his K40,
which we find fires at about 50% PWM, with no radiation below that value with TTL jumpered to ground.

This isnt totally unusual, my Chinese laser fires at 17%, with nothing below that.. point is though, that the analogue input line
seems plenty fast enough to control on/off as well as power simultaneously, though TTL is a fine way to do it as well, it all
goes to show the flexability of a K40, it can be run in many ways, and they all seem to give pretty good performance..

  I appreciate your feedback, Ill bet its ready many times over the next few years by K40 users looking for data on hooking
their units to software of any kind.. Its hard information to find.. I know, Ive looked. :)

Art

Art



Ya-Nvr-No
Old Timer
Posts: 188
Joined: Wed Sep 08, 2010 11:15 am

Re: M3 blocks changing PoKeys PWM

Post by Ya-Nvr-No »

I was test cutting thru some 1/4" teak and found I could do it with two passes at two different power levels per pass. So to test I wrote just a quick multiline MDI script that turns on the tickle, sets the feed, turns on my air assist, and burns twice.

m3 f8
m103 (air assist on)
g1 x1.5
g0 x0 s70 (rapid back set pwm to 70%)
g1 x1.5
g0 x0 s100 (reset back to 100%)
m105 (air assist off)
m30


I edited in the mcode script for setting speeds

//Sets the Spindle speed, triggered by S3000 fo example
global SetSpindleSpeed = function( speed )
{
    //SpindleSpeed( speed );
  //Control power level using SpindleSpeed Settings
  if (speed>100){
    speed = 100;
    print("Speed set to: "+speed);
  };
    GlobalSet("LaserMaxPower",speed);  // passing the value to the laser power variable

};
BobL
Global Moderator
Global Moderator
Posts: 466
Joined: Sun Sep 05, 2010 7:18 am

Re: M3 blocks changing PoKeys PWM

Post by BobL »

Thanks Ya-Nvr-No..

I'm just about finished my home built version of a laser cutter using Auggie, so much to try? 

Cheers
Bob
Gearotic Motion
Bob
BobbyW
Old Timer
Posts: 117
Joined: Sun Sep 08, 2019 12:27 pm

Re: M3 blocks changing PoKeys PWM

Post by BobbyW »

Joakim wrote: Art:

I don't know that much about laser power supplies, but I was of the impression that the potentiometer just gave a DC input between 0 and 5V to set a current limit for the tube. That input react very slowly and I read that it is recommended to use a 20kHz for that DAC.
If I measure the input voltage, it must be below 3.5 to limit current to max 17mA and give the tube long life.

Need to read some more on laser power supplies and how they work...
Joakim
Hello .
I has a lot of problem with my power source . My input impedance was very low almost 1kR and the creator decide to let some residual input voltage as 1.2V , and that made my work very difficult .
I solved finaly , i eliminate almost entire chinese cheap control and now is how should be .In that time i made a lot of researches about , and finaly i open and modify myself .
What i found close with what i saw inside of my source was this schematic found on some russian forum .
If help someone ...
http://mir-cnc.ru/topic/5872-назначение-подстрочников-на-блоке-питания-dy10-к-т/
Thanks
Bobby
Attachments
laser source.jpg
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4586
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: M3 blocks changing PoKeys PWM

Post by ArtF »

Bobby:

Thx, the more information we have the better.

Art
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests