Motor Stepper Example


Closed Thread
Results 1 to 40 of 135

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Hello all, after lots of posts with some other members here, and lots of digging on my own, I came to the conclusion for anything over 500mA drive capacity, it really is less expensive to go with a dedicated chip solution. This is when you figure in board space, manufacturing cost, ...

    Just my 2 cents FWIW
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Mar 2011
    Posts
    10


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    please help me..we have a project using stepper motor..we are making simple linear robot..when the circuit is on it will automatically open the gripper then after a seconds it will close the grip then after a seconds the slider stepper will turn forward then after a seconds again the gripper will open again then close and back to its original position..

    please give me sample code or correct my code because when i tried it the gripper will only vibrate:
    Code:
    clear
    ti var byte
    c var byte
    z var byte
    ti=100
    trisb=0
    
    gripper open(cw the gripper stepper):
    for z=1 to 2
    portb=128
    pause ti
    portb=64
    pause ti
    portb=32
    pause ti
    portb=16
    pause ti
    next z
    goto delay
    
    gripper open1(cw the gripper stepper):
    for z=1 to 2
    portb=128
    pause ti
    portb=64
    pause ti
    portb=32
    pause ti
    portb=16
    pause ti
    next z
    goto delay3
    
    close(reverse gripper stepper):
    for z=1 to 2
    portb=16
    pause ti
    portb=32
    pause ti
    portb=64
    pause ti
    portb=128
    pause ti
    next z
    goto delay1
    
    close1(reverse gripper stepper):
    for z=1 to 3
    portb=16
    pause ti
    portb=32
    pause ti
    portb=64
    pause ti
    portb=128
    pause ti
    next z
    goto delay4
    
    delay:
    portb=0
    pause 2000
    goto close
    
    delay1:
    portb=0
    pause 2000
    goto loop
    delay2:
    portb=0
    pause 2000
    goto open1
    
    delay3:
    portb=0
    pause 2000
    goto close1
    
    delay4:
    portb=0
    pause 2000
    goto loop1
    delay5:
    portb=0
    pause 2000
    goto open
    
    loop(cw the slider):
    for c=0 to 11
    portb=8
    pause ti
    portb=4
    pause ti
    portb=2
    pause ti
    portb=1
    pause ti
    next c
    pause 2000
    goto delay2
    
    loop1(ccw the slider):
    for c=0 to 11
    portb=1
    pause ti
    portb=2
    pause ti
    portb=4
    pause ti
    portb=8
    pause ti
    next c
    goto delay5
    end
    Last edited by ScaleRobotics; - 4th March 2011 at 13:33. Reason: added code tags

  3. #3
    Join Date
    Jan 2010
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    If a stepper motor vibrate this is happen because the power supply is too low or the rotation speed (given by the code) is too high.

  4. #4
    Join Date
    Mar 2011
    Posts
    10


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    what is the correct speed or delay am i using in order to run it well?

    it necessary to define the external oscillator in the program?like:

    define osc 4

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    We really need to know more about the hardware. Are you using a uni-polor or bi-polor motor? How are you driving the motor? direct from the PIC (REALLY small motor) or with some kind of amplifier/driver? I don't think you are pulsing too fast, if you have a 200 step motor, you are asking it to move at 5 RPM (i think,)

    Can you make the motor move by replacing the pic with 4 switches? this will simulate the pic to test the hardware. Although this still will not tell you about current needs.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  6. #6
    Join Date
    Mar 2011
    Posts
    10


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    i am using unipolar stepper motor...i connect the pic to uln2803...then connect to the stepper motor...

    in your own experience..what time delay usually used in order the stepper to operate properly?
    Last edited by thenew; - 4th March 2011 at 16:30.

  7. #7
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Motor Stepper Example

    delay time all depends on how fast you need it to move.

    Please do some simple troubleshooting for us. Replace the motor with LED's. then you will be able to see if all 4 lines are stepping. Vibrating can also come from a missed step or 2. Also could you please apply 5V to the input of the ULN, 1 at a time and see if the motor moves?

    This problem really needs to be isolated to hardware, software, or both. At first glance, it seems like your program should work. I don't know if you will get your desired function, but the motor should move.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

Members who have read this thread : 5

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts