weird dot like somekind power outburst

200 views
Skip to first unread message

nicolas.de.barquin

unread,
Dec 23, 2014, 5:53:43 AM12/23/14
to lase...@googlegroups.com

Good morning everyone.

I'm still very happy with the laser :) 
But I notice some strange dot during my engraving job, English is not my usual language and I'm not sure how to explain it neither how to search about it. I tried to look on the group but I didn't found any lead.

So here is a picture, look at the arrows.
It's like if the laser go to 100%, just for a milisec. I can hear it when he does, just a "tit" noise, like when It goes full power but I used for this one F2500 10% and it append with any settings.


Did someone experienced something like that?

thanks,
Nicolas

Jondale Stratton

unread,
Dec 23, 2014, 8:53:15 AM12/23/14
to lase...@googlegroups.com
Yes, I get this too. 

My initial impression is this happens at some node points.  I have been meaning to find some simple examples of this so I can then parse through the gcode to see if it that is where the problem is but have not done so yet.

​My work around so far has been to find the node where this is happening and then delete/recreate it.  That seems to fix it most of the time.



--
You received this message because you are subscribed to the Google Groups "lasersaur" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lasersaur+...@googlegroups.com.
To post to this group, send email to lase...@googlegroups.com.
Visit this group at http://groups.google.com/group/lasersaur.
To view this discussion on the web visit https://groups.google.com/d/msgid/lasersaur/b3980056-cd43-43c5-bb7f-dc1e94b6c0d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nicolas.de.barquin

unread,
Dec 23, 2014, 9:13:27 AM12/23/14
to lase...@googlegroups.com
Interesting.
I was thinking to look about something in the Gcode but I don't know how to access it. 
What do you mean by node and how to access to it?

Steve Baker

unread,
Dec 23, 2014, 9:36:16 AM12/23/14
to lase...@googlegroups.com
I haven't *noticed* anything like this (which is not to say it doesn't
happen)...and anything that screws up laser control is a bit worrying.

I suppose that one possible explanation might relate to the way that the
Arduino calculates laser power from speed as the head accelerates. If
there was a numerical
overflow or underflow or something - I could kinda imagine it jumping from
almost zero to 100% because the number went negative and wrapped
around...or because there was a divide by zero or something.

Those dots *do* seem to appear at the start or end of a vector - which is
exactly when
you'd expect something like that to happen if there was some kind of a bug.

One observation from the photo is that this only seems to be happening
when the Y axis motor is accelerating - never when the X axis is
accelerating. Do you ever see these dots at the start or end of a
horizontal line - or on the left or right sides of a circle?

If it's only the Y axis, then I'm skeptical that it could be a software
issue because I'd assume that the X and Y axis software was
identical...although the mm/min values are different - so I suppose there
is scope for numerical weirdness there.

Hardware is tough to blame because the motion control and laser control
systems are completely separate. The only hardware possibility that comes
to mind might be electrical noise between the stepper drivers and the
laser control wires - the steppers are working hard to accelerate the head
from zero speed at that moment. So I guess the current might be at a
maximum...and maybe it's the Y-drive cables that are interfering and not
the X-drive.

But that does seem rather unlikely.

Could you post a small example of the problem (as an SVG file maybe) so
that other people can try to reproduce it?

-- Steve


nicolas.de.barquin wrote:
> Interesting.
> I was thinking to look about something in the Gcode but I don't know how to
> access it.
> What do you mean by node and how to access to it?
> On Tuesday, December 23, 2014 2:53:15 PM UTC+1, jondale wrote:
>> Yes, I get this too.
>> My initial impression is this happens at some node points. I have been
meaning to find some simple examples of this so I can then parse
through
>> the gcode to see if it that is where the problem is but have not done
so
>> yet.
>> ​My work around so far has been to find the node where this is happening
>> and then delete/recreate it. That seems to fix it most of the time. ​
>> On Tue, Dec 23, 2014 at 5:53 AM, nicolas.de.barquin <
>> nicolas.d...@gmail.com <javascript:>> wrote:
>>> Good morning everyone.
>>> I'm still very happy with the laser :)
>>> But I notice some strange dot during my engraving job, English is not my
>>> usual language and I'm not sure how to explain it neither how to
search
>>> about it. I tried to look on the group but I didn't found any lead. So
here is a picture, look at the arrows.
>>> It's like if the laser go to 100%, just for a milisec. I can hear it when
>>> he does, just a "tit" noise, like when It goes full power but I used for
>>> this one F2500 10% and it append with any settings.
>>> <https://lh3.googleusercontent.com/-umPqYXmOp4U/VJlGWyFq8pI/AAAAAAAAEhA/wPt1UgOp-I0/s1600/image18031.png>
Did someone experienced something like that?
>>> thanks,
>>> Nicolas
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "lasersaur" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to lasersaur+...@googlegroups.com <javascript:>.
>>> To post to this group, send email to lase...@googlegroups.com
>>> <javascript:>.
<https://groups.google.com/d/msgid/lasersaur/b3980056-cd43-43c5-bb7f-dc1e94b6c0d8%40googlegroups.com?utm_medium=email&utm_source=footer>
.
>>> For more options, visit https://groups.google.com/d/optout.
> --
> You received this message because you are subscribed to the Google
Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send
an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com. Visit
this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/91d3bf23-dc6e-436f-a3f5-5514387c1507%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- Steve




nicolas.de.barquin

unread,
Dec 23, 2014, 12:18:33 PM12/23/14
to lase...@googlegroups.com, st...@sjbaker.org
I join the svg file.
But it append with any svg....Mmmm, it make me think ...  I will try to generate the svg from an other software than inkscape.
I didn't pay attention with a file from illustrator for exemple.

I forgot to precise the version of the machine.
It's Lasersaur 14.03 with lasaurApp 14.11.

thanks
PowerGauge.svg

Steve Baker

unread,
Dec 23, 2014, 3:06:17 PM12/23/14
to lase...@googlegroups.com, st...@sjbaker.org
It's noticeable that this problem is showing up when the laser intensity
has been set all the way down to 10% and the speed is down at 500mm/min -
these are unusually slow speeds and unusually low laser intensities - so I
could see how it might be hitting some numbers that don't often come up in
regular use.

I even start to wonder whether the statement that the laser intensity
jumped up to 100% is even true? At 500mm/min, you'd be able to make a
very dark splotch with even 30% power.

So I wonder if this is some kind of quantization issue related to dealing
with such small numbers in integer math?

I was looking at the code - and there is definitely *some* weirdness going
on there...stuff that weakens my confidence that it's been carefully
checked.

In the firmware/stepper.c file, the code that generates the laser
intensity as the motors
accelerate says:

// beam dynamics
uint8_t adjusted_intensity = current_block->nominal_laser_intensity *
((float)steps_per_minute/(float)current_block->nominal_rate);
uint8_t constrained_intensity = max(adjusted_intensity, 0);
control_laser_intensity(constrained_intensity);

I'm not sure if it matters - but that call to 'max' doesn't do anything
because both adjusted_intensity and constrained_intensity are unsigned
integers - so if anyone ever tried to put a negative number in there
(which the 'max' call is clearly designed to catch) - then it's already
too late, it'll already have wrapped around into some large positive
number - which might well produce the symptoms we're seeing.

SPECULATION: Whoever decided that the 'max()' call was needed may have
been thinking of a situation where it's actually needed...and if the test
isn't working then we'll be seeing very large positive numbers instead of
negatives...and that would EXACTLY explain what we're seeing. It's also
possible that someone came along after the code was originally debugged
and changed signed integers to unsigned - thereby introducing the bug.

However, since all of the numbers going into calculating
adjusted_intensity are also unsigned - that shouldn't ever happen in this
piece of code - so if there is a negative value showing up, it would have
to be someplace else.

I think there is definite scope for there being a problem here...but I
don't really have the time to track it down any further.

-- Steve
>> >> ​My work around so far has been to find the node where this is
>> happening
>> >> and then delete/recreate it. That seems to fix it most of the time.
>> ​
>> https://groups.google.com/d/msgid/lasersaur/91d3bf23-dc6e-436f-a3f5-5514387c1507%40googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> -- Steve
>>
>>
>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/43af56fd-8ea7-40bc-9b25-2fdbd88c2283%40googlegroups.com.

Maximilian Müller

unread,
Dec 23, 2014, 5:59:48 PM12/23/14
to lase...@googlegroups.com
I have the same Problems. The points go through thin materials...

Max

Jondale Stratton

unread,
Feb 27, 2015, 2:45:49 PM2/27/15
to lase...@googlegroups.com
So a follow up to this... I had an engrave I was doing last night that kept doing this.  I exported the gcode and looked through it to make sure it wasn't sticking incorrect S codes in there somewhere and there weren't any (there were only 2 S codes in the entire file).  This was at 10% power and I believe 2000 feed rate.

This tends to happen to me on larger and more complicated engraves but maybe that's because there is just more opportunity for it to happen then.

Hopefully I can find more time for testing on this to find some consistent and simple examples instead of running into it when I am looking for results under a time crunch.


Steve Baker

unread,
Feb 27, 2015, 3:02:51 PM2/27/15
to lase...@googlegroups.com
Our lasers both stop lasing completely somewhere below about 15%
power - although this seems to be different for different people and may
depend on exactly how the laser power supply current potentiometer is
adjusted.

If your machine were right on the edge of the laser cutting out - then
you might be getting random fluctuations between zero power and 10%
- and at the very slow speeds, that would certainly be an issue.

Is there a reason you're going so incredibly slowly and with such low power?

Generally, we're either going at maximum speed and controlling the
power - or at maximum power and controlling the speed.

Running at low speed *and* low power seems like an odd thing to be doing.

-- Steve


Jondale Stratton wrote:
> So a follow up to this... I had an engrave I was doing last night that
> kept
> doing this. I exported the gcode and looked through it to make sure it
> wasn't sticking incorrect S codes in there somewhere and there weren't any
> (there were only 2 S codes in the entire file). This was at 10% power and
> I believe 2000 feed rate.
>
> This tends to happen to me on larger and more complicated engraves but
> maybe that's because there is just more opportunity for it to happen then.
>
> Hopefully I can find more time for testing on this to find some consistent
> and simple examples instead of running into it when I am looking for
> results under a time crunch.
>
>
> On Tue, Dec 23, 2014 at 5:59 PM, Maximilian Müller
>>> >> >> ​My work around so far has been to find the node
>>> where this
>>> is
>>> >> happening
>>> >> >> and then delete/recreate it. That seems to fix it most of the
>>> time.
>>> >> ​
>>> >> -- Steve
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups
>>> > "lasersaur" group.
>>> > To unsubscribe from this group and stop receiving emails from it,
>>> send
>>> an
>>> > email to lasersaur+...@googlegroups.com.
>>> > To post to this group, send email to lase...@googlegroups.com.
>>> > Visit this group at http://groups.google.com/group/lasersaur.
>>> > To view this discussion on the web visit
>>> >
>>> https://groups.google.com/d/msgid/lasersaur/43af56fd-8ea7-40bc-9b25-2fdbd88c2283%40googlegroups.com
>>> .
>>> > For more options, visit https://groups.google.com/d/optout.
>>> >
>>>
>>>
>>> -- Steve
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "lasersaur" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> email to lasersaur+...@googlegroups.com.
>>> To post to this group, send email to lase...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/lasersaur.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/lasersaur/f551a170e35b07bd9eb6d84b697d4844.squirrel%40webmail.sjbaker.org
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/CADNd%2BtKFPH_HyW93_GLaMJ_0RkyrMoXP-B6hf1%2BLB3ten5ZfpQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/lasersaur/CADNd%2BtKFPH_HyW93_GLaMJ_0RkyrMoXP-B6hf1%2BLB3ten5ZfpQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtVZqWojcqfoJzeE3L31u6_73hRFfXdXxXQ%3DZU5MmsvpAw%40mail.gmail.com.

Jondale Stratton

unread,
Feb 27, 2015, 3:21:17 PM2/27/15
to lase...@googlegroups.com
​This tube fires for me as low as 3% but it's newer.  I could probably adjust the pot on the power supply but I've got settings saved for several designs that I would have to redo then.  I added an ammeter early on so I can make sure i never go above 28 mA and rarely ever go near it.

I will test if faster speeds prevent the problem though as that could give a clue to what is going wrong.


Maarten van Dam

unread,
Feb 27, 2015, 4:57:42 PM2/27/15
to lase...@googlegroups.com

Hi jondale, just wanted to let you know we experience the same problems when engraving at low power. If you find the reason of the 100% power bursts we would really like to know :) as far as we know it is software related.

Steve we can go as low as 1%

Op 27 feb. 2015 21:21 schreef "Jondale Stratton" <jon...@jondale.net>:

Steve Baker

unread,
Feb 27, 2015, 5:11:12 PM2/27/15
to lase...@googlegroups.com
Well, there are certainly some red flags in that code.

As I said earlier, that "max" function call shouldn't ever do anything, but
someone clearly thought it was needed - which suggests that they thought
there was a possibility of a negative number creeping in there - and if that
ever happened, the fact that those variables are passed in as 'unsigned'
would cause them to wrap around and generate huge power numbers.

If anyone has the time...then replacing the 'max' function with some kind
of fatal error check for power levels outside the 0 to 255 range would be
instructive.

-- Steve


Maarten van Dam wrote:
> Hi jondale, just wanted to let you know we experience the same problems
> when engraving at low power. If you find the reason of the 100% power
> bursts we would really like to know :) as far as we know it is software
> related.
>
> Steve we can go as low as 1%
> Op 27 feb. 2015 21:21 schreef "Jondale Stratton" <jon...@jondale.net>:
>
>> ​This tube fires for me as low as 3% but it's newer. I could probably
>>> > On Tue, Dec 23, 2014 at 5:59 PM, Maximilian Müller
>>> >>> >> >> ​My work around so far
>>> has been to find the
>>> node
>>> >>> where this
>>> >>> is
>>> >>> >> happening
>>> >>> >> >> and then delete/recreate it. That seems to fix it most of
>>> the
>>> >>> time.
>>> >>> >> ​
>>> https://groups.google.com/d/msgid/lasersaur/07b839e9aff06b015ac09a15f39431d5.squirrel%40webmail.sjbaker.org
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/CAPLxAtXgwDZpmLR8-cKizCKSnJ1kZBYjQwxh67R3GKVGyzdxeA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/lasersaur/CAPLxAtXgwDZpmLR8-cKizCKSnJ1kZBYjQwxh67R3GKVGyzdxeA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAL1EKijHMsPukNi0xPDKAy6%2B_N0%3DXy3rEj-yipqq4bD%2BEGWT5w%40mail.gmail.com.

Jondale Stratton

unread,
Feb 28, 2015, 11:01:47 PM2/28/15
to lase...@googlegroups.com
Going faster with higher power did not seem to change things for me.  I tried 5000 and 8000 feed rates at 20% and 30%.  I kept removing things from the design to get it as simple as possible and still demonstrate the problem.  Attached is an example of an svg and a picture of the results for me at 8000 and 30%.

As you can see the holes show up in the same spots.  This happens every time I use this svg. 

If I simplify it more to just one triangle the problem does not show up even if it was one of the triangles that had holes before.

The gcode does not show any strange S codes that I can find.  If you watch the ammeter you can see a bump in power on occasion.

I'm curious if the same svg would cause the same issues for others and if the holes would be in the same spot.

DSC_0023.JPG
t-filled.svg

Steve Baker

unread,
Mar 1, 2015, 2:30:20 PM3/1/15
to lase...@googlegroups.com
Well, I get mixed results.

Our v12 hardware/v14 software machine ("Ming The Merciless") does a
perfect job at 5000/20%.

Our v13 (ish) hardware/v14 software machine ("IlludiumQ36") produces very
similar dots to your machine...and (although it's not obvious from my
crappy cellphone photo), they are in almost the same places as in your
photo.

So the problem is not in your build...it has to be to do with the motor
gearing...or perhaps the driverboard electronics (because our v12 machine
has the old lasaurshield).

That could either be a software error that shows up in particular roundoff
calculations - or a mechanical resonance of some kind.

I doubt the resonance theory because you see the same problems at a wide
range of different speeds.

So my gut feel is that it's probably a software-related issue.

Even though my two machines are running the same software in the front-end
and back-end code - the Arduino software has different hard-wired
constants for the steps-per-inch values in X and Y.

So this kinda backs up my theory from before that there is some kind of
issue with the acceleration/deceleration code that produces a glitch of
some kind.

Interestingly, the glitch happens on the right-pointing arrow - which has
vertical lines as well as on the other arrows with diagonal lines.

But I don't see these kinds of glitches in my day-to-day work, so I'm
trying to imagine what's special about this design.

The most obvious thing is that the pattern has closely spaced parallel
lines that alternate in the direction they were drawn.

So, to pick the least complicated case:

In the right-facing arrow case, at the point where the spots appear, the
laser was going vertically upwards, then turns the beam off, jogs
diagonally down and to the right, then turns the beam back on again and
heads vertically downwards. The vertical moves vary from around 7mm down
to about a quarter millimeter, the diagonal moves are about a third of a
millimeter in both X and Y.

It's hard to tell whether the glitch happens at the end of the upward
motion, or at the start of the subsequent downward motion...or maybe
whether it's somehow still turned on during the diagonal jog.

In my v12 machine (no glitches) I have 32.80839895 microsteps/mm in both X
and Y.

In the v13(ish) machine (with glitches) I have 88.88888888 and 90.90909090.

So this problem is happening for motion that's a few dozen microsteps long.
>> >> ​This tube fires for me as low as 3% but it's newer. I could
>> >>> > On Tue, Dec 23, 2014 at 5:59 PM, Maximilian Müller
>> >>> >>> >> >> ​My
>> work around so far
>> >>> has been to find the
>> >>> node
>> >>> >>> where this
>> >>> >>> is
>> >>> >>> >> happening
>> >>> >>> >> >> and then delete/recreate it. That seems to fix it most of
>> >>> the
>> >>> >>> time.
>> >>> >>> >> ​
>> https://groups.google.com/d/msgid/lasersaur/593de348c6e1c3b9d651480a9be54aed.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtUA8szN-QXnTziNvAGfOxapkP%2BQmo1FVFHp-3UuBn9OKA%40mail.gmail.com.
t-filled_mingthemerciless.jpg
t-filled_illudiumQ36.jpg

Maarten van Dam

unread,
Mar 3, 2015, 7:37:58 AM3/3/15
to lase...@googlegroups.com
Hey guys,

We noticed that there are no spots when we run at 1600F 10%. Could you try the same pattern with those parameters, see if you get the same good results?

/Maarten

Steve Baker

unread,
Mar 3, 2015, 11:13:16 AM3/3/15
to lase...@googlegroups.com
I'm not near my laser cutters right now, so I can't run the test...but it
wouldn't at all surprise me that there are some settings that don't
trigger the problem - after all, I've been laser cutting on to lasersaurs
for *years* and never notices it happening before!

Since I was able to reproduce your problem exactly on one of my machines,
it's safe to say that your machine is working OK and that whatever
problems you're seeing are common to all lasersaurs with geared motors.
So you can assume that what you're seeing here is very likely to be the
same for everyone else.

If this is a software bug (as I suspect) then it's going to be a rather
specific set of distances, directions, speeds, accelerations and laser
power settings that trigger
it - and fiddling with those settings will undoubtedly make it "go away"
under
some circumstances.

I think a more useful experiment to try to diagnose this would be to
reduce the test case to just the right-pointing arrow - which simplifies
diagnosis because all of the lines are vertical - then to start to
gradually increase the horizontal distances between the lines to see if
that makes the problem "go away". Another interesting test would be to
see if the problem happens when the lines are all the same length, and if
they start at the same Y coordinate - thereby removing the complication of
diagonal 'jogs' and replacing them with horizontal moves only.

Simplifying the test pattern to the simplest possible pattern of lines and
moves that reproduces the glitch is by far the most productive way to help
Stefan (probably!) to fix this.

I've been reading through the code that handles the low-level acceleration
and laser power settings - and it's tough going to understand it all. It
seems to me that if a hardware interrupt were to come along at an
inopportune moment during acceleration
at certain speeds and power settings, that maybe something like this could
happen.

Without a deep understanding of how it all works, that would be hard to
debug.

I'm not optimistic that we're going to find and fix this anytime
soon...and because this is a (seemingly) rare happening, there isn't a lot
of pressure to do so.
>> >> >> ​This tube fires for me as low as 3% but it's
>> Müller
>> ​My
>> >> work around so far
>> >> >>> has been to find the
>> >> >>> node
>> >> >>> >>> where this
>> >> >>> >>> is
>> >> >>> >>> >> happening
>> >> >>> >>> >> >> and then delete/recreate it. That seems to fix it most
>> of
>> >> >>> the
>> >> >>> >>> time.
>> >> >>> >>> >>
>> ​
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> -- Steve
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/cee49b2defa3a5f17cd59d8690a5e237.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAL1EKijenWmYYq45JtF%3D_LhPMK2j7J166h4sXf1c8DkwocvwfA%40mail.gmail.com.

Jondale Stratton

unread,
Mar 4, 2015, 5:26:34 PM3/4/15
to lase...@googlegroups.com
I can confirm that 1600F @ 10% does NOT produce the error on my machine for that design.  It's good to know a workaround for now and to confirm this is a software issue.

I also have some other issues I believe with the acceleration/power code but that's another post when I have more examples to post.

Jondale Stratton

unread,
Mar 5, 2015, 3:58:08 PM3/5/15
to lase...@googlegroups.com
After some more testing it appears that any value I try @ 1600F avoids the error so it appears the feed rate is the key variable here.

Jondale Stratton

unread,
Mar 5, 2015, 4:12:07 PM3/5/15
to lase...@googlegroups.com
I spoke too soon... 1600F had some issues for me doing the same design with higher X values.   I did my engrave side by side and the one further down on the X axis had holes whereas the one on the left did not.

Steve Baker

unread,
Mar 5, 2015, 4:52:45 PM3/5/15
to lase...@googlegroups.com
Having read the code, I'd agree that the actual power setting probably
doesn't
matter. Obviously if you're using a lot of power, the black dots might be
less
noticeable...but I agree that this is probably related to the
acceleration/deceleration
software in the Arduino - and it cares about the speed and the geometry.

As I said, the way ahead is to further reduce the test case - preferably
to just
the right-facing arrow - then to reduce the number of vertical lines to
whatever
still reproduces the bug.

Having got down to that most minimal case, then start playing with the
line lengths and the spacing between the end of one line and the start of the
next.

At some point, you'll be able to say "This geometry works...but move that
vertex
one millimeter to the right and it fails"...which will make it much easier
to figure
out what's going crazy here.

The acceleration/deceleration code in the Arduino is quite complicated - and
it relies on hard timing while interrupts are enabled - which is always a
tough
situation that's difficult to debug. I suspect we're going to need someone
with a high-tech logic analyser hanging off the pins of the AtMega chip to
figure this out...and for that to work, we need a REALLY small test case.
>>> >> >> >> ​This tube fires for me
>>> >> Müller
>>> ’¢â‚¬â€¹My
>>> >> >> work around so far
>>> >> >> >>> has been to find the
>>> >> >> >>> node
>>> >> >> >>> >>> where this
>>> >> >> >>> >>> is
>>> >> >> >>> >>> >> happening
>>> >> >> >>> >>> >> >> and then delete/recreate it. That seems to fix it
>>> most
>>> >> of
>>> >> >> >>> the
>>> >> >> >>> >>> time.
>>> >> >> >>> >>> >>
>>> >>
>>> ÃÃâ€
>>> ’¢â‚¬â€¹
>>> .
>>> > For more options, visit https://groups.google.com/d/optout.
>>> >
>>>
>>>
>>> -- Steve
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "lasersaur" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> email to lasersaur+...@googlegroups.com.
>>> To post to this group, send email to lase...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/lasersaur.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/lasersaur/6907b30d359d85dd785eb977153d94d3.squirrel%40webmail.sjbaker.org
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtWG3YuXi5OAB_npCCOrGNhGSnB9fUh62qFgkxW-%2BcMMOg%40mail.gmail.com.

Steve Baker

unread,
Mar 5, 2015, 4:56:20 PM3/5/15
to lase...@googlegroups.com
Oh...that's weird.

Now it starts to look like a different problem entirely.

I don't think the acceleration code cares about where you are on the bed...so
that throws doubt on what we're seeing here.

If you had different data in your file (hence different G-code) then it's
possible
that this alters when the interrupts hit the Arduino - which could change the
nature of the bug...but that's starting to seem a bit unlikely.

I dunno...I think we need someone who knows the firmware a lot better than
me to comment!
>>>> >> >> >> ​This tube fires for me
>>>> >> Müller
>>>> ’¢â‚¬â€¹My
>>>> >> >> work around so far
>>>> >> >> >>> has been to find the
>>>> >> >> >>> node
>>>> >> >> >>> >>> where this
>>>> >> >> >>> >>> is
>>>> >> >> >>> >>> >> happening
>>>> >> >> >>> >>> >> >> and then delete/recreate it. That seems to fix it
>>>> most
>>>> >> of
>>>> >> >> >>> the
>>>> >> >> >>> >>> time.
>>>> >> >> >>> >>> >>
>>>> >>
>>>> ÃÃâ€
>>>> ’¢â‚¬â€¹
>>>> .
>>>> > For more options, visit https://groups.google.com/d/optout.
>>>> >
>>>>
>>>>
>>>> -- Steve
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "lasersaur" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to lasersaur+...@googlegroups.com.
>>>> To post to this group, send email to lase...@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/lasersaur.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/lasersaur/6907b30d359d85dd785eb977153d94d3.squirrel%40webmail.sjbaker.org
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtXZmxuwTpX4LpSDajvaUrbJJJ9j9GshURCErDKu%3DM%3DBRA%40mail.gmail.com.

Maarten van Dam

unread,
Mar 6, 2015, 4:19:53 AM3/6/15
to lase...@googlegroups.com
We noticed the same @1600 after some more testing with different patterns however a lot less then when we engrave at higher speed. We thought it could be caused by the 'translator' having trouble with certain nodes in the drawing. (?)

Most of our cutting jobs request some engraving so I really hope we can determine the error! Unfortinate neither of us has the skill to fix this. To us this is a really big thing to get our producting quality OK.
Steve: Did you compare the gcodes of the same drawing generated by the v12 and the v14?

Jondale Stratton

unread,
Mar 6, 2015, 9:36:52 AM3/6/15
to lase...@googlegroups.com
I have done a lot of comparing of the gcodes produced as well as producing my own gcode and sending it.  I feel fairly certain it's not an issue with the gcode production.

I'm still trying to isolate where it's happening but I currently suspect it is either just before/after or during a G0 move.

Steve Baker

unread,
Mar 6, 2015, 10:28:35 AM3/6/15
to lase...@googlegroups.com
No, I didn't check the gcode - but my two Lasersaurs are running the
*exact* same frontend and backend code...the *only* software difference
between them is in the Arduino code "config.h" file where the
steps-per-millimeter numbers are different because of the motor gearing.

Hence the gcode will, for 100% sure, be identical between them.

That's how we know that this isn't an SVG-to-Gcode translation screwup.

(That would be exceedingly unlikely anyway - syntactically, this SVG file
is no different than any other that don't show glitches, and in any case,
it works just fine at some speed settings.)

The motor acceleration is defined in mm per minute-squared, so the
steps-per-minute-squared rate at which the stepper motors are ramped up
will be different between my un-geared v12 machine and my geared v13(ish)
machine.

The timing with which the data arrives in the Arduino will also be subtly
different because the step rate on the motors isn't the same between the
two machines.

This is the reason why I so strongly suspect that the
acceleration/deceleration code is the culprit here - and that (perhaps)
interrupts caused by new data arriving from the BeagleBone is causing
timing glitches - which ought to be negligible - but somehow aren't.

This test pattern has very short movements - and that means that the rate
at which data is sent to the Arduino from the BeagleBone is probably less
than the Arduino needs in order to keep the head moving. If the head
were to stop moving with the laser still enabled - then those dark spots
would be the result.

However, the news that the exact same test pattern produces glitches when
cut near X==0 and no glitches when cut further off to the right
contradicts all of that. But without seeing confirmation of this stuff -
it's hard to know what's a one-off difference for some unrelated reason
associated with how the test pattern was repositioned on the bed.

So if you want to help, the best thing you can do is to start playing with
the SVG to get it down to that simplest case...then start experimenting
with that simplest case to see what properties of those lines are causing
the glitch to happen....relative spacing, length, orientation.

Once again, I *STRONGLY* recommend that you work to reduce this to the
smallest test case imaginable. Debugging this is going to be exceedingly
difficult - and a pattern with hundreds of vectors will make it much
harder than if you can reduce it to as little as a couple of etched lines
with a move in-between them...or whatever is the minimum necessary to
reproduce it.

Since we're reliant on volunteer effort in this (nobody gets paid to work
on it) - anything that can be done to help whoever has to dive into this
code is going to help to encourage someone with the necessary skills to
dig into it.

I'd love to spend time solving this - it's a wonderful intellectual
challenge - but Renee and I simply don't see this happening in our
business and I'm already busy with half a dozen other urgent jobs - so I
just don't have the time to spend on it.

As I said before, this would be much easier to debug if someone with a
decent logic analyser could stick it on the outputs of the AtMega chip and
see exactly what happens immediately before and during the glitch...I
don't own such a machine, so this isn't possible for me - which also makes
debugging it that much harder.
>> >>>> >> >> >> ​This
>> ’¼ller
>> ’¢ÃÃâ€
>> ’¢â€šÂ¬ÃÃâ€
>> ’¢â‚¬Â¹My
>> >>>> >> >> work around so far
>> >>>> >> >> >>> has been to find the
>> >>>> >> >> >>> node
>> >>>> >> >> >>> >>> where this
>> >>>> >> >> >>> >>> is
>> >>>> >> >> >>> >>> >> happening
>> >>>> >> >> >>> >>> >> >> and then delete/recreate it. That seems to fix
>> it
>> >>>> most
>> >>>> >> of
>> >>>> >> >> >>> the
>> >>>> >> >> >>> >>> time.
>> >>>> >> >> >>> >>> >>
>> >>>> >>
>> >>>> ÃÃâ€
>> ’Ãâ€
>> >>>>
>> ’¢ÃÃâ€
>> ’¢â€šÂ¬ÃÃâ€
>> ’¢â‚¬Â¹
>> lase...@googlegroups.com
>> .
>> >>>> >> >> Visit this group at http://groups.google.com/group/lasersaur.
>> >>>> >> >> To view this discussion on the web visit
>> >>>> >> >>
>> >>>> >>
>> >>>>
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> -- Steve
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/2b566f854bee2017bbb3fba8a11f450b.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAL1EKihvcN2JJDtyUEcvOpKTMnHhqBeexYL2GDBa2nD2VkMXkg%40mail.gmail.com.

Steve Baker

unread,
Mar 6, 2015, 10:57:34 AM3/6/15
to lase...@googlegroups.com
Yes, I agree.

That 0.3mm diagonal move between doing a ~5mm upward motion and a ~4mm
downward motion seems to be the culprit.

I could see at least three possibilities...

1) That the motion stops at the end of the first line without the laser
being fully turned off soon enough.

2) That the laser is turned on before the head starts drawing the second
line but the motors don't start spinning soon enough.

3) That the velocity compensation code for the laser power level is
somehow providing too much laser energy.


IMHO:

(1) and (2) are plausible scenarios because the timing of the stepper and
the laser power commands could easily be screwed up by the arrival of an
interrupt from the USB communications system that takes longer than it
should to complete. There are lots of comments in the code about issues
with interrupts happening at difficult moments - suggesting that the
author was aware of at least some of these issues.

(3) seems plausible to me because of that line of code in stepper.c that
says:

uint8_t constrained_intensity = max(adjusted_intensity, 0);

...suggesting that the author was concerned that 'adjusted_intensity'
could go negative and wanted to clamp it to zero in that case. Since
both 'adjusted_intensity' and 'constrained_intensity' are unsigned
numbers, this clamp would be ineffective because any preceding code that
put a negative number into 'adjusted_intensity' would wind up putting some
gigantic positive number in there instead...which when stuffed into a
uint8 (a single byte) could easily turn into '255' - which is the maximum
possible intensity.

It should be possible to check for (3) fairly easily by testing:

current_block->nominal_laser_intensity
steps_per_minute
current_block->nominal_rate

...to be sure they are all positive - and maybe causing the Arduino to go
into a 'while(1);' loop if they are negative. That would cause the
machine to freeze instead of generating a glitch and then we'd know for
sure whether this is the cause. If that's the cause than the fix for it
would be to move the 'max' call up one line to clamp that floating point
calculation rather than attempting to (uselessly) clamp the unsigned byte
result!

If it's not (3) - then we're left with (1) and (2).

Neither will be easy to diagnose because the code in that area is very
complicated - and debugging anything that's "hard realtime" with
interrupts occurring within it is an utter nightmare!

I suppose we might consider blocking interrupts between setting the laser
power and moving the motors...I'm not sure that'll work though.

We might also look at whether there are cases in the interrupt code where
a LOT of CPU time might get consumed...and given the nature of this
problem - where a bunch of short draw/move commands cause the glitches -
I'd suspect the data-starvation case where the Arduino is stalled waiting
for new data to arrive - or where there is a data retransmission.

I strongly doubt that code is working properly...all of the data
restransmission crap is a band-aid around a more serious underlying
problem that needs to be fixed. Since we don't appear to fully
understand that issue, I'm quite prepared to believe that it's the guilty
party here too!

Anyway - there are lots of avenues for someone with more time than me to
pursue.

HOWEVER:

We have two other pieces of evidence which greatly confuse matters:

* Someone said that they'd put an ammeter on the laser power supply and
saw a brief power surge....that strongly suggests (3) rather than (1) or
(2). However, I'm skeptical because the glitch would have to be
exceedingly brief to only cause a dark spot and not a hole cut all the way
through the material...and I don't believe you could see that on an
ammeter.

* Someone else said that moving the test pattern further along the X axis
makes the problem go away...which would mean that neither (1) nor (2) nor
(3) could be the cause. If this is TRULY the case - then I think we'd
have to start looking at mechanical issues like vibration and resonance.

Personally, I doubt both of these observations without more people
reproducing them.

...and we need a much simpler test case.
>>> >>>> >> >> >> ​This
>>> ’¼ller
>>> ’¢ÃÃâ€
>>> ’¢â€šÂ¬ÃÃâ€
>>> ’¢â‚¬Â¹My
>>> >>>> >> >> work around so far
>>> >>>> >> >> >>> has been to find the
>>> >>>> >> >> >>> node
>>> >>>> >> >> >>> >>> where this
>>> >>>> >> >> >>> >>> is
>>> >>>> >> >> >>> >>> >> happening
>>> >>>> >> >> >>> >>> >> >> and then delete/recreate it. That seems to
>>> fix
>>> it
>>> >>>> most
>>> >>>> >> of
>>> >>>> >> >> >>> the
>>> >>>> >> >> >>> >>> time.
>>> >>>> >> >> >>> >>> >>
>>> >>>> >>
>>> >>>> ÃÃâ€
>>> ’Ãâ€
>>> >>>>
>>> ’¢ÃÃâ€
>>> ’¢â€šÂ¬ÃÃâ€
>>> ’¢â‚¬Â¹
>>> http://groups.google.com/group/lasersaur
>>> .
>>> >>>> >> >> > To view this discussion on the web visit
>>> >>>> >> >> >
>>> >>>> >> >>
>>> >>>> >>
>>> >>>>
>>> lase...@googlegroups.com
>>> .
>>> >>>> >> > Visit this group at http://groups.google.com/group/lasersaur.
>>> >>>> >> > To view this discussion on the web visit
>>> >>>> >> >
>>> >>>> >>
>>> >>>>
>>> .
>>> > For more options, visit https://groups.google.com/d/optout.
>>> >
>>>
>>>
>>> -- Steve
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "lasersaur" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> email to lasersaur+...@googlegroups.com.
>>> To post to this group, send email to lase...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/lasersaur.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/lasersaur/2b566f854bee2017bbb3fba8a11f450b.squirrel%40webmail.sjbaker.org
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/CAL1EKihvcN2JJDtyUEcvOpKTMnHhqBeexYL2GDBa2nD2VkMXkg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/lasersaur/CAL1EKihvcN2JJDtyUEcvOpKTMnHhqBeexYL2GDBa2nD2VkMXkg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtXjRftXL6oeg%2BAO%3DoADjd79Sy_G%3DD2cabz5WppZknhbiQ%40mail.gmail.com.

Steve Baker

unread,
Mar 6, 2015, 10:57:41 AM3/6/15
to lase...@googlegroups.com
Yes, I agree.

That 0.3mm diagonal move between doing a ~5mm upward motion and a ~4mm
downward motion seems to be the culprit.

I could see at least three possibilities...

1) That the motion stops at the end of the first line without the laser
being fully turned off soon enough.

2) That the laser is turned on before the head starts drawing the second
line but the motors don't start spinning soon enough.

3) That the velocity compensation code for the laser power level is
somehow providing too much laser energy.


IMHO:

(1) and (2) are plausible scenarios because the timing of the stepper and
the laser power commands could easily be screwed up by the arrival of an
interrupt from the USB communications system that takes longer than it
should to complete. There are lots of comments in the code about issues
with interrupts happening at difficult moments - suggesting that the
author was aware of at least some of these issues.

(3) seems plausible to me because of that line of code in stepper.c that
says:

uint8_t constrained_intensity = max(adjusted_intensity, 0);

...suggesting that the author was concerned that 'adjusted_intensity'
could go negative and wanted to clamp it to zero in that case. Since
both 'adjusted_intensity' and 'constrained_intensity' are unsigned
>>> >>>> >> >> >> ​This
>>> ’¼ller
>>> ’¢ÃÃâ€
>>> ’¢â€šÂ¬ÃÃâ€
>>> ’¢â‚¬Â¹My
>>> >>>> >> >> work around so far
>>> >>>> >> >> >>> has been to find the
>>> >>>> >> >> >>> node
>>> >>>> >> >> >>> >>> where this
>>> >>>> >> >> >>> >>> is
>>> >>>> >> >> >>> >>> >> happening
>>> >>>> >> >> >>> >>> >> >> and then delete/recreate it. That seems to
>>> fix
>>> it
>>> >>>> most
>>> >>>> >> of
>>> >>>> >> >> >>> the
>>> >>>> >> >> >>> >>> time.
>>> >>>> >> >> >>> >>> >>
>>> >>>> >>
>>> >>>> ÃÃâ€
>>> ’Ãâ€
>>> >>>>
>>> ’¢ÃÃâ€
>>> ’¢â€šÂ¬ÃÃâ€
>>> ’¢â‚¬Â¹
>>> http://groups.google.com/group/lasersaur
>>> .
>>> >>>> >> >> > To view this discussion on the web visit
>>> >>>> >> >> >
>>> >>>> >> >>
>>> >>>> >>
>>> >>>>
>>> lase...@googlegroups.com
>>> .
>>> >>>> >> > Visit this group at http://groups.google.com/group/lasersaur.
>>> >>>> >> > To view this discussion on the web visit
>>> >>>> >> >
>>> >>>> >>
>>> >>>>
>>> .
>>> > For more options, visit https://groups.google.com/d/optout.
>>> >
>>>
>>>
>>> -- Steve
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "lasersaur" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> email to lasersaur+...@googlegroups.com.
>>> To post to this group, send email to lase...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/lasersaur.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/lasersaur/2b566f854bee2017bbb3fba8a11f450b.squirrel%40webmail.sjbaker.org
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/CAL1EKihvcN2JJDtyUEcvOpKTMnHhqBeexYL2GDBa2nD2VkMXkg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/lasersaur/CAL1EKihvcN2JJDtyUEcvOpKTMnHhqBeexYL2GDBa2nD2VkMXkg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtXjRftXL6oeg%2BAO%3DoADjd79Sy_G%3DD2cabz5WppZknhbiQ%40mail.gmail.com.

Sylvester

unread,
Mar 7, 2015, 3:32:08 AM3/7/15
to lase...@googlegroups.com
I don't think the error is about the laser head being in one place for a bit too long, it definitely fires at somewhere near 100% power for a split second. We can even hear this outburst happening standing within a few meters distance from our lasersaur.

When this happens while cutting acrylic for you can easily see how deep the laser fires. It really screws up the work piece. Last week we had to engrave some foam and everytime it happened it fired right trough the material...

Steve Baker

unread,
Mar 7, 2015, 4:58:56 PM3/7/15
to lase...@googlegroups.com
OK - then we should try changing the firmware code to see if a math
screwup in the acceleration power compensation code is flipping out.

My #1 theory is that we're somehow getting a negative intensity coming out
of the math. There is a test that's supposed to catch that condition, but
the test is coded incorrectly and doesn't work. If a negative intensity
gets as far as the laser power setting software, it'll 'wrap around' into
the maximum possible power setting...which fits the facts as we see them.

Dunno if you have programming skills - but what I'd try is this:

In LasaurApp/firmware/src/stepper.c at line 469, you'll see:

uint8_t adjusted_intensity = ...

...try changing that to:

int adjusted_intensity = ...

...then recompile and reload the firmware (which you can do from the HTML
page, while the machine is running).

I'm not sure it'll fix it, but either way, we'll learn something.

Please let us know what happens.

-- Steve
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/e0cf3ace-4344-4b2b-8b3c-4154fc07098a%40googlegroups.com.

Jondale Stratton

unread,
Mar 8, 2015, 3:11:46 PM3/8/15
to lase...@googlegroups.com
I changed the uint8_t to int.  Unfortunately it still seems to be exhibiting the same problem.

Steve Baker

unread,
Mar 8, 2015, 8:13:41 PM3/8/15
to lase...@googlegroups.com
OK - well, that eliminates the underflow theory. Sadly, that makes
understanding what's going on much harder.

-- Steve

Jondale Stratton wrote:
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtWVW7FmMpvkwUDh6PeQuq9wnz5kmjNRJ%2B%3DOaoKodR6%3Dcw%40mail.gmail.com.

roryrennie

unread,
May 12, 2015, 12:14:38 PM5/12/15
to lase...@googlegroups.com, st...@sjbaker.org

Is anyone's power problem like this?

Maximilian Müller

unread,
May 12, 2015, 12:37:58 PM5/12/15
to lase...@googlegroups.com
Yes, i have exactly the same problem. I make a lot of tests with full and low power but all have the same problems.


Maximilian Müller

unread,
May 12, 2015, 12:40:13 PM5/12/15
to lase...@googlegroups.com
*edit*

I use a 14.03 machine. Have other Saurs not this problem?

Steve Baker

unread,
May 12, 2015, 1:02:36 PM5/12/15
to lase...@googlegroups.com
I'm not sure about *THIS* problem - but the problem that started this
thread seems to be reproducible on v14 machines, even with the latest
firmware and with an SVG file that I've checked is legal.

However,the symptoms here are less clearly wrong - without looking
carefully at the characters in that font...this could be an SVG issue.

Look back through this thread - somewhere there is an attached SVG file
with a star pattern filled with horizontal lines. In that case, there
aren't just dark spots...they seem to lie OUTSIDE of the design pattern!

That's a nice simple test case...without the unknowns of the font in the
photos presented here.

However, I can't think of an easy way to diagnose the problem - it really
needs for someone to be watching the laser power using an oscilloscope or
something...while tracking what the firmware is doing.

For me, it doesn't seem to happen in my normal work (at least not to the
point where I've ever noticed it) - but it's definitely 100% reproducible
with the star-shaped test pattern.

Sadly, I don't have the time to look into it any more deeply than I
already have.

-- Steve



Maximilian Müller wrote:
> *edit*
>
> I use a 14.03 machine. Have other Saurs not this problem?
>
> 2015-05-12 18:37 GMT+02:00 Maximilian Müller <maxi.mu...@gmail.com>:
>
>> Yes, i have exactly the same problem. I make a lot of tests with full
>> and
>> low power but all have the same problems.
>>
>>
>> 2015-05-12 18:14 GMT+02:00 roryrennie <roryr...@gmail.com>:
>>
>>>
>>> <https://lh3.googleusercontent.com/-p8F-WoBYujI/VVImwJJiUCI/AAAAAAAAAdw/vWTCQmg9khM/s1600/IMG_1492.JPG>
>>>
>>> Is anyone's power problem like this?
>>>
>>>
>>> <https://lh3.googleusercontent.com/-p8F-WoBYujI/VVImwJJiUCI/AAAAAAAAAdw/vWTCQmg9khM/s1600/IMG_1492.JPG>
>>> <https://groups.google.com/d/msgid/lasersaur/bf2e782e-dfd9-4bb5-959a-5374e016dd53%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CADNd%2BtJrC6XVtrjHNwGDmOocLFdHBH5MQDjso9M8wjU2R%3DfmxA%40mail.gmail.com.

Jondale Stratton

unread,
May 12, 2015, 1:33:32 PM5/12/15
to lase...@googlegroups.com
​This problem seems to come up for me from time to time.  It's really annoying.  I would really like to identify and fix the problem.  I suspect it is somewhere in the firmware as the gcode produced seems valid.

I would like to do more testing.  We have the svg/gcode that always causes a problem.  I'm assuming I could install LasaurGrbl on an arduino since we use the arduino boot loader here.  I am not strong in this area but have tinkered.

Does anyone have more info/hints on how the firmware could be easily changed/tested?




Sylvester

unread,
May 12, 2015, 2:22:53 PM5/12/15
to lase...@googlegroups.com
We have this problem all the time while engraving, it's really annoying. 
It has something to do with certain speed/power ratio's in combination with small text or lines. We learned that engraving at 750/3 is always a safe setting, but it's so slow that it's often to expensive to use. 1600/10 works quite well too, but with a little less guarantee.

Engraving small text or short lines at high speeds is always trouble, while the same svg file with lower speeds (750/3) doesn't produce any spots.

We would love to see this problem go away. We are thinking of buying a different controller for our next laser.

- Sylvester

Op dinsdag 12 mei 2015 19:33:32 UTC+2 schreef jondale:

Miro Luis

unread,
May 12, 2015, 2:39:45 PM5/12/15
to lase...@googlegroups.com
I have the same problem v14. and i'm interested in buy a controller that resolve the raster issue. 

Best regards :)


For more options, visit https://groups.google.com/d/optout.
Photos.zip

Steve Baker

unread,
May 12, 2015, 3:08:26 PM5/12/15
to lase...@googlegroups.com
I can confirm that the G-code is fine (at least for the star pattern).

So we're looking at either a clear bug in the firmware (I was unable to
find one - although there are a few things that looked like smoking
guns)...or some strange issue in the laser power supply or the laser tube
itself. It could also be a motor control issue.

I agree that the firmware is almost certainly the place to look...but it's
tough to figure it out just by looking at it.

IMHO, we need to hang a logic analyser onto the pins of the AtMega and see
exactly what happens to the motor and laser power outputs at the point
where those bad dots are being drawn.

Armed with that information, I think we could track it down.

The firmware that controls motor speeds and laser power is complicated and
messy...and the code that deals with buffer underflow and error
retransmits is even more ugly. I could easily believe that there are
multiple bugs lurking there.

-- Steve


Jondale Stratton wrote:
> ​This problem seems to come up for me from time to time. It's really
>> https://groups.google.com/d/msgid/lasersaur/bf2e782e-dfd9-4bb5-959a-5374e016dd53%40googlegroups.com
>> >>> <
>> https://groups.google.com/d/msgid/lasersaur/bf2e782e-dfd9-4bb5-959a-5374e016dd53%40googlegroups.com?utm_medium=email&utm_source=footer
>> >
>> >>> .
>> >>>
>> >>> For more options, visit https://groups.google.com/d/optout.
>> >>>
>> >>
>> >>
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "lasersaur" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to lasersaur+...@googlegroups.com.
>> > To post to this group, send email to lase...@googlegroups.com.
>> > Visit this group at http://groups.google.com/group/lasersaur.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/lasersaur/CADNd%2BtJrC6XVtrjHNwGDmOocLFdHBH5MQDjso9M8wjU2R%3DfmxA%40mail.gmail.com
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> -- Steve
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/2254656ab090b5c23eec19bb209061cf.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtVVjn7bW%2BrX7HoW0ahd6OKHLaiZhdZW9g3p0nYHYNJtfg%40mail.gmail.com.

Steve Baker

unread,
May 12, 2015, 4:05:31 PM5/12/15
to lase...@googlegroups.com
It's very simple to change - edit the source code with any text editor,
copy it onto the BBB's drive, then use the "Admin" menu to recompile it
and flash it into the Arduino's memory.

If you want to use a separate Arduino card instead of the AtMega inside
your lasersaur - then connect it to the BBB's USB port and change the
SERIAL_PORT definition in beaglebone_flash.py to "/dev/ttyO1" (that's a
capital 'O', not a zero!)

The Arduino would need to have the X=0, Y=0 and Z=0 switches (and maybe a
couple of other inputs) wired up so it can HOME.

Testing is the problem...without watching the laser actually cutting, it's
hard to know when the problem happened.

We don't yet know what causes the dark spots to appear.

A) It could be that the laser power jumps upwards without being
commanded to do so by the G-code.

B) It could be that the motors stall for a split second with the
laser still running at lower power.

Being able to continuously watch the laser power while a test pattern is
etched (which would presumably require a logic analyzer or maybe a good
digital oscilloscope) would let us see whether the laser power ever jumps
up above whatever low level we set it to for etching.

That would allow us to narrow the realms of problems down to (A) or (B).

It's tough to insert debugging code into the Arduino because anything you
do will change the timing - which will probably change when the glitch
happens.

-- Steve


Jondale Stratton wrote:
> ​This problem seems to come up for me from time to time. It's really
>> https://groups.google.com/d/msgid/lasersaur/bf2e782e-dfd9-4bb5-959a-5374e016dd53%40googlegroups.com
>> >>> <
>> https://groups.google.com/d/msgid/lasersaur/bf2e782e-dfd9-4bb5-959a-5374e016dd53%40googlegroups.com?utm_medium=email&utm_source=footer
>> >
>> >>> .
>> >>>
>> >>> For more options, visit https://groups.google.com/d/optout.
>> >>>
>> >>
>> >>
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "lasersaur" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to lasersaur+...@googlegroups.com.
>> > To post to this group, send email to lase...@googlegroups.com.
>> > Visit this group at http://groups.google.com/group/lasersaur.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/lasersaur/CADNd%2BtJrC6XVtrjHNwGDmOocLFdHBH5MQDjso9M8wjU2R%3DfmxA%40mail.gmail.com
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> -- Steve
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/2254656ab090b5c23eec19bb209061cf.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtVVjn7bW%2BrX7HoW0ahd6OKHLaiZhdZW9g3p0nYHYNJtfg%40mail.gmail.com.

Jondale Stratton

unread,
May 12, 2015, 4:12:22 PM5/12/15
to lase...@googlegroups.com
Yeah, I've changed the firmware before just fine.  What I'd like to do is set debug output on certain variables and then get that output while I'm running certain gcode.  Particularly the intensity variables.  I can edit the firmware and install it from the BBB but then I'm not sure how to get the output.

Steve Baker

unread,
May 12, 2015, 4:36:59 PM5/12/15
to lase...@googlegroups.com
It's really tough to extract those values because the only communications
route from the Arduino/AtMega back to the BBB is via the USB port - and
that's already being used by the Python back-end to read status values of
other kinds.

Also, the RATE at which you'd have to report back would probably exceed
the USB bandwidth (or at least the rate that Python would be able to do
anything with it).

Worst of all, I strongly suspect that this is a timing-related issue - and
sending debug information out from the USB is going to change the timing -
and that will change the nature of the problem.

It's what we programmers call a "Heisenbug":

https://en.wikipedia.org/wiki/Heisenbug

That's why I think we need ways to track what's happening by observing the
data on the pins rather than trying to report stuff back via USB...which
entails oscilloscopes and/or logic analysers...which is rather more of a
serious undertaking than I have time for right now.
>> > ​This problem seems to come up for me from time to time. It's
>> https://groups.google.com/d/msgid/lasersaur/423936d72e3308667fbf7805e85de4d2.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtVB6npRpJSze4Hw-Hr%2BMAV7MXdPLAtmcwmBXe%2B7hue%2BNg%40mail.gmail.com.

Maximilian Müller

unread,
May 12, 2015, 5:42:03 PM5/12/15
to lase...@googlegroups.com
I hope this helps a little bit, i mean i can hear a "pssst" wenn die dots come. It could indicate a higher pulse/power.

Steve Baker

unread,
May 12, 2015, 8:11:09 PM5/12/15
to lase...@googlegroups.com
Yeah - I think that's a possibility.

The thing is that the Arduino continually modifies the laser power to
account for the speed of the head as it accelerates and decelerates. But
that should never INCREASE the power over what you set it to...it should
only DECREASE it.

I think these dots happen at the ends of very short lines...and I wonder
whether we're getting a divide-by-zero or a roundoff error that results in
a negative power level that might wrap around to 65535 and then get
clamped to 100%.

Furthermore, I wonder whether the known issues with communications with
Python (resulting in data retransmissions, stalls and so forth) might
result in a timing issue that could somehow result in a miscalculation of
head speed. Those problems seem to come up most often when the Arduino is
processing G-code faster than the Python code in the BBB can deliver it.
That kind of data starvation could easily cause problems. We recently
speeded up the Python code in that area - which made *most* of those
problems go away...but we didn't fix anything in the actual protocol
itself...and that is (IMHO) decided kludgy.

Aside from issues with the algorithm/protocol itself, the code in that
area is quite complicated and ugly with all sorts of little kludges to
handle special cases like the PAUSE and STOP functionality...and it uses
interrupts - which are a notorious source of programming errors.

I really don't trust it...which is why my programmer's "gut feel" is that
something around that area is somehow wrong.

That said, I spent several hours reading through the code and I don't see
anything obviously wrong. I just don't have the time right now to pull
it all apart and track down the underlying cause.

-- Steve


Maximilian Müller wrote:
>> >> > ​This problem seems to come up for me from time to
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> -- Steve
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/e970c0d1fc618c563d2d90b7eb0d6969.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CADNd%2BtK6Xs9LJ-2hHOQB5mFVsSM2QO6_d_YEaXUyqu6AYZSihA%40mail.gmail.com.

Maximilian Müller

unread,
May 13, 2015, 5:17:35 AM5/13/15
to lase...@googlegroups.com
It looks as if the problem has been already solved in a previous version. https://www.flickr.com/photos/stfnix/8609845233/in/album-72157624491114826/

Maarten van Dam

unread,
May 13, 2015, 5:27:26 AM5/13/15
to lase...@googlegroups.com
Unfortinate its not or it is returned.

Maarten van Dam

unread,
May 13, 2015, 5:45:01 AM5/13/15
to lase...@googlegroups.com
Stefanix, could it be that the 'old bug' somehow came back?

Steve Baker

unread,
May 13, 2015, 12:37:52 PM5/13/15
to lase...@googlegroups.com
No - I think that's when he added the thing where the laser power is
modulated by the speed of the motors as they accelerate. That was around
v13 or so.

We always knew what that problem was.

This is different.
>> >> >> > ​This problem seems to come
>> >> >> >> Maximilian Müller
>> wrote:
>> >> >> >> > *edit*
>> >> >> >> >
>> >> >> >> > I use a 14.03 machine. Have other Saurs not this problem?
>> >> >> >> >
>> >> >> >> > 2015-05-12 18:37 GMT+02:00 Maximilian
>> Müller
>> http://groups.google.com/group/lasersaur.
>> >> >> >> >>> To view this discussion on the web visit
>> >> >> >> >>>
>> >> >> >>
>> >> >>
>> >>
>> https://groups.google.com/d/msgid/lasersaur/bf2e782e-dfd9-4bb5-959a-5374e016dd53%40googlegroups.com
>> >> >> >> >>> <
>> >> >> >>
>> >> >>
>> >>
>> https://groups.google.com/d/msgid/lasersaur/bf2e782e-dfd9-4bb5-959a-5374e016dd53%40googlegroups.com?utm_medium=email&utm_source=footer
>> >> >> >> >
>> >> >> >> >>> .
>> >> >> >> >>>
>> >> >> >> >>> For more options, visit https://groups.google.com/d/optout.
>> >> >> >> >>>
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >
>> >> >> >> > --
>> >> >> >> > You received this message because you are subscribed to the
>> >> Google
>> >> >> >> Groups
>> >> >> >> > "lasersaur" group.
>> >> >> >> > To unsubscribe from this group and stop receiving emails from
>> >> it,
>> >> >> send
>> >> >> >> an
>> >> >> >> > email to lasersaur+...@googlegroups.com.
>> >> >> >> > To post to this group, send email to
>> lase...@googlegroups.com
>> .
>> >> >> >> > Visit this group at http://groups.google.com/group/lasersaur.
>> >> >> >> > To view this discussion on the web visit
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> -- Steve
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/6afd079ef1412ba7b6340546cb75a342.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CADNd%2Bt%2Bjzg7ox%2BY4GFt-uNRg%3DPwO_FtK9ZsuBst3V68bb5YaZQ%40mail.gmail.com.

Steve Baker

unread,
May 13, 2015, 12:50:53 PM5/13/15
to lase...@googlegroups.com
No...the deal is this:

In the beginning (v12 and earlier) - the software set the laser intensity
to whatever you asked for - and accelerated and decelerated the motors as
needed for the speed you set.

However, when the motors are accelerating from a dead stop, the laser is
sitting in one place for too long...more energy is delivered to the
material than was called for, even though the power setting is exactly
what you asked for.

So whenever you started or ended a line - or took a sharp 90 degree turn,
the laser would be held too long in that one spot and you'd get a dark
spot. You could clearly see that the etch was going from too-dark to
just-right over a distance of a few millimeters - which is about how long
the motors take to get up to speed at around 2000 mm/min.

We completely understood the reasons for it - it wasn't exactly a "bug" -
but just a feature that hadn't been implemented yet.

Around the v13 switch to the driverboard, Stefan added a feature where the
laser power was scaled down when the motors are moving more slowly than
you asked for and gradually ramped up to the requested value as the motors
accelerate. This fixed *that* problem completely - and it's been fixed
for over a year now.

Unless you have VERY old software on a v12 lasersaur - this definitely
isn't your problem.

The new problem is slightly similar...I can still reproduce the dark spots
in that star-shaped test pattern with the very latest beta-copy
build...so, no...it's ain't fixed.

The spots are just round dots - not the smeared-out gradual effect of the
v12 software - and they don't happen 100% predictably at every single line
start/end/90 degree turn.

The positioning of the spots is not as predictable as they were with that
old software...which suggests some deeper problem, like a timing bug.

That said, it wouldn't surprise me that a bug of some kind in the
implementation of the acceleration-versus-power code was the underlying
cause of these occasional dark spots.

-- Steve



Maarten van Dam wrote:
> Stefanix, could it be that the 'old bug' somehow came back?
>
>
> On Wed, May 13, 2015 at 11:27 AM, Maarten van Dam <mva...@gmail.com>
> wrote:
>
>> Unfortinate its not or it is returned.
>>
>> On Wed, May 13, 2015 at 11:17 AM, Maximilian Müller <
>>>> >> >> > ​This problem seems to
>>>> >> >> >> Maximilian Müller
>>>> wrote:
>>>> >> >> >> > *edit*
>>>> >> >> >> >
>>>> >> >> >> > I use a 14.03 machine. Have other Saurs not this problem?
>>>> >> >> >> >
>>>> >> >> >> > 2015-05-12 18:37 GMT+02:00 Maximilian
>>>> Müller
>>>> .
>>>> > For more options, visit https://groups.google.com/d/optout.
>>>> >
>>>>
>>>>
>>>> -- Steve
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "lasersaur" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to lasersaur+...@googlegroups.com.
>>>> To post to this group, send email to lase...@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/lasersaur.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/lasersaur/6afd079ef1412ba7b6340546cb75a342.squirrel%40webmail.sjbaker.org
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "lasersaur" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> email to lasersaur+...@googlegroups.com.
>>> To post to this group, send email to lase...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/lasersaur.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/lasersaur/CADNd%2Bt%2Bjzg7ox%2BY4GFt-uNRg%3DPwO_FtK9ZsuBst3V68bb5YaZQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/lasersaur/CADNd%2Bt%2Bjzg7ox%2BY4GFt-uNRg%3DPwO_FtK9ZsuBst3V68bb5YaZQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAL1EKijTqZzrTAir9_cfGxt46hnywyw%3DTVBPVzMHKcw_E%3Dq6KQ%40mail.gmail.com.

Miro Luis

unread,
May 14, 2015, 7:06:27 PM5/14/15
to lase...@googlegroups.com
Ei all here i show the problem. 
Its the Power that grows inespectely to 100%

as you can see and hear. 


I'm prepared to let you steve enter by remote session and see for your self the problem happening

Best. for all of you

Together we gonna make it right.




For more options, visit https://groups.google.com/d/optout.



--

Steve Baker

unread,
May 14, 2015, 10:31:10 PM5/14/15
to lase...@googlegroups.com
I don't need to do that...my lasersaur does the exact same thing.
>> >> On Wed, May 13, 2015 at 11:17 AM, Maximilian Müller <
>> >>>> >> >> > ​This
>> ’¼ller
>> >>>> wrote:
>> >>>> >> >> >> > *edit*
>> >>>> >> >> >> >
>> >>>> >> >> >> > I use a 14.03 machine. Have other Saurs not this
>> problem?
>> >>>> >> >> >> >
>> >>>> >> >> >> > 2015-05-12 18:37 GMT+02:00 Maximilian
>> >>>> MÃÃâ€
>> ’¼ller
>> lase...@googlegroups.com
>> .
>> >>>> >> >> Visit this group at http://groups.google.com/group/lasersaur.
>> >>>> >> >> To view this discussion on the web visit
>> >>>> >> >>
>> >>>> >>
>> >>>>
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> -- Steve
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/2f228c84e27e80d8af3cda10429a6955.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAEEtSuw9JbLHvROZfxsTNKpu9WoerdwvR6nX2CfEGwZEqesKXg%40mail.gmail.com.

Miro Luis

unread,
May 15, 2015, 11:12:40 AM5/15/15
to lase...@googlegroups.com
Hello 
i notice that i have this file in firmware folder.  LasaurGrbl_v13.06.hex

If i program that in arduino. 
And play with it with the LaserApp v14.0 it will work's? 
This solution resolve's the dot burst? just for some time? 

My machine have only one motor in y drive.

Can i use a more power board instead os the atmega 328? like this https://www.pjrc.com/teensy/teensy31.html

Best regards and thanks for all.







For more options, visit https://groups.google.com/d/optout.

Steve Baker

unread,
May 15, 2015, 10:41:26 PM5/15/15
to lase...@googlegroups.com
If you just load the software into a standard Arduino - it should work -
but bear in mind that all of the limit and safety switches that the
Arduino monitors will be disconnected - so it'll just complain about limit
switches being hit and door being opened and so forth - so you won't get a
good test result that way.

Just to home the machine requires you have actual switches connected to
the correct I/O lines on the Arduino board.

It's do-able, but difficult. Honestly, it's probably easier just to
disconnect the laser power supply and do your testing on the actual
Lasersaur.

-- Steve

Miro Luis wrote:
> Hello
> i notice that i have this file in firmware folder. LasaurGrbl_v13.06.hex
> <https://github.com/stefanix/LasaurApp/blob/master/firmware/LasaurGrbl_v13.06.hex>
>> >> >> On Wed, May 13, 2015 at 11:17 AM, Maximilian Müller <
>> ​This
>> >> ’¼ller
>> >> >>>> wrote:
>> >> >>>> >> >> >> > *edit*
>> >> >>>> >> >> >> >
>> >> >>>> >> >> >> > I use a 14.03 machine. Have other Saurs not this
>> >> problem?
>> >> >>>> >> >> >> >
>> >> >>>> >> >> >> > 2015-05-12 18:37 GMT+02:00 Maximilian
>> >> >>>> MÃÃâ€
>> ’Ãâ€
>> >> ’¼ller
>> lase...@googlegroups.com
>> .
>> >> >>>> >> Visit this group at http://groups.google.com/group/lasersaur.
>> >> >>>> >> To view this discussion on the web visit
>> >> >>>> >>
>> >> >>>>
>> >>
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> -- Steve
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/d461e143e04fd5029ca4d7299f28d9fa.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Belmiro Luis
> +351 916166847
> miro...@gmail.com
> https://www.linkedin.com/in/miroluis
> http://crossinganswers.com
> http://fablabpenela.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAEEtSuy8a9C1krZXLeaL-NmV9B7TVCT%3D-fyOs2eBdH8bam2fZQ%40mail.gmail.com.

Jondale Stratton

unread,
May 15, 2015, 10:57:23 PM5/15/15
to lase...@googlegroups.com
I've been playing with this tonight.

I uncommented the following line in config.h
#define DEBUG_IGNORE_SENSORS  // set for debugging

After looking at the frontend code it seemed as if as long as the firmware outputted a string that started with # that it would spit out out to console.  So as long as you started LasaurApp from the command line you would see those messages.

I added the following to stepper.c (firmware directory) in the adjust_speed function.

  if (constrained_intensity > 100){
printString("#\n#");
printFloat((float)steps_per_minute);
printString("\t");
printFloat((float)current_block->nominal_rate);
printString("\t");
printFloat((float)current_block->nominal_laser_intensity);
printString("\t");
printInteger(constrained_intensity);
printString("\n");
  }

I then used the flash.py script in the firmware directory to flash the firmware to an Arduino Uno.  Once flashed I ran the LaserApp which detected the Uno and used it for serial.  I loaded the problem SVG attached above and ran it at 5000/30%.  It ran through it fine but it did trigger the above if statement a few times.  Below is the output:

..Adding to queue 488 lines
..........................................................................................................................................................................................................................................#
#0.000 4294952989.000 77.000 165
........#
#0.000 4294952989.000 77.000 165
............#
#0.000 4294952989.000 77.000 165
....................................................................................................................................................................................................................................................................................................................................................#
#0.000 4294961070.000 77.000 193
#
#0.000 4294961070.000 77.000 191
............#
#0.000 4294958630.000 77.000 126
..................................................................................................................#
#0.000 4294952989.000 77.000 165
............................................................................................................................................................................................................................................................

I'm still trying to figure out what is happening here but figured I'd post this in case others see it more clearly than I do atm.

Steve Baker

unread,
May 15, 2015, 11:05:50 PM5/15/15
to lase...@googlegroups.com
Looks like this message is saying that the power level overflowed
somehow...and when the speed of the head was zero.

A "nominal rate" value of 4294952989 is 0xFFFFC81D - which sure looks like
an overflow issue of some kind.

Also, seems like that test could be tightened somewhat - if the
"constrained intensity" is larger than the "nominal laser intensity" -
then that should also be an error.
>> >> >> >>>> Maximilian Müller
>> ’¢â‚¬â€¹This
>> ’ÃÃâ€
>> ’‚¼ller
>> >> >> >>>> wrote:
>> >> >> >>>> >> >> >> > *edit*
>> >> >> >>>> >> >> >> >
>> >> >> >>>> >> >> >> > I use a 14.03 machine. Have other Saurs not this
>> >> >> problem?
>> >> >> >>>> >> >> >> >
>> >> >> >>>> >> >> >> > 2015-05-12 18:37 GMT+02:00 Maximilian
>> >> >> >>>> MÃÃâ€
>> ’Ãâ€
>> >> ’Ãâ€
>> >> >>
>> ’ÃÃâ€
>> ’‚¼ller
>> lase...@googlegroups.com
>> .
>> >> >> >>>> Visit this group at http://groups.google.com/group/lasersaur.
>> >> >> >>>> To view this discussion on the web visit
>> >> >> >>>>
>> >> >>
>> >>
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> -- Steve
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/caf6c0f3602bf0ac8ebe5bf933c5d6cb.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtW2JuekzUCs%3DZr3h7Zge-jejPUBC1tsV5ZY9YeUQYUsRQ%40mail.gmail.com.

Jondale Stratton

unread,
May 15, 2015, 11:11:15 PM5/15/15
to lase...@googlegroups.com
Yes, I just changed it to check for constrained_intensity > current_block->nominal_laser_intensity and got the same results in this case.

I'm about to test this out by having the check change constrained_intensity at least down to current_block->nominal_laser_intensity but I'm thinking maybe it should change it to zero instead since it isn't moving at that moment.  I think I'll just add both checks in there.

Jondale Stratton

unread,
May 16, 2015, 12:03:33 AM5/16/15
to lase...@googlegroups.com
Here's what I added.

  if (constrained_intensity > current_block->nominal_laser_intensity){
    constrained_intensity = current_block->nominal_laser_intensity;
  }
  if (steps_per_minute == 0.0){
      constrained_intensity = 0.0;
  }


But now I'm getting an error when trying to flash from the beaglebone.

I'm getting the following.
avrdude: stk500_getsync(): not in sync: resp=0x00

The code compiles fine.  I've rebooted several times.  Still no go.  Not sure what's up but it's late now and will continue this tomorrow.

Steve Baker

unread,
May 16, 2015, 1:43:12 AM5/16/15
to lase...@googlegroups.com

That would just be a nasty kludge though - we need to understand WHY it's
miscalculating the power and fix the problem at source rather than
patching it where the symptoms occur. It's perfectly possible that the
underlying cause produces other symptoms.
>> ’¼ller
>> ’¢ÃÃâ€
>> ’¢â€šÂ¬ÃÃâ€
>> ’¢â‚¬Â¹This
>> ’ÃÃâ€
>> ’Ãâ€
>> >>
>> ’‚ÃÃâ€
>> ’‚¼ller
>> >> >> >> >>>> wrote:
>> >> >> >> >>>> >> >> >> > *edit*
>> >> >> >> >>>> >> >> >> >
>> >> >> >> >>>> >> >> >> > I use a 14.03 machine. Have other Saurs not
>> this
>> >> >> >> problem?
>> >> >> >> >>>> >> >> >> >
>> >> >> >> >>>> >> >> >> > 2015-05-12 18:37 GMT+02:00 Maximilian
>> >> >> >> >>>> MÃÃâ€
>> ’Ãâ€
>> >> ’Ãâ€
>> >> >>
>> ’ÃÃâ€
>> ’â€
>> >> >> >>
>> >>
>> ’ÃÃâ€
>> ’Ãâ€
>> >>
>> ’‚ÃÃâ€
>> lase...@googlegroups.com
>> .
>> >> >> >> > Visit this group at http://groups.google.com/group/lasersaur.
>> >> >> >> > To view this discussion on the web visit
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> -- Steve
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/3d0958611aa6cd2ee3467989058d4a61.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtXjgLGKz8qobSJJydNsYD_BNjM%2B-2OsAfj%3DZoTJDVSYRQ%40mail.gmail.com.

Steve Baker

unread,
May 16, 2015, 1:43:18 AM5/16/15
to lase...@googlegroups.com

That would just be a nasty kludge though - we need to understand WHY it's
miscalculating the power and fix the problem at source rather than
patching it where the symptoms occur. It's perfectly possible that the
underlying cause produces other symptoms.

>> ’¼ller
>> ’¢ÃÃâ€
>> ’¢â€šÂ¬ÃÃâ€
>> ’¢â‚¬Â¹This
>> ’ÃÃâ€
>> ’Ãâ€
>> >>
>> ’‚ÃÃâ€
>> ’‚¼ller
>> >> >> >> >>>> wrote:
>> >> >> >> >>>> >> >> >> > *edit*
>> >> >> >> >>>> >> >> >> >
>> >> >> >> >>>> >> >> >> > I use a 14.03 machine. Have other Saurs not
>> this
>> >> >> >> problem?
>> >> >> >> >>>> >> >> >> >
>> >> >> >> >>>> >> >> >> > 2015-05-12 18:37 GMT+02:00 Maximilian
>> >> >> >> >>>> MÃÃâ€
>> ’Ãâ€
>> >> ’Ãâ€
>> >> >>
>> ’ÃÃâ€
>> ’â€
>> >> >> >>
>> >>
>> ’ÃÃâ€
>> ’Ãâ€
>> >>
>> ’‚ÃÃâ€
>> lase...@googlegroups.com
>> .
>> >> >> >> > Visit this group at http://groups.google.com/group/lasersaur.
>> >> >> >> > To view this discussion on the web visit
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>>
>> -- Steve
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups
>> "lasersaur" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an
>> email to lasersaur+...@googlegroups.com.
>> To post to this group, send email to lase...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/lasersaur.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/lasersaur/3d0958611aa6cd2ee3467989058d4a61.squirrel%40webmail.sjbaker.org
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtXjgLGKz8qobSJJydNsYD_BNjM%2B-2OsAfj%3DZoTJDVSYRQ%40mail.gmail.com.

Jondale Stratton

unread,
May 16, 2015, 11:39:48 AM5/16/15
to lase...@googlegroups.com
I agree to finding why it's happening and fix that but for now I'm trying to figure out what the problem is...   

Unfortunately, my changes did not fix this problem.  It's certainly an oddity but does not seem to be the reason for the holes.

I guess next I will look into the code below that which switches PWM frequency based on constrained_intensity.  Maybe a frequency is too high for a few values.  Does anyone have experience or knowledge about setting PWM frequencies?



Jondale Stratton

unread,
May 17, 2015, 2:02:14 PM5/17/15
to lase...@googlegroups.com
From fooling around with the frequencies I could get the dots to move in different places but never go away completely.  It's possible that the frequencies need to switch for different values than it currently is switching.  If anyone has ideas on how to test that out more it would be much appreciated.

Steve Baker

unread,
May 17, 2015, 5:44:10 PM5/17/15
to lase...@googlegroups.com
(SORRY - LONG, TECHNICAL, POST FOLLOWS!)

In "adjust_speed()", there is this code:

control_laser_intensity(constrained_intensity);

// depending on intensity adapt PWM freq
// assuming: TCCR0A = _BV(COM0A1) | _BV(WGM00); // phase correct PWM mode
if (constrained_intensity > 40) {
// set PWM freq to 3.9kHz
TCCR0B = _BV(CS01);
} else if (constrained_intensity > 10) {
// set PWM freq to 489Hz
TCCR0B = _BV(CS01) | _BV(CS00);
} else {
// set PWM freq to 122Hz
TCCR0B = _BV(CS02);
}

The control_laser_intensity() function just does:

OCR0A = intensity ;

...so basically, that code snippet does two things:

OCR0A = xxx ; // Set the duty cycle
TCCR0B = xxx ; // Set the frequency

The frequency is determined by the intensity:

if intensity > 40 then 3.9kHz else
if intensity > 10 then 489Hz else
if intensity <= 10 then 122Hz

PWM systems like this are notorious for glitching when you change the
duty cycle or the frequency while the thing is running. The AtMega
chip has a special mode to prevent glitches when you change the duty
cycle...which seems to be set up in "control_init" on startup...

TCCR0A = _BV(COM0A1) | _BV(WGM00); // phase correct PWM mode

But it's far from clear what it does if you change the frequency
while it's running. The code references this arduino document:

http://www.arduino.cc/en/Tutorial/SecretsOfArduinoPWM

...which comes right out and says:

"the datasheet can be difficult to understand, due to the
many different control and output modes of the timers."

...and if you look at the Atmel datasheet, he's not kidding! The precise
details also vary depending on which Atmel chip you use.

So the thing is - we're changing the ratio between the ON and the OFF
pulse duration in proportion to the amount of power we want the laser to
generate. For (say) 80% power, you have it on for 80% of the time and off
for 20%...like this:
_____ _____ _____ _____ _____
__| |_| |_| |_| |_|

And for 20% power, it'll be like this:
__ _ _ _ _
|_____| |_____| |_____| |_____| |_____

The laser evidently only cares about the ratio of ON to OFF time.

But for some reason (probably due to the precision of that control) we are
also changing the frequency of the pulses.

So while this is 80% power at one frequency:
_____ _____ _____ _____ _____
__| |_| |_| |_| |_|

...this is also 80% power but at a lower frequency:
____________ _____________ ____
__| |__| |__|

...the laser power supply doesn't mind which so long as the ratio of ON to
OFF time is the same.

OK...now, imagine that we're halfway through a pulse when the software
decides to change the frequency.

Suppose we had the power set to some value like 50% - so the ON and OFF
times should be equal...and the PWM output is ON and is very close to
going OFF when we suddenly double the frequency of the timer. If we did
that then the OFF duration will be half what the ON duration was - which
briefly indicates 75% power...not 50%.

But we don't double the frequency - we go (potentially) from 122Hz to
3900Hz and back again...so if you switched from 122Hz to 3900Hz at the end
of an ON pulse, then the OFF pulse could be 32 times shorter than it
should be. Doing the reverse (switching from 3900Hz to 122Hz at the end
of an OFF pules) could have the exact same effect.

So the power level certainly COULD glitch to 97% for just one cycle even
if the set power is very low - and that's the symptoms we're seeing here.

I doubt the laser would actually change power enough to make a big black
dot in just one cycle at 3900Hz...but at 122Hz, perhaps it's possible?

HOWEVER:
========

Notice that we FIRST set the intensity THEN decide how to set the
frequency. These two operations should happen very close together - but
according to the source code, we allow nested interrupts and so there
could be a serial port interrupt happening between those two instructions
and we could be stuck with a high power setting and a low frequency or
vice-versa for a significant amount of time.

CONCLUSIONS:
============

The first thing I think we should try is to disable interrupts before we
call 'control_laser_intensity' and enable them again after setting the
timer frequency.

I'm not sure whether this will fix it...but it's worth a try - and it's
easy to do and unlikely to have any nasty side-effects.

If not - then maybe the problem is with switching frequencies AT ALL while
the timer is running - and that would be a much more serious problem to
fix.
>>> >> ’¼ller
>>> ’ÃÃâ€
>>> ’‚¢ÃÃâ€
>>> ’Ãâ€
>>> >>
>>> ’¢ÃÃâ€
>>> ’¢â‚¬Å¡ÃÃâ€
>>> ’‚¬ÃÃâ€
>>> ’Ãâ€
>>> >>
>>> ’¢ÃÃâ€
>>> ’¢â€šÂ¬ÃÃâ€
>>> ’‚¹This
>>> ’¢â‚¬â„¢ÃÃâ€
>>> ’Ãâ€
>>> >> ’Ãâ€
>>> >> >>
>>> >>
>>> ’ÃÃâ€
>>> ’¢â‚¬Å¡ÃÃâ€
>>> ’Ãâ€
>>> >>
>>> ’‚ÃÃâ€
>>> ’‚¼ller
>>> >> >> >> >> >>>> wrote:
>>> >> >> >> >> >>>> >> >> >> > *edit*
>>> >> >> >> >> >>>> >> >> >> >
>>> >> >> >> >> >>>> >> >> >> > I use a 14.03 machine. Have other Saurs not
>>> >> this
>>> >> >> >> >> problem?
>>> >> >> >> >> >>>> >> >> >> >
>>> >> >> >> >> >>>> >> >> >> > 2015-05-12 18:37 GMT+02:00 Maximilian
>>> >> >> >> >> >>>> MÃÃâ€
>>> ’Ãâ€
>>> >> ’Ãâ€
>>> >> >>
>>> ’ÃÃâ€
>>> ’â€
>>> >> >> >>
>>> >>
>>> ’ÃÃâ€
>>> ’Ãâ€
>>> >> ’â€
>>> >> >> >> >>
>>> >> >>
>>> >>
>>> ÃÃâ€
>>> ’¢â‚¬â„¢ÃÃâ€
>>> ’Ãâ€
>>> >> ’Ãâ€
>>> >> >>
>>> >>
>>> ’ÃÃâ€
>>> ’¢â‚¬Å¡ÃÃâ€
>>> https://groups.google.com/d/msgid/lasersaur/337b94028d789210f0b89ce4c59ba9c1.squirrel%40webmail.sjbaker.org
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtUir4p%3Dp4gi41BJtAcO_Usmt%3DFkiHHnDirjDgELL1az7Q%40mail.gmail.com.

Jondale Stratton

unread,
May 17, 2015, 8:03:14 PM5/17/15
to lase...@googlegroups.com

It looks like the you can mark code as atomic to avoid interrupt problems.

ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
{
     // do the things
}
I'll try to test this out in a bit.

Jondale Stratton

unread,
May 17, 2015, 10:11:32 PM5/17/15
to lase...@googlegroups.com
Below are the changes I made to the adjust_speed function in an attempt to nail it down.  Unfortunately the holes are still there.  I did change the location of the holes a bit by messing with the frequencies yesterday so I guess I'll look more into that.  Any more ideas would be very appreciated.


static void adjust_speed( uint32_t steps_per_minute ) {
  // steps_per_minute is typicaly just adjusted_rate
  if (steps_per_minute < MINIMUM_STEPS_PER_MINUTE) { steps_per_minute = MINIMUM_STEPS_PER_MINUTE; }
  cycles_per_step_event = config_step_timer((CYCLES_PER_MICROSECOND*1000000*60)/steps_per_minute);
  // beam dynamics
  uint8_t adjusted_intensity = current_block->nominal_laser_intensity * 
                               ((float)steps_per_minute/(float)current_block->nominal_rate);
  uint8_t constrained_intensity = max(adjusted_intensity, 0);
  
  if (constrained_intensity > current_block->nominal_laser_intensity) {
//printString("# CONSTRAINED");
constrained_intensity = current_block->nominal_laser_intensity;
  }
  if (steps_per_minute == 0.0) {
 constrained_intensity = 0;
  }
  
  /*
  Setting                          Prescale_factor
  TCCR0B = _BV(CS00);              1 31372 Hz
  TCCR0B = _BV(CS01);              8 3921  Hz
  TCCR0B = _BV(CS00) | _BV(CS01);  64 490   Hz
  TCCR0B = _BV(CS02);              256 123   Hz
  TCCR0B = _BV(CS00) | _BV(CS02);  1024 31  Hz
  */
  
  ATOMIC_BLOCK(ATOMIC_RESTORESTATE) {

Steve Baker

unread,
May 18, 2015, 12:42:09 AM5/18/15
to lase...@googlegroups.com
The next thing I'd try would be to (temporarily) force the frequency to
always be one specific value (probably 3.9kHz) and see if the spots go
away.

The problem with running at that frequency all the time would be a lack
of precise power control...but at least we'd learn something.
>>> ’ÃÃâ€
>>> ’‚¼ller
>>> ’ÃÃâ€
>>> ’Ãâ€
>>> >>>
>>> ’‚ÃÃâ€
>>> ’‚¢ÃÃâ€
>>> ’Ãâ€
>>> >>> ’Ãâ€
>>> >>> >>
>>> >>>
>>> ’ÃÃâ€
>>> ’‚¢ÃÃâ€
>>> ’Ãâ€
>>> >>>
>>> ’¢ÃÃâ€
>>> ’¢â€šÂ¬ÃÃâ€
>>> ’…¡ÃÃâ€
>>> ’Ãâ€
>>> >>>
>>> ’‚ÃÃâ€
>>> ’‚¬ÃÃâ€
>>> ’Ãâ€
>>> >>> ’Ãâ€
>>> >>> >>
>>> >>>
>>> ’ÃÃâ€
>>> ’‚¢ÃÃâ€
>>> ’Ãâ€
>>> >>>
>>> ’¢ÃÃâ€
>>> ’¢â‚¬Å¡ÃÃâ€
>>> ’‚¬ÃÃâ€
>>> ’Ãâ€
>>> >>>
>>> ’‚ÃÃâ€
>>> ’…¡ÃÃâ€
>>> >>> ÃÃâ€
>>> ’Ãâ€
>>> >>>
>>> ’¢ÃÃâ€
>>> ’¢â€šÂ¬ÃÃâ€
>>> ’¢â€žÂ¢ÃÃâ€
>>> ’Ãâ€
>>> >>> ’Ãâ€
>>> >>> >>
>>> ’ÃÃâ€
>>> ’â€
>>> >>> >> >>
>>> >>> >>
>>> >>>
>>> ’ÃÃâ€
>>> ’Ãâ€
>>> >>>
>>> ’¢ÃÃâ€
>>> ’¢â€šÂ¬ÃÃâ€
>>> ’…¡ÃÃâ€
>>> https://groups.google.com/d/optout
>>> .
>>> >>> >> >> >> >
>>> >>> >> >> >>
>>> >>> >> >> >>
>>> >>> >> >> >> -- Steve
>>> >>> >> >> >>
>>> >>> >> >> >> --
>>> >>> >> >> >> You received this message because you are subscribed to
>>> the
>>> >>> Google
>>> >>> >> >> >> Groups
>>> >>> >> >> >> "lasersaur" group.
>>> >>> >> >> >> To unsubscribe from this group and stop receiving emails
>>> from
>>> >>> it,
>>> >>> >> >> send
>>> >>> >> >> >> an
>>> >>> >> >> >> email to lasersaur+...@googlegroups.com.
>>> >>> >> >> >> To post to this group, send email to
>>> >>> lase...@googlegroups.com.
>>> >>> >> >> >> Visit this group at
>>> http://groups.google.com/group/lasersaur
>>> .
>>> >>> >> >> >> To view this discussion on the web visit
>>> >>> >> >> >>
>>> >>> >> >>
>>> >>> >>
>>> >>>
>>> lase...@googlegroups.com
>>> .
>>> >>> >> >> Visit this group at http://groups.google.com/group/lasersaur.
>>> >>> >> >> To view this discussion on the web visit
>>> >>> >> >>
>>> >>> >>
>>> >>>
>>> .
>>> > For more options, visit https://groups.google.com/d/optout.
>>> >
>>>
>>>
>>> -- Steve
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "lasersaur" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>> email to lasersaur+...@googlegroups.com.
>>> To post to this group, send email to lase...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/lasersaur.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/lasersaur/38d795f65ca9d7c17166842be5dc58e3.squirrel%40webmail.sjbaker.org
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtWwt7WC%3DW74ZHS8yrFQ96O92j5ZfkCs2b%3DHfT7_g8WmAw%40mail.gmail.com.

Jondale Stratton

unread,
May 19, 2015, 11:21:57 PM5/19/15
to lase...@googlegroups.com
I commented out the section that switches the frequency.  This should leave the frequency to be whatever is initially set in the control_init function in sense_control.c

The default is 489 Hz.  489 Hz and 122 Hz have the same results with the same holes.  31.3 kHz doesn't fire at all.  I still have a few more to try.


5) PWM can also be used in footer 6, but the pulse peak is required to reach 5V, and

 and the frequency should be above 20K.


​In an effort to get more possible frequency values I switched it to Fast PWM instead of phase correct and tried 7.8 kHz.  Attached is the result.  As you can see it only fired when it had a chance to be at higher speeds but it ALSO created the holes in the same spots even though it was not firing there.  

I'm not sure what this tells us.

DSC_0143.JPG

Steve Baker

unread,
May 20, 2015, 1:48:57 AM5/20/15
to lase...@googlegroups.com
Well...so much for those theories then.

Disabling the interrupt didn't fix it - and *not* changing the frequency
didn't fix it. I wouldn't mess with different frequencies - if you can
see glitches with any *fixed* frequency - then the act of switching can't
be the culprit...and neither can the interrupt hitting us at the moment of
switching be the problem.

Shame - that was a *REALLY* good theory!

OK - well back to the drawing board.

I'd really like to see an oscilloscope trace of the PWM signal right when
that glitch happens.

The claim is that you can *HEAR* the laser tube flip up to high
power...which eliminates the more likely possibility that the motors are
somehow the cause. I'd really like to be more certain of that - and
looking at the PWM signal right when the glitch happens is the only way to
be 100% certain.

-- Steve

Jondale Stratton wrote:
> I commented out the section that switches the frequency. This should
> leave
> the frequency to be whatever is initially set in the control_init function
> in sense_control.c
>
> The default is 489 Hz. 489 Hz and 122 Hz have the same results with the
> same holes. 31.3 kHz doesn't fire at all. I still have a few more to
> try.
>
> On the page for the laser psu I have (DY13)
> http://www.recilaser.com/en/productInfo/fc9181e93b448cac013b44fba49f0f2a.htm
>
> 5)
> PWM can also be used in footer 6, but the pulse peak is required to
> reach 5V, and
>
> and the frequency should be above 20K.
>
>
> ​In an effort to get more possible frequency values I switched it to
> Fast
> PWM instead of phase correct and tried 7.8 kHz. Attached is the result.
> As you can see it only fired when it had a chance to be at higher speeds
> but it ALSO created the holes in the same spots even though it was not
> firing there.
>
> I'm not sure what this tells us.
>
> ​
>
> --
> You received this message because you are subscribed to the Google Groups
> "lasersaur" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lasersaur+...@googlegroups.com.
> To post to this group, send email to lase...@googlegroups.com.
> Visit this group at http://groups.google.com/group/lasersaur.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/lasersaur/CAPLxAtV%2B1kHjp%3DkpsMZtJFzMbt0ofqO%2BYQbpS%2Bbbau2rS8-D-A%40mail.gmail.com.

Maarten van Dam

unread,
May 20, 2015, 11:31:16 AM5/20/15
to lase...@googlegroups.com

Besides the sound you can also see the tube light up. Atleast with our saur you can. Just as a small reply on the 'more proof' considering pwm vs motors.

Op 20 mei 2015 07:48 schreef "Steve Baker" <st...@sjbaker.org>:

Steve Baker

unread,
May 20, 2015, 12:50:13 PM5/20/15
to lase...@googlegroups.com
With the frequency not changing and the power levels clamped - I can't
even begin to imagine how this is happening.

We *NEED* someone to get an oscilloscope/logic-analyser scan of the PWM
signal when the problem occurs.

-- Steve


Maarten van Dam wrote:
>> > ​In an effort to get more possible frequency values I switched
>> it to
>> > Fast
>> > PWM instead of phase correct and tried 7.8 kHz. Attached is the
>> result.
>> > As you can see it only fired when it had a chance to be at higher
>> speeds
>> > but it ALSO created the holes in the same spots even though it was not
>> > firing there.
>> >
>> > I'm not sure what this tells us.
>> >
>> > ​
> https://groups.google.com/d/msgid/lasersaur/CAL1EKij2dEHFsNVuwHk9qn1CfV9ddmTanrxehC%3D81L7GbM_sOQ%40mail.gmail.com.

Jondale Stratton

unread,
May 28, 2015, 9:52:42 PM5/28/15
to lase...@googlegroups.com
I installed the firmware on an arduino and then ran the problem job through it while I had a cheapo logic analyzer hooked up to it pin 6 which I believe correspond to timer 0 which is what the code uses for the laser psu pwm.

I ran the problem design through it and recorded the 38 seconds it took to finish.  There appear to be the occasional surge in the pwm.  I've attached a screenshot which is zoomed to a level that shows the first two which are fairly close to each other just under and just over 8 seconds in.  I feel like this corresponds to the first 2 holes on the top triangle.  There is another one around 8.55 seconds which I think would match up with the 3rd hole in the top triangle.  Then there is a lull and another surge at around ~16.33 seconds then ~17.2 seconds.  A quick glance through the whole things hows at least 12 surges.  I count 14 holes so maybe I missed a couple.

I ran this off an arduino instead of in the laser itself so I think this should eliminate the possibility of some interference.

laser-LA1.png
Reply all
Reply to author
Forward
0 new messages