Nope there was just a G76 stuck in there. Tormach generates a G76 block in the 'conversational mode' on their GUI for the controller software. It looks like G33 is simply spindle sync and would be the hard way to do threading, whereas G76 handles depth regression, spring passes, compound slide angle, etc. Tormach uses a G33.1 for tapping.
Here's the one I'm working on (forgive the clunky code, I'm not javascript savy ); I haven't got internal threading or taper threading yet. I can't give you 'calcThreadPasses', cause it's not mine, but a SlantPROer 'could' just get the 'J' value off the conversational threading window.
function writeX(_x) {
if ( properties.using_QCTP || properties.using_GangTooling )
_x = -_x;
return xOutput.format(_x);
}
function onCyclePoint(x, y, z) {
switch (cycleType) {
case "thread-turning":
if ( alreadyInThreadingCycle ) {
return;
}
alreadyInThreadingCycle = true;
var pos = currentSection.getFirstPosition( );
if ( pos ) {
writeln( writeX( pos.x ) );
writeln( zOutput.format( pos.z ) );
}
var external = getParameter("operation-comment") == "External Thread" ? true : false;
var r = -cycle.incrementalX; // positive if taper goes down - delta radius
var threadsPerInch = 1.0/cycle.pitch; // per mm for metric
var p = 1/threadsPerInch;
var driveLine = external ? getParameter("operation:outerClearance_value") :
getParameter("operation:innerClearance_value");
var threadCrest = external ? getParameter("operation:outerRadius_value") :
getParameter("operation:innerRadius_value");
var threadDepth = getParameter("operation:threadDepth");
var numPasses = getParameter("operation:numberOfStepdowns");
var iVal = ( driveLine - threadCrest ) * 2;
var rootLine = ( threadCrest - threadDepth ) * 2;
var jVal = calcThreadPasses( iVal,
threadCrest * 2,
rootLine,
numPasses);
var rVal = getParameter("operation:infeedMode") == "constant" ? 1 : 2;
var qVal = getParameter("operation:infeedAngle");
var hVal = getParameter("operation:nullPass");
writeBlock( gMotionModal.format(76),
pOutput.format(p),
zOutput.format(z),
iThreadOutput.format( iVal ),
jThreadOutput.format( jVal ),
kThreadOutput.format( threadDepth * 2 ),
rThreadOutput.format( rVal ),
qThreadOutput.format( qVal ),
hVal > 0 ? hThreadOutput.format( hVal ) : "" );
return;
case "drilling":
case "counter-boring":
case "chip-breaking":
case "deep-drilling":
case "reaming":
expandCyclePoint(x, y, z);
return;
case "tapping":
var threadsPerInch = getParameter("operation:tool_threadPitch"); // per mm for metric
writeBlock( gMotionModal.format(33.1),
zOutput.format(z),
kThreadOutput.format( threadsPerInch ) );
return;
}
}