Skip to content

Commit 5463047

Browse files
committed
1.0.26 property group ordering and Z check options
1 parent b335768 commit 5463047

File tree

1 file changed

+81
-79
lines changed

1 file changed

+81
-79
lines changed

OpenbuildsFusion360PostGrbl.cps

+81-79
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ Changelog
3737
16 Jan 2021 - V1.0.23 : Remove end of file marker '%' from end of output, arcs smaller than toolRadius will be linearized
3838
25 Jan 2021 - V1.0.24 : Improve coolant codes
3939
26 Jan 2021 - V1.0.25 : Plasma pierce height, and probe
40+
29 Aug 2021 - V1.0.26 : Regroup properties for display, Z height check options
4041
*/
41-
obversion = 'V1.0.25';
42+
obversion = 'V1.0.26';
4243
description = "OpenBuilds CNC : GRBL/BlackBox"; // cannot have brackets in comments
4344
vendor = "OpenBuilds";
4445
vendorUrl = "https://openbuilds.com";
@@ -74,11 +75,6 @@ properties =
7475
machineHomeX : -10, // always in millimeters
7576
machineHomeY : -10,
7677
gotoMCSatend : false, // true will do G53 G0 x{machinehomeX} y{machinehomeY}, false will do G0 x{machinehomeX} y{machinehomeY} at end of program
77-
_Section2: "******", // used to break up properties into sections for clarity
78-
_Section3: "******", // used to break up properties into sections for clarity
79-
_Section4: "******", // used to break up properties into sections for clarity
80-
_Section5: "******", // used to break up properties into sections for clarity - laser options
81-
_Section6: "******", // used to break up properties into sections for clarity
8278
PowerVaporise : 100, // cutting power in percent
8379
PowerThrough : 50,
8480
PowerEtch : 2,
@@ -91,21 +87,18 @@ properties =
9187
machineVendor : "OpenBuilds",
9288
machineModel : "Generic",
9389
machineControl : "Grbl 1.1 / BlackBox",
90+
91+
checkZ : false, // true for a PS tool height checkmove at start of every file
92+
checkFeed : 200 // always MM/min
9493
};
9594

9695
// user-defined property definitions - note, do not skip any group numbers
9796
propertyDefinitions = {
98-
_Section2: {
99-
title:"--- SPINDLE INFO ---",
100-
description:"Informational only. Not used for any computation.",
101-
type:"string",
102-
group: 2
103-
},
10497
routerType: {
105-
title: "Spindle/Router type",
98+
group: 1,
99+
title: "SPINDLE: Spindle/Router type",
106100
description: "Select the type of spindle you have.",
107101
type: "enum",
108-
group: 2,
109102
values:[
110103
{title:"Other", id:"other"},
111104
{title:"Router11", id:"Router11"},
@@ -114,103 +107,98 @@ propertyDefinitions = {
114107
]
115108
},
116109
spindleTwoDirections: {
117-
title: "Spindle can rotate clockwise and counterclockwise?",
110+
group: 1,
111+
title: "SPINDLE: Spindle can rotate clockwise and counterclockwise?",
118112
description: "Yes : spindle can rotate clockwise and counterclockwise, will send M3 and M4. No : spindle can only go clockwise, will only send M3",
119113
type: "boolean",
120-
group: 2
121114
},
122115
spindleOnOffDelay: {
123-
title: "Spindle on/off delay",
116+
group: 1,
117+
title: "SPINDLE: Spindle on/off delay",
124118
description: "Time (in seconds) the spindle needs to get up to speed or stop, also used for plasma pierce delay",
125119
type: "number",
126-
group: 2
127120
},
128121
hasCoolant: {
129-
title: "Has coolant?",
122+
group: 1,
123+
title: "SPINDLE: Has coolant?",
130124
description: "Yes: machine uses the coolant output, M8 M9 will be sent. No : coolant output not connected, so no M8 M9 will be sent",
131125
type: "boolean",
132-
group: 3
133126
},
134-
_Section3: {
135-
title:"--- TOOL CHANGE HANDLING ---",
136-
description:"Informational only. Not used for any computation.",
137-
type:"string",
138-
group: 4
139-
},
127+
checkFeed: {
128+
group: 2,
129+
title: "SAFETY: Check tool feedrate",
130+
description: "Feedrate to be used for the tool length check, always millimeters.",
131+
type: "spatial",
132+
},
133+
checkZ: {
134+
group: 2,
135+
title: "SAFETY: Check tool Z length?",
136+
description: "Insert a safe move and program pause M0 to check for tool length, tool will lower to clearanceHeight set in the Heights tab.",
137+
type: "boolean",
138+
},
139+
140140
generateMultiple: {
141-
title:"Generate muliple files for tool changes?",
141+
group: 3,
142+
title:"TOOLCHANGE: Generate muliple files for tool changes?",
142143
description: "Generate multiple files. One for each tool change.",
143144
type:"boolean",
144-
group: 4
145145
},
146-
_Section4: {
147-
title:"--- END OF JOB COORDINATES ---",
148-
description:"Informational only. Not used for any computation.",
149-
type:"string",
150-
group: 5
151-
},
146+
147+
152148
gotoMCSatend: {
153-
title:"Use Machine Coordinates (G53) at end of job?",
149+
group: 4,
150+
title:"JOBEND: Use Machine Coordinates (G53) at end of job?",
154151
description: "Yes will do G53 G0 x{machinehomeX} y(machinehomeY) (Machine Coordinates), No will do G0 x(machinehomeX) y(machinehomeY) (Work Coordinates) at end of program",
155152
type:"boolean",
156-
group: 5
157153
},
158154
machineHomeX: {
159-
title:"End of job X position (MM).",
155+
group: 4,
156+
title:"JOBEND: End of job X position (MM).",
160157
description: "(G53 or G54) X position to move to in Millimeters",
161158
type:"spatial",
162-
group: 6
163159
},
164160
machineHomeY: {
165-
title:"End of job Y position (MM).",
161+
group: 4,
162+
title:"JOBEND: End of job Y position (MM).",
166163
description: "(G53 or G54) Y position to move to in Millimeters.",
167164
type:"spatial",
168-
group: 6
169165
},
170166
machineHomeZ: {
171-
title:"End of job Z position (MCS Only) (MM)",
172-
description: "G53 Z position to move to in Millimeters, normally negative.",
167+
group: 4,
168+
title:"JOBEND: START and End of job Z position (MCS Only) (MM)",
169+
description: "G53 Z position to move to in Millimeters, normally negative. Moves to this distance below Z home.",
173170
type:"spatial",
174-
group: 6
175171
},
172+
173+
176174
linearizeSmallArcs: {
177-
title:"Linearize Small Arcs",
178-
description: "Arcs with radius < toolRadius can have mismatched radii, set this to Yes to linearize them.",
175+
group: 5,
176+
title:"ARCS: Linearize Small Arcs",
177+
description: "Arcs with radius < toolRadius can have mismatched radii, set this to Yes to linearize them. This solves G2/G3 radius mismatch errors.",
179178
type:"boolean",
180-
group: 6
181179
},
182180
183-
_Section5: {title:"--- LASER/PLASMA CUTTING OPTIONS ---", description:"Informational only. Not used for any computation.", type:"string", group: 7},
184-
PowerVaporise: {title:"Power for Vaporizing", description:"Scary power VAPORIZE power setting, in percent.", group:8, type:"integer"},
185-
PowerThrough: {title:"Power for Through Cutting", description:"Normal Through cutting power, in percent.", group:8, type:"integer"},
186-
PowerEtch: {title:"Power for Etching", description:"Just enough power to Etch the surface, in percent.", group:8, type:"integer"},
187-
UseZ: {title:"Use Z motions at start and end.", description:"Use True if you have a laser on a router with Z motion, or a PLASMA cutter.", group:8, type:"boolean"},
188-
plasma_usetouchoff: {title:"Use Z touchoff probe routine", description:"Set to true if have a touchoff probe for Plasma.", group:8, type:"boolean"},
189-
plasma_touchoffOffset:{title:"Plasma touch probe offset", description:"Offset in Z at which the probe triggers, always Millimeters, always positive.", group:8, type:"spatial"},
190-
191-
_Section6: {
192-
title:"--- MACHINE INFO ---",
193-
description:"Informational only. Not used for any computation.",
194-
type:"string",
195-
group: 9
196-
},
181+
PowerVaporise: {title:"LASER: Power for Vaporizing", description:"Scary power VAPORIZE power setting, in percent.", group:6, type:"integer"},
182+
PowerThrough: {title:"LASER: Power for Through Cutting", description:"Normal Through cutting power, in percent.", group:6, type:"integer"},
183+
PowerEtch: {title:"LASER: Power for Etching", description:"Just enough power to Etch the surface, in percent.", group:6, type:"integer"},
184+
UseZ: {title:"LASER: Use Z motions at start and end.", description:"Use True if you have a laser on a router with Z motion, or a PLASMA cutter.", group:6, type:"boolean"},
185+
plasma_usetouchoff: {title:"PLASMA: Use Z touchoff probe routine", description:"Set to true if have a touchoff probe for Plasma.", group:6, type:"boolean"},
186+
plasma_touchoffOffset:{title:"PLASMA: Plasma touch probe offset", description:"Offset in Z at which the probe triggers, always Millimeters, always positive.", group:6, type:"spatial"},
187+
197188
machineVendor: {
198189
title:"Machine Vendor",
199190
description: "Machine vendor defined here will be displayed in header if machine config not set.",
200191
type:"string",
201-
group: 9
202192
},
203193
machineModel: {
204194
title:"Machine Model",
205195
description: "Machine model defined here will be displayed in header if machine config not set.",
206196
type:"string",
207-
group: 9
208197
},
209198
machineControl: {
210199
title:"Machine Control",
211200
description: "Machine control defined here will be displayed in header if machine config not set.",
212201
type:"string",
213-
group: 9
214202
}
215203
};
216204
@@ -219,7 +207,7 @@ plasma_probedistance = 30; // distance to probe down in Z, always in millimete
219207
plasma_proberate = 100; // feedrate for probing, in mm/minute
220208
// END OF USER ADJUSTMENTS
221209
222-
var debug = true;
210+
var debug = false;
223211
// creation of all kinds of G-code formats - controls the amount of decimals used in the generated G-Code
224212
var gFormat = createFormat({prefix:"G", decimals:0});
225213
var mFormat = createFormat({prefix:"M", decimals:0});
@@ -271,6 +259,7 @@ var workOffset = 0;
271259
var haveRapid = false; // assume no rapid moves
272260
var powerOn = false; // is the laser power on? used for laser when haveRapid=false
273261
var retractHeight = 1; // will be set by onParameter and used in onLinear to detect rapids
262+
var clearanceHeight = 10; // will be set by onParameter
274263
var topHeight = 1; // set by onParameter
275264
var leadinRate = 314; // set by onParameter: the lead-in feedrate,plasma
276265
var linmove = 1; // linear move mode
@@ -913,6 +902,16 @@ function onSection()
913902
f = "";
914903
writeBlock(gAbsIncModal.format(90), gMotionModal.format(0), xOutput.format(initialPosition.x), yOutput.format(initialPosition.y), f);
915904
905+
if ( (isNewfile || isFirstSection()) && properties.checkZ && (properties.checkFeed > 0) )
906+
{
907+
// do a Peter Stanton style Z seek and stop for a height check
908+
z = zOutput.format(clearanceHeight);
909+
f = feedOutput.format(toPreciseUnit(properties.checkFeed,MM));
910+
writeComment("Tool height check");
911+
writeBlock(gMotionModal.format(1), z, f );
912+
writeBlock(mOutput.format(0));
913+
}
914+
916915
// If the machine has coolant, write M8/M7 or M9
917916
if (properties.hasCoolant)
918917
{
@@ -1270,26 +1269,29 @@ function onCommand(command)
12701269
function onParameter(name, value)
12711270
{
12721271
// writeComment("onParameter =" + name + "= " + value); // (onParameter =operation:retractHeight value= :5)
1273-
if ( (name.indexOf("retractHeight") >= 0) && (name.indexOf("value") >= 0 ) ) // == "operation:retractHeight value")
1272+
name = name.replace(" ","_"); // dratted indexOF cannot have spaces in it!
1273+
if ( (name.indexOf("retractHeight_value") >= 0 ) ) // == "operation:retractHeight value")
12741274
{
12751275
retractHeight = value;
1276-
//writeComment("OPERATION " + name +":"+value);
1276+
if (debug) writeComment("retractHeight = "+retractHeight);
12771277
}
1278-
if (name.indexOf("movement") !== -1)
1278+
if (name.indexOf("operation:clearanceHeight_value") >= 0)
12791279
{
1280-
name = name.replace(" ","_"); // dratted indexOF cannot have spaces in it!
1281-
if (name.indexOf("lead_in") !== -1)
1282-
{
1283-
leadinRate = value;
1284-
if (debug && isPlasma) writeComment("leadinRate set " + leadinRate);
1285-
}
1280+
clearanceHeight = value;
1281+
if (debug) writeComment("clearanceHeight = "+clearanceHeight);
1282+
}
1283+
1284+
if (name.indexOf("movement:lead_in") !== -1)
1285+
{
1286+
leadinRate = value;
1287+
if (debug && isPlasma) writeComment("leadinRate set " + leadinRate);
1288+
}
1289+
1290+
if (name.indexOf("operation:topHeight_value") >= 0)
1291+
{
1292+
topHeight = value;
1293+
if (debug && isPlasma) writeComment("topHeight set " + topHeight);
12861294
}
1287-
if (name.indexOf("topHeight") > 0)
1288-
if (name.indexOf("value") > 0)
1289-
{
1290-
topHeight = value;
1291-
if (debug && isPlasma) writeComment("topHeight set " + topHeight);
1292-
}
12931295
// (onParameter =operation:pierceClearance= 1.5) for plasma
12941296
if (name == 'operation:pierceClearance')
12951297
plasma_pierceHeight = value;

0 commit comments

Comments
 (0)