Accurate control of stepper motor


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2008
    Posts
    42

    Default Accurate control of stepper motor

    Hello All,
    I am trying to accurately control the position of a stepper motor using either a variable resistor or maybe some type of rotary encoder. I have written the code and have had some luck
    but I can't seem to get my system operating right, mostly I think because I'm using the POT command and variable resistor. The ideal system would turn the stepper motor 1/2 turn with the full swing of the variable resistor or encoder, and then slowly return to its original position as the v. resistor is turned back down. There are probably separate controllers that already do this but I prefer banging my head against the wall. So, any help would be greatly appreciated.

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


    Did you find this post helpful? Yes | No

    Default Re: Accurate control of stepper motor

    You will have better luck using the ADC command, the POT command is not always best. And make sure the variable resistor is linear, it will be easier to code for.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: Accurate control of stepper motor

    Well, if you want to bang your head a little harder, have you considered using a rotary encoder instead of a pot? Then you don't have to worry about linearity, ADC, pot reaching end of travel, etc.

    Count the pulses going, and then back. Something like these:

    http://www.ebay.ca/itm/ws/eBayISAPI....m=380410565135



    I have yet to use one of these so I can't comment on their downsides. My order should get here any day.

    Robert

  4. #4
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: Accurate control of stepper motor

    Quote Originally Posted by Demon View Post
    Well, if you want to bang your head a little harder, have you considered using a rotary encoder instead of a pot? Then you don't have to worry about linearity, ADC, pot reaching end of travel, etc.

    Count the pulses going, and then back. Something like these:

    http://www.ebay.ca/itm/ws/eBayISAPI....m=380410565135



    I have yet to use one of these so I can't comment on their downsides. My order should get here any day.

    Robert
    Hi Robert;

    I used one of those this last days. They are not bad for the price. I'll put the code as soon as i can on the wiki.
    Thanks and Regards;
    Gadelhas

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


    Did you find this post helpful? Yes | No

    Default Re: Accurate control of stepper motor

    You can Find the code for reading a two channels optical encoder (in quadrature) @ http://www.picbasic.co.uk/forum/showthread.php?t=12911

    Post 28 or 27.

    Cheers

    Al.
    All progress began with an idea

Members who have read this thread : 1

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