Sie sind auf Seite 1von 4

Stepper motor

As explained in earlier article, Stepper motor is operated by energizing the stator coils in an ordered sequence. When the input sequence of signal is applied to the motor leads, it starts rotating in steps. AT89C51 microcontroller has a current rating of 50mA. It can neither source nor sink huge current. ULN2003 is high voltage and high current Darlington array IC. Each input-output pair in ULN2003 acts as an interface between the end points of the stepper motor and port pins of the microcontroller. Port P2 of AT89C51 is configured as the output port to provide input sequence to four input pins of ULN2003. The output of ULN2003 accordingly helps in driving the motor. To work with the unipolar stepper motor, the common points are connected to either Ground or Vcc and the end points of both the phases are usually connected through the port pins of a microcontroller. In present case the common (Green) wires are connected to Vcc. The end points receive the control signals as per the controller's output in a particular sequence to drive the motor. Since the coils related to each phase are arranged in alternate manner, the end points of two phases are energized in alternate fashion to rotate the motor. This means that the voltage signal should be applied to first end point of Phase1 and then to the first end point of the Phase2 and so on. 1. Wave Drive Stepping Mode The above mentioned sequence is repeated to rotate the motor in Wave Drive Stepping Mode. (For more details on different Stepping Modes, refer to the article on Stepper Motors) The direction of rotation can be clockwise or anti clockwise depending upon the selection of end points.

Signal sequence for Wave Drive Stepping Mode Yellow lead Blue lead Red lead White lead (End point 1 of (End point 2 of (End point 1 of (End point 2 of Phase1) Phase1) Phase2) Phase2) 1 1 0 0 0 2 0 0 1 0 3 0 1 0 0 4 0 0 0 1 2. Full Drive Stepping Mode Step The Full Drive Stepping can be achieved by energizing two endpoints of different phases simultaneously. Signal sequence for Full Drive Stepping Mode Yellow lead Blue lead Red lead (End point 1 of (End point 2 of (End point 1 of Phase1) Phase1) Phase2) 1 0 1 0 1 1 0 1 0 1 0 0

Step

1 2 3 4

White lead (End point 2 of Phase2) 0 0 1 1

3. Half Drive Stepping Mode The Half Drive Stepping is achieved by combining the steps of Wave and Full Drive Stepping Modes. This divides the stepping angle by half. Signal sequence for Half Drive Stepping Mode Yellow lead Blue lead Red lead (End point 1 of (End point 2 of (End point 1 of Phase1) Phase1) Phase2) 1 0 0 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 0 0

Step

1 2 3 4 5 6 7 8

White lead (End point 2 of Phase2) 0 0 0 0 0 1 1 1

// Program to Interface Stepper Motor with PIC18F4550 Microcontroller void main() { unsigned int i=0; TRISB=0; // Set PortB as output port while(1) { LATB=0x07; // To send 1110 at PortB Delay_ms(20); LATB=0x0B; Delay_ms(20); LATB=0x0D; Delay_ms(20); LATB=0x0E; Delay_ms(20); } } // To send 1101 at PortB

//

To send 1011 at PortB

//

To send 0111 at PortB

// Program to control Stepper Motor with AT89C51 using ULN2003 /**** Wave Drive Stepping ****/ #include<reg51.h> sfr stepper=0xA0; void delay(unsigned int count) { int i; for(i=0;i<count;i++); } void main() { while(1) { stepper=0x01; delay(350); stepper=0x02; delay(350);

stepper=0x04; delay(350); stepper=0x08; delay(350); } } /*****************************/ /**** Half Drive Stepping ****/ #include<reg51.h> sfr stepper=0xA0; void delay(unsigned int count) { int i; for(i=0;i<count;i++); } void main() { while(1) { stepper=0x01; delay(300); stepper=0x03; delay(300); stepper=0x02; delay(300); stepper=0x06; delay(300); stepper=0x04; delay(300); stepper=0x0C; delay(300); stepper=0x08; delay(300); stepper=0x09; delay(300); } } /*****************************/

Das könnte Ihnen auch gefallen