EMC2 Laser Driver


Results 1 to 17 of 17

Thread: EMC2 Laser Driver

  1. #1
    Member
    Join Date
    Jun 2007
    Location
    USA
    Posts
    73
    Downloads
    0
    Uploads
    0

    Default EMC2 Laser Driver

    So I purchased Mach 3 three years ago and I thought it was the hottest thing out there, but I've recently purchased a CNC laser and find MACH3 is not ideal at this point for driving a laser.

    Last night I downloaded the free Ubuntu EMC2 live CD and installed it on my computer. WOW! I'm amazed at how nice my machine runs compared to Mach 3 on Windows! The steppers are incredibly smooth with EMC2. I was particularly impressed with the stepper setup helper. I had my X Y Z motions set up and working great in a matter of minutes without ever reading a manual. It all seemed very intuitive to me, although I did have the experience with these types of setups from MACH 3. The motor test feature is GREAT the way it repeatedly cycles across the travel region and allows you to tweak the acceleration and top speed on the fly.

    I hooked my laser ON/OFF to the Z direction bit so down will be on and up will be off.

    20 minutes after installing Ubuntu with EMC2 I was cutting paper. I ran the stock gcode file that shows the EMC2 logo upon initial startup. It cut out that logo text in a few seconds. It was an absolutely PERFECT CUT! What amazed me was the fact that it was already set up for constant velocity and it handled it quite well with the laser. Most of my previous attempts with Mach3 would give me a burn mark at the very beginning of each motion because the Z direction and the XY motions seemed to be slightly out of sync.

    Clearly Linux is a better operating system for running a machine. All the motions can be directly mapped to the parallel port without the multi-tasking latency found in windows. With the smart Linux programmers I'm seeing that EMC2 will be quicker to upgrade and modernize. Looks like a touch screen interface is already possible too. These people are amazing.

    Now I do find myself in need of some advice for one particular issue as described below:

    1. Vector cutting is beautiful! No need to change a thing.
    2. I processed an image to gcode using BMPtoCNC for a Raster cut engraving and I have some problems. The files are attached as text but they are NC files ready to run.

    I want this thing to fly across in a sweeping X axis without stalling for the laser to turn on and off. This is what we see when we watch the videos of the more expensive laser engravers on YouTube. It acts just like an ink jet printer and fires some ink during the sweep without ever stalling the motion. I thought that if I make the machine think that the Z axis is infinitely fast then when it hit that portion of code it wouldn't stall but would instead simply fire the laser as it continued the sweep at constant speed. Perhaps my code is wrong or I'm not understanding constant velocity, but it's just not working for me. It stops the X motion to fire the laser and then it sweeps across and stops to turn off. This could go unnoticed when using a low power laser, but with a higher power (40W) laser this creates a deep burn at both the laser ON and the laser OFF positions and a shallow burn during the sweep. You can also see that because of the accel and decel of the X axis the burn goes from deep to shallow then to deep as it is leaving the turn-on and approaching the turn-off.

    I thought to myself "hey, this is LINUX EMC2" and it's super fast. Perhaps I should just attach pin 1 (the laser ON/OFF) to the flood button and edit the code to have it turn flood on and off instead of the Z0 and Z-0.5 so I used the find and replace function of the word editor to repace the Z0 with M9 and the Z-0.1 with the M8. I thought that surely the EMC2 would instantly turn it on and off without a latency stall. Nope. Sure enough it still pauses the X sweeping motion to turn the flood on and off.

    I could probably write my own M code, but wouldn't that have the same delay?

    There must be some value hidden in the bowels of the initialization scripts that sets the dwell time for the M codes.

    Any advice would be greatly appreciated.

    -John

    Similar Threads:
    Attached Files Attached Files


  2. #2
    Member
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    496
    Downloads
    0
    Uploads
    0

    Default

    Look here and see if this helps:
    http://www.linuxcnc.org/docs/2.3/htm...1,-G61.1,-G64:

    Also in stepconf you can set a parallel pin for digital out, then this pin is
    controlled by m62 -65 - a little bit cleaner then using coolant m code (but doesn't really matter)

    Here is a link for another fancier laser controlled by EMC2:
    http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?M5i20_Laser
    doesn't talk too much about the g coding side thou.

    Chris M



  3. #3
    Member
    Join Date
    Jun 2007
    Location
    USA
    Posts
    73
    Downloads
    0
    Uploads
    0

    Default

    Super! I'll give that a try. I had not seen that before... well, as I confessed earlier I hadn't read any of the EMC manuals.

    I'm livin' on the edge right now. I'm going straight from the parallel port to my stepper drives and the laser power supply. I would possibly purchase an interface card if it showed a demonstrated improvement over what I can get from the raw EMC2 parallel port. I visited the link to the M5i20, but I see no videos of the thing in action. I'm also wary of cards that would plug directly to a computer bus which may become outdated in the next decade. I like the newer methods that use USB or fire wire. With MHz digital transport rates on USB, I don't see why anyone would still need to design a board that plugs into an ISA bus.

    All this CNC stuff is cool, but sometimes I wish that my laser could simply think it was a printer. Wouldn't it be nice to open a document in any program and simply hit print? I've seen where linkmotion makes a driver, but the price seems a little ridiculous. I would have thought that the Linux folks would have done something similar by now. After all, it is actually a retro type of software that would make the parallel port act like it's driving an old plotter open loop.



  4. #4
    Member
    Join Date
    Jun 2007
    Location
    USA
    Posts
    73
    Downloads
    0
    Uploads
    0

    Default

    Well I gave it a try and it still pauses when it hits the M code. I tried both the M62 M63 and the M64 M65 combinations. I also thought that maybe I should try different path control modes like G61, G64. Not any better. The G64 with a high P value would make the axis swing without stopping, but it would also ignore the M63 and M62. This seems odd?

    I must be doing something wrong in my code. The path motion is staying in the X plane. If it sees the following string, the X path is constant in the negative direction. It is simply being told to fire the laser when it reaches a certain point along the line and then shut if off at another. Why would the Xstage momentarilly pause at these trigger points when there is obviously no change in the direction of travel? There must be an inherent software delay in the trajectory planner or there is a dwell put there on purpose.

    X-0.132
    X-0.146 M63
    X-0.979
    X-0.993 M62
    X-1.285
    X-1.299 M63
    X-1.896
    X-1.91 M62
    X-2.104
    X-2.118 M63
    X-3.799

    Last edited by lasersafe1; 11-22-2009 at 08:11 PM.


  5. #5
    Community Moderator
    Join Date
    Mar 2004
    Location
    Sweden
    Posts
    1661
    Downloads
    0
    Uploads
    0

    Default

    I'm not a laser guy at all (but I do use Linux and EMC2). If I were you i would try the mailing list or the IRC. There are a lot of people there that can help you.



  6. #6
    Member
    Join Date
    Jun 2007
    Location
    USA
    Posts
    73
    Downloads
    0
    Uploads
    0

    Default

    I will try the EMC2 forum. Thanks.



  7. #7
    Member
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    496
    Downloads
    0
    Uploads
    0

    Default

    You will want to talk to the major players of EMC. register for the mailing list.
    Most of them don't follow the EMC forum unfortunately.



  8. #8
    Registered
    Join Date
    Mar 2008
    Location
    Australia
    Posts
    267
    Downloads
    0
    Uploads
    0

    Default

    Laser,

    Connecting the laser control to the Z axis is the way I have approached the same problem.
    There is this thing called BLENDING of motion in EMC2.

    it is the G64 code.read up on how it can help You smooth the motion of laser as XYZ AXES MOVE.
    Since You are using the Z axis to control laser on/off set your Z axis to a minimum resolvable value ( in case of meric set up make Z axis UP =0.0000 and Z axis DOWN = -0.0001 ) this isufficient to toglle the UP/DOWN flag and control laser on/off state without necesarily penalising You with a time to actually move the Z axis. If this does not provide reliable outcome then set Z axis down stroke to whtat is equivalent to a single stepper motor step.

    Further by blending ( G64 Pn.nnnn ) motion you may loose on accuracy of cut by n.nnnn factor but the motion will be much faster, the XY axes will not come to a stop but tend to move continuously.

    Good luck, tell us how you progress.



  9. #9
    Member
    Join Date
    Jun 2007
    Location
    USA
    Posts
    73
    Downloads
    0
    Uploads
    0

    Default

    Thanks Zig.

    I will certainly be trying things out over the holiday. Perhaps you can provide a hint to a good starting value for P given the following:

    X-0.132
    X-0.146 Z0.0000
    X-0.979
    X-0.993 Z-0.0001
    X-1.285
    X-1.299 Z0.0000
    X-1.896
    X-1.91 Z-0.0001
    X-2.104
    X-2.118 Z0.0000
    X-3.799

    Am I to understand that the P value for blending has more to do with the distance between the X moves than anything to do with Z?

    I read the link on trajectory control, but I'm still a little confused because everything seems to pertain to path changes along an arc but my path is always a straight line when rastering.



  10. #10
    Community Moderator
    Join Date
    Mar 2004
    Location
    Sweden
    Posts
    1661
    Downloads
    0
    Uploads
    0


  11. #11
    Member
    Join Date
    Jun 2007
    Location
    USA
    Posts
    73
    Downloads
    0
    Uploads
    0

    Default

    Well after a couple days of testing, here is what I've learned.

    1. G64 Px.xxx isn't doing the trick for me.

    2. I downloaded and tested the LinkMotion virtual CO2 printer software. I could run my laser with it using the control panel, but it would crash when I tried to send a print job. This is presently $600 software, so it had better work flawlessly. Right now this is a non-starter for me.

    3. Since I had to put in a new 3.4GHz machine with at least 1G ram for the linkmotion software, I decided to try Mach 3 again on this new machine.

    4. Mach 3 runs well on this machine and the laser engraver plugin does exactly what I need it to do. It still has some faults: The image must be exactly square or it will fold over on itself. This I can live with because I will be repeating two specific images in the production of a product.

    So this is the end of the road for me for now. My system will produce the product that I need. I will still be watching this thread with hopes that someone can figure out how to do the fast rastering within the Gcode. It will be nice to one day raster my image and then immediately cut it out within one piece of code. I hope the EMC programmers can take a look at the freely available source code for the Mach 3 laser engrave plugin. It would be nice if this could be improved upon and made a part of EMC3.

    One more statement to make: We have all sorts of companies pushing their new driver cards that have FPGA's and built-in memory for loading a file. They would have us think that our computer printer port cannot do a fast raster on its own. I beg to differ. With a 3.4GHz PC I've got the Mach 3 pulsing engine running at 100kHz. It is outputing the raster to my laser as fast as my motor can travel (1400"/min on X with 250 accel). I suspect if I replace my X axis with a servo I could go even faster. Our problem is not the parallel port interface (on a fast PC) but is instead the present state of milling software. Art did a fine job with the laser engraver plugin, but it does need a few improvements to make it perfect. I suspect that a LINUX software could out perform any Windows software with respect to direct drive of the parallel port. I would think within Linux one would indeed have the ability to suspend all other activity while a file is being "printed" by the laser.



  12. #12
    Community Moderator
    Join Date
    Mar 2004
    Location
    Sweden
    Posts
    1661
    Downloads
    0
    Uploads
    0

    Default

    Did you ever ask the guys on the IRC or the mailing list?



  13. #13
    Member
    Join Date
    Jun 2007
    Location
    USA
    Posts
    73
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by svenakela View Post
    Did you ever ask the guys on the IRC or the mailing list?
    Not yet. I got side tracked with the LinkMotion attempt. I will still contact the list and work to get a gcode solution. The laser/impact engraver plugin for Mach 3 works well for me, but Gcode would be much nicer. Primarily because I could tell it to skip over the unmarked areas with rapid commands. The plugin will raster the whole image even if there were only a couple small spots to be engraved.



  14. #14
    Registered
    Join Date
    Mar 2008
    Location
    Australia
    Posts
    267
    Downloads
    0
    Uploads
    0

    Default

    What adverse behaviour did you experience with G64 Px.xxx command?



  15. #15
    Member
    Join Date
    Jun 2007
    Location
    USA
    Posts
    73
    Downloads
    0
    Uploads
    0

    Default

    It wasn't so much adverse behaviour, but no behaviour. The command seemed to be ignored. I know very little about gcode and EMC2. No matter how small a program I load, the list of active codes appearing in the "active codes" section is large. One or more of them are probably cancelling out the other commands I give. Is there some code I can enter that clears the "active codes" section?



  16. #16
    Member
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    496
    Downloads
    0
    Uploads
    0

    Default

    Just read this On EMC IRC.
    Seems using m62 and m63 is the way to go:
    here the link about it:
    http://www.linuxcnc.org/docs/2.3/htm...ec:M62-to-M65:
    I see in your code example you used m63 instead of m63 p1 (etc)

    13:40:22 Different subject .. Is there a way to control an output during motion - ie turn it on at 10" and turn it off at 22.5" - without stopping motion?
    2009-11-30 13:40:24 It would be nice to be able to do this within Gcode but I don't think it is possible. What about at the hal level? Do some compares on the current position and turn a bit on and off based on the compares? Does that sound feasible?
    2009-11-30 13:40:59 Thanks!
    2009-11-30 13:41:32 Dave911: it sounds feasible, but there are some caveats
    2009-11-30 13:41:40 you need to take care of offsets, etc
    2009-11-30 13:41:46 the HAL positions are motor positions
    2009-11-30 13:41:52 g-code is a whole different thing
    2009-11-30 13:42:24 Is that motor position in encoder counts?
    2009-11-30 13:42:45 no, that's a double precision position
    2009-11-30 13:42:57 which is counts * scale for stepgens I think
    2009-11-30 13:43:12 but you still have backlash added and comp applied
    2009-11-30 13:43:24 and other calculations.. so it might be a bit off from what you expect
    2009-11-30 13:43:33 I would do it in g-code using Mxx
    2009-11-30 13:44:40 I thought that all motion had to stop before a Mxx was executed. Or am I missing something
    2009-11-30 13:45:13 no, there's a Mxx code that can be blended
    2009-11-30 13:45:17 for this exact reason
    2009-11-30 13:45:54 I didn't realize that..
    2009-11-30 13:46:56 G1 X10
    2009-11-30 13:47:04 M62 P1 (turn on output 1)
    2009-11-30 13:47:11 G1 X22.5
    2009-11-30 13:47:18 M63P1 (turn off output 1)
    2009-11-30 13:47:22 G1 X30
    2009-11-30 13:47:40 this move shouldn't slow down at all
    2009-11-30 13:49:33 ... that is almost too easy! :-)
    2009-11-30 13:49:34 I missed those M commands entirely when I read through the manuals. Thanks Alex, I can test that very easily.
    2009-11-30 13:58:09 Dave911: you can blame me if it doesn't work

    Last edited by chester88; 12-01-2009 at 04:10 AM.


  17. #17
    Member
    Join Date
    Jun 2007
    Location
    USA
    Posts
    73
    Downloads
    0
    Uploads
    0

    Default

    Thanks. That does look like something to try once I repair my machine. I did learn an interesting tidbit about high step rates and Mach 3 laser pulsing plugin if anyone is interested.

    http://www.machsupport.com/forum/ind....html#msg87152



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

EMC2 Laser Driver

EMC2 Laser Driver

EMC2 Laser Driver