How to program PIC16F877A stepper motor revolution [Full circuit & 3/4 Code]


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Really ??? Everyone have it's own project
    Every one is a smart _ _ _

    The variable "i" needs to be WORD sized.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    <b>Open Loop Solution</b>
    How powerful is that stepper motor? You know what happens to a stepper motor when it stalls? At worst it demagnetizes, at best, nothing.
    Stepper motors have no commutator, no brushes, no sparks, no increase in current (to speak of), very unlike a brushed motor which gets very Ticked Off when it stalls. So here is a thought, rig up a counter and count the steps between the ends of travel, and drive your motor that many steps + a few extra.
    Last edited by Archangel; - 5th November 2008 at 05:14.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    A common trick is to logically AND the limit switches with one of the phases.
    That way the stepper will always stop in the same place, and the position sensitivity of the limit switch (or opto) is decreased by at least 4.

    This is easy to do in software.
    Charles Linquist

  4. #4
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Slapdash, I don't know what kind of blind you are trying to move with a unipolar stepper motor. They should be very light!

    Remember that to use an open loop system (relying only on the steps count) with a minimum of confidence, you should use at maximum half the torque the motor can produce.

    Even so every open loop system has at least one switch for the zero position. This means that at power up the system search for the zero and set the internal counter offsetting possible drift.
    You are using a unipolar stepper which I doubt has the necessary torque for your application, so very likely you will need a gearbox to increase the mechanical torque at the expense of the speed.
    Naturally the number of steps per turn of the gearbox shaft should take into account the gearbox ratio.

    Further more I suggest you to take into seriuos consideration the needs of two limit switches.

    If you could let us know what kind of blind you are moving and the type of stepper you are using it will make life easier in helping you.

    Al.
    All progress began with an idea

  5. #5
    Join Date
    Nov 2008
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    Slapdash, I don't know what kind of blind you are trying to move with a unipolar stepper motor. They should be very light!

    Remember that to use an open loop system (relying only on the steps count) with a minimum of confidence, you should use at maximum half the torque the motor can produce.

    Even so every open loop system has at least one switch for the zero position. This means that at power up the system search for the zero and set the internal counter offsetting possible drift.
    You are using a unipolar stepper which I doubt has the necessary torque for your application, so very likely you will need a gearbox to increase the mechanical torque at the expense of the speed.
    Naturally the number of steps per turn of the gearbox shaft should take into account the gearbox ratio.

    Further more I suggest you to take into seriuos consideration the needs of two limit switches.

    If you could let us know what kind of blind you are moving and the type of stepper you are using it will make life easier in helping you.

    Al.
    I'm using vertical blind.

  6. #6
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Good to know.

    Did you try to pull your blind up with the stepper and with 500 mA max current you can supply to your stepper ?
    (I suggest you to replace the ULN2003a with ULN2803a. This has 8 transitors, you can parallel them obtaining 4 couples and doubling the output current in this way)

    Is it working ?

    Does the stepper run smoothly ?

    Can you install the two limit switches?

    Al.
    Last edited by aratti; - 6th November 2008 at 10:34.
    All progress began with an idea

Similar Threads

  1. PIC 16F877A circuit for stepper motor...
    By kristina in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th June 2012, 08:13

Members who have read this thread : 0

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