Automatic PCB Drill Machine-Microcontroller and Assembly Language-Project Report, Thesis of Microcontrollers

This is project report by a student to fulfil requirement of course Microcontroller and Assembly Language at Ankit Institute of Technology and Science. It contains Automatic, PCB, Drill, Machine, Generate, Stepper, Motor, Open, loop, Load, Independent, Working

Typology: Thesis

2011/2012

Uploaded on 07/03/2012

booby
booby 🇮🇳

3.8

(15)

21 documents

1 / 24

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Report of Automatic PCB Drill Machine
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download Automatic PCB Drill Machine-Microcontroller and Assembly Language-Project Report and more Thesis Microcontrollers in PDF only on Docsity!

Report of Automatic PCB Drill Machine

OVERVIEW:

 Generate Drill file from in *.txt format from PCB design through ALTIUM software  The Drill file will give X and Y coordinates of Holes in PCB

 File processing system through MATLAB  Send X and Y coordinates form MATLAB to 8051 separately and one by one

 Generate length of clock for each coordinate

 Moving the respective stepper motor to desired coordinate through drive cards for X coordinate first then Y coordinate

 After reaching the X and Y coordinate move the stepper motor for Z coordinate for drilling

 Repeat the process again for next X and Y coordinate.

Working:

The stepper motor uses the theory of operation for magnets to make the motor shaft turn a precise distance when a pulse of electricity is provided. You learned previously that like poles of a magnet repel and unlike poles attract. Figure 1 shows a typical cross-sectional view of the rotor and stator of a stepper motor. From this diagram you can see that the stator (stationary winding) has four poles, and the rotor has six poles (three complete magnets). The rotor will require 12 pulses of electricity to move the 12 steps to make one complete revolution. Another way to say this is that the rotor will move precisely 30° for each pulse of electricity that the motor receives. The number of degrees the rotor will turn when a pulse of electricity is delivered to the motor can be calculated by dividing the number of degrees in one revolution of the shaft (360°) by the number of poles (north and south) in the rotor. In this stepper motor 360° is divided by 12

to get 30°.

Figure 1. Diagram that shows the position of the six-pole rotor and four-pole stator of a typical stepper motor

When no power is applied to the motor, the residual magnetism in the rotor magnets will cause the rotor to detent or align one set of its magnetic poles with the magnetic poles of one of the stator magnets. This means that the rotor will have 12 possible detent positions. When the rotor is in a detent position, it will have enough magnetic force to keep the shaft from moving to the next position. This is what makes the rotor feel like it is clicking from one position to the next as you rotate the rotor by hand with no power applied.

When power is applied, it is directed to only one of the stator pairs of windings, which will cause that winding pair to become a magnet. One of the coils for the pair will become the north pole, and the other will become the south pole. When this occurs, the stator coil that is the north pole will attract the closest rotor tooth that has the opposite polarity, and the stator coil that is the south pole will attract the closest rotor tooth that has the opposite polarity. When current is flowing through these poles, the rotor will now have a much stronger attraction to the stator

winding, and the increased torque is called holding torque.

By changing the current flow to the next stator winding, the magnetic field will be changed 90°. The rotor will only move 30° before its magnetic fields will again align with the change in the stator field. The magnetic field in the stator is continually changed as the rotor moves through the 12 steps to move a total of 360°. Figure 2 shows the position of the rotor changing as the current supplied to the stator changes.

FIGURE 2 Movement of the stepper motor rotor as current is pulsed to the stator. (a) Current is applied to the top and bottom windings, so the top winding is north, (b) Current is applied to left and right windings, so the left winding is north, (c) Current is applied to the top and bottom windings, so the bottom winding is north, (d) Current is applied to the left and right windings so the right winding is north.

In Fig. 2a you can see that when current is applied to the top and bottom stator windings, they will become a magnet with the top part of the winding being the north pole, and the bottom part of the winding being the south pole. You should notice that this will cause the rotor to move a small amount so that one of its south poles is aligned with the north stator pole (at the top), and the opposite end of the rotor pole, which is the north pole, will align with the south pole of the stator (at the bottom). A line is placed on the south-pole piece that is located at the 12 o'clock position in Fig. 2a so that you can follow its movement as current is moved from one

For the following discussions please refer to the figure 9.

In Wave Drive only one winding is energized at any given time. The stator is energized according to the sequence A -> B -> A -> B and the rotor steps from position 8 -> 2 ->4 -> 6. For unipolar and bipolar wound motors with the same winding parameters this excitation mode would result in the same mechanical position. The disadvantage of this drive mode is that in the unipolar wound motor you are only using 25% and in the bipolar motor only 50% of the total motor winding at any given time. This means that you are not getting the maximum torque output from the motor.

In Full Step Drive you are energizing two phases at any given time. The stator is energized according to the sequence and the rotor steps from position 1 ->3 ->5-> 7. Full step mode results in the same angular movement as 1 phase on drive but the mechanical position is offset by one half of a full step. The torque output of the unipolar wound motor is lower than the bipolar motor (for motors with the same winding parameters) since the unipolar motor uses only 50% of the available winding while the bipolar motor uses the entire winding.

Half Step Drive combines both wave and full step (1&2 phases on) drive modes. Every second step only one phase is energized and during the other steps one phase on each stator.

The stator is energized according to the sequence

and the rotor steps from position 1 ->2 -> 3-> 4 ->5 -> 6 -> 7 ->

  1. This results in angular movements that are half of those in 1- or 2-phases-on drive modes. Half stepping can reduce a phenomena referred to as resonance which can be experienced in 1- or 2- phases-on drive modes.

The excitation sequences for the above drive modes are summarized in Table 1.

Figure 9 Unipolar and bipolar wound stepper motors.

In Microstepping Drive the currents in the windings are continuously varying to be able to break up one full step into many smaller discrete steps.

Shortcut for finding the proper wiring sequence

For 5 wires – 1 is common to be plugged at positive supply and rest four to the pulses. For 6 wires – 2 are common to be plugged at positive supply and rest four to the pulses.

Connect the center tap(s) to the power source (or current-Limiting resistor.) Connect the remaining 4 wires in any pattern. If it doesn't work, you only need try these 2 swaps...

1 2 3 4 - (arbitrary first wiring order)

1 2 4 3 - switch end pair

1 4 2 3 - switch middle pair

You're finished when the motor turns smoothly in either direction. If the motor turns in the opposite direction from desired, reverse the wires so that ABCD would become DCBA.

Wiring of stepper motor of different number of wires:

Stepper Motor Drive Circuit

General Description

The SAA1027 is a bipolar integrated circuit intended for driving a four-phase two-stator motor. The circuit consists of a bidirectional four-state counter and a code converter to drive the four outputs in the sequence required for driving a stepper motor.

Features

 High noise immunity inputs  Clockwise and counter-clockwise operation  Reset facility  High output current  Outputs protected against damage by overshoot.

Quick Reference Data

Supply voltage range VCC 9.5 to 18 V

Supply current, unloaded ICC typ. 4.5 mA

Input voltage, all inputs

HIGH VIH^ min.^ 7.5 V LOW VIL^ max.^ 4.5 V

Input current, all inputs, LOW IIL typ. 30 A

Output current LOW IOL max. 500 mA

Operating ambient temperature range Tamb - 20 to +70 C

Package outline - 16-lead DIL; plastic (SOT-38A)

Fig. 1 Block diagram. The blocks marked HNIL/CML are high noise immunity input stages, the block marked CTR2 is a bidirectional sychronous 2-bit (4-state) counter and the block marked X/Y is a code converter. C is the count input, M the mode input to select forward or reverse counting and R is the reset input which resets the counter to content zero.

Functional Description

Count input C (pin 15) The outputs change state after each L to H signal trasition at the count input.

Mode input M (pin 3) With the mode input the sequence of output signals, and hence the direction of the stepping motor, can be chosen, as shown in the following table.

Counting sequence

M = L M = H

Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q

0 L H L H L H L H

1 H L L H L H H L

2 H L H L H L H L

3 L H H L H L L H

0 L H L H L H L H

Reset input (pin 2) A LOW level at the R input resets the counter to zero. The outputs take on the levels shown in the upper and lower line of the table above.

If this facility is not used the R input should be connected to the supply.

External resistor pin RX (pin 4) The External resistor pin R4 connected to RX sets the base current of the output transistors. Its value has to be chosen in accordance with the required output current (see Fig. 5).

Outputs Q1 to Q4 (pins 6, 8, 9, and 11) The circuit has open-collector outputs. To prevent damage by an overshooting output voltage the outputs are protected by diodes connected to VCC2, pin 13. High output currents mainly determine the total power dissipation, see Fig. 3.

Ratings

Limiting values in accordance with the absolute Maximum System (IEC 134)

Supply voltage, d.c. VCC1;VCC2 max. 18 V

Input voltage, all inputs VI max. 18 V

Current into pin 4 IRX max. 120 mA

Output current IOL max. 500 mA

Power dissipation Ptot see Fig.

Storage temperature range Tstg (^) - 40 to +125 �C

Operating ambient temperature range Tamb (^) - 20 to +70 �C

Characteristics

VCC = 9.5 to 18 V; VEE = 0 V; Tamb= -20 to +70 �C unless otherwise specified.

parameter symbol min. typ. max. unit

Supply VCC1 and VCC2 (pins 14 and 13) Supply Current at VCC1 = 12 V; unloaded; all inputs HIGH; pin 4 open ICC 2 4.5 6.5 mA

Inputs C, M and R (pins 15, 3 and 2) Input voltage: HIGH LOW Input current: HIGH LOW

VIH

VIL

IIH

-IIL

V

V

�A

�A

External resistor pin RX (pin 4)

Voltage at RX at VCC = 12 V � 15%

R4 = 130 ohm � 5% (^) VRX 3 - 4.5 V

Outputs Q1 to Q Output voltage LOW at IOL = 350 mA at IOL = 500 mA Output current LOW HIGH at VQ = 18 V

VOL

VOL

IOL

-IOH

mV mV

mA �A

CODE:

REFERENCE SETTING:

#include <reg51.h>

sbit clk = P1^2;

sbit clk1 = P2^2;

sbit reset = P1^3;

sbit reset1 = P2^3;

sbit dir = P1^4;

sbit dir1=P2^4;

sbit lim_sw1 = P1^7;

sbit lim_sw2 = P1^6;

void main(void)

{

TMOD=0*22;

//IT0=1;

dir=0;

dir1=0;

TH0=-50;

TH1=-50;

TR0=1;

TR1=1;

reset=1;

reset1=1;

if(lim_sw1==0)

while(TF0!=1);

TF0=0;

clk=!(clk);

}

else

{

reset=0;

}

if(lim_sw2==0)

{

while(TF1!=1);

TF1=0;

clk1=!(clk1);

}

else

reset1=0;

}

SERIAL COMMUNICATION:

#include <REG51.H>

sbit clk = P1^2;

sbit clk1 = P2^2;

sbit reset = P1^3;

void AckFun(char value)

{

if(value==0) //Incorrect Data received

{

SBUF='N';

while(TI==0);

TI=1;

}

else //Correct Data Received

{

SBUF='Y';

while(TI==0);

TI=1;

}

}

///////////////////////////////////////////////

int DataFun(int value)

{

i=0;

for(i=0;i<value;i++)

{

factr[1]=10;

factr[2]=10;

factr[3]=10;

factr[4]=1;

while(RI==0);

arr[i]=SBUF;

arr[i]=(arr[i])*(factr[i]);

RI=0;

}

return i;

}

/////////////////////////////

int sum(int value)

{

for(i=0;i<=value;i++)

{

sum1=(sum1)+(arr[i]);

}

return sum1;

}

///////////////////////////////////////

void main()

{

initial();

soc='A';

eoc='B';

//Set Baud Rate

TMOD=0x20;

TH1=0xFA;