|
Introduction
All the technology in the CNC drill has been used before. The challenge is the bringing together hardware, software and electronics to form a design that meets performance, is cost-effective, competitive and useful to customers. There are existing products that are similar, but are positioned in the mass manufacture market, or the high end prototyping market.
Technical feasibility is discussed under the following headings:-
· Software
· Hardware
Electronics
Parallel Port Information
Most parallel ports are located at address hex 378, or denary 888. The parallel port has a 25 pin D type female connector, which contains the 3 sub ports; data, status and control. The following is a table of common port addresses
Motor Control Chips
There are a few customised stepper motor driver chips, with varying degrees of complexity and cost. After researching what was available, I concluded it would be cheaper and give mouse control if I drove each coil separately from the parallel port. Most of the cheaper ones had a current capacity of 500mA max, some up to 1A. An example of this is the SA10047 from Phillips

Drive Circuit
The following circuit has been tested in a test rig and has been found to be satisfactory in terms of function. Further tests will determine its reliability and performance.

Circuit Considerations
· Series resistors to each coil for improving torque/RPM curve, limiting current for higher voltage drive
· Increased voltage/lower current to coils for faster current rise time
· Heatsinks needed for forcing resistors and power transistors
· Bought in PSU must have enough current capabilities for motors, see tech. feasibility.
Power supplies required:
· 12V DC for drivers/motors
The power supply will be bought in, as they are readily available. The voltages used are also common to switched mode PC power supplies, so my intention is to source from a PC PSU manufacturer.
Driver Transistor Specification
In order to provide a rugged power drive system, a TIP122 power Darlington pair is used. This will provide ample current drive and voltage protection.
TIP122
Material NPN
Max I 5A
Hfe 5000 @ 2A
Vceo max 100V
Vcbo max 100V
Vebo max 5V
Ptot max 65mW
Current Limiting Resistor
By providing the motor with a higher supply voltage that its rated voltage, there is the benefit of increased current rise time in the coils as shown in the graph:-

This is quite a common trick in order to increase the step per second performance. However, in order not burn out the coils, there needs to be a resistor in series with each coil.
To calculate the value of the forcing resistor:
![]()

Figure 5-5 Circuit is similar to a resistance and coil in series
Where:
Rb=Value of the current limiting resistor
Vs=Supply voltage to steppers
Vm=The motor voltage rating
Vd=The voltage drop across the ICs (typ 1V)
Im=The current rating of the motor
The wattage of this resistor: ![]()
![]()
In the case of the first prototype,
Vs=12V Vm=6.5 Vd=1 Im=1.3
So Rb=(12-6.5)-1/1.3
Rb=4.7Ohms (2d.p.)
Pw=1.3*1.3*4.7=7.943W
Shunt Diodes
As the load driven by the transistors is a coil and inductive, there will be quite high reverse voltages when the coils are discharged. In order to protect the transistors from over voltage damage there is a diode place in parallel with each coil.
Drill On/Off Circuit and Drill Up/Down Circuit
These circuits are essentially the same as the circuit for each coil of the stepper motor, but there will be no forcing resistors, as they are not needed.
Limit Switches Circuit
Each axis of the drive system has a 2 limit switches in order to detect its home position, to initialise the step count, to protect against moving outside the traverse boundary.
The circuit used will be the following:
Figure 5.6 Limit switches circuit
Software
Writing and Reading to/from the Parallel Port
The logic levels of each port are controlled by sending a byte to the respective address. This is done in Qbasic by using the command OUT. To switch all bits high on port 888, the command would be:
OUT 888,255
The binary result of the above command on port 888 is 11111111.
Note:- The format of the command is OUT [port address],[data] The equivalent command in C is outportb.
To read port 888, and print the result, the Qbasic command is:
x = INP(888)
PRINT x
This would return a decimal value between 0 and 255, representing the binary status of each line.
Bitwise ANDing
In order to read or write the logic levels of each bit, the port byte is read as above, and by ANDing the result with an appropriate number, the undesired bits can be masked out.
Example: To read bit 2
Byte Read: 11011010l
AND: 00000010
Produces: 00000010
So bit 2 logic is: High (1)
Byte Read: 11011000
AND: 00000010
Produces: 00000000
So bit 2 logic is: Low(0)
Port Address' Configuration
In order to accommodate differing machine configurations, the control software asks the users to enter the address of the parallel port that they wish to use for the drill. The address is stored in a preferences file for future use.
File Formats
There are many file formats available; HPGL, DXF, Gerber, Exellon, NC to name a few. The most important consideration was which file type would the customer be most able and likely to generate, and which would be particularly suitable for a drilling application. I chose HPGL because it is the native language of the pen plotter, and its commands are transferable to a CNC drill, which is a particularly analogous device.
Some of the basic HPGL commands are:
PU pen up
PD pendown
PA plot absolute
An example of a HPGL file is as follows:-
.(;.I81;;17:.N;19:IN;SC;PU;PU;SP7;LT;VS36;PU;PA199,199;PD;PA199,199;PU;PA279,279;PD;PA279,279;PU;PA398,398;PD;PA398,398;PU;PA0,0;SP;EC;PG1;EC1;OE;
Each command is separated by a semi-colon, and the positional commands like "PA199,199" are in the format PA [x distance],[y distance]. The units are HPGL units, which have a real-world scale of 0.025mm, or » 1 thousandth of an inch. This is user definable in the control software, so customers can scale their output if required.
Hardware
The following drive layout is the basis for the mechanical calculations:
Figure 5.7 Basic single axis drive layout
Stepper motors have been chosen over servo motors because of the following reasons:
· no feedback required (motor must not be overloaded or over-accelerated / decelerated )
· easy to interface
· good mass to torque performance
· no error build-up
· high polar resolution (400 steps/rev in half step mode)
Types of Stepper Motors
There are a few different types of stepper, namely:- Unipolar, bipolar, bifilar, permanent magnet, etc.. but the easiest interface and cheapest to use is the bipolar. See diagram for basic coil schematic:
Figure 5.8 Stepper motor coil layout
Stepper motors can be driven either in half step or full step mode.
Full Step Mode
Full step mode energises each coil in turn and steps the rated step resolution of the motor, i.e. 200 steps per rev in this case. The sequence for full step drive is as follows:
Full Step Output Sequence
Step Phase
a b c d
1 1 0 0 0
2 0 1 0 0
3 0 0 1 0
4 0 0 0 1
To change the direction of rotation, the sequence is reversed from whatever sequence was last output.
Half Step Output
This stepping mode can position the armature halfway between coil positions, giving twice the rotary positioning resolution.
Half Step Output Sequence
Step Phase
a b c d
1 0 0 0
1 1 0 0
0 1 0 0
0 1 1 0
0 0 1 0
0 0 1 1
0 0 0 1
1 0 0 1
Again, to change the direction of rotation, the sequence is reversed from whatever sequence was last output.
Pulleys
The following chart gives the amount of linear movement on the belt for a 1/400th of a revolution in the stepper.
Calculated using the following formula:
Total Linear Movement on belt=2p r/No of steps per Rev.

Figure 5.9 Belt movement per step
Given the required resolution of 0.1mm, a good radius for the drive pulley would be 6mm, giving a 1 pulse linear movement of 0.094mm
To achieve the required linear speed of 25mm/sec, the required number of pulses per second is calculated by using the formulae:
Pulses per Second (PPS)=Required Speed/Distance moved by 1 pulse
in this case, PPS=25/0.094=265.9 pulses per second
So the motors must be pulses at least this rate to achieve the specification.
Drill Mechanism
![]()
|
|
Drill Feed Rate
The feed rate of the drill will be directly proportional to the speed of the DC motor driven disc, and will follow a sinusoidal model, because of the mechanism. The feed rate can be calculated using the following formula.
Drill Feed Rate Average =(RPS of disk/2)*diameter of disk
e.g. for a disk RPS of 0.5 and a disk diameter of 10mm, the average feed rate would be:
(0.5/2)*10=2.5mm sec
However, because of the mechanism, the maximum feed rate will occur at the 0° position, so
Drill Feed Rate Max =(RPS/2)*p r
given r=5mm and RPS=0.5
Drill Feed Rate Max = (0.5/2)*p 5=3.93mm/s (2d.p.)

Figure 5.11 Feed rates for 3, 4, and 5mm disc sizes