Beruflich Dokumente
Kultur Dokumente
Widely use in Robotics ---why?? ---why?? Because More precise than DC motor Measured rotation and can be held at a particular position- U can rotate the positionstepper motor with an accuracy of 0.9 degree!!!!!! Alignment is much better...
Comparison
Unipolar
Current flow in one direction Simple drive circuit Less torque
Bipolar
Current flow in both direction Complicated drive Circuit High Torque
Modes of Operation
Single Coil Excitation: Only one out of the 4 coils is excited at a given time Double Coil: Two adjacent coils are excited at a given time Single and Double: It s a hybrid of both..(refer diagram for details)
Note that until the next coil is switched on, the stator remains in its position only And as we can control when to switch on a particular coil thru software, we can rotate it by exactly the angle we wish.. Compare this with DC motor where the shaft keeps on rotating as soon as the current is switched on
b. Two-Coil Excitation - Each successive pair Twoof adjacent coils is energized in turn.
Interleaving the two sequences will cause the motor to half-step half-
Comparison
Single coil
Low torque
Double coil
High torque
Circuit Diagram
Pin details
Pin Details
D0D0-D7 are the data pins(used for output) C0C0-C3 are control pins. Note that C1 and C3 are hardware inverted. They can be used for both input and output S3S3-S7 are status pins. They are used for taking input from external ckt
PC parallel Port
The PC's Parallel Printer Port had a total of 12 digital outputs and 5 digital inputs accessed via 3 consecutive 8-bit ports in the processor's 8I/O space. 8 output pins accessed via the DATA Port 5 input pins (one inverted) accessed via the STATUS Port 4 output pins (three inverted) accessed via the CONTROL Port The remaining 8 pins are grounded
Control pins
The address for control pins can be obtained by adding 2 to the address of data pins. For eg, here the address of control pins will be 0x378+0x2=0x37a Therefore the command outportb(0x37a,3) will make both the 1st 2 control pins(C0,C1) low! Because 3=0011 low! and C0 and C1 are hardware inverted
Implementation of H bridge
Data Port1
Motor 1
Data Port2
Motor 2
Note connect a 15v zener diode to pin 10 of IC as shown to prevent damage to the IC due to "back emf" when loads such as motors switch on and off
Hybrid mode
The order of the values to be written to parallel port(data pins)
00000001 00000011 00000010 00000110 00000100 00001100 00001000 00001001 (1st coil is on) = 1 (1st & 2nd coil is on) = 3 (2rd coil is on) = 2 (2nd & 3rd coil is on) = 6 (3st coil is on) = 4 (4th & 3nd coil is on) = 12 (4rd coil is on) = 8 (1st & 4th coil is on) = 9
The values for the other coil can be determined by shifting the binary representation by 4 places left or multiply the decimal values by 2^4=16
//hybrid mode #include <stdio.h> #include <dos.h> main() { char a[]={1,3,2,6,4,12,8,9 }; for (int i=0;i<=100;i++) { outportb(888,a[i%8]); delay(10); } outportb(888,0); }
main() main() { char a[]={3,6,12,9}; { char a[]={1,2,4,8}; for (int for (int i=0;i<=100;i++) i=0;i<=100;i++)
{ outportb(888,a[i%4]); delay(10); } outportb(888,0);
main() main() main() { char a[]={3,6,12,9}; { char { char a[]={1,2,4,8}; a[]={1,3,2,6,4,12,8,9 for (int i=100;i<=0;ii=100;i<=0;ifor (int i=100;i<=0;i--) i=100;i<=0;i--) }; -) { outportb(888,a[i%4]); for (int i=100;i<=0;i--) i=100;i<=0;i--) delay(10); {outportb(888,a[i% { } 4]); outportb(888,a[i%8]); outportb(888,0); delay(10); delay(10); } } } outportb(888,0); outportb(888,0); } }
//hybrid mode #include <stdio.h> #include <dos.h> main() { char a[]={1,3,2,6,4,12,8,9 char }; b[]={48,96,192,144}; for (int i=100;i<=0;i- char i=100;i<=0;ib[]={16,48,32,96,64,19 -)
2,128,144};
//hybrid mode #include <stdio.h> #include <dos.h> main() { char a[]={1,3,2,6,4,12,8, 9};
char b[]={16,48,32,96,64,1 92,128,144};
MATLAB CODE
dio=digitalio('parallel','LPT1'); addline(dio,0:3,'out'); putvalue(dio,[0 1 1 0]);