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.
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.
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
http://www.sure-electronics.net/DC,I...-CO043_2_b.jpg
I have yet to use one of these so I can't comment on their downsides. My order should get here any day.
Robert
Re: Accurate control of stepper motor
Quote:
Originally Posted by
Demon
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.
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.