1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

control of stepper motor

Discussion in 'General Electronics Chat' started by sanjivee, Mar 27, 2006.

  1. sanjivee

    sanjivee New Member

    Joined:
    Mar 27, 2006
    Messages:
    1
    Likes:
    0
    On this page, I will explain about the operation principle of stepper motor.
    There are many kind of stepper motors. Unipolar type, Bipolar type, Single-phase type, Multi-phase type... Single-phase stepper motor is often used for quartz watch.
    On this page, I will explain the operation principle of the 2-phase unipolar 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.

    As for four poles, the top and the bottom and either side are a pair. coil, coil and coil, coil correspond respectively. For example, coil and coil are put to the upper and lower pole. coil and coil are rolled up for the direction of the pole to become opposite when applying an electric current to the coil and applying an electric current to the coil. It is similar about and , too.
    The turn of the motor is controlled by the electric current which pours into , , and . The rotor rotational speed and the direction of the turn can be controlled by this control.



    Clockwise control
    , , and are controlled in the following order.
    Step angle
    0 1 0 1 0°
    1 0 0 1 90°
    1 0 1 0 180°
    0 1 1 0 270°

    "0" means grounding.



    Counterclockwise control
    , , and are controlled in the following order.
    Step angle
    0 1 0 1 0°
    0 1 1 0 -90°
    1 0 1 0 -180°
    1 0 0 1 -270°

    "0" means grounding.

    You can find by the figure, the rotor is stable in the middle of 2 poles of stator. When one side of the stator polarity is changed, the bounce by the magnetism occurs. As a result, the direction of rotor's turn is fixed.

    The characteristic of stepper motor is the angle can be correctly controlled and to be stable rotates ( It is due to the reliability of the control signal ). Moreover, because the rotor is fixed by the magnetism in the stationary condition as shown in the principle, the stationary power(Stationary torque) is large. It suits the use to make stop at some angle.

    --------------------------------------------------------------------------------

    The motor which was used this time is 48 steps and the step angle is 7.5 degrees.
    The way of controlling is the same as the previous example completely. It operates when controlling the electric current of coil, coil, coil and coil.


    The case of the clockwise control is shown below.
    The combination of , , and repeats four patterns.
    Step angle
    0 1 0 1 0.0°
    1 0 0 1 7.5°
    1 0 1 0 15.0°
    0 1 1 0 22.5°
    0 1 0 1 30.0°
    1 0 0 1 37.5°
    1 0 1 0 45.0°
    0 1 1 0 52.5°
    0 1 0 1 60.0°
    1 0 0 1 67.5°
    1 0 1 0 75.0°
    0 1 1 0 82.5°
    0 1 0 1 90.0°
    1 0 0 1 97.5°
    1 0 1 0 105.0°
    0 1 1 0 112.5°
    0 1 0 1 120.0°
    1 0 0 1 127.5°
    1 0 1 0 135.0°
    0 1 1 0 142.5°
    0 1 0 1 150.0°
    1 0 0 1 157.5°
    1 0 1 0 165.0°
    0 1 1 0 172.5°
    Step angle
    0 1 0 1 180.0°
    1 0 0 1 187.5°
    1 0 1 0 195.0°
    0 1 1 0 202.5°
    0 1 0 1 210.0°
    1 0 0 1 217.5°
    1 0 1 0 225.0°
    0 1 1 0 232.5°
    0 1 0 1 240.0°
    1 0 0 1 247.5°
    1 0 1 0 255.0°
    0 1 1 0 262.5°
    0 1 0 1 270.0°
    1 0 0 1 277.5°
    1 0 1 0 285.0°
    0 1 1 0 292.5°
    0 1 0 1 300.0°
    1 0 0 1 307.5°
    1 0 1 0 315.0°
    0 1 1 0 322.5°
    0 1 0 1 330.0°
    1 0 0 1 337.5°
    1 0 1 0 345.0°
    0 1 1 0 352.5°


    Circuit drawing of Stepper Motor controller


    --------------------------------------------------------------------------------

    Pattern drawing of Stepper Motor controller
    (Wiring side)
     
    Last edited by a moderator: Oct 4, 2006
  2. tkvenki

    tkvenki New Member

    Joined:
    Nov 7, 2005
    Messages:
    83
    Likes:
    0
    Location:
    India
    Good work sanjeevi
     
  3. geezergeek

    geezergeek New Member

    Joined:
    Jul 9, 2004
    Messages:
    1
    Likes:
    0
    Stepper Motor controller

    I don't see any image or file to download where you indicate the schematic is supposed to be. Am I doing something wrong? Please advise, TIA. Joe
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. elcopart

    elcopart New Member

    Joined:
    Jan 11, 2006
    Messages:
    29
    Likes:
    0

    Stepp Motor Driver.
     

    Attached Files:

    • k179.pdf
      File size:
      125.8 KB
      Views:
      1,944
  6. xplus

    xplus New Member

    Joined:
    Apr 7, 2005
    Messages:
    4
    Likes:
    0
    Good work

    think you
     
  7. bibinjohn

    bibinjohn New Member

    Joined:
    May 7, 2006
    Messages:
    47
    Likes:
    0
  8. florin

    florin New Member

    Joined:
    Jul 8, 2006
    Messages:
    3
    Likes:
    0
    Location:
    Romania, Bucharest
    Stepper

    This design implements a simple stepper motor controller using a PIC16F84.

    The two buttons cause the motor to rotate clockwise or anticlockwise
    using a standard two-coil drive pattern.

    The ULN2003A darlington driver provides the interface between the low
    current PIC outputs and the stepper motor coils.
    [​IMG]
    Code (text):

     LIST    p=16F84 ; PIC16F844 is the target processor

                  #include "P16F84.INC" ; Include header file

                  CBLOCK 0x10   ; Temporary storage                
                     pos
                     dc1
                     dc2
                  ENDC
                  LIST    p=16F84 ; PIC16F844 is the target processor

                  #include "P16F84.INC" ; Include header file

                  CBLOCK 0x10   ; Temporary storage
                  ENDC

                  ORG   0
    entrypoint    goto  start

                  ORG   4
    intvector     goto  intvector
           
    start         clrw                    ; Zero.

                  movwf   PORTB           ; Ensure PORTB is zero before we enable it.
                  bsf     STATUS,RP0      ; Select Bank 1
                  movlw   0xF0            ; Set port B bits 0-3 as outputs
                  movwf   TRISB           ; Set TRISB register.          
                                                                   
                  bcf     STATUS,RP0      ; Select Bank 0
                     
                  movlw   3           ; Initialize the motor position
                  movwf   pos                                            
                  movwf   PORTB
                  call    delay
                  clrf    PORTB       ; Motor drive off

    ;Main loop              
    loop          btfss   PORTA,0         ; Test clockwise button
              call    stepcw
              btfss   PORTA,1         ; Test anti-clockwise button
              call    stepccw
              goto loop
                                   
    ;Rotate one step clockwise                              
    stepcw        bcf    STATUS,C         ; Clear the carry flag
              btfsc  pos,3            ; Set carry if this bit set
              bsf    STATUS,C
              rlf    pos,W        ; Pick up and rotate the motor's current position
                  andlw  0x0F             ; Mask to lower nibble
                  movwf  pos
                  movwf  PORTB        ; Drive the outputs
                  call   delay        ; Wait
                  clrf   PORTB            ; Clear the output
                  return

    ;Rotate one step counter clockwise                                                                                 
    stepccw       bcf    STATUS,C         ; Clear the carry flag
              btfsc  pos,0
              bsf    pos,4
              rrf    pos,W        ; Pick up and rotate the motor's current position
                  andlw  0x0F             ; Mask to lower nibble
                  movwf  pos
                  movwf  PORTB        ; Drive the outputs
                  call   delay        ; Wait
                  clrf   PORTB            ; Clear the output
                  return

    ; This routine implements the delay between steps,
    ; and thus controls the motor speed.
    delay         movlw   18         ; Outer loop iteration count
              movwf   dc1      
    dl1       clrf    dc2            ; Initialize inner loop
    dl2       nop
              nop
              decfsz  dc2,F        
              goto    dl2
              decfsz  dc1,F
              goto    dl1
              return

              END              
                 
     
     
  9. chamilrohana

    chamilrohana New Member

    Joined:
    Aug 1, 2006
    Messages:
    1
    Likes:
    0
    But i cannot see the diagrams








     
  10. harshpix

    harshpix New Member

    Joined:
    Aug 2, 2006
    Messages:
    1
    Likes:
    0
    Circuit drawing of Stepper Motor controller


    --------------------------------------------------------------------------------

    Pattern drawing of Stepper Motor controller
    (Wiring side)

    Where r all those schematics, u mentioned?

    आपने "Circuit drawing of Stepper Motor controller" लिखा तो है पर circuit diagram कहाँ है?
     
  11. manwani

    manwani New Member

    Joined:
    Aug 7, 2006
    Messages:
    1
    Likes:
    0
    good work and very nice project that ever i see
     
  12. Vortex_

    Vortex_ New Member

    Joined:
    Aug 23, 2006
    Messages:
    1
    Likes:
    0
    Hi people

    I am hardly looking for stepper motor control tuttorial for pic 16 f62x.

    Glaad for help
     
  13. akg

    akg New Member

    Joined:
    Sep 2, 2005
    Messages:
    1,404
    Likes:
    1
    Location:
    India
    have u looked at www.winpicprog.co.uk tutorials
     
  14. HiTech

    HiTech Well-Known Member

    Joined:
    Jun 28, 2006
    Messages:
    2,874
    Likes:
    30
    Location:
    Penna. USA
    Now, how in the world does one come up with a useful answer to that question, huh?:rolleyes:
    Why should I look hard when he's hardly looked for it himself!
     
  15. Meesam

    Meesam New Member

    Joined:
    Jun 30, 2006
    Messages:
    16
    Likes:
    0
    Location:
    Qatar
    Anybody please tell me how to identify the cables of a stepper motor. I mean which will be connected to which pin of which port of MCU. Also please help me how to connect some toy tires to the motor. I am not looking for a rover like thing but want to actually test whether a motor can be really tested for speed and direction. I'll be thankful for that.
     
  16. goblin_techies

    goblin_techies New Member

    Joined:
    Sep 25, 2006
    Messages:
    31
    Likes:
    0
    Location:
    somewhere in Asia
    good day dudes!

    im sorry for spamming your thread....:(

    im kinda new here...
    we have a project (interfacing stepper motor unto computer (PC)) by using the programming language turbo-c....anyone pls help me:D
    or pls send me some links
     
  17. Hero999

    Hero999 Banned

    Joined:
    Apr 6, 2006
    Messages:
    14,902
    Likes:
    79
    Location:
    England
    Perhapps actually tryng to read and understand the above thread might give you a clue rather than spamming it.
     
  18. aoamb83

    aoamb83 New Member

    Joined:
    Feb 15, 2006
    Messages:
    18
    Likes:
    0
    driving a stepper motor using microcontroller is very easy. most steppers have 5 wires as an input . from this wires u can drive the motor by applying a combination of 1s and 0s (+5v , 0v) but u must connect the last wire with vcc, what u have to do is to write a code on PIC or AVR or whatever to give you the sequence of 4 bit combination (0110 foe example) according to the sequences that sanjivee mentioned then take the o/p of the micro controller to a ULN2003A
    this IC gives u the ground to deal with stepper internal coils
    if the notch of the IC on left side so pin 1,2,3,4,5 acts as i/p pin 6 should connect to ground and ur output will be the pins upper side
    for example if ur i/p was on the 1st pin in the IC so ur o/p is @ pin number 12
    the pin infront of the input pin on the upper side
     
  19. Meesam

    Meesam New Member

    Joined:
    Jun 30, 2006
    Messages:
    16
    Likes:
    0
    Location:
    Qatar
    I have a stepper motor with 4-wires. I have also bought an IC ULN2803. Now i want to control this motor via AT89C52 MCU. Anybody can please guide me through about the circuit and its some details. I'll program the whole thing myself but I want to know that initially how will i have to start and how the hardware components will be interfacing to eachother.
    I'll warmly welcome anybody's response.
     
  20. Sceadwian

    Sceadwian Banned

    Joined:
    Oct 27, 2006
    Messages:
    14,047
    Likes:
    141
    Location:
    Rochester, US
    The ULN2803 is a darlington array. Your motor only has 4 wires which means it's a bipolar stepper motor. You need h-bridge drivers on each line. Only unipolar steppers can be driven directly from a basic transistor driver.
     
  21. theinfamousbob

    theinfamousbob Member

    Joined:
    Mar 31, 2005
    Messages:
    546
    Likes:
    5
    Location:
    Cleveland, Ohio, USA
    Use a multimeter to test...

    A bipolar stepper will have two coils, four wires...check which pairs are connected by using the resistance feature

    0---&&&&&&&&---0 Coil 1

    0---&&&&&&&&---0 Coil 2


    A unipolar motor will have five, or six wires (maybe more). To drive it, you drive each wire in series...


    0​
    |​
    |​
    0---&&&&&&&&---0 Coil 1

    0---&&&&&&&&---0 Coil 2
    |​
    |​
    0​

    (Note: in five wire motors the center taps are connected)


    Hope this helps.
     

Share This Page