In this project it is proposed to convert a Wabeco bench top milling machine (shown above and purchased by me) into a Computer Aided Machine (CAM), which will be used to repair/make clocks and other hobby type operations. The project was originally conceived as a retirement (from Agilent) project on the basis that old engineers never die they just fade away doing something like this. There is a long term goal here in that I want to make a copy of a17c clock. However the features developed in this project have lead me to believe this product may have some commercial value as the capability is better than many low cost solutions..
The issue with such a simple milling machine used manually is that it only has has a 4mm movement for every 360 degree turn in the lead screw of either X,Y or 2mm on the Z axis. Repetitive strain injury is a real possibility if manual operation is going to be used extensively. Applications like engraving and 3 dimensional cutting are much more practical with CAM technology, see examples in the Andrew Werby page. In the long term, to make gears for example, a fourth axis will be needed. This will be implemented using a rotary table also controlled by the computer. This then makes small gear cutting a real possibility.
The purpose of this web page is to track the progress of my investigations and route to a final design and gather some comment from interested parties. My initial experiments can be viewed here( Initial Experiments). I basically do not trust the various claims made by the hundreds of CNC solution providers out there who, if you just give them a few thousand dollars all your problems will be solved.How well do these solution work is a key question. Most of these solutions have no feedback so are limited in accuracy.
The purpose of the initial experiment was to decide if a simple low cost approach was possible and what performance such an approach would yield. In fact the experiment told me I was about a factor of 10-20x short in terms of maximum velocity, so a new approach was needed (i.e. 2mm/sec instead of 20-30mm/s). The motor of course can be changed but there are physical limitations of space and cost. It was decided if possible to stick with the type 34 Motor size and look for further improvements in performance from the motor driver. The motor I used in the initial experiments was quite an old design and was not capable of micro-setpping drive for example.
Software
One of the major issues in a project like this is the software application cost. The cost of professional fully integrated CNC software package (including hardware) can exceed £20,000. Most low cost software/hardware packages have some severe limitations and are unlikely do what you want and are likely to inflexible or inaccurate or both for my developing needs. The other issue is that low cost software applications have either no of few shaft encoder feedback features so are limited to dead reckoning in terms of navigation about the work piece. The ergonomics of the user interface is a major issue.
My answer is to split the problem into three: Data Capture, G-Code conversion and Driver Software. I have invested in a copy of TurboCAD 8 for the Data Capture (£40), this is a general purpose low cost industry standard drawing package capable of producing portable vector drawing formats called (.dfx). This package is perfectly adequate for the two dimensional problems that I have in mind. This package can be upgraded to V9 professional at an estimated cost of $500.
There are free G-Code converters available to convert from .dfx to G-Code the industry standard for CAM control.. G-Code converts the .dfx type vector commands into point-point, linear and circular interpolation commands that are readable by the industry standard machine controllers. One such converter that has some reputation is called Ace. The source code for Ace is available so if needed this can be tweaked to resolve any support issues (as a last resort). The best solution found to date is DeskCNC. This package generates tool paths from the .dfx files and is well written and supported costing $250.
I decided to write the lower level driver software myself using LabWindows CVI for the Graphical User Interface and C++ to implement the lower level coding. National Instruments provide a huge resource library for this type of work. Their support page is excellent. There are lots of experts (current and former work colleagues) around who have C coding experience to help me. One of these is Phil Walter of Eastmore Systems who has been of great assistance with this project.
Hardware Drivers
There are literally hundreds of drivers out there in the www competing for business. However I came across an e-bay advert one day from a chap called Frank Hoffmann in Wales. He was selling some professional Parker/ Compumotor 650X microstepping drivers. These are professional drives originally selling for >£600 each see .http://www.compumotor.com/manuals/OEM/OEM350-650.pdf. They have extensive features and are more than capable of driving any motor likely to be connected to my milling machine. They are capable of driving 12A at 72 volts, which is more capable than I need . They also have provision for readily available shaft encoders. To use these drivers the software must compile and interpret the G-code at run time into X-ware. X-ware is the native language of Compumotor drivers
Three of these drivers were obtained for approx $60 each and were to form the basis for the new design. Unfortunately there is NO low cost software supporting this type of driver despite much searching. Parker used to (now obsolete) produce a controller box for this drive but I have little information on the feature set, However going down that route is likely to limit my features and the controller is no longer in production. The advantages of these drivers far outweigh the driver issues. These drives can support 25,000 micro steps per revolution. The Compumotors drivers supports an RS-232 character based language called X-Ware. Most of the lower level functions are implemented internally with a u-Processor reducing the amount of code to be written (in theory) at the lower level. I need a challenge and as an analogue/digital design engineer I need the C-coding experiance.
Motors
Stepper motors are a difficult and potentially expensive problem, versions with built in shaft encoders are even more expensive ~£300. However HP (Hewlett Packard) sell a low cost shaft encoder (£40) that is compatible with the 650X driver and runs from the output shaft on the back of the motor. The CNC conversion Usenet groups are full of tales of incorrect motor choice relative to any specific conversion.
The original experimental motor had a Torque of 110oz/in or 776 mNm in a type 34 casing. . I looked at the highest powered motor available in a type 34 casing that has a torque = 6,864 mNm made by SanyoDenki and costing about £77inc VAT from Active Robots. This is about 10x more powerful than the motor used in the experiment and consumes slightly less than 4x the power (modern motors are more efficient). This will require a PSU with 4A per phase x3 motors = 12A continuous rating. I was fortunate enough to find 3 x 200W switching PSU modules that can be connected in series giving 50V at 12A continuous rating . I estimate that I will nowl require a minimum of 2x improvement in the drive capability even taking into account the increased motor performance. This can be achieved with the micro-stepping driver as described here. Although the 650x is an obsolete product the 750x is very similar and they indicate at least a x2 increase in torque is possible over square wave drives. The issue of resonance is also addressed by these drives. The Compumotor 650X/ Sanyo combination can be driven with up to 75V at 4A if necessary. I feel I am now guaranteed sufficient power to drive the milling table under all conditions at speeds in excess of >20mm/second.
General Arrangement
All of the drivers and PSU were housed in a fan cooled 19 inch rack mount cabinet. The motors are attached by a simple arrangement to each axis on the milling machine.
Software Architecture
Modern CNC machines use velocity control. This is done to minimise toolong marks and increase milling speeds. The tool has a constant velocity in the direction of travel at any given point in time and the tool is steered by dynamically changing the relative velocity of the X Y axis. If a circle is to be cut for example the velocity is the differential of position e.g. a sine wave at twice the frequency (ignoring the amplitude sign).
The G-Code will be derived from .dfx conversion software application that has to be designed. By inspection of the G-Code converter output file the commands are either (G2) linear interpolation or (G3) circular interpolation of the original (.dfx) drawing vectors. I calculated that an update of the velocity to each motor would be required every 100mS if a 1mm/second cutting speed is to be maintained with sufficient resolution. With a speed of 9.6Kbit/s on the RS-232 interface then a character rate (<100 characters per 100mS) needs to be maintained requiring optimisation of the X-ware conversion process to say 25% of that rate ideally. The following table shows by limiting the milling speed to 1mm/sec then the resolution decreases by circle diameter. However the larger the diameter circle the circle the greater the number of interpolated points. The default milling speed is 3mm/s and the resolution scales accordingly. For a 5mm radius the number or points decreases to 100 points, a more than adequate resolution.
| Calculating no of points assuming a point every X (mm) | ||||
| One Point Every | 0.1 | (mm) | ||
| Milling Speed | rps | 0.25 | 1 | (mm)sec |
| Radius (mm) | Circumference | Points | Milling Time (secs) | sec/point |
| 5 | 31 | 314 | 31 | 0.1 |
| 10 | 63 | 628 | 63 | 0.1 |
| 15 | 94 | 942 | 94 | 0.1 |
| 20 | 126 | 1257 | 126 | 0.1 |
| 25 | 157 | 1571 | 157 | 0.1 |
| 30 | 188 | 1885 | 188 | 0.1 |
| 35 | 220 | 2199 | 220 | 0.1 |
| 40 | 251 | 2513 | 251 | 0.1 |
| 45 | 283 | 2827 | 283 | 0.1 |
| 50 | 314 | 3142 | 314 | 0.1 |
| 55 | 346 | 3456 | 346 | 0.1 |
| 60 | 377 | 3770 | 377 | 0.1 |
| 65 | 408 | 4084 | 408 | 0.1 |
| 70 | 440 | 4398 | 440 | 0.1 |
| 75 | 471 | 4712 | 471 | 0.1 |
| 80 | 503 | 5027 | 503 | 0.1 |
| 85 | 534 | 5341 | 534 | 0.1 |
| 90 | 565 | 5655 | 565 | 0.1 |
| 95 | 597 | 5969 | 597 | 0.1 |
| 100 | 628 | 6283 | 628 | 0.1 |
A multithreaded event driven approach was chosen for the architecture. A time event process sends the commands to the motors based on a 100ms tick. The second process is generated as a result of messages from the motor driver like completion messages and absolute position etc.
A graphical user interface was designed using LabWindows CVI to make the operation of the CNC machine as simple as possible..
As there is shaft encoders on each axis then a continuous display of the exact position can be maintained independent of the actual motor achievement, even under stall conditions. The displays can be reset at the home position manually.
Simple Application (To start with)
![]()
A simple application was implemented to test the architecture and some of it's performance issues. This application is driven from the bottom of the GUI panel and is designed to cut regular slots in sheet metal of any X-Y dimension using multiple passes as necessary depending on tool diameter and depth of cut. This has now been implemented and tested. The choice of Motor, PSU and drivers have turned out to exceed my expectation in terms of performance i.e. moving between cutting position can be done at 30mm per second. The throughput performance still has to be examined as I have no knowledge yet of the Driver processing overhead yet .
Scrolling application (G-code to X-Ware converter)
Linear/Circular interpolation is the key to cutting (Scrolling) any shape. Constant velocity of the tool progress regardless of direction is also very important. The item to be machined will start life as a .dfx drawing, be converted in some application to G-code then compiled and interpreted at constant velocity in this application. This application now written, performing the function of converter/compiler and interpreter to go from G-code to X-ware. This application has it's own GUI window. The following link shows the G-code in a separate window displayed as it is executing plus a GUI for monitoring the progress of the G-code as it is interpreted in real time.
Mid course correction
The accuracy of dead reckoning with velocity control is limited if no feedback is provided. A more sensible approach is to include a correction method. The method chosen is to correct any G-code function Linear or circular where the distance exceeds a certain threshold. I have termed this feature Mid Course Correction and the controls can be seen in the panel illustration above. The default setting is 5mm. This leads to a dramatic increase in accuracy over the typical 350mm needed for clock frame fabrication.
Accuracy achieved
Backlash compensation
First order backlash compensation is an essential feature of this application. The backlash compensation controls are seen on the main panel. In normal mode each movement is tracked and compensated for in real time by adding or subtracting a small amount of distance. In the Scroll application this has to be added in at compile time.
The fourth dimension (Rotary Table)
A rotary table has been purchased and the mechanical conversion to CNC is now complete. A simple application has been written to convert No of teeth/rev to degrees of rotation per step. Compensation for non integer division ratios has been written to eliminate errors in such a system.
Mecanical details
See the latest mechanical detail
Contact
alastair_reynolds@blueyonder.co.uk