Master CNC Utilities
 
by Alan J Munday
 
   This is a suite of utilities for Model Engineers. It is of use to 
those with 3-axis CNC control of a milling machine. The program runs on a 
PC running Microsoft Windows and uses 6 output pins in the printer port 
to control the machine's 3 stepper motors.
   Those without an appropriate machine can still run the program to 
see some of the things of which CNC control is capable.
   A graphical display shows a drawing of the component to be machined, 
and shows the X, Y and Z motions of the tool around the component.
 
 
VERSION 12.2, FOR WINDOWS
November 2005
 
1. INSTALLATION:-
 
The program is self un-zipping and installing by clicking on the 
downloaded exe file.
 
The previous version should be removed before installing the new 
version.
 
Use the default installation directory.
 
The program has been run by the author on computers with Win 98 SE, Win 
ME, and Win XP Home. It will NOT run under Windows 95 or Windows 3.1, 
or DOS, or other operating systems.
 
2. HISTORY:- 
 
Version 1 was a DOS program. It was written in Borland Turbo C++ in 
July 1998 and uploaded to Compucutter's Forum in October 2001. It is still 
available there.
 
Version 2 was the 1st Windows version. It was written in Microsoft 
Visual Basic 6 in September 2003.
 
Version 3 included the Aerofoil Utility which had also been a DOS 
program.
 
Version 4 had the Circlip and Flat Spring utilities added, and the 
Wheel utility improved.
 
Version 5 had the 'Tool Radius Compensation' and 'Spherical Milling' 
Utilities added. Additional options have been added to some Utilities.
 
Version 6 had the 'Engrave Text', 'Engrave Graduations', 'Engrave 
Numerals for Graduations', and 'XY or Radial Position, Diagonal and Arc' 
Utilities added.
 
Version 7 had the additional utility 'Change order of cutting in a HPGL 
file', and the Tool Radius Compensation Utility can now output to a 
file. Version 7.1 had 'Output to File' added to 'Cut an Aerofoil Shape'. 
Version 7.1.1 had some improvements to the operation of the 'tool radius 
compensation' utility. Version 7.2 had the option of IV or IIII for the 
numeral 4 engraved on a 'Roman Numeral Clockface', AND another HPGL 
file utility for speeding-up engraving.
 
Version 8 had a change to the spherical cutting utility. The fine cut 
is now a continuous spherical spiral. A 3D cutting utility was added. 
The HPGL optimise utility was extended to include the PA command. The 
windows were rearranged on screen. Version 8.1 had a Pause/Continue 
control added, and errors corrected in the clock face engraving utility. 
 
Version 9 had FIVE new utilities added. A radial spline utility for 
fixing discs on shafts, which can also be used for shaping knobs. A 
utility for making 'C' spanners. A utility for making a jig for use when 
truing lathe chuck jaws. A utility for cutting triangular holes and 
recesses. A utility for making girders. The menu page was reorganised to group 
utilities with something in common for easier selection now that there 
are so many. Version 9.1.0 had more commands added to the 3D cutting 
utility, and section 11 added to this text.
 
Version 10 had 3 new utilities. A utility for making 'radial flow' 
bladed fans, turbines, pumps, diffusers, etc. Utilities for reading, 
drawing and cutting from 2D and 3D DXF and G-code files. A message facility 
had been added to the XYZ cutting utility. Utilities that read files had 
been altered to show the filename in the heading, and repeat cuts made 
easier.
 
Version 11 had two new utilities; for cutting hexagon bolt heads, and 
for engraving decorative text. The DXF utility  handles DXF command 
LWPOLYLINE.
 
Version 11.1 had revisions to the spotface, spherical cutting, DXF 
utilities, and screen layout. The spherical cutting utility had been 
extended to allow the cutting of parabolic reflectors. The DXF utility no 
longer supports 3D, but provides better support to engraver files. The 
program was rearranged for a 800 X 600 screen resolution instead of 640 X 
480.
 
Version 12 comes as a self extracting and installing exe file.
Most utilities now have a 'Return to Start' button. This 'escapes' from 
the cutting process by raising the tool and returning to the starting 
position without leaving the utility. Useful when you got the setup 
wrong.
There was one new utility. 'Tool Path Design' is a very simple CAD/CAM 
utility which could be enough for avoiding CAD usage for many jobs. The 
XYZ cutting utility was been extended to include arc cutting.
 
Version 12.1 included:- (1) A hidden routine to initialised the output 
port, hoping to solve the problem a few users had with their computers. 
(2) The first initialisation of the backlash compensation done 
automatically. (3) An 'Auto Power Down' control was added. When ticked, the 
power is automatically removed from the stepper motors when cutting is 
'finished', or on quitting the utility. Re-powering is automatic. [NB: 
This has only been tested with one Compucut Interface]. (4) A backlash 
compensation re-initialisation button was added to the Show screen. (5) 
The controls on the Show screen had 'bubble help' messages added. (6) 
The utilities 'Drill a Rectangular Grid of Holes', 'Drill Holes on a PCD 
','2D and 3D Cutting from a G-code file', 'Tool Path Design', and 'XYZ 
cutting.....' were given a Peck Drill Cycle option.
 
Version 12.2 has a Draw command added to the 2D HPGL utility.
 
3. This program is free of both charges to me and guarantees from me!
 
If using these utilities puts you in a generous mood, please send a 
donation to the author's favourite charity.
 
    RedR - Engineers for Disaster Relief
       1 Great George Street
         London
           SW1P 3AA
             England
 
Or your country's equivalent.
 
4. TO EVALUATE the program without cutting metal, use the supplied 
DATA.DAT file in the Master CNC Utilities directory. To make the emulation 
run faster, increase the value of steps/sec in the DATA.DAT file, 
and/or, reduce the component dimensions from their default values.
 
5. CONNECTIONS. If your CNC machine does not have Mr Bartlett's 
Compucut Interface it may still be possible to use this program by making a 
special 'printer' cable, or by using a 'breakout box'.
Printer Port pin usage is:-
OUTPUTS:
pin 4= X direction, pin 5= X clock,
pin 6= Y direction, pin 7= Y clock,
pin 8= Z direction, pin 9= Z clock.
Only the Compucut interface should connect to pins 2 and 3. 
INPUTS:
The program responds to the total change in input, not to pins 
individually, so any of the input pins 10, 11, 12, 13 can be used for X, Y, Z 
end-stops and an Emergency Stop Switch.
Consequently, DO NOT HAVE ANY STOP SWITCHES ENGAGED WHEN YOU START THE 
PROGRAM.
NB: LPT1 uses address 888 (Hex 378). LPT2 uses address 632 (Hex 278).
 
6. CAUTION. I have not tested all possible combinations of data and 
utility, so I strongly recommend a dummy run for your setup without the 
tool near the workpiece.
   CAUTION: Do not use the Pause control when traversing or cutting a 
high speeds. This may cause the stepper motors to skip steps.
 
8. ACCURACY. Note that the program cannot by itself control the 
accuracy of the machined component. That will depend upon the following:-
   The accuracy of the tool's dimensions, its sharpness, your choice of 
cutter speed, feedrate and cutting and cooling fluid. The tool holder 
stiffness, the machine stiffness, the stiffness and backlash in the axis 
drive mechanisms, and the stepper motor's power being sufficient to 
avoid missing steps.
   The difference between CNC and manual machining is that in manual 
machining you measure the component and so are able correct for the above 
problems. 
 
9. A LITTLE ABOUT THE AUTHOR. He served an apprenticeship as an 
Aeronautical and Automobile Engineer with Armstrong Siddeley Motors of 
Coventry in England from 1956 to 1961. During that time he wrote his 1st 
computer program, in Autocode, for a Ferranti computer.
   Most of Master CNC utilities were first developed as 'BBC Basic for 
Windows' programs, (see www.rtrussell.co.uk)which provides a most 
comfortable and speedy development environment for the mathematics, 
graphics, and file handling. The program is then copied across to Visual Basic, 
some Basic language translations are made, and then the visual 
interface developed.
 
10. THANKYOU to www.logix4u.net for the inpout32.dll used by this 
program.
    THANKYOU to www.chilkatsoft.com for Zip 2 Secure EXE Creator.
    THANKYOU to Mr Richard Bartlett and to Mr Iwan Martynyszyn for 
their contributions to this program.
 
11. UPDATES will now only appear at www.colinusher.info
    The author monitors the Colin Usher website and 'Compucutters 
Forum' for reports of errors, and suggestions for improvements and 
additional utilities.
    He will NOT enter into correspondence with users.