Download Stepper Motor Speed Control

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Mains electricity wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Buck converter wikipedia , lookup

Pulse-width modulation wikipedia , lookup

Commutator (electric) wikipedia , lookup

Opto-isolator wikipedia , lookup

Three-phase electric power wikipedia , lookup

Electrification wikipedia , lookup

Alternating current wikipedia , lookup

Coilgun wikipedia , lookup

Dynamometer wikipedia , lookup

Galvanometer wikipedia , lookup

Voltage optimisation wikipedia , lookup

Resonant inductive coupling wikipedia , lookup

Rectiverter wikipedia , lookup

Electric machine wikipedia , lookup

Brushless DC electric motor wikipedia , lookup

Electric motor wikipedia , lookup

AC motor wikipedia , lookup

Brushed DC electric motor wikipedia , lookup

Induction motor wikipedia , lookup

Variable-frequency drive wikipedia , lookup

Stepper motor wikipedia , lookup

Transcript
ABSTRACT:
Stepper motor is widely used in CNC machine drives, robots, and wherever an accurate
positioning is required. In such applications, step angle, direction, operating modes (single-coil
or double-coil), speed, and position are important considerations. This simple program written in
Turbo C provides easy control over the stepper motor.
The program accepts the input in decimal number and outputs on 2 digit 7 segment display for
controlling connected stepper motor.
ACKNOWLEDGEMENT
To show our deep sense of gratitude towards them, the word "thanks" is not satisfactory, but still
we would like to thank to express our gratitude in our work.
We wish to acknowledge with thanks Mr. MIHIR BHATT SIR for their various kinds of help in
the successful completion of my working model.
PREFACE
An engineer is a person who applies the knowledge of science for the welfare of society.
Neccessity is the mother of invention.
Technical knowledge is like a coin, which has two sides, one is theoretical & another is practical
knowledge. Both are very important for technical person but infect practical knowledge is more
important than theoretical.
CONTENTS
• Abstract
• Acknowledgement
• Preface
1)Stepper Motor Introduction............
2)Schematic of a 4 –phase stepper motor…………….
3)Software program……..
4)Understanding Step ................
5)Construction & operation……..
6 )application………….
7)Advantages & Limitations………
8)Conclusion……….
9)future Aspects……….
STEPPER MOTOR INTRODUCTIONS:A stepper motor is an electromagnetic device that translates electrical (Digital) pulses into
mechanical movement. Every stepper motor has a permanent magnet rotor (also called the staff)
surrounded by a stator. The Shaft of the motor rotates in equal increments when a train of input
pulses is applied To control the direction and number of steps, appropriate pulses are applied to
the stator windings of the motor.
STEPPER MOTOR TYPES:(a) Unipolar Type
(b) Bipolar Type
(2) Variable Reluctance Type
1.PERMANENT MAGNET TYPE
a) UNIPOLAR STEPPER MOTOR:Relatively easy to control. A simple 1- of –‘n’ counter circuit can generate the proper stepping
sequence and drivers as simple as one transistor per winding are possible with unipolar motors.
Two winding combination gives around 1.5 times more torque than standard sequence .
b) BIPOLAR STEPPER MOTOR:It is known for i1eir excellent size/torque ratio and provide more torque for their size than
unipolar motors. Bipolar motors are designed with separate coils that need to be driven in that
direction. for proper stepping to occur.
2. VARIABLE RELUCTANCE TYPE:The rotor does not carry permanent Poles. Three consecutive poles on the stator are A, B and C ,
called phase. Each phase has four poles equally apart on the circumference of the stator.
Sometimes referred to as a hybrid motors, it is the simplest to control over other types of steeper
motors. This motor feels like a D.C. motor when the shaft is spun by hand, it turns freely and
we.cannot feel the steps. This type of stepper motor is not permanently magnified like its
unipolar and bipolar counterparts.
HARDWARE:For driving the stepper motor, the circuit uses the ULN2003 driver IC interfaced to a PC's
parallel port via 25-pin 'D' connector as shown in Fig. 1.
In case you want to isolate the input circuit of ULN2003 from the PC's parallel port (for greater
safety), an alternative circuit for connecting the relevant pins of 25-pin 'D' connector of the
parallel port via the optocouplers (MCT2E) to the input of ULN2003 is shown in Fig. 2. This
circuit should be used only when the stepper motor has a high current rating.
Position control can be achieved by using a photo interrupter module in con-junction with a
simple spike fixed to the its initial position, by obstructing the path of light in the interrupter
module in that position.
The spike, should be long and wide enough to block the space between the LED and the photodetector of the interrupter module. Using this method, we can control the motor position
whenever we want. Here, we shall describe only the four-coil stepper motor control.
SOFTWARE SECTION:* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
• #PROGRAM: STEPPER MOTOR CONTROL OPTIONS
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include<stdio.h>
#include<conio.h>
#include<dos.h>
#inc1ude<graphics.h>
int data[]={ 8,4,2,1,8,4,2,1};
int
single_a[]={ 1,2,4,8,1,2,4,8},single_ c[]={8,4,2,1,8,4,2,1 };
int
dual_ a[]={3,6,12,9,3,6,12,9},dual _c[]={9,12,6,3,9,12,6,3};
int
half_ a[]={ 1,3,2,6,4,12,8,9},half _c[]={9,8,12,4,6,2,3,1 };
int s= 1 ,d=O,f= I ,h=O,c= 1 ,a=O,run= 1;
union REGS i,o;
void main()
{
int
gd=DETECT,gm,x,y,button,time=25 ,k=O, speed;
char speeds[20],ch=O;
initgraph(&gd,&gm,");
setviewport( 1,1 ,640,480, 1);
if(initmouse==O)
{
cIosegraph();
restorecrtmode();
printf("\n Mouse driver not loaded");
exit(1);
}
restrictmouseptr( 1,1,635,475);
image();
setcolor(9);
showmouseptr();
line(225,258,265,258);
line(225,188,275,188);
Iine(330,188,345,188);
while(ch!=27) //main polling loop
•
{
if(kbhit())
ch=getch();
getmousepos(&button,&x,&y);
if(x>200&&x<2 lO&&y>l75 &&y<l 85&&button== I &&h ! =1)
{//single coil mode
s=1;
d=0;
rectangle(201,176,209,184);
if(c==1)
single_cf();
if(a==i)
sing1e_af();
if(f==1)
line(225,1 88,275,188);
setcolor(0);
line(225,208,275,208);
setcolor(9);
}
if(x>200&&x<2 10&&y> 195 &&y<205 &&button==1)
{//double coil mode
d=1;
S=O;
rectanglê(20 1,196,209,204);
if(c==1)
dual_cf();
if(a==1)
dual_af();
if(f==1)
line(225,208,275,208);
setcolor(0);
line(225,188,275,188);
setcolor(9);
}
if(x>305 &&x<3 15&&y>1 75&&y< 1 85&&button= 1)
{//step angle 1.8
f=1;
h=0;
rectangle(306, 176,314,184);
if(s==1&&c==l)
single_cf();
if(s==1&&a==1)
single_af();
if(d==1&&c=1)
dual_cf();
if(d== 1 &&a== 1)
dual_af();
line(330,188,345,188);
line(225,208,275,208);
setcolor(0);
line(330,208,345,208);
setcolor(9);
}
if(x>305 &&x<3 l5&&y>l 95&&y<205&&button== 1)
{//step angle 0.9
f=0,
h=1,
d=1;
S=O;
rectangle(306, 196,314,204);
if(c==1)
half_ cf();
if(a==1)
half _af();
line(330,208,345,208);
line(225,208,275,208);
setcolor(0);
line(330,188,345,188);
//line(225,208,275,208);
line(225,188,275,188);
setcolor(9);
}
if(x>200&&x<2 1 0&&y>245 &&y255 &&button== 1) {/
/clockwise direction
C=I;
a=0;
rectangle(201 ,246,209,254);
if(h==1)
half_ cf();
if(f== I &&s== I)
singIe_cf();
if(f==1&&d==1)
dual_cf();
line(225,258,265,258);
setcolor(0);
line(225,278,265,278);
setcolor(9);
}
if(x>200&&x<2 1O&&y>265 &&y<275 &&button== 1)
{//anticlockwise
C=O;
a=1;
rectangle(20 1,266,209,274);
if(h==i)
half _af();
if(f==1&&s==1)
sing1e_af();
if(f==1&&d==1)
dual _af();
line(225 ,278,265,278);
setcolor(0);
line(225,258,265,258);
setcoior(9);
}
if(x>320&&x<3 35 &&y>300&&y<3 1 0&&button== 1)
{ //speed increase
rectangle(32 1,301,334,309);
if(time>5)
time—;
}
if(x>320&&x<3 35&&y>3l 0&&y<320&&button== 1)
{ //speed decrease
rectangle(321,311,334,319);
if(time<1000)
time++;
}
lf(x>205 &&x<255 &&y>3 50&&y<370&&button== 1)
{//run
run=1;
rectangle(206,35 1,254,369); //run
sound( 1500);
delay(300);
nosound();
}
if(x>285&&x<335&&y>350&&y<370&&button==1)
{//Istop
run=O;
rectangle(286,35 1,334,369);
sound(l 500);
delay(50);
nosound();
}
if(x>305&&x<3 l5&&y>255 &&y<265 &&button== 1)
{//reset
Rectangle(306,256,314,264);
Reset();
}
if(x>365&&x<4 l5&&y>3 50&&y<370&&button== 1)
{
rectangle(366,35 1,414,369);
sound(1000);
outport(0x378,0);
delay(500);
nosound();
c1osegraph();
exit();
}
if(run==1)
outport(0x378,data[k%8]);
k++;
if(k>=3 2000)
k=0;
speed=( 1 000/time)*60;
itoa(speed, speeds, 10);
outtextxy(290,305,speeds);
nosound();
delay(time) ;//time
setcolor(0); //erasing the previousvalues
outtextxy(290,305,speeds);
rectangle(206,35 1,254,369);
rectangle(286,35 1,334,369);
rectangle(366,35 1,414,369);
rectangle(201 ,176,209,184);
rectangle(20 1,1 96,209,204);
rectangle(306,176,314,184);
rectangle(306, 196,314,204);
rectangle(201 ,246,209,254);
rectangle(20 1,266,209,274);
rectangle(32 1,301,334,309);
rectangle(321,31 1,334,319);
rectangle(306,256,3 14,264);
outtextxy(340,270,"SEARCHING”);
outtextxy(240,282,"PROBLEM IN POSITION CONTROL
CIRCUIT");
setcolor(9);
}
Closegraph();
} //end
initmouse()
{
ix. ax=0;
int86(0x33,&i,&o);
return(o.x.ax);
}
showmouseptr()
{
i,x.ax=1;
int86(0x33,&i,&o);
return(0);
}
restrictmouseptr(int xl,int yl,int x2,int y2)
{
ix, ax=7;
i.x,cx=xl;
i.x.dx=x2;
int86(0x33,&i,&o);
i.x,ax=8;
i.x.cx=y 1,
i.x.dx=y2;
int86(0x33,&i,&o);
return(0);
}
getmousepos( int *button,int *x,jnt *y)
{
i.x.ax=3;
int86(0x33,&i,&o);
*button=o.x.bx;
*X=O.X.CX;
*y=o.x.dx;
return(0);
}
image()
{
setcolor(3);
rectangle(190,1 15,435,135);
rectangle( 175,100,450,400);
rectangle(173,98,452,402);
rectangle(205,350,255,370); //run
rectangle(285 ,350,335,370);
rectangle(365,350,415,370);
//rectangle(365,230,41 5,250);
rectangle(200,175,210, 185);
rectangle(200,195,210,205);
rectangle(305,175,315,185);
rectangle(305, 195,315,205);
rectangle(200,245,210,255);
rectangle(200,265 ,2 10,275);
rectangle(285,300,335,320);
rectangle(320,300,335,3 10);
rectangle(320,3 10,335,320);
rectangle(305 ,255,3 15,265);
settextstyle(2,0,6);
setcolor(3);
outtextxy(210,1 15,"STEPPER MOTOR CONTROL");
settextstyle(2,0,5);
outtextxy(200, 1 50,"MODE");
outtextxy(300, 150,' 'STEP ANGLE");
outtextxy(200,220,"DIRECTION");
outtextxy(2 1 7,352,"RUN");
outtextxy(295,352,"STOP");
outtextxy(35,352,"EXIT");
outtextxy(225,300,"SPEED");
outtextxy(340,300,"SPM");
settextstyle(2,0,4);
outtextxy (220,1 75"S1NGLE COIL");
outtextxy(220,195,"DOUBLE COIL");
outtextxy(325, 175," 1 ,8u);
outtextxy(325, 195,"0.9");
outtextxy(220,245 ,"CLOCKWISE");
outtextxy(220,265 ,"ANTICLOCK");
outtextxy(325,255,"RESET");
outtextxy(150,425,"x CLICK THE PROPER BOXES TO CONTROL THE STEPPER
MOTOR");
outtextxy(150,438,"x WHEN THE STEP ANGLE IS
0,9 SINGLE COIL MODE DOESN'T WORK");
outtextxy(1 50,451 ,"x DURING RESETTING
PERIOD OTHER FUNCTIONS DOESN'T WORK");
outtextxy( 150,464,' 'x WITHOUT MOUSE YOU
CAN'T OPERATE THIS PROGRAM");
settextstyle(2, 1,4);
outtextxy(322,3 I 0,"<");
outtextxy(322,300,">");
settextstyle(2,0,4);
return(0);
}
single_cf()
{
Int i;
for(i=0;i<8 ;i++)
data [i]=singlec[i];
sound( 1500);
delay(100);
nosound();
return(0);
}
Dual_af()
{
Int i;
for(i=0;i<8 ;i++)
data [i] = single.a [i];
sound( I 500);
delay( 100);
nosound();
return(0);
}
dual_cf()
{
Int i;
for(i=0;i<8 ;i++)
data [i]=dualc[i];
sound( 1500);
delay( 100);
nosound();
return(0);
}
Dual_af()
{
Int i;
for(i=0;i<8 ;i++)
data [i]=duala[i];
sound(1 500);
delay(100);
nosound();
return (0)
}
half_cf()
{
Int i;
for(i=0 ;i<8 ;i++)
data[i]=halfc[i];
sound(1500);
delay(100);
nosound();
return (0)
}
half af()
{
inti; for(i=0;i<8;i++)
data[i]=half a[i];
sound(! 500);
delay( 100);
nosound();
return(0);
}
reset()
{
int in=0,1=0;
outportb(007a,002);
in=inportb(0x378);
outportb(0x37a,0);
outtextxy(340,270,"SEARCHING…”);
sound( 1500);
delay(5010);
nosound();
whiIe(in>200&&R=400)
rectangle
e(306,256,314,264);
outportb(0x378 , sing1ec [1% 8]);
delay(S);
outportb(0x37a,002);
in=inportb(0x378);
if(l==401)
{
setcolor(0);
outtextxy(340,270,"SEARCHING…”);
setcolor(9);
outtextxy(240,282,"PROBLEM IN POSITION CONTROL CIRCUIT");
sound( 1500);
delay(100);
nosoundO;
delay(3000);
}
outportb(0x37a,0);
}
outportb(0x37a,0); return(0);
}
CONST. & OPER.:HOLDING TORQUE:The following is a definition of holding torque "With the motor shaft at stand still or zero RPM
condition, the amount of torque, from an external source, required to break away the shaft from
its holding position. This is measured with rated voltage and current applied to the motor
DYNAMIC TORQUE:Mainly controlled by the electronic control circuit. Torque will drop down as the speed increases
VOLTAGE:Stepper Motor usually has a voltage rating, which is directly printed on the unit or is specified in
the motor's datasheet. Exceeding the rated voltage is sometimes necessary to obtain the desired
torque from a given motor, but it will produce excessive heat and/or shorten the life of motor,
RESISTANCE:Resistance per winding will determine, current drawn by the motor as well as affect the motor's
torque curve at a maximum speed
START RANGE:The start range is the region such that the stepper motor with load can start and synchronize with
the input pulse rate without losing steps. (Note that to drive a load the stepper motor must be able
to overcome the static friction in the system and start and stop inertial loads, which includes rotor
inertia.)
SLEW RANGE:The region such that the motor speed can follow the input pulse rate without losing steps but
cannot stop or reverse on command without losing steps.
.
MAXIMUM PULL –IN PULSE RATE:The maximum pulse rate that the stepper motor, resting under no load, can start and synchronize
with, (The input pulse train must have a constant frequency when applied to the driving unit.)
MAXIMUM PULL OUT RATE:The maximum pulse rate that the stepper motor, without load, can be operated in a synchronous
manner with theinput once it has been started.
-:TORQUE Vs PULSE RATE CURVES:-
UNDERSTANDING OF OPERATION:After we output one step code, we must wait a few milliseconds before we output another step
command~= because the motor can only step so fast. Maximum stepping rates for different types
of steppers vary from a few hundred steps per seconds to several thousand steps per second.
MULTI PHASE STEPPER MOTOR:When A is energized four poles of the phase A are magnetized in the order N-pole, S-pole, Npole and s-pole. The rotor occupies the position of minimum reluctance. When phase B is
excited the rotor moves 150 and it again occupies the position of minimum reluctance.
STEPPER MOTOR APPLICATION:Stepper motor is used primarily for getting precise incremental motions it can provide accurate
positioning without the need for position feedback.
Because of low cost, stepper motors are used very frequently in industry and it can be found in
almost any piece of electro-mechanical equipment.
ADVANTAGES:1. We can control the speed , direction and running modes by simply clicking the switch
2. Small hardware is requires for position control system.
LIMITATIONS:1. Smooth increment of speed is not possible
2. Since we are using the polling concept fir detecting the option selected , at the lowest
speed the switch will take long time to select the option. However at a high speed this
time delay will not matter.
-: MCT2E:-
DESCRIPTION:The MCT2XXX series optoisolators consist of agallium arsenide
infrared emitting diode driving a silicon
phototransistor in L 6-pin
dual in-line package.
APPLICATION:Power supply regulators
Digital logic inputs
Microprocessor iputs
PIN DETAILS:1.
2.
3.
4.
5.
6.
ANODE
CATHODE
NO CONNECTION
EMITTER
COLLECTOR
BASE
SCHEMETIC FEATURES:1. UL recognized ( File # E90700)
2. VDE recognized ( File # 94766)
Add option V for white package (e.g., MCT2VM)
Add option 300 for black package (e.g.,MCT23OO)
• MCT2 and MCT2E are also available in white
COCLUSION
Stepper motor is widely used in CNC machine drives, robots, and wherever an accurate
positioning is required. In such applications, step angle, direction, operating modes (singlecoi1 or
doub1ecoi1), speed, and position are important considerations.
By this project we can control all this things in a very simple way. Thus we have various options
such as we can increase or decrease the steps per revolution as well as reverse the direction of
motor and also change the step angle of stepper motor.
FUTURE ASPECTS
We can control the stepper motor by remote control. We can control it by wireless method. So it
can make less complex. We can control more then one stepper motor.
We can control all the types of motor by only one hardware/software/circuit. We can add the
starter in case of I.M.
This is the circuit, which drives the coil of stepper motor. There are circuits which drive X coil, (
coil, V coil and V coil respectively.
Transistor is used for the drive of the coil. As for the connection, 2 stages of transistors are
connected inside in series. The "life" of this transistor is the multiplication of the "life" of each
transistor inside, in case of MJE13007 orMJE1 3005, which was used this time, the He is over
40. Because the ratio of the input electric current and the output current is big, the rising edge
and the falling edge of the control signal can be made sharp.
The diode to be putting between the collector and the power is for the protection of the transistor.
When the transistor becomes OFF from ON, the coil of the motor tries to continue to pass an
electric current and generates high voltage. An electric current by this voltage is applied to the
diode and the high voltage which applies over the transistor is prevented
The purpose of this circuit is to keep power supply voltage to AT89C51 to 5V when the power of
the stepper motor is more than 5V.Because the operating voltage of the stepper motor to be using
this time is about 5V, the power supply voltage is +5V. In this case, the voltage, which is applied
to AT89c5 1, becomes less than 5V because of the voltage drop (about IV) of the regulator. In
case of AT89C5 1, the operation is possible even if the power falls to about 3V because the
operating voltage range is from 2V to 5.5V. it is enough in the I 00-mA. type.
This is the circuit for the clockwise rotating, the counterclockwise rotating or stopping a motor.
The button switch of the non lock is used. Pull-up resistor is used for the port to become H level
when the switch is OFF. The PORT 0 of AT89c5 1 has no internal pull up therefore Pull-up
resistor is require for this port.
In this figure, we will explain about the operation principle of stepper motor.
There are many kind of stepper motors. Unipolar type, Bipolar type, Single-phase type, Multiphase type... Single-phase stepper motor is often used for quartz watch.
On this page, I will explain the operation principle of the 2-phase umpolar PM type stepper
motor.
In the PM type stepper motor, a permanent magnet is used for rotor and coils are put on stator.
The stepper motor model which has 4-poles is shown in the figure on the left. In case of this
motor, step angle of the rotor is 90 degrees.
I
As for four poles, the top and the bottom and either side are pair. x coil, 7 coil and V coil,
V coil correspond respectively. For example, V coil and V coil are put to the upper and lower
pole. V coil and V coil are rolled up for the direction of the pole to become opposite when
applying an electric current to the V coil and applying an electric current to the V coil. it is
similar about )( and 3, too.
The turn of the motor is controlled by the electric current which pours into X, ), V and V. The
rotor rotational speed and the direction of the turn can be controlled by this control.
Operation Of Switch:SW 6 & SW 4 are use as Counterclockwise & Clockwise.
SW 2 & SW 3 are use as Speed UP & Speed Down.
SW 1 is use for stop the motor.
SW 5 is RESET switch. This switch is use for reset the program. if program is hang then reset
for few seconds.
LEDS indicator:Li :-Stop indicator; L2 :-counterclockwise, L3 :-clockwise
Features:-.
• Compatible with .MCS-5 1. Products
• 4K Bytes of in-system reprogrammable flash memory • Fully, static operation: 0 Hz to 24MHz
• Three-level program memory lock"
• 128*8 Bit internal:RAM
• 32 Programmable IN/OUT lines
• Two 16-bit timer/counters
• Six interrupt sources
. Programmable serial channel
• Low-power idle and power down modes
PIN CONFIGURATIONS:-