For those interested in writing their own post processor, this package may provide some example code and ease of use features that interest you.
I have only ‘computer tested’ it thus far for correct pp control logic and operation of the Custom Options pop up window and variable uses within the pp and job. The gcode produced is for GRBL plasma generic dialect and has not been tested on my machine yet. I fully expect all those interested in this pp as a template for their custom pp will modify the gcode production to suit their CNC controller dialect and custom features.
The attached zip file contains 2 sample jobs (one for rotary, one not), two gcode files, the pp, and notes.
Developed on SheetCam TNG Development 7.1.40 Windows
(not tested with but should work on V7.0.21)
This pp produces generic GRBL plasma gcode.
Includes features/options such as:
- Custom Tool Params examples
- Custom Operation Params examples
- ‘Set a post process variable’ Operation examples
- RotaryPlasma plugin support (but not required to have installed)
- Includes rotary axis orientation of XA, YA, and YB, see the pp prologue to set as needed.
- Torch Probe TouchOff cycle (but not required)
- Arc As (G01) Moves sheetcam option
- pp debug tracing example
- reset of Custom Option values to default definitions
The RotaryPlasma plugin helper is conditionally loaded only if the plugin is installed/enabled, thus typical editing of the pp to remove the loading of the rotaryHelper is not required.
SC pp example w Custom Options v2-0.zip (37.8 KB)
2 Likes
well that didn’t take long, I found a bug while doing more testing.
I intended for the ‘First pierce +/- delay’ to be positive or negative value, but used the unitTIME datatype which does not allow negative values. oh well, changed it to unit2DECPLACE datatype to fix.
SC pp example w Custom Options v2-1.scpost (17.1 KB)
1 Like
BIG NEWS!
With a lot of help from @Les_Newell , sheetcam now has a G93 Inverse Time Feedrate Mode that is implemented in a post processor ! This means anyone experiencing the pesky feedrate inaccuracy on rotary jobs, G93 feedrate mode is the the universally understood feedrate mode in all controllers that support G93. Most do, for this very reason.
The problem, if you haven’t experienced it, is that coordinated linear (XYorZ) and angular (ABorC) motion feedrate can be interpreted in least 3 different units per min by a controller when gcode is operating in G94 distance/time feedrate mode, usually the default. Coordinated motion is what occurs when more than 1 axis is in motion simultaneously. The axes will ‘coordinate’ speed such that the control point (cutting bit) starts and ends with all axes in motion that are named in the gcode line (motion block). Since angular (rotary axes) are usually configured in degrees per min, and linear axes in mm per min, then what speed is F100 in this gcode line G01 X10 A5 F100 ?
The NIST spec for gcode interpreter states that in linear-angular motion blocks the feedrate is to be interpreted as linear, when in G94 distance/time feedrate mode. Not surprisingly, the LinuxCNC doc states the same. Not all controllers abide by the spec though. Sheetcam was designed and built perhaps before this spec was adopted by NIST, I’m not sure. Sheetcam and Mach 3/4 are aligned. Sheetcam and various grbl interpreters are not. Others I can’t say, there is a 1 in 3 chance.
The fix: use G93 Inverse Time Feedrate mode. Not all CAM sw has the option to produce gcode in G93 feedrate. Sheetcam does NOW with post processor custom code performing some clever math mojo, very specific to how Sheetcam calculates the G94 feedrate of linear-angular motion, not all CAMs do it that way either. The good news is that G93 mode makes right or wrong per a spec irrelevant, so we don’t need to go there.
The pp attached here implements rotary motion with the option to use G93 feedrate mode. The code to implement G93 is not scattered, see the function WriteFeed() and the few places it is used and supporting variables, you should be able to lift and drop into your pp if need be. I’m going to open a linked thread about G93 feedrate mode if you have questions, would rather not clutter up this thread as it will continue to have new versions of the pp for example and template use purposes.
SC pp example w Custom Options v3-1.scpost (20.3 KB)
More testing on the G93 Inverse Time Feedrate mode revealed some cases of invalid gcode when G01, 02, or 03 were posted without further motion block definition, similarly when Fnnn was posted alone. The fix unfortunately was split between two functions, PostGXYZA() and WriteFeed(). That merely means the G93 pp solution is not as compact as it was originally, but it’s still fairly compact and hopefully readable for easy lift and place into your favorite rotary pp.
I’m adding a test case job for easy testing of the correct G94 feedrate in linear-angular motion on your controller. The multiple 50mm lines should ‘cut’ in 3 seconds each, the 25mm lines in 1.5secs. You can compare G94 controller runtime results with G93 if in doubt.
sc rotary test case.job (17.5 KB)
SC pp example w Custom Options v3-3.scpost (21.6 KB)
update: v3.7
This job and taps are of round pipe. The taps when run on a grbl CNC XYZA machine demo the G94 problem quite nicely. Layer_0 lines cut in correct speed and time, 3 seconds for 50mm lines, 12 seconds for 200mm lines. Layer_2 lines traverse well under 3 seconds, fast the closer the line angles get to 0 degrees. Layer_3 lines are proportionally much faster than 12 seconds also, quicker the closer the line angle is to 0 deg (vertical).
By contrast, the G93 tap runs with the same lines and all in correct timings, and speed.
sc rotary test case round pipe.job (23.4 KB)
sc rotary test case round pipe G93.tap (4.4 KB)
sc rotary test case round pipe G94.tap (4.4 KB)
update: V4.0
- many new functions and some new options.
- I have more testing to do, many variations now. Please report errors in this thread. Thanks.
-
" * Optional use of RotaryPlasma plugin without need to edit this pp. \n"..
" * Optional Rotary Z zero at surface of cylinder or max radius of rectangles/I-Beams.\n"..
" * G93 Inverse Time Feedrate mode as option.\n"..
" * Marker Tool support for flat sheet and rotary.\n"..
" * First pierce delay adjustment +/-. \n"..
" * Torch Probe switch offset for floating torch mounts.\n"..
" * Torch Probe Cycle proximity distance to last probe cycle.\n"..
" * Plasma Drill/Peck center point with custom Operation params for minimal peck.\n"..
" * Cut arcs as G01 line segments instead of true arcs G02/03, sheetcam ArcAsMoves().\n"..
" * Air Supply runtime timer/pause to allow for undercapacity systems to catchup on PSI.\n"..
" * THC dynamic ON/OFF support.\n"..
" * Z Re-Home cut counter for autonomous THCs that induce Z error/cut.\n"..
" * Pause at new Part, to remove finished Part from table.\n"..
" * Bench testing mode, run on controller w/o physical CNC machine.\n"..
" * Custom Tool param for THC Voltage spec.\n"..
" * Custom params for Marker Tools, for plunge safety height and slow plunge feedrate.\n"
sc rotary test case round pipe.job (25.2 KB)
sc rotary test case round pipe.tap (15.5 KB)
sc rotary test case rectangle pipe.tap (116.4 KB)
SC pp example w Custom Options v4-0.scpost (37.1 KB)
update: V5.1
- fixed several bugs after more rotary testing, including cases of YA or YB configurations.
- fixed torch probe proximity condition when rotary.
- changed the plasma drill pecking params, hopefully simpler.
- added separate WCS for Marker Tool uses, G55 unless edited in pp OnInit()
sc rotary test case round pipe.job (25.3 KB)
sc rotary test case round pipe.tap (16.2 KB)
SC pp example w Custom Options v5-1.scpost (40.2 KB)
update: v5.2
- minor code consistency changes and improved comments; added ppChkThcWarning(); fixed currentZ in OnRapid()
SC pp example w Custom Options v5-2.scpost (41.4 KB)
adding a couple of CNC table diagrams w added rotary axis, showing physical orientation of rotary (and chuck) with XY axes. A recent question in another thread prompted me to make the diagram, but it applies to the this pp given the rotary YB (or YA) gcode it can produce will match this YB diagram. Good to know when setting up the rotary chuck on the XY table.
update: v5.3,
- renamed boolean vars, change ModalText() to Text() to allow use of G01 in Path Rules, minor bug fixes
- fixed OnDrill(), via correct currentX and Y when rotaryPlasma plugin is disabled.
- another fix to ‘Set PP Variables’ operation for sheetcam v7.0.21
- added ppIsAlwaysShowCustomOptions
- increased vars in DoTorchProbeCycle(), buf 7 to 20, nearZ0 2 to 5
- error handling improvements and consistency
- easy to disable machine pauses with nil cmd value
- adjusted plasma drill peck defaults
update v5.17,
- fixed syntax error on line 14 since v5.3, sorry.
SC pp example w Custom Options v5-17.scpost (45.8 KB)