Below is a short program typical of the code I run, with comments added to indicate where I would like to turn the Z axis oscillation on and off.
Can a Mach3 brain be used to generate motor movements?
To user Hood: my Z axis is a pretty standard affair, it has a stepper motor that turns a lead screw. I can't get that to move with an analog oscillator driving a solenoid. I suppose I could design a digital circuit that, when triggered, disconnects the Z axis stepper pulse and direction inputs from the Mach3 PC and connects them instead to an independent pulse/direction generator that creates the oscillation. This seems like way too much work to me compared to any purely software solution however.
N0000 (Filename: Test Code.tap)
N0010 (Post processor: Mach3.scpost)
N0020 (Date: 20/09/2011)
N0030 G20 (Units: Inches)
N0040 G40 G90 G91.1
N0050 F1
N0060 (Part: Test Code)
N0070 (Operation: Outside Offset, 0, T12: Mill/router, 0.125 in diameter, 0.125 in Deep)
N0080 S10000 G00 Z1.0000
N0090 (Mill/router, 0.125 in diameter)
N0100 T12 M06 G43 H12
N0110 M08 (Flood coolant on)
N0120 S10000 M03
N0130 G00 X1.4240 Y0.4593
N0140 Z0.2000
N0150 G01 Z-0.125 F1
(TURN ON Z OSCILLATION HERE)
N0160 G03 X1.4568 Y0.4787 Z-0.1250 I-0.0000 J0.0375 F3.0
N0170 G02 X1.5990 Y0.5625 I0.1422 J-0.0787
N0180 G01 X1.9000 Z-0.125 F3
N0190 G02 X2.0625 Y0.4000 Z-0.1250 I0.0000 J-0.1625 F3.0
N0200 G01 Y0.1000 Z-0.125 F3
N0210 G02 X1.9000 Y-0.0625 Z-0.1250 I-0.1625 J0.0000 F3.0
N0220 G01 X0.1000 Z-0.125 F3
N0230 G02 X-0.0625 Y0.1000 Z-0.1250 I0.0000 J0.1625 F3.0
N0240 G01 Y0.4000 Z-0.125 F3
N0250 G02 X0.1000 Y0.5625 Z-0.1250 I0.1625 J0.0000 F3.0
N0260 G01 X0.3990 Z-0.125 F3
N0270 G02 X0.5412 Y0.4787 Z-0.1250 I-0.0000 J-0.1625 F3.0
N0280 G03 X0.6068 Y0.4787 I0.0328 J0.0182
N0290 G02 X0.7490 Y0.5625 I0.1422 J-0.0787
N0300 G01 X1.2490 Z-0.125 F3
N0310 G02 X1.3912 Y0.4787 Z-0.1250 I0.0000 J-0.1625 F3.0
N0320 G03 X1.4240 Y0.4593 I0.0328 J0.0182
(TURN OFF Z OSCILLATION HERE)
N0330 G00 Z1.0000
N0340 X0.0000 Y0.0000
N0350 M09 (Coolant off)
N0360 M05
N0370 M05 M30