I have made a macro (only after I found out I couldn't do it solely with gcode) to create some gcode, and have an issue with stuttering that I am wondering if anyone could shed some light on.
First background info...
I am trying to create a helical toolpath so that I can quickly change parameters for different situations. I have it coded to the macro to: (starting from the bottom of the cut) make a vertical move, helix around at a desired pitch and radius until I reach a certain z height, then exit the cut vertically. This then repeats after increasing the cut radius by a small stepover. So far I have gotten this all to work.
My issue is that when executing the macro, the machine moves like it is in absolute stop (G61) mode rather than constant velocity. I am guessing the issue is due to the way the code is calculated for each step, but am unsure if it is due to my code, or if this is a limitation of mach3. When the angle increment is set to a low value motion slows to a crawl.
Here is the snippit of code that I am having an issue with:
(I made the program in polar coordinates (G16), so Y is equivalent to angle)
Do 'Begin helical interpolation
CURRENT_Z_HEIGHT = (CURRENT_Z_HEIGHT +(PITCH * ANGLE_INCREMENT / 360)) 'increment height for this move
CURRENT_ANGLE = (CURRENT_ANGLE + ANGLE_INCREMENT) 'increment angle for this move
CODE "G1 Y" & CURRENT_ANGLE & "Z" & CURRENT_Z_HEIGHT
If CURRENT_Z_HEIGHT >= (TOTAL_HEIGHT - FLAT_LENGTH) THEN 'stop at top of helix
Exit Do
Else
End If
Loop
This portion executes then is looped back up to the top after incrementing the cut radius. So essentially I am trying to program a loop in a loop. Maybe there is a method to do this entriely in a gcode file, but so far it has eluded me.
Any suggestions, insight, or alternative methods would be appreciated.