m1 behavior

More
13 Feb 2012 20:07 #17637 by justin
m1 behavior was created by justin
Is it possible to have M1 stop the spindle of a lathe? Currently my axis motion stops but the spindle remains on. I would like to be able to measure features before running the next tool....

This may be similar to the question about modifying an m3 code that was just posted, but I figured this would be a very commonly desired option.

Thanks all.

Please Log in or Create an account to join the conversation.

More
14 Feb 2012 10:51 - 14 Feb 2012 10:51 #17648 by Rick G
Replied by Rick G on topic Re:m1 behavior
Have you looked at Manual tool changer and M6?

linuxcnc.org/docs/html/gui_axis.html#sec:Manual-Tool-Change

Rick G
Last edit: 14 Feb 2012 10:51 by Rick G.

Please Log in or Create an account to join the conversation.

More
14 Feb 2012 11:47 #17653 by BigJohnT
Replied by BigJohnT on topic Re:m1 behavior
M1 functions the same as pause button and only affects motion. If you want the spindle and coolant and other things to turn on or off you will have to program them. You could have a subroutine to take care of that something like this. The / is for optional skip lines if it is on the code is skipped if off it is executed.
...
/o<inspect> call
T2 M6 G43
....

The inspect.ngc file
o<inspect> sub
M5 M9
M1
M3 M8
o<inspect> endsub
M2

John

Please Log in or Create an account to join the conversation.

More
17 Feb 2012 02:06 #17745 by justin
Replied by justin on topic Re:m1 behavior
Yes, using the block skip function and subroutine would get me where I want....

That said, I do think that it should be an option. The spindle stopping and coolant turning off is pretty standard on most controls when a M1 or M0 command is issued. Would anyone else be interested in such a thing? If so maybe a feature request could be started.

Justin

Please Log in or Create an account to join the conversation.

More
17 Feb 2012 13:02 - 17 Feb 2012 13:03 #17755 by BigJohnT
Replied by BigJohnT on topic Re:m1 behavior
Simply switch to master and you can define a M code to suit your particular needs. None of my commercial CNC controllers do anything more than stop motion with M1 or program pause. Of course you would also have to handle what to turn back on somehow...

John
Last edit: 17 Feb 2012 13:03 by BigJohnT.

Please Log in or Create an account to join the conversation.

More
18 Feb 2012 00:43 #17774 by mhaberler
Replied by mhaberler on topic Re:m1 behavior
there've been several requests to modify the behaviour of the m1,m2,m30 etc group codes

those arent currently in the set of remappable codes, but is doable

any strong reason not to define a new M code and be done?

-Michael

Please Log in or Create an account to join the conversation.

More
18 Feb 2012 06:12 #17783 by justin
Replied by justin on topic Re:m1 behavior
I guess I am used to fanuc controls, and that is essentailly the industry standard. I believe that with fanuc there is most likely a group of parameters that control the behavior of m0, m1 so that integrators can make their machines run however they need to. I believe m0, m1 and maybe some others would greatly benefit from a similar setup, similar to the homeing sequences that Linuxcnc has now. You define the behavior in the .ini file and it acts accordingly. What would it take to add something like this?

Making a custom mcode to do this is just fine, but I do not know how you could turn it on and off like you can with both m1 and m0 other than use block delete, which would prevent you from using block delete for anything else.

Please Log in or Create an account to join the conversation.

More
18 Feb 2012 09:41 #17786 by mhaberler
Replied by mhaberler on topic Re:m1 behavior
BigJohnT wrote:

Simply switch to master and you can define a M code to suit your particular needs. None of my commercial CNC controllers do anything more than stop motion with M1 or program pause. Of course you would also have to handle what to turn back on somehow...

John


here's an example how it can be done with remapping (requires master), this is John's example
repackaged as new code:

git.mah.priv.at/gitweb/emc2-dev.git/shor...s/extend-m1-by-remap

Current restrictions:
- M1 cant be remapped directly like M6/M61/T/S/F, so a new code is needed for now
- the M10 is modal group 5, not group 4 like M1, since group 4 cant currently be remapped

Lifting the 'current restrictions' requires some coding on my side. Think what you wish for..

- Michael

Please Log in or Create an account to join the conversation.

More
18 Feb 2012 14:46 #17796 by mhaberler
Replied by mhaberler on topic Re:m1 behavior
I've added the capability to redefine or extend the m0,m1,m60 codes

see the configs/sim/remap/extend-builtins demo

git.mah.priv.at/gitweb/emc2-dev.git/shor...ads/remap-mgroup4-rc

This needs exercise, so I'd be grateful for feedback

- Michael

Please Log in or Create an account to join the conversation.

More
19 Feb 2012 20:08 #17842 by justin
Replied by justin on topic Re:m1 behavior
Thanks Michael!

I just tested the extended m1 and m0 posted, it works great and is exactly what I needed. Would it be possible to record if it was in m3 or m4 before the m1/ m0 and then start the spindle the same direction after the program is started again. I imagine this would be much like how it checks the coolant....


; record whether mist/flood were on
#<mist> = #<_mist>
#<flood> = #<_flood>

/M5 M9 ; stop spindle, mist+flood off

/m1 (refer to builtin m1)

; restore mist, flood setting
/o100 if [#<mist>]
/ m7
/o100 endif

/o200 if [#<flood>]
/ m8
/o200 endif


Only <mist> and <flood> would be m3 and m4?

Please Log in or Create an account to join the conversation.

Time to create page: 0.083 seconds
Powered by Kunena Forum