Realtime PWM mode added.

Discussions and file drops for Auggie
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

Hi Glen:

Thx, I know there are many little bugs.. one I might mention, is the Laser3D mode stays
in effect till turned off, so if you don't get any laser, check its off. it is after the final pass, youll get
no laser until its reset or turned off.

  Ill be fixing that shortly..

Thx
Art


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

Re: Realtime PWM mode added.

Post by Joakim »

Art:
Watch the latest video I posted 2 night ago on configing the laser, it shows where to set the PWM channel
that the freeaxis will drive. Select a PWM channel there and the appropria te pin will then have the PWM
controlle d by the freeaxis. . ( You dont actually use the freeaxis, its just a transfer mechanism to the
PWM controlle r... and a great indicator that its working..
Great video explaining how things are working - watched it twice.
Had mixed up laser power (RT LaserOn) and laser power (mA to tube). After reconsideration I selected the same laser activation input on the power supply as the Mosi board used. That has opto coupled protection and connected it to Pokeys PWM channel 4.

Works fine!  :) Thanks!

For my CO2 tube and K40 machine, the limits are:
  • 12% RT PWM before the laser fires at 20kHz PWM period.
  • 4mA current at high voltage before laser fires.
I noticed a nonlinear relation between feedrate and power setting: 400mm/s at 50% is not the same as 800mm/s at 100%.
Seems that 400mm/s at 50% gives more cutting power than the double speed and 100%.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

Hi Joakim:

  Ive noticed the same thing.. perhaps some sort of correction can be developed over time..

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

Re: Realtime PWM mode added.

Post by Joakim »

Try and error... hmmm... Using PWM channel 4 with GND for powering Laser Fire opto coupler has the side effect of putting Pokeys57CNC into recovery mode on power on as PWM 4 on pin 18 is also RST.
Now using PWM channel 2 on Pokeys pin 20.

Just if someone run into similar problems, now you know why it loops recovery mode...  ;)
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

Good to know. :)

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

Re: Realtime PWM mode added.

Post by Joakim »

Art:

Have laser current control (mA) and laser PWM power working. I set the laser current in the SpindleSpeed() function, that way the GCode S parameter will set the current from 0% to 100% (S0 - S100). This will make it possible to change laser current on the fly.

Doing GCode vector cutting, how I can set the max laser power?

If the feedrate is set to 1000 mm/min (F1000) and the max laser power at 50%, I would expect a G1 move to ramp up (PWM) from 0% and be at 50% when the commanded feedrate is reached. But I need some way to set the max laser power from the GCode.

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

Re: Realtime PWM mode added.

Post by ArtF »

Hi J:

  Ill release a version at some point tomorrow. Thats the version Ill describe below..

  In this version, you select Laser Spindle. You then dont have to use an S word. The Laser Power slider
on the screen selects the maximum power of the laser. SO if its set to 50% for example, and you command
F50, the PWM will ramp up from 0 - 50 and reach 50 when feedrate does. I will be tying the S word to the slider
so that it adjusts that when an S word is seen.

By doing it this way, both vector and raster modes are supported.  It also allows tweaking while running just
by sliding the max power slider beside the test button.The version Ive been using should be out
at some point in the morning..

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

Re: Realtime PWM mode added.

Post by Joakim »

Art:
Thank you, Great. Just downloaded 1.48a and will try it out.
(Safest to back up changed scripts before installing...)

Is it possible to use another parameter (P or similar) to control laser current setting or is the solution to define a new G/M code?

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

Re: Realtime PWM mode added.

Post by ArtF »

J:

Probably best to add a new Gcode.. the spindle script will get only the S parameter in its
call, but a Gcode gets many parameters, so allows better flexibility..

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

Re: Realtime PWM mode added.

Post by Joakim »

Art:
Moved the K40 current control to G110 Pxx GCode as you suggested - works great. Making a new GCode is really easy...  :D

The GCode S parameter has no effect on power setting (Real time PWM), not the output measured on the scope nor the power slider - am I doing something wrong?

The version I tested are the latest 1.48a.
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Realtime PWM mode added.

Post by ArtF »

J:

  No, nothign wrong, its me, your just ahead of me is all. I haven't yet hooked the S word to the slider as I havent needed to
yet, Ive been using the slider.
  Ill probably just add it to the spindle speed script call to set the variable MaxLaser to the correct value from 0 - 100.. It will
happen in a future update when I get to need it to react to the S word..
 
Glad to hear its coming together. :)

Art

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

Re: Realtime PWM mode added.

Post by Joakim »

Art:
Thank you. I am slowly moving forward with the laser project...  :)

If I read you correct I could set the variable "MaxLaser" to a value from 0 - 100 in the SpindleSpeed function. I will try doing that tomorrow, must be something like: GlobalSet( "MaxLaser", value );

When I played around with the dialog slider control, I noticed that script is never called on slider change - would be nice to have script calls, whenever slider changes value. I wanted to use this functionality to have the PWM value follow slider.

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

Re: Realtime PWM mode added.

Post by ArtF »

J:

  Yes, all correct , should work fine..

As I recall, as you need to do is make a script called

global LaserMax = function()
{
...
}

  And the script will get called when you slide it..

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

Re: Realtime PWM mode added.

Post by Joakim »

Art:

It works great setting the laser power from SpindleSpeed(). Likewise reading the values  :) Thanks.
No luck getting callback function to work when DRO changes. I must be doing something wrong...

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

Re: Realtime PWM mode added.

Post by ArtF »

Hi J:

  Im adding a few things in there, so Ill try it myself and fix what ever the logjam is.. :)

Thx
Art
Post Reply

Who is online

Users browsing this forum: No registered users and 80 guests