Discussion:
[Emc-users] G-code to support multiple spindles.
andy pugh
2017-07-08 22:12:16 UTC
Permalink
I have a patched version of LinuxCNC that attempts to support multiple
spindles.

For example M3 E3 S3 will start the 4th spindle at a speed of 3 rpm.

In the current incarnation E is used to modify any spindle-related
code to define the spindle to be used. Except for G76 (lathe
threading) where E was "taken" and D is used. But KimK wants D for
thread taper so it's not ideal in two ways.

Other options are possible.

Jepler found that one controller uses M90 for spindle 0, M92 for
spindle 1 and M93 for spindle 2. (presumably their M91 was taken).
LinuxCNC has M90 through to M99 unused, so that would be an option.
M93 M3 S3

LinuxCNC does not currently use decimal M-codes. But M3.3 S3 would
seem reasonable, if the option was added. G76.3 would then be
threading. Rigid tapping, though, is difficult. G33.1.1?

But there is another option that has some appeal, but is a marked
departure. G-code does not use the $ character. But it looks a bit
like an S-for-spindle. If we used that to define the spindle then
there is no chance of a "collision" with any other G-code dialect (and
I think that Remapping would then ve free to emulate any other G-code
dialect).
--
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916
Roland Jollivet
2017-07-09 18:58:45 UTC
Permalink
Since almost every character is taken, and this does become a deviation,
why not use the comments area?

G0 X1 Y1 Z0
S100 M3 (*spindle2 )
S400 M3 (*spindle3 )

If * is used to denote a command, for example, you can go to town on your
own instructions. It's very unorthodox, but the scope becomes limitless.
Even (*turn off the lights) at the end of a program.

If it's all documented, it becomes extra functionality anyone could add in.
The syntax would need more thought..

Roland
Post by andy pugh
I have a patched version of LinuxCNC that attempts to support multiple
spindles.
For example M3 E3 S3 will start the 4th spindle at a speed of 3 rpm.
In the current incarnation E is used to modify any spindle-related
code to define the spindle to be used. Except for G76 (lathe
threading) where E was "taken" and D is used. But KimK wants D for
thread taper so it's not ideal in two ways.
Other options are possible.
Jepler found that one controller uses M90 for spindle 0, M92 for
spindle 1 and M93 for spindle 2. (presumably their M91 was taken).
LinuxCNC has M90 through to M99 unused, so that would be an option.
M93 M3 S3
LinuxCNC does not currently use decimal M-codes. But M3.3 S3 would
seem reasonable, if the option was added. G76.3 would then be
threading. Rigid tapping, though, is difficult. G33.1.1?
But there is another option that has some appeal, but is a marked
departure. G-code does not use the $ character. But it looks a bit
like an S-for-spindle. If we used that to define the spindle then
there is no chance of a "collision" with any other G-code dialect (and
I think that Remapping would then ve free to emulate any other G-code
dialect).
--
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
https://lists.sourceforge.net/lists/listinfo/emc-users
andy pugh
2017-07-09 19:54:59 UTC
Permalink
Post by Roland Jollivet
Since almost every character is taken, and this does become a deviation,
why not use the comments area?
G0 X1 Y1 Z0
S100 M3 (*spindle2 )
S400 M3 (*spindle3 )
That's an interesting idea, and one I think I want to ponder further on.

An option missing from my original email was to us "N"

Currently N is a line number, only valid at the start of a line, and
is ignored (apart from by Touchy GUI, which uses it to make
run-from-line more touch-friendly)
So, N101 M3 S300 N3 would still be fairly unambiguous and the parser
should be able to make the dstinction.
--
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916
Todd Zuercher
2017-07-10 02:24:02 UTC
Permalink
On the milling machines I've used with multiple spindles (No lathe experience). I have seen mostly M codes uses to specify which spindle the following spindle commands are for. But one manufacturer who's machines we run using Fanuc controls does it with T codes. Their T codes come in 2 flavors a T followed by 4 digits or a T followed by 3. The Three digit codes are used for activating a spindle head, air cylinders move the head down in the milling position and allow the spindle to be ran. The 4 digit T codes are used for tool changes, with the first digit designating which spindle/tool changer is used. When a spindle is inactive, it is raised up out of the way, turned off, and does not respond to any spindle commands (other than tool changes which are spindle specific).

I'm not sure how much it really matters how you get it done, just so it works. There is no industry consensus on how it should be done, and every machine builder does it their own way with different codes.

----- Original Message -----
From: "andy pugh" <***@gmail.com>
To: "Enhanced Machine Controller (EMC)" <emc-***@lists.sourceforge.net>
Sent: Sunday, July 9, 2017 3:54:59 PM
Subject: Re: [Emc-users] G-code to support multiple spindles.
Post by Roland Jollivet
Since almost every character is taken, and this does become a deviation,
why not use the comments area?
G0 X1 Y1 Z0
S100 M3 (*spindle2 )
S400 M3 (*spindle3 )
That's an interesting idea, and one I think I want to ponder further on.

An option missing from my original email was to us "N"

Currently N is a line number, only valid at the start of a line, and
is ignored (apart from by Touchy GUI, which uses it to make
run-from-line more touch-friendly)
So, N101 M3 S300 N3 would still be fairly unambiguous and the parser
should be able to make the dstinction.
--
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users
andy pugh
2017-07-10 09:34:57 UTC
Permalink
On 10 July 2017 at 03:24, Todd Zuercher
Post by Todd Zuercher
I'm not sure how much it really matters how you get it done, just so it works. There is no industry consensus on how it should be done, and every machine builder does it their own way with different codes.
That was my conclusion, and was also why I quite like the N or $
approaches, as they don't interfere with any re-mapping that folk
might want to use to match existing controls.
(This is also true of the (*spindle3) idea)
--
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1916
Erik Christiansen
2017-07-10 10:16:30 UTC
Permalink
Post by andy pugh
On 10 July 2017 at 03:24, Todd Zuercher
Post by Todd Zuercher
I'm not sure how much it really matters how you get it done, just so it works. There is no industry consensus on how it should be done, and every machine builder does it their own way with different codes.
That was my conclusion, and was also why I quite like the N or $
approaches, as they don't interfere with any re-mapping that folk
might want to use to match existing controls.
(This is also true of the (*spindle3) idea)
Except that the last idea screws up comments, as comments have to be
scrutinised by the reader to find obfuscated commands. As well, certain
comment text becomes prohibited comments because those comments are not
comments, but commands masquerading as comments. It is a path to hell, I
suggest. Our gcode will then be as good as perl - "write-only code".

Not only does $ have an 'S' for spindle, but it has a spindle passing
through it. And it is a command in the command space of the language,
which seems a useful attribute. (But then I may have spent too many
years as a programmer.)

Erik
--
Hell is other people's Perl.
-- Linux Journal - Dec. 2000
robert - Innovative-RC
2017-07-19 19:12:52 UTC
Permalink
Post by andy pugh
But there is another option that has some appeal, but is a marked
departure. G-code does not use the $ character. But it looks a bit
like an S-for-spindle. If we used that to define the spindle then
there is no chance of a "collision" with any other G-code dialect (and
I think that Remapping would then ve free to emulate any other G-code
dialect).
This tends to get used for Multi path contorls that use 1 file per
program construct
$1 (program/path 1)
$2 (program/path 2)

but if linuxcnc did have multipath it could use %1,%2 etc

!n (n=a number in equence) tends to get use for multipath controls where
you need to sync programs or wait for another program etc
L i have seen used but tends to be a basic wait code but again this depends on control, this was on a mitsubishi

on one lathe we have which has 3 spindles it uses Sn=

also just S = spindle 0

so
s0=200 is spindle0 200rpm
s1=100 is spindle1 100rpm

but dont forget some times you need to run Spindle 1 forward, spindle 2
reverse, as if its a sub for pickup one has to be CW, other CCW to grip the part and exchange from spindle to spindle
this is why you tend to find on lathes multi direction M codes
ie
M03 M04

M53 M54
etc

but this varys on controls.

i wonder what a more up to date control program looks like on a multi path multi spindle machine like the newer nakamuras etc

rob

Roland Jollivet
2017-07-10 12:04:27 UTC
Permalink
Post by Todd Zuercher
Post by andy pugh
On 10 July 2017 at 03:24, Todd Zuercher
Post by Todd Zuercher
I'm not sure how much it really matters how you get it done, just so
it works. There is no industry consensus on how it should be done, and
every machine builder does it their own way with different codes.
Post by andy pugh
That was my conclusion, and was also why I quite like the N or $
approaches, as they don't interfere with any re-mapping that folk
might want to use to match existing controls.
(This is also true of the (*spindle3) idea)
Except that the last idea screws up comments, as comments have to be
scrutinised by the reader to find obfuscated commands. As well, certain
comment text becomes prohibited comments because those comments are not
comments, but commands masquerading as comments. It is a path to hell, I
suggest. Our gcode will then be as good as perl - "write-only code".
Not only does $ have an 'S' for spindle, but it has a spindle passing
through it. And it is a command in the command space of the language,
which seems a useful attribute. (But then I may have spent too many
years as a programmer.)
Erik
I had the idea years ago when looking at the limitations of CncPro and
TurboCNC using the parports only. By editing the source code to spit out
all code on the serial bus as it is read, the user could have as many uP's
as they want sitting on the serial bus to parse this text, and perform
tasks assigned to them. This effectively give you infinite I/O for fixtures
and clamps without affecting the programs ability to handle Gcode, or
having to mess with the programs source code, or using up valuable parport
lines for clamps.

You could then assign one line on the parport for the real.. Gcode to use
as an input with the Wait command, as a handshake line.
It is best suited to a production environment where the machine runs all
day making one part.

I'm sure that if one used an obvious and unique prefix there would be no
confusion.

Roland


<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Continue reading on narkive:
Loading...