PDA

View Full Version : Controlling stepper motor with PIC



The Master
- 30th June 2008, 16:51
Hi, I decided to have another go at controlling a stepper motor again the other day. Its the first time ive given it much thought since i was about 10 and now i know about PICs i managed to link a stepper motor through a ULN...something driver chip into a PIC. I was quite impressed with the results but i feel like it should be better. The motor ive been testing with is a 6 wire type. I told the PIC to turn the 4 outputs on and off in sequence and the motor worked. The problem i have is that i cant make it move fast. If i try to speed it up the PIC chip works faster than the motor and sometimes it even runs backwards.

Should stepper motors be connected to PICs using a proper stepper motor driver circuit or can it be done how ive done it here? The motor i have is really old and aparently its a 15 degree one. I was thinking about buying some bigger motors which are 1.8 degrees. Would my circuit work better with newer motors or do i need the driver circuit?

Ioannis
- 30th June 2008, 18:47
I am sure there are a lot of special function chips but make sure that the motor can go faster. Usually stepper motors are slower than servos, asynchronus or classic PM motors. No surprise that it skips some steps or even turns back.

On an old application note, I saw a technique to improve every step by doubling or even tripling the voltage driven to the motor with carefully selected coil in series and appropriate current limiting.

But even like that, I don't see a more than 20% increase.

You might want to have a look at the very cheap L297/L298 pair.

Ioannis

Archangel
- 1st July 2008, 08:02
Roman Black whipped one up which works pretty well : http://www.piclist.com/tecHREF/io/stepper/linistep/index.htm

The Master
- 1st July 2008, 10:21
Im not completely sure that this motor should go faster. I know stepper motors arnt the fastest in the world and i suppose with this one being quite old it might not be designed for speed. I do want to use them for the accuracy and speed doesnt really matter anyway but its still nice to make things run as fast as possible. If its possible to do it with just a PIC chip then i would like to do that. Im sure the newer motors should run a little faster and be a bit more powerfull.

If i use the normal voltage can i hold the motor in 1 position without it overheating? Does this depend on the exact type of motor? The type of motors i plan to buy are these http://www.rapidonline.com/Electrical-Power/Fans-Motors/Motors/Mini-hybrid-stepper-motor-size-14/73211

I like the idea in that link about smoothing the steps. Is that easy to do? I dont really need it but it might be usefull to learn. Is it something like PWM?