Home

Articles

The CNC explosion

CNC explained

Secrets of CNC

Current Projects

Products

Encoders

3D Scanner

Servo Motors

Servo Components

Stepper Motors

Stepper Components

EDM plans

Tachometer

CNC Software

Mill-Drill

Resources

Misc Images

CNC Links

CNC Glossary

Common G-code

About Camtronics

About Us

Contact Us

Payment Info

Feedback


Secrets of CNC

Secrets of CNC

The following is really outdated. It is from the '90s. Currently I am using Mach3 and most servo systems using Gecko servo amps and MCG motors.

 

 

There is very little information available for the hobbyist that will explain the whole process of CNC from the computer to the machine. Even more appalling, is that if there is information available, it is limited to a single facet of CNC.  The folks that like to program don't seem to care about the mechanical end. Those that specialize in electronics may have trouble with the programming of a computer. The folks that are good with mechanical things may have problems with the programming or the electronic portion of CNC. In the following, I will explain the various aspects of home CNC and to make it simple. The following should go along way to explain the concepts of CCNC.

It is recommended that you study the glossary, photos, schematic and flow charts before reading the following information.

There are 5 elements to Cimple Computer Numerical Control (CCNC). They are:

  1. IBM compatible computer
  2. CAD Programs (Computer Aided Design)
  3. The CNC/CAM Programs
  4. Electronic Translator-Driver System (Controller)
  5. X-Y-Z Mechanism

An explanation of each element is as follows:

1. The Computer runs the CAD programs and generates files that are used on the same computer or are transferred to another computer for execution of the tool path file by a CAM program.  The computer that runs the CAM program must have a parallel port with a standard LPT1 or LPT2 port address of 378(HEX). Other CNC/CAM programs may use serial or other parallel port addresses. The computer that controls the CNC machine can be an obsolete IBM AT that will be operated in a rugged shop environment. No sense using your good computer for this task.  The computer must be 100% IBM compatible. These are generally
available for under $70 at swap meets. The computers should be equipped with the following minimum hardware:

  • monochrome monitor
  • single 360K floppy drive
  • 640K of RAM

This configuration is more than adequate to operate a 3 axis motion control system. If a sophisticated computer is used, then an optical isolator should be installed between the translator-driver and the parallel port to protect the computer in case of an operator problem or malfunction of the electronics. CAD programs should be run on a 80386-25 or better computer with a minimum of an EGA color monitor, a hard disk, a 1.44K floppy drive and 4 MB of memory above the 640K base. After the part is designed, an XT/AT computer can be used to send commands to the controller.



2. The following CAD/CAM programs are known to work with the electronic motion control system that will be described below:
 

  • DANCAD3D ver 2.6 (Shareware)3D CAD
  • DANCAM ver 2.6 (Shareware)
  • CNC/CAM ùDANPLOT ver 2.6 (Shareware) CNC/PLOTTER
  • Protel Easytrax (Freeware) pc circuit board design.
  • Protel Autotrax (about $395) Schematic capture/plot/printed circuit board CAD programs
  • Optimizer ver 1.0 ($25) Excellon file conversion and drill pattern optimization program.


DANCAD3D is a 3 dimensional CAD program where the user designs the part to be made in 2 or 3 dimensions. It provides various outputs to plotters or printers for a hard copy of the part. More importantly, the CAD program will generate a tool path data file for use by the CNC/CAM/PLOT program. This file contains all the instructions read by the CAM/CNC program and provides, feed rates, and coordinates for the tool path. An example of a tool path to drill 4 holes in a 4 inch square pattern follows.

ENTER (starts tool path)

1ST X 1ST Y 1ST Z 2ND X 2ND Y 2ND Z FEEDS

0.000 0.000 -0.250 0.000 0.000 -0.460 1 0 0 0 (drill moves down)

0.000 0.000 -0.460 0.000 0.000 -0.250 1 0 0 0 (drill moves up)

-4.000 0.000 -0.250 -4.000 0.000 -0.460 1 0 0 (X=4, Y=0 drill down)

-4.000 0.000 -0.460 -4.000 0.000 -0.250 1 1 0 0 (drill moves up)

-4.000 4.000 -0.250 -4.000 4.000 -0.460 1 1 0 0 (X=4, Y=4 drill moves down)

-4.000 4.000 -0.460 -4.000 4.000 -0.250 1 1 0 0 (drill moves up)

0.000 4.000 -0.250 0.000 4.000 -0.460 1 1 0 0 (X=0, Y=4, drill moves down)

0.000 4.000 -0.460 0.000 4.000 -0.250 1 1 0 0 (drill moves up)

0 0 0 0 0 0 0 0 0 0 (End of file- return to home point)


If you were to view that tool path file in Dancad you will see four dots in a square pattern 4 inches long and 4 inches apart. The Z axis (drill head) would move down .460 inch and then move up clear of the work to .250 inch.

DANCAM is a vital program that reads the tool path file, calculates the number of pulses to move the machine to the coordinates indicated by the file. It sends steps and direction commands via the parallel port to the electronic translator-driver. The program receives input signals from the X-Y-Z home switches and out-of-range micro-switches via the translator-driver. These signals are essential for protection of the machines and for repeatability.

DANCAM provides numerous configuration setup screens to match the leadscrew/drive mechanism, motor steps per revolution, motor direction, backlash compensation, home switch set up, ramping of the stepper motor, pulses per inch of travel and just about any other variable one could think of including auxiliary relays and a fourth axis set up utilities.  DANPLOT is similar to DANCAM except that the Z axis (vertical) does not allow for a range of up or down locations for each hole/line but does allow the user to fix the up position and the down position. The tool path file only needs the X and Y coordinates. The Z axis up and down positions are set up by the user in the utility program.Version 2.6 allows the user to import HP-GL files and run them directly. It is great for engraving or sign making. 

PROTEL EASYTRAX is an outstanding freeware printed circuit board design program. It can provide an Numerical Control (NC) drill data file for drilling steel plate just as easily as is used to layout drill patterns for the circuit board drill machine. After the design is completed, the Easyplot portion of the program generates a numerical control Excellon drill file that will be used to provide the coordinates for the holes to be drilled. A laser transparency of the circuit traces can be produced for the artwork for the circuit board. Easytrax produces Gerber photo plot files which can be sent to a photo plot service for plotting the circuit on film. Dot matrix, Postscript and pen plotter printers are supported. The NC output is used by the Optimzer (see below) to read the X-Y coordinates and convert Excellon file formats to Dancam format. The following is an Excellon file:

T04 (Tool number)
XY0 (X and Y coordinates = 0)
X4 (X=4 inches Y=0)
Y4 (X=4 inches Y=4 inches)
X0 (X=0 inches Y=4 inches
M30 (end of file)

PROTEL AUTOTRAX is a combination schematic and printed circuit board design program. This is a low cost but very powerful program that has all the features of Easytrax but also has auto place components, auto-router, schematic capture and numerous other features required for professional electronic designs.

OPTIMIZER is a program that reads the Excellon NC drill file, optimizes the tool path for the shortest path to drill all the holes. It then plots the drill pattern on the computer monitor and then converts the Excellon file to a format the CAM program requires. This program is used only for CNC drilling. It takes the drudgery of converting the Excellon file to CAM. It also sets the drill bit up and down positions.

 

3. The CAM program recommended is DANCAM 2.52. This program was previously described. Other, user generated, programs may be written and sent via the parallel port to the translator- driver as long as the code sends the tool path to the same parallel port data lines as set on the controller.

 

4. A low cost ($85) L/R 3 axis motion control system is used with the shareware. Other controller that are PWM chopper drivers are better. See below for an explanation of the chopper drivers.The controller receives step and direction signals from the CAM program via the parallel port. X, Y and Z step pulses are sent from the computer parallel port via pins 2, 3 and 4 respectively. X-Y-Z direction pulses are sent via the computer to pins 6, 7 and 8 respectively. Pin 10, when pulled high by an open over-travel protection microswitch, sends a signal back to the computer that there is an over travel condition, stops the program, which in turn freezes the positions of the stepper motors and displays a message on the monitor that there is an open switch. The problem must be cleared before the program will allow the user to continue. This feature, usually found only in expensive controller, protects the mechanism from damage by preventing the machine from over travel should the operator send a command to the machine that is beyond the travel of the mechanism. When pin 10 is low, the CAM programs runs the tool path file and continues to monitor this line. Pins 11, 12 and 13 are X-Y-Z axis home switches inputs to the computer. The micro switches are normally open. The pull up resistors brings these pins up to +5. When any of the home switches closes it pulls the pin low and signals the computer that the mechanism has moved to a predetermined HOME point. When the CAM program commands the machine to Home up, the CAM hardware configuration file is read.  Next, the stepper motors simultaneous turn to move the X-Y-Z axis mechanism into the home micro switches. As each switch is closed the stepper motor is stopped by a logic low signal to the appropriate pin of the parallel port. Each stepper motors moves until each axis is at their respective home position and removes any backlash provided for in the configuration file. This feature is essential for repeatability.

The translator portion of each controller IC receives the signals from the computer and converts step and direction pulses into the correct stepping sequence for the stepping motor. The driver portion of the IC's are MOSFETS that are capable of delivering 1.25 amps per phase with two phases on to each unipolar stepping motor. Peak current is 1.5 amps per phase. Thermal shut down provisions provide some protection for the IC's. Heat sinks and a cooling fan are needed for heavy loads. A 78MO5 voltage regulator is used to take the 12VDC supply voltage and regulate the +5 volts for powering the IC's, supplies the 5 volts source to the pull up resistors and output voltage to the computer input lines. Power resistors are provided where needed to limit the current to stepper motors with a voltage rating of less than the 12 VDC supply voltage. Supply voltages to 35VDC will work with the controller with minor modifications. I also have a three axis chopper drive that is much more powerful than the unipolar drive. It will output 2 amps at 24VDC. It has a 20KHZ chopper and has numerous other features like All Windings Off. Inhibit or control chopping, and full, half or Wave drive.  It runs two-three times faster and is much more powerful that the unipolar drive. It will run 4,6 or 8 wire motors.

Unipolar, 4 phase, 2 phase on stepping motors are used with the controller that will be built in the next article. Typically they are 5 volt, 200 step, .88 amp per phase, 6 wire, 40 ounce inch stepping motors. The stepping motor is bifilar wound which means that two coils are wound on the same bobbin. By center tapping the coil, two coils are formed with a single common lead. These coils are called phases. Eight such bobbins are equally spaced in most stepper motors. The common leads are connected to +12 VDC. A current limiting resistor is used if the voltage of the supply is greater than the motor rated voltage.  This formula provides the value of the resistor:

RB=(Vs-Vm)-Vd/Im

Where:
RB = Value of current limiting resistor.
VS = Supply voltage to the steppers.
VM = The motor voltage rating.
VD = The voltage drop across the 1C's (usually 1 volt).
IM = The current rating of the motor.

The wattage of this resistor is calculated with the following formula: Im*Im*Rb

As the CAM program sends pulse and direction signals to the parallel port, these pulses are received by the translator. The translator is permanently configured for the full step mode.  This mode provides the maximum torque. The phases are then turned on or off in accordance with the following sequence:

STEP Phase
A B C D
1 ON OFF OFF ON
2 ON ON OFF OFF
3 OFF ON ON OFF
4 OFF OFF ON ON

The stepper motor phase (coils) are energized rotating the shaft the number of steps ordered. The motor is reversed by reversing the step pattern. This is accomplished when the computer program sends a logic high pulse to pins 6, 7, or 8 as called for by the CAM file. The translator reverses the stepping sequence starting with the previous step.

 

5. The X-Y-Z mechanism will vary from machine to machine but generally use the stepping motor to rotate a leadscrew or drive a timing belt. A leadscrew rotates in a drive nut. The drive nut is fixed to a cross slide thus converting the rotary motion of the leadscrew to linear motion. The X axis stepping motor is fixed to a base. The Y axis motor is mounted on the X axis cross slides and moves with the X axis. The Z axis is fixed vertically and is coupled to leadscrew similar to the X axis. The accuracy of the mechanism depends on the quality of the leadscrews and any backlash or looseness in the mechanism. For most CNC work .003 per foot maximum pitch error (the lead angle of the thread) is required. The greater the number of threads, the greater the resolution of the machine and the greater the force applied to the X-Y-Z cross slides. With a 20 thread per inch leadscrew the pitch would be:
 

Accordingly: P = 1/20 = .050
 

Therefore, a 200 step per revolution stepping motor directly coupled to leadscrew, would move the axis .050 inch per revolution.
 

Resolution of the stepper motor and the leadscrew is defined as:


R=P/S

Where:
R = resolution
P= leadscrew pitch
S= steps per revolution
 

Thus, a single step would move the mechanism .00025 inch (.050 / 200). A coarse leadscrew ie 5 TPI (threads per inch) would have a resolution of l / 5 = .200 and a resolution of (P / 200 (steps) = .001 inch. Multiple leads (starts) on a leadscrew with very high pitch will move the axis very rapidly but should be avoided because the resolution would be too coarse for most CNC applications. Generally, you will trade speed for accuracy.

The load that a small stepper motor can drive is significant when used with a leadscrew. A little 12 ounce-inch stepper motor when coupled with a 20 TPI leadscrew yields 16 pounds of force at low speed and 9 pounds at high speed. Neglecting friction, the following formula can be used to calculate the load that can be driven with a stepping motor and leadscrew:

L=F*6.2832R/P

L= load
R= radius from center of lead screw to the point that the torqueis applied
P= leadscrew pitch
F= force applied

The X-Y drive nuts are connected to the moving X-Y table. The table rolls on precision ball bearing slides or ways. The ball slides or ways keep the X-Y coordinates at right angles at all times. The Z axis stepper motor is similar to the X axis in that it is fixed to a stationary mount. As the motor turns the leadscrew, a drive nut connected to a ball slide or way converts the rotary motion of the motor to linear motion. This moves the drill power head or spindle up or down.

This completes the overview of Cimple Computer Numerical Control (CCNC).

 

 

Site by: Digital Platinum