ChapterPDF Available

Design and Implementation of PCB Drilling Machine based on Image Processing

Authors:

Abstract

With the advancement of computer technologies, electronic machinery is being automated, which require less time and less men-power. For this purpose, an automatic PCB drilling machine is designed. Creating holes on single or multilayer printed circuit boards (PCBs) is an important stage in electronic production. Holes of different sizes and at a large number of positions (up to thousands) must be drilled with high precision for manual or automatic insertion of various electronic devices and components. In this method, PCB pattern of the circuit schematic diagram is extracted from a sample PCB using image processing techniques and stepper motors are used to move drill to the required position.
Abstract With the advancement of computer
technologies, electronic machinery is being automated,
which require less time and less men-power. For this
purpose, we have designed and built an automatic PCB
drilling machine. Creating holes on single or multilayer
printed circuit boards (PCBs) is an important stage in
electronic production. Holes of different sizes and at a large
number of positions (up to thousands) must be drilled with
high precision for manual or automatic insertion of various
electronic devices and components. The PCB pattern of the
circuit schematic diagram is extracted from a sample PCB
using image processing techniques and stepper motors are
used to move drill to the required position. The image
processing techniques are discussed in this paper.
A brief comparison between commonly used CNC CAD
based machines and our designed machine will illustrate
the importance of our project and its role in the PCB
industry. The project has been completed and put in use
(making small scale PCBs).
Index Terms —CNC; Drilling Machines; Image Processing;
Microcontroller
I. INTRODUCTION
Printed circuit boards are used in virtually every modern-
day electronics application. For production standard
boards, all aspects of board construction are carried out by
machine, based on a design created in a computer aided
design package. However this type of construction is only
economical for boards which are to be produced in large
quantities. One of the tasks involved in this process is
drilling all of the holes in the board which are required to
hold the components. In the production level process, this
task is carried out using a drilling device known as a CNC
(Computerized Numerically Controlled) machine, which
drills holes based on the input from an NC (Numerical
Control) drilling i.e. created by the CAD application.
The objective of the paper is to introduce a prototype
drilling machine which takes its input from imaging
sensor (camera). The machine drill holes at the correct
points on a printed circuit board, based on the input from
the computer which use image processing techniques to
detect exact hole location on sample PCB and direct the
microcontroller to move the motors to the desired location.
II.HARDWARE DESIGN
The Hardware section of our project consists of two main
parts, Mechanical Structure and Electronics Circuitry.
Mechanical system is the realization of 3-dimensional
motion control. Motion Control, in electronic terms, means
to accurately control the movement of an object based on
speed, distance, load, inertia or a combination of all these
factors. We have selected rail based structure for our
project. Motor attached to a rod will move the axis to the
desired location.
Hole position consists of X-Y coordinates, and Z coordinate
is a parameter to move the drill machines up and down.
The drill is moved horizontally to X-Y coordinates of a
hole, moved down in Z direction to make the hole, then
withdrawn and translated to another place.
We have selected Stepper Motor for all three axis
movement because of its following favorable specifications:
No separate PID is required in stepper motor.
The control and circuitry of the Stepper motor is
easy.
It is very easy to have the controlled step
movement using stepper motor so the element of
risk is finished with it.
The programming of the stepper motor is much
short as compared to other motors so it makes the
task easy, accurate and easy to understand.
The drive circuit for stepper motor is designed using the
Switching property of the transistor. We are using BJT
3904 for circuit switching, next to them are affixed power
transistor to increase the amount of current being supplied
to the motors and next to them are diodes to stop the back
current coming from the stepper motors. Zener diodes are
used so as to maintain the voltage level so that TIP32 does
not become off..
Design and Implementation of PCB Drilling
Machine based on Image Processing
Haris Ahmad Khan
Q1
2N3904
D1
BZY88C
D2
DIODE
R2
2.2k
R1
680
R3
150
Q2
TIPP31
input 1
VCC
5V
Q3
2N3904
D3
BZY88C
D4
DIODE
R4
2.2k
R5
680
R6
150
Q4
TIPP31
VCC
5V
Q5
2N3904
D5
BZY88C
D6
DIODE
R7
2.2k
R8
680
R9
150
Q6
TIPP31
VCC
5V
Q7
2N3904
D7
BZY88C
D8
DIODE
R11
2.2k
R10
680
R12
150
Q8
TIPP31
VCC
5V
output1
output2
output3
output4
input4
input3
input1
ground1
ground2
Fig: Stepper Motor Drive Circuit
The microcontroller used is ATMEL 89S52. It is a low-
power, high-performance CMOS 8-bit microcontroller with
8K bytes of in-system programmable Flash memory. The
device is manufactured using Atmel’s high-density
nonvolatile memory technology and is compatible with the
industry-standard 80C51 instruction set and pin out.
Normally, the flash memory of an ATMEL microcontroller
is programmed using a parallel interface, which consists of
sending the data byte by byte (using 8 independent lines for
the data, and another bunch of lines for the address, the
control word and clock input). On the other hand ISP is
performed using only 4 lines, and literally, data is
transferred through 2 lines only, as in a I2C interface,
where data is shifted in bit by bit though MOSI line, with a
clock cycle between each bit and the next.
MISO line is used for reading and for code verification; it is
only used to output the code from the FLASH memory of
the microcontroller.
The RST pin, which is normally used to reset the device, is
also used to enable the 3 pins (MOSI,MISO and SCK) to be
used for ISP simply by setting RST to HIGH (5V),
otherwise if RST is low (0V), your program start running
and those three pins, are used normally as P1.5, P1.6 and
P1.7.The following table show the pins used for ISP.
Fig: Pins used for ISP
Keil μVision 4 is used for writing the code for
microcontroller. The µVision IDE from Keil combines
project management, make facilities, source code editing,
program debugging, and complete simulation in one
powerful environment. The µVision development platform
is easy-to-use and help in quickly create embedded
programs that work. The µVision editor and debugger are
integrated in a single application that provides a seamless
embedded project development environment.
III. SOFTWARE DEVELOPMENT
Pins used for ISP
MOSI: data input
MISO: data output
SCK: clock input
RESET: used to activate the serial
Programming
The software section consists of Interfacing with the
Imaging Sensor, Image Processing Algorithm,
Microcontroller Programming, and Serial Communication.
We are using IDE of C++ language over MATLAB
because, MATLAB is good for simulation or even prototype
level but at the product level it is too slow and quiet a lot
heavy for a normal system. We need lot of loops in our
techniques and algorithms of image processing and
MATLAB gets very heavy and slow when loops are used in
it. After deciding the fact that we will work in IDE, there
are different choices in IDE and Language. We choose
Microsoft Foundation Classes and Microsoft Visual C++
6.0 as our integrated development environment besides
being the only tool to support the Microsoft Foundation
Classes.
A software development kit (SDK) is typically a set of
development tools that allows for the creation of
applications for a certain software package, software
framework, hardware platform, computer system, video
game console, operating system, or similar platform.
VideoOcx is used as SDK because it is quiet easy
to develop a Graphical User Interface using MFC wizard.
The issues being faced and methods to overcome them as
discussed in the following
A. Interfacing the Imaging Sensor.
The camera used is plug and play camera and its driver is
pre installed in the Windows XP. The other difficult part
i.e. camera initializing and image control and camera
control is solved by easy programming and controlling
software development kit (SDK).i.e. VideoOCX.
B. Image Processing Algorithm
In image processing, thresholding of the obtained image of
PCB is done. During the thresholding process, individual
pixels in an image are marked as “object” pixels if their
value is greater than some threshold value (assuming an
object to be brighter than the background) and as
“background” pixels otherwise. This convention is known
as threshold above. Variants include threshold below,
which is opposite of threshold above; threshold inside,
where a pixel is labeled "object" if its value is between two
thresholds; and threshold outside, which is the opposite of
threshold inside (Shapiro, et al. 2001:83). Typically, an
object pixel is given a value of “1” while a background
pixel is given a value of “0.” Finally, a binary image is
created by coloring each pixel white or black, depending on
a pixel's label.
After thresholding, averaging of image is done. The
Average (mean) filter smooth image data, thus eliminating
noise. This filter performs spatial filtering on each
individual pixel in an image using the grey level values in a
square or rectangular window surrounding each pixel.
For example:
a1 a2 a3
a4 a5 a6 3x3 filter window
a7 a8 a9
The average filter computes the sum of all pixels in the
filter window and then divides the sum by the number of
pixels in the filter window:
Filtered pixel = (a1 + a2 + a3 + a4 ... + a9) / 9
In order to filter pixels located near the edges of the image,
edge pixel values are replicated to give sufficient data.
After averaging, clustering of image is performed. Cluster
analysis or clustering is the assignment of a set of
observations into subsets (called clusters) so that
observations in the same cluster are similar in some sense.
Clustering is a method of unsupervised learning, and a
common technique for statistical data analysis used in
many fields, including machine learning, data
mining, pattern recognition, image analysis, information
retrieval, and bioinformatics.
Quantized thresholding is applies after clustering. In this
thresh holding we only set a range instead of a single value.
That is from 100 to 150 gray scale units. Any value above
or below this range was suppressed to zero value.
The following images shows the steps involved in image
processing.
Fig: Colored Image
Fig: Gray scaled image
Fig : Averaged and then Threshold image
Fig: Clustered+ quantized Threshold
In the above figure, the holes detected after applying image
processing algorithm is shown in circles.
After detecting the point location on the image we extract
out the position or the location of the hole on the PCB with
the help of last step and PCB size. Then that location (in x-
axis and y-axis form) are transmitted to the controller with
through the serial port.
C. Serial Communication.
RS 232 protocol is used in serial communication with the
help of MAX 232. The MAX232 is an integrated
circuit that converts signals from an RS-232 serial port to
signals suitable for use in TTL compatible digital logic
circuits. The MAX232 is a dual driver/receiver and
typically converts the RX, TX, CTS and RTS signals. The
following figure shows schematics of RS 232 using MAX
232.
Fig: Serial Interfacing
D. Microcontroller Programming.
The programming of microcontroller is done so that it gets
coordinates from computer through serial interface. The
Baudrate is kept at 9600, Data Bits are kept at 8 and Parity
is kept at none.
Data is received in character from through serial interface
which is converted through Type Casting. The present
location is detected as a point at (0,0) initially. Target
location’s difference in both x-axis and y-axis is calculated
and stepper motors are moves the PCB to that location.
Once the desired position is reached, present location is
updated and code is sent back that drill is done. When the
confirmation message is received, coordinates for second
hole location are sent and this process continues till all
requires holes are drilled.
The flow chart of microcontroller’s program is shown in
the following.
Serial Input
NO
YES
NO
YES
IV. CONCLUSION
This paper presents a design proposal for the Printed
Circuit Board (PCB) Drilling Machine based on Image
Processing. The development of the whole system can be
completed in a short time by this method. And, the
experimental results demonstrate that the feeding system
can run to the target position quickly and precisely. This
design scheme could be widely applied to develop the
intelligent control systems for the equipment of automatic
production line. The CAD based drilling machines which
are much more costly and too bulky, can easily be replaced
by the proposed and designed system. This system is cost
effective, time saving and portable and it can prove its
effectiveness in PCB industry worldwide.
Type cast
Type cast
Difference between
present and target
location
Differenc
e positive
for X
axis
Differenc
e positive
for X
axis
X++
X++
Differenc
e negative
for Y axis
Y -
-
Y -
-
Update present
location
Update present
location
Tell serially to computer that
controller is read for drilling next
hole
Tell serially to computer that
controller is read for drilling next
hole
X-
-
X-
-
Y++
Y++
Get Serial Input
Get Serial Input
ResearchGate has not been able to resolve any citations for this publication.
ResearchGate has not been able to resolve any references for this publication.