Post Processors, a guide to Centroid CNC12 G&M codes

Moderator: cnckeith

Post Reply
cnckeith
Posts: 3358
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: Yes
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
CNC Control System Serial Number: none
Contact:

Post Processors, a guide to Centroid CNC12 G&M codes

Post by cnckeith »

Centroid doesn't create post processors for CAD/CAM systems, the manufacture of the CAD/CAM system (or users) create the post processors to work with different CNC controls.

Resources...

If you or if you are working with someone that is building a post processor for a Centroid CNC control here is the info you need to get going.

1.) Marc at CNC Services Northwest posed an excellent summary of how Centroid G&M code works.

http://www.cncsnw.com/PostProcessorsMill.htm

http://www.cncsnw.com/PostProcessorsLathe.htm

2.) in addition to this, every Acorn CNC12 software installation includes a wide variety of sample G&M code programs that are compatible with Centroid CNC12 software, those example files can be used to learn how the various G and M codes are typically used. Intercon (Centroid's conversational generates CNC12 compatible G and M code and is a excellent resource)

3.) The Centroid Mill and Lathe Operator manuals have large comprehensive chapters on G and M codes with examples of each code with its common use. https://www.centroidcnc.com/centroid_di ... nuals.html

4.) If you have a good working post processor we encourage you to share it here on this thread for others to use and modify.

Marc's Lathe
CNC Services Northwest
Centroid CNC control sales, service, training and support

Centroid T-Series Post Processor Information
General
Centroid controls use Fanuc-style G codes. They are quite permissive regarding formatting details. In general, a Fanuc 0T post processor with basic functions will work fine.

There is no difference among the different model numbers of the Centroid T-Series controls. The same post processor will work for a T15, T39, T400, or any other control in the series.

There have been minor differences with increasing software versions over the years. In general these changes have been to make the G code interpreter more permissive.

In the information which follows, "optional" means just that: permitted, but not required. Therefore if you are modifying an existing post processor, don't waste time and effort adding or removing such features.

Basics
A program number (Oxxxx) for the main program in the file is optional.
If used, the main program number must not be in the range 9100-9999.
Block numbers (Nxxxx) are optional, except where used with the G70-G72 cycles.
White space is optional.
Leading zeros are optional.
Decimal points are optional. A value with no decimal point is interpreted as whole units (e.g. "2" means 2.0 inches, 2.0mm, 2.0 seconds etc. depending on context).
Comments are optional.
A "safety block" is optional.
CNC codes are not case sensitive.
There can be no more than one M function on a line.
A tool-changing T code is counted as an M function, so there can be no other M function on the same line as a tool change.
X axis dimensions and distances are Diameter values.
See the Manual for syntax details. CNC program codes are covered in Chapters 10 - 13.

Canned Cycles
Canned drilling, tapping and boring cycles (G83 - G85) are available.

Stock removal cycles (G70 - G72) are available, but do not conform to Fanuc standards. You will be better off posting long-hand codes for repetitive stock removal.

Single closed-circuit turning, threading and facing cycles (G90, G92, G94) are available.

Multi-pass threading with single-edge cutting and constant chip load (G76) is available.

Arcs
Arcs may be specified either by center (I and K values) or by radius (R value). Radius values are preferred if you will be using tool nose radius compensation (G41/G42) as they are not affected by roundoff errors as much as center values are.

The I value, for an X axis arc center, is a Diameter amount.

I and K values for the arc center are always incremental from the arc start point.

R values, specifying arc radius, are signed. A positive R will yield an arc less than or equal to 180° (the short way). A negative R will yield at arc greater than or equal to 180° (the long way). On a lathe, there is no need for arcs exceeding 180°, so R should always be positive.

Subprograms
In general, program storage capacity and memory space are not an issue on Centroid controls, so it is better to post out CNC programs long-hand rather than to use subprograms.

If you wish to include G code subprograms and calls in the program file, you must number the subprograms in the range 9100 - 9999, and you must include the subprogram definition (O9xxx through M99) prior to any call to that subprogram.

For example:

O9123
G1 F.005 X1.0
X0.8 W-0.1
G2 W-0.2 R0.1414
G1 X1.0 W-0.1
G0 X1.1
M99

T0101
G97 M3 S1200
M8
G0 X1.1 Z.1
G96 S350
G0 Z-0.5
M98 P9123
G0 Z-1.0
M98 P9123
G0 Z-1.5
M98 P9123
G0 Z0.1
M5
M9
G28

"Safety Block"
In general, Centroid controls do not require the traditional "safety block" at the beginning of a program. The following modes are automatically reset at the beginning of every program cycle:

G0
G20 or G21 (depending on control configuration)
G40
G80
G97
G99
The following codes do remain active (modal) between cycles:

T code (tool length offset values)
Even so, these codes generally do not need to be reset in a safety block at the beginning of a program; just set to new values when needed.

Coordinate System Setting and Selection
There should be no coordinate-setting codes (i.e. G50 X_ Z_) in the CNC program. The operator will set the work coordinate system (fixture offsets) using the control's Part Setup screen before he starts the job running.

Comments
Comments may begin with a semi-colon; a colon; or be in parentheses
Comments beginning with a semi-colon may appear anywhere, and continue to the end of the line
Comments beginning with a colon must be the first thing on the line, and continue to the end
Comments in parentheses may follow other CNC codes
Comments in parentheses may not precede other CNC codes
Comments in parentheses may not span multiple lines (each line needs its own set of parentheses)
The comment found on the first line of programs posted from Intercon, which specifies "ICN_PATH = somefilepath.LTH" is intended for Intercon, to help locate the conversational program file from which the G codes were generated. That comment need not, and should not, be duplicated in CAD/CAM post processors.

Move to Home
You can move both axes to a safe position (home or tool change position) using G28. G28 will move both axes to whatever position is specified for Return Point #1 (G28), referenced in Machine Coordinates on the WCS Tables under Part Setup.

G30 may be used to move to additional reference points. However, a postprocessor should generally assume that G28 is the desired position for tool changes and end-of-job clearance.

Tool nose radius compensation (G41/G42) must be cancelled (with G40) before using G28 or G30.

It is not necessary to cancel tool length compensation (e.g. change from T0101 to T0100) before moving to home.

End of Program
No special M code or other character is required to mark the end of a CNC program. When the control reaches the end of the file, the program cycle ends.

You may optionally include an M30 code. Most controls are configured to simply ignore M30 (it is a valid code which does nothing). Some users will install a custom M30 which performs some housekeeping tasks.

M2 and M102 request automatic restart of the program cycle, and so should be avoided unless such continuous looping is specifically required.

Automatic Tool Changers
No post processor changes are strictly necessary in order to support machines with automatic tool changers. Just change the T code to change tools, as always.

On a machine with manual tool changing, the control will display a prompt ("Insert tool and press Cycle Start"), and wait for the Cycle Start key.

On a machine with automatic tool changing, the control will do whatever is required by the tool changer, as directed by its PLC and macro programming.

CNC Services Northwest Home

Copyright © 2010 Marc Leonard
Last updated 16-Jun-2010 MBL

Marc's Mill

CNC Services Northwest
Centroid CNC control sales, service, training and support

Centroid M-Series Post Processor Information
General
Centroid controls use Fanuc-style G codes. They are quite permissive regarding formatting details. In general, a Fanuc 0M post processor with basic functions will work fine.

There is no difference among the different model numbers of the Centroid M-Series controls. The same post processor will work for an M10, M15, M39, M40, M50, M400, or any other control in the series.

There have been minor differences with increasing software versions over the years. In general these changes have been to make the G code interpreter more permissive.

In the information which follows, "optional" means just that: permitted, but not required. Therefore if you are modifying an existing post processor, don't waste time and effort adding or removing such features.

Basics
A program number (Oxxxx) for the main program in the file is optional.
If used, the main program number must not be in the range 9100-9999.
Block numbers (Nxxxx) are optional.
White space is optional.
Leading zeros are optional.
Decimal points are optional. A value with no decimal point is interpreted as whole units (e.g. "2" means 2.0 inches, 2.0mm, 2.0 seconds etc. depending on context).
Comments are optional.
A "safety block" is optional.
CNC codes are not case sensitive.
There can be no more than one M function on a line.
Canned Cycles
Canned drilling, boring and tapping cycles (G73 - G89) are available. See the Manual for syntax details.

By default, when a canned cycle has been activated, the Centroid control will only drill (or bore or tap) a hole for each G code line which contains an axis coordinate other than Z. E.g. a coordinate for X, Y or a rotary axis.

Your postprocessor, then, should output at least one axis coordinate for the first hole location even if the axes are already positioned over the hole as a result of a previous G0 positioning move. Usually the simplest solution is to output all axis coordinates unconditionally when using canned cycles.

For example:

M6 T1
M3 S1200
M8
G0 X0 Y0 Z1 G43 H1
G81 X0 Y0 Z-.5 R.1 F12
X1 Y0
X1 Y1
X0 Y1
G80
M5
M9
M25

The chip-breaking (G73) and deep hole (G83) cycles do not provide variable peck amounts. Each cycle uses the Q value as a fixed peck amount, used throughout the cycle. If you require varying peck depth, you will have to output multiple cycles at the same location.

The pull-back amount for the chip-breaking (G73) cycle is set in Machine Parameter 73 in the control. The postprocessor can select a specific distance by setting Parameter 73 with the G10 code before calling the G73 cycle.

For example:

G0 X0 Y0 Z1 G43 H1
G10 P73 R0.02
G83 X0 Y0 Z-.5 R.1 Q0.1 F12
X1 Y0
X1 Y1
G80
If you do not set a new pull-back distance in Parameter 73, then the G73 cycle will use the previous value of the parameter, whatever it may be.

The rapid-down clearance amount for the deep hole (G83) cycle is set in Parameter 83, in the same manner as Parameter 73 for G73 above.

Arcs
Arcs may be specified either by center (I, J, K values) or by radius (R value). Radius values are preferred if you will be using cutter radius compensation (G41/G42) as they are not affected by roundoff errors as much as center values are.

By default, the I, J and K values for the arc center are always incremental from the arc start point, regardless of the G90/G91 mode.

Optionally, a user can set Bit 0 of Machine Parameter 2 (i.e. add 1 to the parameter value) to have I/J/K arc centers be absolute coordinates in G90 mode, and incremental in G91 mode. However, this selection is rare, and as a post writer you should assume it is not selected.

Using arc centers (I/J/K) you can command up to 360° in a single move. An arc command which ends at the same arc-plane coordinates that it starts at will be a full circle.

When using radius (R), arcs must be less than 360°. If the end point is the same as the start point, then the control cannot locate the arc center.

R values, specifying arc radius, are signed. A positive R will yield an arc less than or equal to 180° (the short way). A negative R will yield an arc greater than or equal to 180° (the long way).

Helical arcs are supported. Any axis movement outside the arc plane (e.g. Z movement included with an arc in the G17 plane) will be interpolated linearly as the arc axes swing the arc.

Subprograms
In general, program storage capacity and memory space are not an issue on Centroid controls, so it is better to post out CNC programs long-hand rather than to use subprograms.

If you wish to include G code subprograms and calls in the program file, you must number the subprograms in the range 9100 - 9999, and you must include the subprogram definition (O9xxx through M99) prior to any call to that subprogram.

For example:

O9123
G90 G1 F10 Z-0.1
G91 F15 X1.5
Y1.5 X-1.5
Y-1.5
G90 G0 Z0.1
M99

M6 T1
M3 S1200
M8
G0 X0 Y0 Z.1 G43 H1
M98 P9123
G0 X4 Y0 Z.1
M98 P9123
G0 X8 Y0 Z.1
M98 P9123

M5
M9
M25

"Safety Block"
In general, Centroid controls do not require the traditional "safety block" at the beginning of a program. The following modes are automatically reset at the beginning of every program cycle:

G0
G90
G17
G20 or G21 (depending on control configuration)
G40
G80
G98
The following codes do remain active (modal) between cycles:

G43/G44/G49 (tool length compensation)
H (length offset value)
G54-G59 (work coordinate system)
Even so, these codes generally do not need to be reset in a safety block at the beginning of a program; just set to new values when needed.

For example, as long as you include G43 and the new H code at your tool change, it does not matter whether you previously cancelled any previous offset. The new offset will take effect when you call for it.

Coordinate System Setting and Selection
There should be no coordinate-setting codes (i.e. G92) in the CNC program. The operator will set the work coordinate system (fixture offsets) using the control's Part Setup screen before he starts the job running.

It is best to omit any coordinate system selection codes (e.g. G54, G55 ...) in any single-fixture program. The program should run in whatever WCS is presently selected, because that is most likely the one that the operator just set in the Part Setup screen.

Coordinate system selection codes should be included only in multiple-fixture programs: for example, one which cuts the same part in several vises.

Comments
Comments may begin with a semi-colon; a colon; or be in parentheses
Comments beginning with a semi-colon may appear anywhere, and continue to the end of the line
Comments beginning with a colon must be the first thing on the line, and continue to the end
Comments in parentheses may follow other CNC codes
Comments in parentheses may not precede other CNC codes
Comments in parentheses may not span multiple lines (each line needs its own set of parentheses)
The comment found on the first line of programs posted from Intercon, which specifies "ICN_PATH = somefilepath.ICN" is intended for Intercon, to help locate the conversational program file from which the G codes were generated. That comment need not, and should not, be duplicated in CAD/CAM post processors.

Move to Home
You can move the Z axis to a safe position (home or tool change level) using either M25 or G28. Centroid's own postprocessor for the Intercon conversational programming uses M25 because it is more concise and does not interfere with the G90/G91 selection. However, M25 is essentially equivalent to G91 G28 Z0: both codes will move the Z axis to whatever level is specified for Return Point #1 (G28), referenced in Machine Coordinates on the WCS Tables under Part Setup.

It is generally undesirable to include home return moves on other axes, but if that is required, G28 and/or G30 may be used. The operator can then set the exact machine location he wants in the WCS Tables.

It is not necessary to cancel tool length compensation (with G49 and/or H0) before moving Z to home.

End of Program
No special M code or other character is required to mark the end of a CNC program. When the control reaches the end of the file, the program cycle ends.

You may optionally include an M30 code. Most controls are configured to simply ignore M30 (it is a valid code which does nothing). Some users will install a custom M30 which performs some housekeeping tasks.

M2 and M102 request automatic restart of the program cycle, and so should be avoided unless such continuous looping is specifically required.

Rotary axes
Rotary axes are generally commanded in degrees, with feedrates in degrees/minute, regardless of the G20/G21 modal selection.

The rotary axes may be labeled A, B, C, U, V or W. The letter used should be selectable by the end user, if possible.

Feedrates for combined linear/rotary moves are interpolated and include both inch/mm and degrees components. See my rotary fourth axis writeup for distance and feedrate formulas and examples.

Automatic Tool Changers
No post processor changes are strictly necessary in order to support machines with automatic tool changers. Just use M6 and a T code to change tools, as always.

On a machine with manual tool changing, the control will move Z home, stop the spindle and coolant, display a prompt ("Insert tool and press Cycle Start"), and wait for the Cycle Start key.

On a machine with automatic tool changing, the control will do whatever is required by the tool changer, as directed by its PLC and macro programming.

There are two features that can be helpful on ATC machines, even though neither is required:

A user-selectable M code (usually M17) can be inserted at the end of the last cut before a tool change, after the tool is clear of the stock but before a G28 or M25 move to Z home. If the control is so configured, this M code will turn off the spindle and coolant and begin the spindle orientation process. That saves time in the tool change because the orient can take place while the head moves up to the ATC level.
On machines with a random-access tool changer (generally ones with a double-ended transfer arm) an M107 code with the next (upcoming) T number can be inserted immediately after the completion of each tool change. That will allow the ATC carousel to pre-stage the next tool while the current tool is cutting.
CNC Services Northwest Home

Copyright © 2016 Marc Leonard
Last updated 16-Nov-2016 MBL
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
cnckeith
Posts: 3358
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
MPU11 & GPIO4D -w/ 3rd Party Drives: Yes
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
CNC Control System Serial Number: none
Contact:

Re: Post Processors, a guide to Centroid CNC12 G&M codes

Post by cnckeith »

I'll kick off the Post Processor sharing here on this thread with a link to Swissi's excellent Fusion 360 post.

viewtopic.php?f=63&t=3262

Please add links to your favorite post processor here on this thread so we have them all in one spot for everyone to use.
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
TCandee
Posts: 79
Joined: Sun Jun 17, 2018 2:42 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC11: No
CPU10 or CPU7: Yes
CNC Control System Serial Number: C8FD19F6D5CF-0403180778

Re: Post Processors, a guide to Centroid CNC12 G&M codes

Post by TCandee »

This is really good info that I had to piece together when I was getting my post processor up and running. Nice to see it all here in one spot. Disappointing that no one has added to the conversation. I would like to add my PP for Solidworks/Camworks but I’m not sure I can. I paid them to make and maintain it and I’m not sure if I have the right to post it. I will look into it.

The PP works pretty well except the cutter comp on contour operations is not implemented properly and I have manipulate the lead-ins etc to keep the tool from gouging the part. The manipulation seems to vary between different shape features. The G41/G42 is on the same line as the lead in move. I have been toying with the idea of modifying the PP to put the CC code on its own line before the lead-in and possibly before the the tool drops to depth. This is a very frustrating issue. Any help would be appreciated.
Post Reply