That's really neat Ray.....THANKS.
Consider using a BP J head w/no VFD.
In the event that there IS a pulley change required but using the same tool....as in roughing then finishing, what would be in your program to stop for the pulley change ? Would that be part of the PP ?
Basically, any time the commanded speed is <> current pulley min/max, M1 or something ? ? ?
Thanks
(got a servo and drive for my knee, following you on that too)
Here's a section of one of my programs:
(Filename: Motor Shield Plate.tng)
(Post processor: My Mach2 Post 091221.scpost)
(Date: 12/21/2009)
G20 (Units: Inches)
G40 G90
F10
(Part: Motor Shield Plate)
()
(Process: Drill, Motor Shield Plate Bolt Holes, T505: #4 Center Drill [5/16 x 1/8 x 1/8] [0.31250], 0.25 in Deep)
G00 Z1.5000
M06 T1 (#4 Center Drill [5/16 x 1/8 x 1/8] [0.31250])
M843 P1
G00 Z1.5000
M00 ( Pulley: 4 Motor: L )
M966 P4
M03 S3423 (Spindle CW 3423 RPM)
(Drill: Dia=0.3125, Start=-0.0000, Depth=-0.2500, Peck=0.3125)
G00 X-1.3700 Y1.3700
G00 Z0.0200
G01 Z-0.2500 F6.064 S3423
....
The way I generate this is rather round-about, and involves a customized SheetCAM POST to generate a G-code file, which is then processed by a custom Perl program that post-processes that file, and outputs another one that actually runs on the mill. The whole process is a bit complex, and was a PITA to create, but once I got it working, it's been trouble-free, and does create much better G-code for my machine.
My SheetCAM post outputs a fairly generic G-code file that knows nothing the characteristics of the machine. I parse that file with the Perl program, extracting a lot of information about spindle speeds, tool numbers, etc that are used. It does this based on constraints on things like min/max allowable VFD frequency in each motor speed range (I allow 120Hz in low speed, but only 90HZ in high speed), and minimizing the amount of manual intervention required to run the program on the machine. Among other things, I look at the sequence of spindle speeds required throughout the program, and determine the optimum sequence of pulleys, motor speed ranges and VFD frequencies to use, to minimize the number of pulley changes, since pulley changes are a PITA, and time-consuming. VFD frequency is controlled my Mach3, to that comes basically "free". Pulley and motor speed range changes require stopping the spindle, and manually flipping a switch or changing the belt. So, when either a pulley change or motor speed change is required, I insert G-code to stop the spindle, turn off coolant, and prompt the user to do whatever needs to be done. You can see this in the line "M00 ( Pulley: 4 Motor: L )", which tells me to put the belt on the highest speed pulley, and flip the motor to the low speed range. After the user hits Cycle start, the spindle and coolant are restored to their previous state, and the program continues on.
You can see the use of my M966 macro, right after the M00 line prompting me to change the pulley, to tell Mach which pulley is now active.
The "M843 Px" is my "pseudo-G43" to enable tool-length compensation with the knee. I also have "M849" to take the place of G49 to turn off tool length comp. I can't use G43, because Mach3 does not provide the necessary hooks to use the knee in this way. This will be fixed in v4, and I'll be able to use G43. For now, this kludge gets the job done, but it is a PITA.
Regards,
Ray L.