Hi Joakim:
I think perhaps Ill explain the full theory of what Im doing here.. I think Ive hit that spot.

Forgive the length of this one...
The PWM control is set every ms ( while in motion), here is the way it works..
Normally, without considering power, motors are moved in 1ms way-points
from the jerk planners. There are two of them one for each set of 4 axis. That's
8 bytes of data for each ms, the byte varies from 0 ( no steps or system is motionless)
to 125 for that ms as that makes 125Khz the maximum speed. These control
speed bytes are constantly sent by Auggie to the pokeys, no matter what, as long as
your not in E stop mode , speed bytes are sent continuously.
What Pokeys has done for me, is change the meaning of the byte for
any axis I declare to a number from 0-100 as duty cycle for the PWM. This means
you trade any of the extra 4 axis ( 5,6,7,or 8) for pwm control of the laser.
You can trade another ( or 2) for use as an index-able conveyors, spindles..whatever..
What that means in implementation, is that I will control that byte to
set power based on a few things. Speed, acceleration, and power requested,
I will make averaging algorithms to spread the power as a "Joules per mm"
setting rather than joules per second.
This has a very nice feature, it means if speed is zero, power is as well,
so laser power is ensured to be off when not moving, and power goes
higher the faster you move. Auggie will calculate ( with user assistance
by selection of options, ) how much power per mm, and what kind
of correction function to apply for acceleration periods. Lasers are
very often nonlinear in their output, so my initial thought is to add
visual calibrations, so a matrix of small engravings on a test board
to quantify that lasers linearity ( or non-linearity) visually by selection
of "which of the following 10 is smoothest", or "which of the following
has the best grey scale " or ..whatever.. I suspect between those
of us who join in we can come up with what are basically test patterns
from which you will selected the items that represent your systems ability to cope
with the various nonlinearities in its operation, you will then apply
correction filters to that profile to make that laser operate as closely as
it can to other lasers running the same program. My current thought
is to make a high order polynomial to represent your particular lasers
response function as a result of several multiple answer questions based
on small quick repetitive cuts with different curves till an algorithm
can compute the best matching intersection of test pattern responce.
Because of the (no-motion = no laser) property, ( I loved this
in Darwin's Laser mode), when you turn on the laser with
the "Laser on " button, nothing happens. If you jog or do any feedrate
move while in that mode, the laser runs only for that motion, and the
power is adjusted during accel and decel to attempt to make even a
slowly accelerated line as linear as possible in power.
Now, its not possible to do this with perfection, I admit this up front,
but until we actually make calibration and correction tables and bezier
curves of power profiles to match up our systems, we just wont know
how close we can get. But as far as I know this has never been done in
the way I envision it, so...I gotta try.
Perusing the web for similar control of lasers under Windows looks
to me to be very expensive, in fact it looks similar to the day when I
did research on motion controllers when I built my first router and
decided I had to make a program that did CNC as I was way too cheap
to pay for the current software. We may never match the capabilities of
high end laser controllers, but I know from personal experience, if we
can attract a core base of users that hits that critical number( which is
always unknown beforehand), your knowledge, and theirs, combined
with a willingness to experiment, may invent something that is
useful, functional, and a further evolution of the hobbyist experience.
One last word. Auggie is short for "The Augmented Controller" and Ive had
trouble till now explaining what the augmentation is about. It was the reason
I started down this road, but ironically was the thing I couldn't quite bring into
focus till near the end, and haven't even started the code for it, though its written
already in my head. The fact I COULDNT control a laser ms by ms in any other
controller is what drove this. Darwin could, nothing else could. Its important, in
industry to have safety and interlocks and keep the user ( generally considered
the weakest link of a cnc system) away from low level operations. Auggie
is trying to put the user into the hardware..at a very low level. In this it differs
from all other controllers. Its augmention mode is meant to load data, any data,
and apply it in the way the user wants. Since the format of the data is unknown to
me ( the guy writing the software , lol ), I have to accept it may be images, or
spreadsheet data, or a 3d model or just probe points from a probing operation,
and give you tools to tell the various algorithms how YOU want it interpreted. Ill
be giving you the equivalent of shader threads which in graphics run in parallel
on all pixels. So I want to write script frames where you decide on the power output
for a given instant based on your data. As a very rough example of what Im
envisioning as "Augmentation" are scripts similar to this, which you will modify to suit..
global MyBlueBurns = function( x, y)
{
dataword = AugmenterData( AugData1 ); //returns data word representing current tool
//position in matrix grid of loaded data( image, spreadsheet whatever..)
OutPower = AugmentScale( dataword & 0xff ); //this is a photo, get just the blue word..scale the power to it
return OutPower;
}
Such a script would be "called" for every single ms of motion and feed the power word the data
representing that moment in time, how you deal with it will be up to you. The above would
laser engrave only based on the blue words in the image. Obviously vastly more complex ways
of interpreting data could be done. Perhaps with focus,youd turn on a second augmentor script
and you could do
global MyFocus = function( x, y)
{
dataword = AugmenterData( AugData2 ); //returns data word representing current postion on 3d model
NewFocus = dataword.z(); //this is a 3d model , use the Z to move the focus.
return NewFocus;
}
I think one should be able to run multiple augmentions, each affecting one or more realtime operations
during motions. To activate such things.. youd call then in Gcode as Auggie understands special Gcode
commands. So it would look similar to
g1X10Y10 //ready for spiral raster
{SetAugment( 1, "my3dmodel.stl" , MyFocus ); }
{SetAugment( 2, "PhotoOfMe.jpg" , MyPower ); }
{SetAugmentScale( 8, 10 )}
...
Gcode program of a 2d spiral raster..
...
So your scripts of control become the augmentations for the run.
That, in a nutshell is what I envision the end system to look like, though
such things tend to change over time... you just never know...
Sorry for the long ramble, but I's early, Im fresh, and I figured it was time
to do a more full explanation.. besides, Im a little burned, Im taking most of the day
off.
Art