timing question

Questions, Suggestions, Tips, Etc

timing question

Postby educa » Mon Jul 09, 2012 12:20 am

Hi. I was wondering. If I want to make my own electronics to control the lasercutter, then how is the engraving done?

I mean. When you rasterengrave, you move x axis and let laser shoot points. But does that mean that the x axis continues to move while the laser goes on and off or is it more like the laser head stops, shoots a dot and only after shooting is finished it continues to move a little, stops again and shoots another dot? I think if the x axis continues to move then you don't shoot dots but stripes and on the other hand if the head has to stop for each dot then you cannot reach very high speeds.

So does somebody know (maybe ever checked this with a logic analyzer) how this is done?

Thanks for any hints
Bart
educa
 
Posts: 239
Joined: Thu Dec 22, 2011 9:13 pm

Re: timing question

Postby twehr » Mon Jul 09, 2012 12:56 am

educa wrote:Hi. I was wondering. If I want to make my own electronics to control the lasercutter, then how is the engraving done?

I mean. When you rasterengrave, you move x axis and let laser shoot points. But does that mean that the x axis continues to move while the laser goes on and off or is it more like the laser head stops, shoots a dot and only after shooting is finished it continues to move a little, stops again and shoots another dot? I think if the x axis continues to move then you don't shoot dots but stripes and on the other hand if the head has to stop for each dot then you cannot reach very high speeds.

So does somebody know (maybe ever checked this with a logic analyzer) how this is done?

Thanks for any hints
Bart


I wrote the beginnings of a bitmap-to-gcode utility once. I took the approach of looking at a scan line and calculating the position you would be when a series (1 or more) black bits were present. Turn the laser on and move another calculated position at which there begins a series (1 or more) of white bits. So, in effect, you are lasing strips the length of the black bit clusters. So it works like this:

1. Move to the first scan line
2. calculate the places where there are black dots
3. move to the beginning of the next set of black dots
4. turn laser on
5. move to the beginning of the next white dot (or end of scan line)
6. turn laser off
7. repeat 3...6 until you reach the end of the scan line
8. move to next scan line
9. repeat 2...8 until done

Of course, step 2 and step 8 take into consideration whether you are doing bilateral or unilateral engraving

This was all done in gcode, so how you move and how you fire the laser is pretty well set. If you are planning to interface with your own electronics (controller/drives/etc), then you may have to do more.
tim
--
"The answer is usually easy and obvious once you know what it is." tw

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

Re: timing question

Postby educa » Mon Jul 09, 2012 8:31 am

Did you also test this out on a real laser?

Its hard to understand for me that this would actually work out well.


as far as I know you really pulse every individual pixel, but the question was more like: Is the head moving while burning that pixel or not) ?


With your solution I guess you'll get banding in the picture and certainly not a very smooth running stepper motor. Thats of course the biggest problem, dus know if the stepper is going to have problems with this....
educa
 
Posts: 239
Joined: Thu Dec 22, 2011 9:13 pm

Re: timing question

Postby twehr » Mon Jul 09, 2012 12:04 pm

educa wrote:Did you also test this out on a real laser?

Its hard to understand for me that this would actually work out well.


as far as I know you really pulse every individual pixel, but the question was more like: Is the head moving while burning that pixel or not) ?


With your solution I guess you'll get banding in the picture and certainly not a very smooth running stepper motor. Thats of course the biggest problem, dus know if the stepper is going to have problems with this....


I don't know of any reasonable way in gcode to pulse the laser for every pixel. I did very limited testing as I went to the DSP and no longer have a mach3 setup available.
tim
--
"The answer is usually easy and obvious once you know what it is." tw

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

Re: timing question

Postby educa » Mon Jul 09, 2012 12:15 pm

Well I didn't mean how to do it in gcode actually.

I meant to ask how controllers like dsp do it?

There are obviously 2 ways of doing it.


1) is to burn a dot while head is not moving and then move and burn another dot. In this technique yur dots are perfect but you will not reach high speed

2) somehow the x axis continues to move, and the laser shoots on and off rapidly. It is not such a big problem to do this in software but I was just wondering how long a laser is then ON (0.2ms or so) to shoot 1 single dot and if the steppers are really moving during that shooting.
educa
 
Posts: 239
Joined: Thu Dec 22, 2011 9:13 pm

Re: timing question

Postby twehr » Mon Jul 09, 2012 2:21 pm

educa wrote:Well I didn't mean how to do it in gcode actually.

I meant to ask how controllers like dsp do it?

There are obviously 2 ways of doing it.


1) is to burn a dot while head is not moving and then move and burn another dot. In this technique yur dots are perfect but you will not reach high speed

2) somehow the x axis continues to move, and the laser shoots on and off rapidly. It is not such a big problem to do this in software but I was just wondering how long a laser is then ON (0.2ms or so) to shoot 1 single dot and if the steppers are really moving during that shooting.


Obviously, I did not write the DSP software, but based on some knowledge I have about it, and how Mach3 works and how steppers in general work, I can make the following conjecture:

1. steppers work on a series of steps (how did I ever figure that one out :mrgreen: )
2. the DSP has a laser "frequency" of 20,000 default but can be adjusted if you are using an RF laser
3. the DSP is capable of PPI
4. items 2 and 3 when paired with item 1 imply that the processor (controller) is sending a series of pulses to the steppers with interspersed pulses to the laser
5. regardless of what LaserCAD is sending to the controller, I believe this is likely the way the controller is actually working.

Again, conjecture, but 36+ years of commercial software development points me in that direction. If I were writing software for a dedicated controller, I would probably approach it that way.
tim
--
"The answer is usually easy and obvious once you know what it is." tw

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

Re: timing question

Postby mattrsch » Mon Jul 09, 2012 3:04 pm

educa wrote:Well I didn't mean how to do it in gcode actually.

I meant to ask how controllers like dsp do it?

There are obviously 2 ways of doing it.


1) is to burn a dot while head is not moving and then move and burn another dot. In this technique yur dots are perfect but you will not reach high speed

2) somehow the x axis continues to move, and the laser shoots on and off rapidly. It is not such a big problem to do this in software but I was just wondering how long a laser is then ON (0.2ms or so) to shoot 1 single dot and if the steppers are really moving during that shooting.


The laser fires while the steppers are on the move.
mattrsch
 
Posts: 98
Joined: Wed Jul 21, 2010 5:09 pm

Re: timing question

Postby educa » Mon Jul 09, 2012 3:49 pm

any idea how long those pulses are when he fires ?
educa
 
Posts: 239
Joined: Thu Dec 22, 2011 9:13 pm

Re: timing question

Postby bdring » Mon Jul 09, 2012 4:53 pm

The laser head is definitely moving the whole time.

I tried both methods...g-code and dedicated controller.

I did a g-code code version which did not work that well. See this from my original laser. (look at 10/22/09)

http://www.buildlog.net/cnc_laser/buildlog_2.html

You really need to be in charge of both the steps and the laser in the same controller. I did that via my XMOS controller. It worked, but I tried to control power on the fly via PWM, which does not work well. It would have worked better if I just used to the enable pin. I also tried to compensate for the acceleration phase in power. It is better to accelerate and decelerate outside the image so the laser power does not matter.

XMOS controller
viewtopic.php?f=16&t=137
Bart
"If you didn't build it, you will never own it."
bdring
Site Admin
 
Posts: 2966
Joined: Sun Nov 22, 2009 7:33 pm
Location: Chicago, IL, USA

Re: timing question

Postby jv4779 » Mon Jul 09, 2012 4:55 pm

I am doing raster engraving via gcode on my LinuxCNC controlled 2.x laser. This required a custom hal component to do the on/off timing during the raster sweep.

https://github.com/jv4779/2x_laser/tree/raster

I run 0.5 ms pulse time at 600in/min, 200 dpi on 40w laser. This leaves about a 0.006in dot on acrylic.
jv4779
 
Posts: 40
Joined: Fri Dec 09, 2011 10:54 pm

Next

Return to 2.x Laser Support

Who is online

Users browsing this forum: No registered users and 12 guests

cron