Controlling Step Motor With Microchip PIC

Discussion in 'The Projects Forum' started by qZanity, Feb 2, 2014.

  1. qZanity

    Thread Starter New Member

    Feb 2, 2014
    4
    0
    Hello, I need to accurately control a 12v step motor from a PIC16F88.

    I'm wondering what components I need to control it, as the PIC obviously can't directly control the motor due to current and the fact the pics running off a 5v power supply.

    So I need to use some kind of transistor or something? What's the best way? Schematic would be awesome
     
  2. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,031
    3,803
    Look up application notes on stepper motors from microchip.com.

    Also, do not waste your time with such an old chip. The pic16f628A was the versatile successor and has internal oscillator - much easier. I think there is even successors to that now (and cheaper too).

    You will need transistors (NPN or N-mosfets- just look in the app note for stepper motors). Well presented with sample code if I remember correctly).

    http://ww1.microchip.com/downloads/en/AppNotes/00907a.pdf
     
  3. Experimentonomen

    Member

    Feb 16, 2011
    331
    46
    You need a stepper driver with step and direction inputs, and for any kind of accuracy you need a shaft encoder on the stepper motor feeding back a position signal to the PIC.
     
  4. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    Shaft encoders would only be really useful for a DC motor or servo setup, steppers do not need them since you should know what position you had it step to, unless you need a closed loop system in case any of the axis' are moved manually.
     
  5. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,031
    3,803
    What is your goal? What are you controlling - and what accuracy/performance do you need?
     
  6. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    As for an easy way to control a stepper with a pic, I would use a stepper driver IC such as the allegro A4988 stepper driver, you can find these on ebay for a few dollars already mounted to a circuit board. Thats if you are using a bi polar stepper motor, but since you did not include this info, one can only speculate.
     
  7. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305

    Check out the Linistepper;
    http://www.piclist.com/techref/io/stepper/linistep/index.htm

    It uses a PIC to provide microstepping, and linear motor coil drive for smoothness and reducing resonance.

    There's a schematic linked on that web page and many people build their own. Or you can buy the kit. :)
     
    BMorse likes this.
  8. qZanity

    Thread Starter New Member

    Feb 2, 2014
    4
    0
    Are you sure your thinking of the right chip? The pic16f88 has an internal oscillator as far as I know.

    What's a good general purpose 'newer' PIC, which as USB interface support?

    And thanks to everyone for the comments, really helped.
     
  9. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,031
    3,803
    Do a parametric search on Microchips website. Pick the features you want/need.
     
Loading...