Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: twehr on September 18, 2009, 10:13:46 AM

Title: Config Question
Post by: twehr on September 18, 2009, 10:13:46 AM
How do I config Mach3 to use the M10/M11 (pallet on/off) commands? Specifically, how do I assign the pin/port for these commands?

I want to use this to control the firing of a laser, as it is supposed to have zero delay, unlike the m3-m4/m5 combination. (Using spindle controls delays between spindle on and the following G1 movement.)
Title: Re: Config Question
Post by: Tweakie.CNC on September 19, 2009, 02:20:13 PM
Just a thought but have you tried the M7 / M5 combination as this has a much smaller delay and is easily configured port and pin in the spindle setup menu.

Tweakie.
Title: Re: Config Question
Post by: twehr on September 19, 2009, 09:12:59 PM
Just a thought but have you tried the M7 / M5 combination as this has a much smaller delay and is easily configured port and pin in the spindle setup menu.

Tweakie.

Actually, I believe I have found it, after 5.75 hours of searching. I got the info here: http://www.machsupport.com/forum/index.php/topic,6629.msg43375.html#msg43375

Appearantly, I don't need to do much "special" in Mach3. I already have my "spindle" (laser) relay set to output #1. When you use the M10 or M11, you simply add on a "Px" (x = output number you are using). So, in my case, a M10P1 will turn on the laser and M11P1 will turn it off. Delay is reported to be only 1.5ms instead of 500ms.

I have not tried it yet. (My eyes are tired and brain dead from searching the forum and net for this answer.) Hope to try it tomorrow and will report back.

Thanks for answering.
Title: Re: Config Question
Post by: Tweakie.CNC on September 20, 2009, 09:08:19 AM
Look forward to hearing the results.

Tweakie.
Title: Re: Config Question
Post by: twehr on September 20, 2009, 11:43:01 AM
OK. Took me a couple of hours and some more research on the M10/M11 commands, but here it is what is working for me. ;D

Preconditions:
     1. I already had my laser "fire" confiurged to work with a spindle relay on Output #1.
     2. It was working well with M3/M4 and M5, but had the 500ms delay at the beginning.
     3. M3/M4 turn on the spindle (Laser for me) immediately when encountered.

Changes to make M10/M11 work:
     1. Realize that M11 is ON and M10 is OFF (intuitively backward from the M3/M4, M5 combination.
     2. You have to explicitly specify the Output # (M11P1 turns on output #1, M10P1 turns off output #1)
     3. M10/M11 do NOT execute until there is a subsequent G0/G1.

That 3rd item is what took be a couple of hours to work out. I kept testing with the direct input and my relay never fired because I was not following with a movement command.

So, my code needs to read as follows:

N001 G0 X0.0 Y0.0
N002 M11P1
N003 G1 X1.0 Y0.0
N004 M10P1
N005 G1 X1.0 Y1.0
N006 M11P1
N007 G1 X0.0 Y1.0
N008 M10P1
N009 G0 X0.0 Y0.0
N010 M30

This draws two parallel lines, one from 0,0 to 1,0 and the second from 1,1 to 0,1

Important: Notice line 9 - if you don't make this final move, your M10P1 will not occur, so the laser will not shut off. ALSO, if line 9 were a G0 or G1 that did not actually move the head, then there would be a 500ms delay in turning off, resulting in over burn at the end.

In summary

     M11Px (x= output number) turns my laser ON, but NOT UNTIL the subsequent Movement command.
     M10Px (x= output number) turns my laser OFF, but NOT UNTIL the subsequent Movement command.

The Movement commands that follow the M10Px MUST actually move the head, or there is a delay in turning off the laser.

Like most things in life, seems really simple, once you know the answer, but difficult as heck until you do!

My personal philosophy is once again proven - "Whatever we ardently desire, sincerely believe, vividly imagine, and enthusiastically act upon MUST inevitably come to pass." (Time, effort, and passion make all things possible!)

Title: Re: Config Question
Post by: Tweakie.CNC on September 20, 2009, 01:31:28 PM
Thank you for the very detailed explanation.
When my laser is finished (in about 6 months time, at the speed I am working) I will give this a try.

Tweakie.
Title: Re: Config Question
Post by: twehr on September 20, 2009, 05:45:51 PM
Thank you for the very detailed explanation.
When my laser is finished (in about 6 months time, at the speed I am working) I will give this a try.

I know I always appreciate (and rarely find) complete and detailed answers, so I make it practice to share everything I learn. If it helps you, I'll be happy I spent the time.

When you get further along, feel free to contact me. I am sure I will have new experiences that may save you some time and effort.

tim
Title: Re: Config Question
Post by: LuAn on January 20, 2011, 12:08:46 PM
My thanks also to twehr for providing such a comprehensive explanation.

A small contribution from myself:

Even if you use M11P1 to turn the beam on, you can still use M5 to turn it off (because the delay occurs while the beam is off).  Less code to change (if you're doing it by hand) and no need for a move afterwards to activate it.  Stumbled across that realisation by accident when I left an M5 in.  ;-)
Title: Re: Config Question
Post by: Tweakie.CNC on January 20, 2011, 12:37:45 PM
Hi LuAn,

I must admit that is a combination that I have not tried (at last I don't think so).
I shall give it a blast tomorrow (once the laser is up to temperature) and report back.
Thank you for the information.

Tweakie.
Title: Re: Config Question
Post by: rrc1962 on January 20, 2011, 01:54:46 PM

     2. It was working well with M3/M4 and M5, but had the 500ms delay at the beginning.



Under ports and pins / spindle setup, you can set the spin up/down delay to what ever you want.  We set it to 0 for plasma cutting.
Title: Re: Config Question
Post by: twehr on January 20, 2011, 03:43:33 PM
Good points on both the M5 and the spin up/down config.

I am currently using a DSP controller for my laser and am planning on building a new laser this winter. When that is done and the DSP is in its new home, I may go back to the old Mach3 controller in the original box and will try both those ideas.

Thanks!

tim
Title: Re: Config Question
Post by: Tweakie.CNC on January 21, 2011, 05:51:59 AM
Hi LuAn,

I managed to get a chance to try your suggestion, first thing this morning, but unfortunately the M5 introduces turn-off delay.

If you run Tim's code (earlier posting) with the laser set to very low power and drawing on paper or card the result will be like Fig.1 but if you replace the 'M10P1' with 'M5' the result will be like Fig.2. This is a good indication of the turn-off delay without actually resorting to setting up equipment to measure it. Repeating the same test with clear acrylic using M5 shows a deep penetration at the end of each line whereas M10P1 does not.

My tests were carried out with Mach versions 042.020 and 043.022 - other versions may behave differently. (As an example I was using the control pair E1P0/E1P1 but this stopped working correctly following one revision).

Tweakie.
Title: Re: Config Question
Post by: LuAn on January 21, 2011, 06:52:55 AM
I'm using 3.042.020 so maybe that accounts for the difference.  It was working for me.  I was cutting paper and cereal packet card so it really doesn't take much to make a hole if there's any delay.

Will get myself into the habit of using M11P1 with a move in case I upgrade at some point.


@rrc1962: I looked under ports and pins but can't find a place to change that delay.  Again, this is probably to do with the fact that I'm running an old versions.

Hmm, maybe I should do that upgrade sooner rather than later.
Title: Re: Config Question
Post by: twehr on January 21, 2011, 08:12:20 AM
[quote author=Tweakie.CNC link=topic=12
I managed to get a chance to try your suggestion, first thing this morning, but unfortunately the M5 introduces turn-off delay.

If you run Tim's code (earlier posting) with the laser set to very low power and drawing on paper or card the result will be like Fig.1 but if you replace the 'M10P1' with 'M5' the result will be like Fig.2. This is a good indication of the turn-off delay without actually resorting to setting up equipment to measure it. Repeating the same test with clear acrylic using M5 shows a deep penetration at the end of each line whereas M10P1 does not.
[/quote]

Thanks for checking this out Tweakie. We can always count on you to jump on anything new and report your findings. It's the reporting that makes it all useful for the rest of us.

tim
Title: Re: Config Question
Post by: rrc1962 on January 21, 2011, 08:38:58 AM
I'm not sure when it became available, but I'm using 3.042.036.
Title: Re: Config Question
Post by: Hood on January 21, 2011, 09:53:57 AM
Its been there for a long time, almost since the beginning of Mach3 but there will still be the delay that, the laser guys see, even when set to zero. I am not sure but I think the delay may be because when you call a M3/M4/M5 Mach will look at the macro so you get a slight delay, this is not a problem for machine tool spindles but for lasers the small delay is a problem.
 M11/M10 was I believe the way Art made to get round this short delay issue.
Hood
Title: Re: Config Question
Post by: LuAn on January 23, 2011, 06:03:30 AM
I'm not sure when it became available, but I'm using 3.042.036.

They are there in mine.  I think part of the reason I didn't notice them before is that they are already set to 0... so they don't make any difference with a laser (as others have now said).