You are on page 1of 50

PROJECT REPORT ON :-

CNC PLOTTER

Name Of Student Patel Jainik P. Patel Kirtan H. Shah Ashish D.

Roll No. 04MC35 04MC40 04MC53

Sr. No. 35 39 44

Exam No. 435 439 454

MECHANICAL AND MECHATRONICS ENGG. DEPARTMENT U.V.PATEL COLLEGE OF ENGINEERING GANPAT UNIVERSITY MEHSANA KHERVA 2008

CERTIFICATE
This is to certify that this project entitled CNC PLOTTER Being Submitted By Name Of Student Patel Jainik P. Patel Kirtan H. Shah Ashish D. Roll No. 04MC35 04MC40 04MC53 Serial No. 29 33 44 Exam No. 435 439 454

Towards The Partial Fulfillment of the requirements for the award of the Degree of B.Tech Mechatronics Of the Ganpat University is the record of candidates own work, carried out by him under our supervision and guidance. In our opinion work submitted has reached a level required for being accepted for examinations. The matter embodied in this project has not been submitted to any other university for the award of any Degree. Prof. S.M.Patel
Mechanical Mechatronics Engg. Dept. U.V.Patel College Of Engineering Mehsana Countersigned Head Of Department Mechanical Mechatronics Engg. Dept. U.V.Patel College Of Engineering Mehsana Guided By : C.P.Patel (Lect. ME & MC Dept.)

ACKNOWLEDGEMENT
First We would like to express our salutation to god for giving our strength, confidence and moral boost for successful completion of this project. We specially thank to Ganpat University for giving me a great opportunity to prepare a project work on CNC PLOTTER . We also express my profound gratitude to Prof. Dr. J.L.JUNEJA, our principal, who has been constant source of inspiration to steer me forward throughout the four year of our study. We wish to acknowledge those of my many classmate whose feedback have told me so much about what worked and what did not. A number of colleagues who help me, are thanked for their ides and suggestion about this project. We Specially thank to our Asst. Prof. J. P. Patel, our Guide Lect. C. P. Patel and Asst. Prof. J. R. Mevada for their contribution and whose ideas and evalution led to many improvement in this manuscript.

Some people spend their entire lives reading without being able to go any further. They dont understand that words are there only to to reach the other side. It is other side that matters.

ABSTRACT :
In our cnc plotter we have used the concept of XY table. 'XY' series can be used for a variety of automation applications. Two degrees of freedom allow more complex tasks to be performed such as working with a rack of test tubes or drilling small holes in a circuit board. The aluminum frame makes the table strong and lightweight while the solid steel shafts and bronze bearings provide accuracy and long life with a minimum of flexure. The 'XY' series tables can be controlled using stepper motor. However, the power requirements for the larger steppers simply was not enough. I experimented with opto-isolators and high amperage Darlington transistors, but eventually decided that the isolators were not really needed once the proper transistors were used. I did, however, use a parallel port card instead of the port on the motherboard during the development phase since a card is much safer for experimenting on. The driver for the motors began as a simple interface where the user could tune different steppers for best operation in both single and dual excitation modes. This was fun to learn about while developing the software. Several versions were developed and I finally settled on a semirobust driver that could be tuned both to different motors but also to different processor clock speeds. This is important because the delays that are needed to slow down the clock cycle speed are different on other machines and therefore affect the rate at which a pulse is sent to the motor. I can't draw circles because the rate of change between the x and y axis is non-linear. This is because I inadvertantly used two different steppers for x and y. So, I can't set the appropriate bits in one instruction to make both motors move simultaneously. This happens to do with the frequency at which the different motors respond to the clock pulse.

INDEX
Sr No.
1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) Project Profile Introduction Design Analysis of Mechanical Component Electrical Drives Parallel Port Stepper Motor Controll Via Parallel Port Electronics Hardware Software Application Philosophy of our project Bibliography

Topic Name

Page No.

Chapter 1 PROJECT PROFILE

PROJECT TITLE: CNC PLOTTER (X Y TABLE)

MECHANICAL STRUCTURE REQUIREMENT: ALUMINIUM PLATES(3) STAINELESS STEEL SHAFT(4) TIMING BELT(2); TIMING PULLEY(4);

ELECTRONICS COMPONEMT REQUIREMENT: 74LS06 IC(2) OPTO COUPLER MCT-2E IC(8) DARLINGTON TRANSISTOR TIP 122(8) RESISTORS(32) DIODES(8)

ELECTRICAL COMPONENETS REQUIREMENT: STEPPER MOTORS(2) DC 5V POWER SUPPLY

PROJECT GUIDE: INTERNAL GUIDE: C. P. PATEL EXTERNAL GUIDE: T. H. POPAT(E-INFOCHIPS) P. I. SHAH(FINIX LAB)

Chapter 2 Introduction

In our cnc plotter we have used the concept of XY table. 'XY' series can be used for a variety of automation applications. Two degrees of freedom allow more complex tasks to be performed such as working with a rack of test tubes or drilling small holes in a circuit board. The aluminum frame makes the table strong and lightweight while the solid steel shafts and bronze bearings provide accuracy and long life with a minimum of flexure. The 'XY' series tables can be controlled using stepper motor. However, the power requirements for the larger steppers simply was not enough. I experimented with opto-isolators and high amperage Darlington transistors, but eventually decided that the isolators were not really needed once the proper transistors were used. I did, however, use a parallel port card instead of the port on the motherboard during the development phase since a card is much safer for experimenting on. The driver for the motors began as a simple interface where the user could tune different steppers for best operation in both single and dual excitation modes. This was fun to learn about while developing the software. Several versions were developed and I finally settled on a semirobust driver that could be tuned both to different motors but also to different processor clock speeds. This is important because the delays that are needed to slow down the clock cycle speed are different on other machines and therefore affect the rate at which a pulse is sent to the motor. I can't draw circles because the rate of change between the x and y axis is non-linear. This is because I inadvertantly used two different steppers for x and y. So, I can't set the appropriate bits in one instruction to make both motors move simultaneously. This happens to do with the frequency at which the different motors respond to the clock pulse.

Chapter 3 Design Analysis of Machine Elements

10

1) Base :
Length Breadth Thickness of plate = 530mm = 378 mm = 4 mm

2) X-Axis :
Length Breadth Thickness of plate Center distance between pulley = 533 mm = 165 mm = 4 mm = 415 mm

3) Y-Axis :
Length Breadth Thickness of plate Center distance between pulley = 218 mm = 152 mm = 3 mm = 415 mm

4) Dimension of pulley :
Diameter Width = 42 mm = 21 mm

5) Traveling Distance for X-axis :


Total Length of slideway Breadth of X-axis Total Traveling Distance = 330 mm = 165 mm = Total Length of slideway-breadth of x-axis = 330-165 =165 mm

11

Conclusion : Total Traveling distance of x-axis 165 mm

6) Traveling distance for Y-axis :


Total Length of slideway Breadth of Y-axis Total Traveling Distance = 300mm = 152 mm = Total Length of slideway-breadth of y-axis = 300-152 = 148 mm Conclusion : Total Traveling distance for y-axis 148 mm

7) Work Area :
Work area = x travel distance * y travel distance = (165*148) mm2

8) Number OF Pulses Required for movement of x-axis :


1 pulse is required for 1.8 degree rotation of shaft. 200 pulse is required for 360 degree rotation of shaft 200 pulse = 360 degree = 1 revolution = 2r = 2*21* = 131.88mm 200 pulses are required for linear movement of x-axis Total Traveling distance of x-axis is 165 mm Conclusion : 250 pulses are required for reaching x-axis from home to final posiition

12

9) Number OF Pulses Required for movement of Y-axis :


1 pulse is required for 1.8 degree rotation of shaft. 200 pulse is required for 360 degree rotation of shaft 200 pulse = 360 degree = 1 revolution = 2r = 2*21* = 131.88mm 200 pulses are required for linear movement of Y-axis Total Traveling distance of Y-axis is 148 mm Conclusion : 224 pulses are required for reaching Y-axis from home to final position

10) Design of Belt :


Pitch distance of teeth of belt = width of one teeth + space between two teeth = 2+3 = 5 mm Length of Belt = [/2 *(D1 + D2)] + [(D1 D2)^2/ 4x] +[ 2x] Where : x = center distance between pulley = 415 mm D1=D2= dia. of driving and driven pulley = 42 mm = 3.14 There for Length of belt = 961.94 mm = 0.96 m Conclusion : pitch distance = 5 mm and length of belt 961.94 mm

13

11) Accuracy :
Accuracy depends on following factors : 1) Dia. Of Pulley : Accuracy inversely proportional to dia. of pulley 2) Rigidity of Base : If rigidity of base is high then it will have good vibration damping capacity which leds to higher accuracy 3) Friction : Slideway material should be selected such that sliding components causes less friction and give better accuracy 4) Pitch distance of teeth of timing belt : Accuracy inversely proportional to pitch distance 5) Programmers Skills : With better skill of programming it will be able to achieve microstepping of pulses which gives higher accuracy. Conclusion : Accuracy = 5 mm +/- 0.7 mm

14

Chapter 5 Electrical Drives

15

4.1 Stepping Motor Types Introduction


Stepping motors come in two varieties, permanent magnet and variable reluctance (there are also hybrid motors, which are indistinguishable from permanent magnet motors from the controller's point of view). Lacking a label on the motor, you can generally tell the two apart by feel when no power is applied. Permanent magnet motors tend to "cog" as you twist the rotor with your fingers, while variable reluctance motors almost spin freely (although they may cog slightly because of residual magnetization in the rotor). You can also distinguish between the two varieties with an ohmmeter. Variable reluctance motors usually have three (sometimes four) windings, with a common return, while permanent magnet motors usually have two independent windings, with or without center taps. Center-tapped windings are used in unipolar permanent magnet motors. Stepping motors come in a wide range of angular resolution. The coarsest motors typically turn 90 degrees per step, while high resolution permanent magnet motors are commonly able to handle 1.8 or even 0.72 degrees per step. With an appropriate controller, most permanent magnet and hybrid motors can be run in half-steps, and some controllers can handle smaller fractional steps or microsteps. For both permanent magnet and variable reluctance stepping motors, if just one winding of the motor is energised, the rotor (under no load) will snap to a fixed angle and then hold that angle until the torque exceeds the holding torque of the motor, at which point, the rotor will turn, trying to hold at each successive equilibrium point.

Variable Reluctance Motors

Figure 4.1

If your motor has three windings, typically connected as shown in the schematic diagram in Figure 1.1, with one terminal common to all windings, it is most likely a variable reluctance stepping motor. In use, the common wire typically goes to the positive supply and the windings are energized in sequence.

16

The cross section shown in Figure 1.1 is of 30 degree per step variable reluctance motor. The rotor in this motor has 4 teeth and the stator has 6 poles, with each winding wrapped around two opposite poles. With winding number 1 energised, the rotor teeth marked X are attracted to this winding's poles. If the current through winding 1 is turned off and winding 2 is turned on, the rotor will rotate 30 degrees clockwise so that the poles marked Y line up with the poles marked 2. To rotate this motor continuously, we just apply power to the 3 windings in sequence. Assuming positive logic, where a 1 means turning on the current through a motor winding, the following control sequence will spin the motor illustrated in Figure 1.1 clockwise 24 steps or 2 revolutions:
Winding 1 1001001001001001001001001 Winding 2 0100100100100100100100100 Winding 3 0010010010010010010010010 time --->

There are also variable reluctance stepping motors with 4 and 5 windings, requiring 5 or 6 wires. The principle for driving these motors is the same as that for the three winding variety, but it becomes important to work out the correct order to energise the windings to make the motor step nicely. The motor geometry illustrated in Figure 1.1, giving 30 degrees per step, uses the fewest number of rotor teeth and stator poles that performs satisfactorily. Using more motor poles and more rotor teeth allows construction of motors with smaller step angle. Toothed faces on each pole and a correspondingly finely toothed rotor allows for step angles as small as a few degrees.

Unipolar Motors

Figure 4.2

Unipolar stepping motors, both Permanent magnet and hybrid stepping motors with 5 or 6 wires are usually wired as shown in the schematic in Figure 1.2, with a center tap on each of two windings. In use, the center taps of the windings are typically wired to the positive supply, and the two ends of each winding are alternately grounded to reverse the direction of the field provided by that winding. The motor cross section shown in Figure 1.2 is of a 30 degree per step permanent magnet or hybrid motor -- the difference between these two motor types is not relevant at this level of abstraction. Motor winding number 1 is distributed between the top and bottom stator pole, while motor winding number 2 is distributed between the left and right motor poles. The rotor is a permanent magnet with 6 poles, 3 south and 3 north, arranged around its circumfrence.

17

For higher angular resolutions, the rotor must have proportionally more poles. The 30 degree per step motor in the figure is one of the most common permanent magnet motor designs, although 15 and 7.5 degree per step motors are widely available. Permanent magnet motors with resolutions as good as 1.8 degrees per step are made, and hybrid motors are routinely built with 3.6 and 1.8 degrees per step, with resolutions as fine as 0.72 degrees per step available. As shown in the figure, the current flowing from the center tap of winding 1 to terminal a causes the top stator pole to be a north pole while the bottom stator pole is a south pole. This attracts the rotor into the position shown. If the power to winding 1 is removed and winding 2 is energised, the rotor will turn 30 degrees, or one step. To rotate the motor continuously, we just apply power to the two windings in sequence. Assuming positive logic, where a 1 means turning on the current through a motor winding, the following two control sequences will spin the motor illustrated in Figure 1.2 clockwise 24 steps or 4 revolutions:
Winding Winding Winding Winding 1a 1b 2a 2b 1000100010001000100010001 0010001000100010001000100 0100010001000100010001000 0001000100010001000100010 time ---> 1100110011001100110011001 0011001100110011001100110 0110011001100110011001100 1001100110011001100110011 time --->

Winding Winding Winding Winding

1a 1b 2a 2b

Note that the two halves of each winding are never energized at the same time. Both sequences shown above will rotate a permanent magnet one step at a time. The top sequence only powers one winding at a time, as illustrated in the figure above; thus, it uses less power. The bottom sequence involves powering two windings at a time and generally produces a torque about 1.4 times greater than the top sequence while using twice as much power. The step positions produced by the two sequences above are not the same; as a result, combining the two sequences allows half stepping, with the motor stopping alternately at the positions indicated by one or the other sequence. The combined sequence is as follows:
Winding Winding Winding Winding 1a 1b 2a 2b 11000001110000011100000111 00011100000111000001110000 01110000011100000111000001 00000111000001110000011100 time --->

18

Bipolar Motors

Figure 4.3

Bipolar permanent magnet and hybrid motors are constructed with exactly the same mechanism as is used on unipolar motors, but the two windings are wired more simply, with no center taps. Thus, the motor itself is simpler but the drive circuitry needed to reverse the polarity of each pair of motor poles is more complex. The schematic in Figure 1.3 shows how such a motor is wired, while the motor cross section shown here is exactly the same as the cross section shown in Figure 1.2.

Briefly, an H-bridge allows the polarity of the power applied to each end of each winding to be controlled independently. The control sequences for single stepping such a motor are shown below, using + and - symbols to indicate the polarity of the power applied to each motor terminal:
Terminal Terminal Terminal Terminal 1a 1b 2a 2b +---+---+---+----+---+---+---+-+---+---+---+----+---+---+---+ time ---> ++--++--++--++---++--++--++--++ -++--++--++--+++--++--++--++--+

Note that these sequences are identical to those for a unipolar permanent magnet motor, at an abstract level, and that above the level of the H-bridge power switching electronics, the control systems for the two types of motor can be identical. Note that many full H-bridge driver chips have one control input to enable the output and another to control the direction. Given two such bridge chips, one per winding, the following control sequences will spin the motor identically to the control sequences given above:
Enable Direction Enable Direction 1 1 2 2 1010101010101010 1x0x1x0x1x0x1x0x 0101010101010101 x1x0x1x0x1x0x1x0 time ---> 1111111111111111 1100110011001100 1111111111111111 0110011001100110

To distinguish a bipolar permanent magnet motor from other 4 wire motors, measure the resistances between the different terminals. It is worth noting that some permanent magnet stepping motors have 4 independent windings, organized as two sets of two. Within each set, if the two windings are wired in series, the result can be used as a high voltage bipolar motor. If

19

they are wired in parallel, the result can be used as a low voltage bipolar motor. If they are wired in series with a center tap, the result can be used as a low voltage unipolar motor.

Bifilar Motors
Bifilar windings on a stepping motor are applied to the same rotor and stator geometry as a bipolar motor, but instead of winding each coil in the stator with a single wire, two wires are wound in parallel with each other. As a result, the motor has 8 wires, not four. In practice, motors with bifilar windings are always powered as either unipolar or bipolar motors. Figure 1.4 shows the alternative connections to the windings of such a motor.

Figure 4.4

To use a bifilar motor as a unipolar motor, the two wires of each winding are connected in series and the point of connection is used as a center-tap. Winding 1 in Figure 1.4 is shown connected this way. To use a bifilar motor as a bipolar motor, the two wires of each winding are connected either in parallel or in series. Winding 2 in Figure 1.4 is shown with a parallel connection; this allows low voltage high-current operation. Winding 1 in Figure 1.4 is shown with a series connection; if the center tap is ignored, this allows operation at twice the voltage and half the current as would be used with the windings in parallel. It should be noted that essentially all 6-wire motors sold for bipolar use are actually wound using bifilar windings, so that the external connection that serves as a center tap is actually connected as shown for winding 1 in Figure 1.4. Naturally, therefore, any unipolar motor may be used as a bipolar motor at twice the rated voltage and half the rated current as is given on the nameplate. For those who salvage old motors, finding an 8-wire motor poses a challenge! Which of the 8 wires is which? It is not hard to figure this out using an ohm meter, an AC volt meter, and a low voltage AC source. First, use the ohm meter to identify the motor leads that are connected to each other through the motor windings. Then, connect a low-voltage AC source to one of these windings. The AC voltage should be below the advertised operating voltage of the motor; voltages under 1 volt are recommended. The geometry of the magnetic circuits of the motor guarantees that the two wires of a bifilar winding will be strongly coupled for AC signals, while there should be almost no coupling to the other two wires. Therefore, probing with an AC volt meter should disclose which of the other three windings is paired to the winding under power.

20

Multiphase Motors

Figure 4.5

A less common class of permanent magnet stepping motor is wired with all windings of the motor in a cyclic series, with one tap between each pair of windings in the cycle. The most common designs in this category use 3-phase and 5-phase wiring. The control requires 1/2 of an H-bridge for each motor terminal, but these motors can provide more torque from a given package size because all or all but one of the motor windings are energised at every point in the drive cycle. Some 5-phase motors have high resolutions on the order of 0.72 degrees per step (500 steps per revolution). With a 5-phase motor, there are 10 steps per repeat in the stepping cycle, as shown below:
Terminal Terminal Terminal Terminal Terminal 1 2 3 4 5 +++-----+++++-----++ --+++++-----+++++--+-----+++++-----++++ +++++-----+++++--------+++++-----+++++time --->

Here, as in the bipolar case, each terminal is shown as being either connected to the positive or negative bus of the motor power system. Note that, at each step, only one terminal changes polarity. This change removes the power from one winding attached to that terminal (because both terminals of the winding in question are of the same polarity) and applies power to one winding that was previously idle. Given the motor geometry suggested by Figure 1.5, this control sequence will drive the motor through two revolutions. To distinguish a 5-phase motor from other motors with 5 leads, note that, if the resistance between two consecutive terminals of the 5-phase motor is R, the resistance between nonconsecutive terminals will be 1.5R. Note that some 5-phase motors have 5 separate motor windings, with a total of 10 leads. These can be connected in the star configuration shown above, using 5 half-bridge driver circuits, or each winding can be driven by its own full-bridge. While the theoretical component count of half-bridge drivers is lower, the availability of integrated full-bridge chips may make the latter approach preferable.

21

4.2 Torque versus Speed


An important consideration in designing high-speed stepping motor controllers is the effect of the inductance of the motor windings. As with the torque versus angular position information, this is frequently poorly documented in motor data sheets, and indeed, for variable reluctance stepping motors, it is not a constant! The inductance of the motor winding determines the rise and fall time of the current through the windings. While we might hope for a square-wave plot of current versus time, the inductance forces an exponential, as illustrated in Figure 2.10:

Figure 4.2.1

The details of the current-versus-time function through each winding depend as much on the drive circuitry as they do on the motor itself! It is quite common for the time constants of these exponentials to differ. The rise time is determined by the drive voltage and drive circuitry, while the fall time depends on the circuitry used to dissipate the stored energy in the motor winding. At low stepping rates, the rise and fall times of the current through the motor windings has little effect on the motor's performance, but at higher speeds, the effect of the inductance of the motor windings is to reduce the available torque, as shown in Figure 2.11:

Figure 4.2.2

The motor's maximum speed is defined as the speed at which the available torque falls to zero. Measuring maximum speed can be difficult when there are resonance problems, because these cause the torque to drop to zero prematurely. The cutoff speed is the speed above which the torque begins to fall. When the motor is operating below its cutoff speed, the rise and fall times of the current through the motor windings occupy an insignificant fraction of each step, while at the cutoff speed, the step duration is comparable to the sum of the rise and fall times. Note that a sharp cutoff is rare, and therefore, statements of a motor's cutoff speed are, of necessity, approximate.

22

The details of the torque versus speed relationship depend on the details of the rise and fall times in the motor windings, and these depend on the motor control system as well as the motor. Therefore, the cutoff speed and maximum speed for any particular motor depend, in part, on the control system! The torque versus speed curves published in motor data sheets occasionally come with documentation of the motor controller used to obtain that curve, but this is far from universal practice! Similarly, the resonant speed depends on the moment of inertia of the entire rotating system, not just the motor rotor, and the extent to which the torque drops at resonance depends on the presence of mechanical damping and on the nature of the control system. Some published torque versus speed curves show very clear resonances without documenting the moment of inertia of the hardware that may have been attached to the motor shaft in order to make torque measurements. The torque versus speed curve shown in Figure 2.11 is typical of the simplest of control systems. More complex control systems sometimes introduce electronic resonances that act to increase the available torque above the motor's low-speed torque. A common result of this is a peak in the available torque near the cutoff speed.

4.3 Microstepping of Stepping Motors Introduction


Microstepping serves two purposes. First, it allows a stepping motor to stop and hold a position between the full or half-step positions, second, it largely eliminates the jerky character of low speed stepping motor operation and the noise at intermediate speeds, and third, it reduces problems with resonance. Although some microstepping controllers offer hundreds of intermediate positions between steps, it is worth noting that microstepping does not generally offer great precision, both because of linearity problems and because of the effects of static friction.

Sine Cosine Microstepping


For an ideal two-winding variable reluctance or permanent magnet motor the torque versus shaft angle curve is determined by the following formulas: h = ( a2 + b2 )0.5 x = ( S / ( /2) ) arctan( b / a ) Where: a -- torque applied by winding with equilibrium at angle 0. b -- torque applied by winding with equilibrium at angle S. h -- holding torque of composite. x -- equilibrium position. S -- step angle.

23

This formula is quite general, but it offers little in the way of guidance for how to select appropriate values of the current through the two windings of the motor. A common solution is to arrange the torques applied by the two windings so that their sum h has a constant magnitude equal to the single-winding holding torque. This is referred to as sine-cosine microstepping: a = h1 sin((( /2)/S) ) b = h1 cos((( /2)/S) ) Where: h1 -- single-winding holding torque (( /2)/S) -- the electrical shaft angle Given that none of the magnetic circuits are saturated, the torque and the current are linearly related. As a result, to hold the motor rotor to angle ), we set the currents through the two windings as: Ia = Imax sin((( /2)/S) ) Ib = Imax cos((( /2)/S) ) Where: Ia -- current through winding with equilibrium at angle 0. Ib -- current through winding with equilibrium at angle S. Imax -- maximum allowed current through any motor winding. Keep in mind that these formulas apply to two-winding permanent magnet or hybrid stepping motors. Three pole or five pole motors have more complex behavior, and the magnetic fields in variable reluctance motors don't add following the simple rules that apply to the other motor types.

Half-Stepping and Microstepping


So long as no part of the magnetic circuit saturates, powering two motor windings simultaneously will produce a torque versus position curve that is the sum of the torque versus position curves for the two motor windings taken in isolation. For a two-winding permanent magnet or hybrid motor, the two curves will be S radians out of phase, and if the currents in the two windings are equal, the peaks and valleys of the sum will be displaced S/2 radians from the peaks of the original curves, as shown in Figure 2.2:

Figure 4.3.1

This is the basis of half-stepping. The two-winding holding torque is the peak of the composite torque curve when two windings are carrying their maximum rated current. For common twowinding permanent magnet or hybrid stepping motors, the two-winding holding torque will be: h2 = 20.5 h1 24

where: h1 -- single-winding holding torque h2 -- two-winding holding torque This assumes that no part of the magnetic circuit is saturated and that the torque versus position curve for each winding is an ideal sinusoid. Most permanent-magnet and variable-reluctance stepping motor data sheets quote the twowinding holding torque and not the single-winding figure; in part, this is because it is larger, and in part, it is because the most common full-step controllers always apply power to two windings at once. If any part of the motor's magnetic circuits is saturated, the two torque curves will not add linearly. As a result, the composite torque will be less than the sum of the component torques and the equilibrium position of the composite may not be exactly S/2 radians from the equilibria of the original. Microstepping allows even smaller steps by using different currents through the two motor windings, as shown in Figure 2.3:

Figure 4.3.2

For a two-winding variable reluctance or permanent magnet motor, assuming nonsaturating magnetic circuits, and assuming perfectly sinusoidal torque versus position curves for each motor winding, the following formula gives the key characteristics of the composite torque curve: h = ( a2 + b2 )0.5 x = ( S / ( /2) ) arctan( b / a ) Where: a -- torque applied by winding with equilibrium at 0 radians. b -- torque applied by winding with equilibrium at S radians. h -- holding torque of composite. x -- equilibrium position, in radians. S -- step angle, in radians. In the absence of saturation, the torques a and b are directly proportional to the currents through the corresponding windings. It is quite common to work with normalized currents and torques, so that the single-winding holding torque or the maximum current allowed in one motor winding is 1.0.

25

Limits of Microstepping
The utility of microstepping is limited by at least three consideraitons. First, if there is any static friction in the system, the angular precision achievable with microstepping will be limited.

4.4 Current Limiting for Stepping Motors Introduction


Small stepping motors, such as those used for head positioning on floppy disk drives, are usually driven at a low DC voltage, and the current through the motor windings is usually limited by the internal resistance of the winding. High torque motors, on the other hand, are frequently built with very low resistance windings; when driven by any reasonable supply voltage, these motors typically require external current limiting circuitry. There is good reason to run a stepping motor at a supply voltage above that needed to push the maximum rated current through the motor windings. Running a motor at higher voltages leads to a faster rise in the current through the windings when they are turned on, and this, in turn, leads to a higher cutoff speed for the motor and higher torques at speeds above the cutoff. Microstepping, where the control system positions the motor rotor between half steps, also requires external current limiting circuitry. For example, to position the rotor 1/4 of the way from one step to another, it might be necessary to run one motor winding at full current while the other is run at approximately 1/3 of that current. The remainder of this section discusses various circuits for limiting the current through the windings of a stepping motor, starting with simple resistive limiters and moving up to choppers and other switching regulators. Most of these current limiters are appropriate for many other applications, including limiting the current through conventional DC motors and other inductive loads.

Resistive Current Limiters


The easiest to understand current limiter is a series resistor. Most motor manufacturers recommended this approach in their literature up until the early 1980's, and most motor data sheets still give performance curves for motors driven by such circuits. The typical circuits used to control the current through one winding of a permanent magnet or hybrid motor are shown in Figure 4.1.

26

Fig 4.4.1

R1 in this figure limits the current through the motor winding. Given a rated current of I and a motor winding with a resistance Rw, Ohm's law sets the maximum supply voltage as I(Rw+R1). Given that the inductance of the motor motor winding is Lw, the time constant for the motor winding will be Lw/(Rw+R1). Figure 4.2 illustrates the effect of increasing the resistance and the operating voltage on the rise and fall times of the current through one winding of a stepping motor.

Figure 4.4.1

R2 is shown only in the unipolar example in Figure 4.1 because it is particularly useful there. For a bipolar H-bridge drive, when all switches are turned off, current flows from ground to the motor supply through R1, so the current through the motor winding will decay quite quickly. In the unipolar case, R2 is necessary to equal this performance. Note: When the switches in the H-bridge circuit shown in Figure 4.1 are opened, the direction of current flow through R1 will reverse almost instantaneously! If R1 has any inductance, for example, if it is wire-wound, it must either be bypassed with a capacitor to handle the voltage kick caused by this current reversal, or R2 must be added to the H-bridge. Given the rated maximum current through each winding and the supply voltage, the resistance and wattage of R1 is easy to compute. R2 if it is included, poses more interesting problems. The resistance of R2 depends on the maximum voltage the switches can handle. For example, if the supply voltage is 24 volts, and the switches are rated at 75 volts, the drop across R2 can be as much as 51 volts without harming the transistors. Given an operating current of 1.5 amps, R2 can be a 34 ohm resistor. Note that an interesting alternative is to use a zener diode in place of R2. Figuring the peak average power R2 must dissipate is a wonderful exercise in dynamics; the inductance of the motor windings is frequently undocumented and may vary with the rotor 27

position. The power dissapated in R2 also depends on the control system. The worst case occurs when the control system chops the power to one winding at a high enough frequency that the current through the motor winding is effectively constant; the maximum power is then a function of the duty cycle of the chopper and the ratios of the resistances in the circuit during the on and off phases of the chopper. Under normal operating conditions, the peak power dissipation will be significantly lower.

4.5 Use of Pulse Width Modulation


Another alternative approach to controlling the current through the motor winding is to use a simple power supply controlled by pulse width modulaton (PWM) or by a chopper. During the time the current through the motor winding is increasing, the control system leaves the supply attached with a 100% duty cycle. Once the current is up to the full rated current, the control system changes the duty cycle to that required to maintain the current. Figure 4.6 illustrates this scheme:

Figure 4.5.1

28

Chapter 6 Parrallel Port

29

5.1 Introduction to parallel port


The Parallel Port is the most commonly used port for interfacing home made projects. This port will allow the input of up to 9 bits or the output of 12 bits at any one given time,thus requiringminimal external circuitry to implement many simpler tasks. The port is composed of 4 control lines,5 status lines and 8 data lines. It's found commonly on the back of your PC as a D-Type 25 Pin femaleconnector. There may also be a D-Type 25 pin male connector. This will be a serial RS-232 port andthus, is a totally incompatible port. Newer Parallel Ports are standardized under the IEEE 1284 standard first released in 1994. This standard defines 5 modes of operation which are as follows, 1. Compatibility Mode. 2. Nibble Mode. (Protocol not Described in this Document) 3. Byte Mode. (Protocol not Described in this Document) 4. EPP Mode (Enhanced Parallel Port). 5. ECP Mode (Extended Capabilities Port).

5.2 Hardware Properties


On the next page is a table of the "Pin Outs" of the D-Type 25 Pin connector and the Centronics 34 Pin connector. The D-Type 25 pin connector is the most common connector found onthe Parallel Port of the computer, while the Centronics Connector is commonly found on printers. TheIEEE 1284 standard however specifies 3 different connectors for use with the Parallel Port. The firstone, 1284 Type A is the D-Type 25 connector found on the back of most computers. The 2nd is the1284 Type B which is the 36 pin Centronics Connector found on most printers. IEEE 1284 Type C however, is a 36 conductor connector like the Centronics, but smaller. This connector is claimed to have a better clip latch, better electrical properties and is easier to assemble. Italso contains two more pins for signals which can be used to see whether the other device connected has power.1284 Type C connectors are recommended for new designs, so we can look forward onseeing these new connectors in the near future.

30

Pin No.(D- Pin No. type 25) centronics


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18-25 1 2 3 4 5 6 7 8 9 10 11 12 13 14 32 31 36 19-30

SPP Signal
nStrob Data 0 Data 1 Data 2 Data 3 Data 4 Data 5 Data 6 Data 7 nAck Busy Paper out Paper end select n-auto-line feed nError/nFault nInitialize Nselectprinter Nselect-in Ground

Direction In/Out
In/Out Out Out Out Out Out Out Out Out In In In In In-out In In-out In-out Gnd

Register
Control Data Data Data Data Data Data Data Data Status Status Status Status Contrl Status Control Control

Hardware Inverted
Yes

Yes

Yes

Yes

Table 5.2.1

31

5.3 Centronics
Centronics is an early standard for transferring data from a host to the printer. The majority of printers use this handshake. This handshake is normally implemented using a Standard Parallel Portunder software control. Below is a simplified diagram of the Centronics Protocol.

Fig 5.3.1 Data is first applied on the Parallel Port pins 2 to 7. The host then checks to see if the printer is busy. i.e. the busy line should be low. The program then asserts the strobe, waits minimum of 1S,and then de-asserts the strobe. Data is normally read by the printer/peripheral on the rising edge of the strobe. The printer will indicate that it is busy processing data via the Busy line. Once the printer has accepted data, it will acknowledge the byte by a negative pulse about 5S on the nAck line. Quite often the host will ignore the nAck line to save time. Latter in the Extended Capabilities Port, you will see a Fast Centronics Mode, which lets the hardware do all the handshaking for you. All the programmer must do is write the byte of data to the I/O port. The hardware will check to see if the printer is busy, generate the strobe. Note that this mode commonly doesnt check the nAck either.

5.4 Port Addresses


The Parallel Port has three commonly used base addresses. These are listed in table 2, below. The 3BCh base address was originally introduced used for Parallel Ports on early Video Cards. This address then disappeared for a while, when Parallel Ports were later removed from Video Cards. They has now reappeared as an option for Parallel Ports integrated onto motherboards, upon which their configuration can be changed using BIOS.

32

Address
3BCh - 3BFh

Notes
Used for Parallel Ports which were incorporated in to Video Cards and now, commonly an option for Ports controlled by BIOS. Doesn't support ECP addresses

378h - 37Fh 278h - 27Fh

Usual Address For LPT 1 Usual Address For LPT 2

Table 5.4.1

5.5 Nibble Mode


Nibble mode is the preferred way of reading 8 bits of data without placing the port in reversemode and using the data lines. Nibble mode uses a Quad 2 line to 1 line multiplexer to read a nibbleof data at a time. Then it witches to the other nibble and reads its. Software can then be used toconstruct the two nibbles into a byte. The only disadvantage of this technique is that it is slower. Itnow requires a few I/O instructions to read the one byte, and it requires the use of an external IC. Fig.5.5.1(pin out of IC 74LS157)

33

34

Chapter 7 Stepper Motor Controlling Via Parrallel Port

35

To better understand the circuit, one needs to have some knowl- edge of electronics, computer programming, and the computers parallel port.You will of course need a computer, 12-volt power supply (preferably a battery eliminator), stepper motor,ULN2003chip,andsomeconnecting wires. The circuit can be easily assembled on a breadboard. It is very important that you workwith the smallest stepper motor available in the market, such as the one used in a floppy drive. If you go in for the large ones used in CNC machines, there is a chance of damaging the PCs parallel port. The second thing to mention is that the colours of the wires of the stepper motor are non-standard. computer to communicate with the outside world. The parallel port is generally used to interface printers, but we have used it to interface the stepper motor. The parallel port consists of 25 pins, but it can only transmit 8 bits of data at a time. The reason for the large number of pins is that every data pin has its own ground return pin. There are other pins for various other functions. We have used only four data pins and a ground pin. The functions of the various pins are given in Table I. Pins 2 through 9 are data pins. Here, we will use data pins 2 to 5, corresponding to data bits D0 through D3 of port 378(hex) for LPT1 or 278(hex) for LPT2. Also, pin 25 is used as the ground pin. The PCs parallel port cannot sink much current. At the most, it can handle a few milliamperes. So, if the parallel port is connected directly to an electrical device, it will damage the parallel port. Thus, we need a current amplifier in between the parallel port and the electrical device. The ULN2003, used precisely for this purpose, has an array of Darlington transistor pairs. A Darlington configuration is a way of connecting two transistors in order to amplify current to many times the input current value.The stepper motor has various advantages over other motors, as far as controlling by a computer is concerned. It includes high precision of angular movement, speed of rotation, and high moving and holding torque. It comes in various flavours. We are dealing with unipolar permanent magnet stepper motor that has four coils arranged as follows: Terminals 1 and 2 are common terminals (connected to ground or the positive supply) and the other four terminals are fed to the appropriate signals. When a proper signal is applied, the shaft turns by a specific angle, called the step resolution of the motor. On continuous application of the same signal, the shaft stays in the same position. Rotation occurs only when the signal is changed in a proper sequence. There are three modes of operation of a stepper motor, namely, single-coil excitation mode, dual-coil excitation mode, and half-step modes.

Fig.6.1(stepper motor controlling circuit)

36

Fig.6.2 (signal generation from the parallel port) Single-coil excitation. Each coil is energised successively in a rotary fashion. If the four coils are assumed to be in a horizontal plane, the bit pattern will be 0001, 0010, 0100, 1000, and 0001. Dual-coil excitation. Here, two adjacent coils are energised successively in a rotary fashion. The bit pattern will be 0011, 0110, 1100, 1001, and 0011.Half-step mode. Here, the stepper motor operates at half the given step resolution. The bit pattern is 0001, 0011, 0010, 0110, 0100, 1100, 1000, 1001, and 0001.Two software control programs, one for DOS and another for Linux, are included here. The program for DOS can be used to run the motor in full- or half-step mode, or in single-coil or double-coil excitation mode. (EFY Lab) note. The method used at EFY for correct identification of the stepper motor coils involved measuring the windings resistance as well as their continuity in ohmsx1 scale, using any good multimeter. The resistance of individual coils with respect to the middle points will roughly be half the resistance of the combined coil pairs (L1 and L2 or L3 and L4 in the figure). After having identified the coils in this fashion, connect them to the circuit as shown in the figure. Now, if the sequence of input to the coils happens to be wrong, the shaft, instead of moving (clockwise or anti-clockwise), will only vibrate. This can be corrected by trial and error, by interchanging connection to the coils. The output waveforms for full-step single-coil mode, as seen on the oscilloscope, are shown in the figure.)

37

Chapter : 8 Electronics Hardware

38

Inverter (IC 74LS06) :

Inverter (IC74LS06) Is used as a buffer.The input signal from the Pcs parallel port can not drive current more than a few micro amperes so buffer is required to increase the drive strength of the i/p signal.

Optical Isolator (MCT2E) :

39

This is a MCT2E. It is a optical isolator.Isolation from the motor winding is extrmely necessary in order to protect the rest of the interfacing circuit.The frequent switching between motor widing may cause inductive kick back a hence huge voltage spike. This may cause severe damage to the interfacing circuit.To protect the circuit we have used this optical isolator ehich gives necessory isolation.

Transistor (TIP 122) :

Transitor TIP122 is used to switch and drive the motor winding .This transitor has a very high power disipation capacity.This is selected in order to drive the motors from low voltage and power disipation and for high power and high torque motors.

40

Diode (IN4007) :

The Diode IN 4007 is kept between collector and +vcc in reverse biase in order to protest the transitor from inductive kick back of an stepper motors winding.

LEDS :
The LEDs are used for debugging purpose.This LEDs glow direction from right to left and left to right indicates the movement of motor is clock and anti clock respectively.

Operation Of Circuit :
When high voltage is given at the Pcs parallel port using C program,the logic 1 will be used to inverter(IC 74LS06).The inverter will invert the logic 1 to logic0.Hence the internal Diode of optocoupler becomes forward bias.This makes the internal phototransistor of an optocoupler is ON.And this will result in current flow through 1 Kilo ohm resistor this cause the transistor to ON position.Hence the current starts flowing from common terminal of stepper motor to winding connected to energized transistor. On current flow through the winding of an stepper motor also enabeles the LED to glow.

41

Chapter 9 Software

42

We have used Turbo C programming language to develop our software. Still we have made only one axis (i.e.X-axis). So program for the controlling one axis movement as follows:

#include<stdio.h> #include<conio.h> #include<iostreme.h> #include<dos.h> void main() { clrscr(); int step,i; cout<<Enter step = <<step; for(i=0;i<=step;i++) { outport(0x378,0); \\ all the ports will be off outport(0x378,1); \\ pin 2 will be on delay(700); outport(0x378,2); \\ pin 3 will be on delay(700); outport(0x378,4); \\ pin 4 will be on delay(700); outport(0x378,8); \\ pin 5 will be on delay(700); } getch(); }

43

44

Chapter 10 Application

45

There are so many applications in advance automation products. Such as : 1) CNC Plotter

Fig.9.1(CNC Plotter) 2) PCB Drilling Machine

Fig.9.2(PCB Drilling Machine)

46

Chapter 11 Philosophy Of Project

47

What we learn by doing . We have to learn to do. - ARISTOTLE (Ethics) As complexity rises precise, statement lose winning and meaningful statement lose precision. - LOTFI A. ZADEH

48

Books : 1) Electronics Principles


By: Albert paul Malvino

2) Digital Electronics and computer design


By: Morris Mano

3) Parrallel Port : Hardware Programming and Interfacing


By: Jen Allexesson

URLs: www.arricksrobotics.com www.beyondlogics.com

49

Imagination is more important than knowledge.

Every thing should be made as simple as possible, But not simpler. Any one who has never made a mistake has never tried anything new. The Only source of knowledge is experience.

50

You might also like