BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 12:12 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: hlep with stepper motors please
PostPosted: Mon Jan 30, 2012 11:16 am 
Offline
Guru

Joined: Wed Nov 30, 2011 7:56 pm
Posts: 52
Location: Ontario Canada
Hi
I am trying to figure out how to spin or use stepper motors. I tried the program from the library in Studio but the motor just jerks sporadically, spun a bit, etc. I tried mixing up the lines (coding) but could not find the right combo. I know very little about steppers and have no documentation on this one. It is a AStrosyn 17pm series but cannot find the spec sheet online. Probably out of a printer or something I scrapped years ago. I used an ohm meter to figure out the 6 leads and they are 2 centertapped coils and it bumps on 12-24 volts but that is as far as I got.

Any pointers? Is there any particular sequence that one can reason out the correct pulse sequence? Can I move such a device with 4 mosfets and a single sided supply?

Cheers,


Top
 Profile  
 
 Post subject: Re: hlep with stepper motors please
PostPosted: Mon Jan 30, 2012 11:34 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Sounds liek you have a uni-polar motor. The 2 center tap leads are your common power. The 4 other leads are the 4 pins from the driver chip which is being controlled by the processor. Do not try running a stepper directly off the I/O pins of the processor. There isn't even close to enough sinking capability unless its a super tiny stepper with no load. You have to use a driver chip of some find.

I've run Nema17 motors(probably what that is) with a Mosfet driver board. Its pretty simple. Figuring out which wires to put where is also fairly simple. There are only 16 combinations and IIRC only 8 are unique as far as the stepper are concerned.

Pin combinations example:

1 2 3 4
2 3 4 1
3 4 1 2
4 1 2 3
etc...

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: hlep with stepper motors please
PostPosted: Mon Jan 30, 2012 5:39 pm 
Offline
Guru

Joined: Wed Nov 30, 2011 7:56 pm
Posts: 52
Location: Ontario Canada
I am driving power Mosfets (http://pdf1.alldatasheet.com/datasheet- ... F820A.html) with a Nano8. I initially used the program mentioned above but then tried just turning the various P0-P3 in different combinations.

Now I am back on the bench and the motor is an Astrosyn PJJQ159ZB-A.

So that is correct and I just have to find the right combination? I will keep playing.

Thanks


Top
 Profile  
 
 Post subject: Re: help with stepper motors please
PostPosted: Mon Jan 30, 2012 7:02 pm 
Offline
Guru

Joined: Wed Nov 30, 2011 7:56 pm
Posts: 52
Location: Ontario Canada
I am able to get motor to spin but very jumpy and ocassionally, jumps a couple of steps backwards, then continuous on. It is like 20 steps forward, couple back, 18 forward, few back, cannot see a rhythm or particular sequence.

This is the code I am using, It is what I figure is the simplest form to drive a motor but am I off base? I have been switching the sections around but have not been able to find the right combo. (kind of like the lottery, have not found that combo either... ;) )

Code:
;Start Program
;P0-P3 connected to Gates of Power Mosfets
; Trying for continuous rotation
output p0
output p1
output p2
output p3
low p0
low p1
low p2
low p3
t var byte
t=3

Main
   
   high p0
   pause t
   low p0
   pause t
   high p2
   pause t
   low p2
   pause t
   high p3
   pause t
   low p3
   pause t   
   high p1
   pause t
   low p1
   pause t
   
   Goto Main


Top
 Profile  
 
 Post subject: Re: hlep with stepper motors please
PostPosted: Wed Feb 01, 2012 2:30 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Just means you aren't stepping in the correct sequence.

You should have 4 steps. You should set all 4 pins each step.

eg:
Code:
pin1 con p0
pin2 con p1
pin3 con p2
pin4 con p3

loop
high pin1
high pin2
low pin3
low pin4
pause 100

low pin1
high pin2
high pin3
low pin4
pause 100

low pin1
low pin2
high pin3
high pin4
pause 100

high pin1
low pin2
low pin3
high pin4
pause 100

goto loop


Now just change the pin constants until you get the right order.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: hlep with stepper motors please
PostPosted: Thu Feb 02, 2012 5:36 am 
Offline
Guru

Joined: Wed Nov 30, 2011 7:56 pm
Posts: 52
Location: Ontario Canada
Ohhh, I did not realize that more than one pin was enabled at a time.

I only ever put one winding on at a time sooo

Thanks Nathan and I will give it a shot.

Report back later


Top
 Profile  
 
 Post subject: Re: hlep with stepper motors please
PostPosted: Fri Feb 03, 2012 10:58 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
There are stepping patterns that only use one winding at a time but it cuts the torque way down(by about 1/3 IIRC).

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: hlep with stepper motors please
PostPosted: Sat Feb 04, 2012 10:26 am 
Offline
Guru

Joined: Wed Nov 30, 2011 7:56 pm
Posts: 52
Location: Ontario Canada
That worked out better, although I do not think I have the perfect pattern yet. I did get continuous rotation but it faltered after a few rotations and became erratic. This could be a result of the Mosfets heating up too as they are not heatsinked.

With a pause = 0, the motor just sits and whines. With a pause of ~2-3, it is not too fast. Is this a function of the Nano 8 being a slower controller? ie 4 MHz I think? I expected a much faster rotation with a short pause.

I set up a For Next loop to see how many pulses for a complete revolution but haven't fine tuned it yet. Looks like around 60.


Top
 Profile  
 
 Post subject: Re: hlep with stepper motors please
PostPosted: Mon Feb 06, 2012 7:56 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Different stepper motors can go at different speeds. You very well could need to slow yours down so it doesn't mis-step.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: hlep with stepper motors please
PostPosted: Thu May 10, 2012 8:06 am 
Offline
Guru

Joined: Mon Apr 19, 2010 9:13 am
Posts: 63
I know this may be a bit late, but have you considered using a :looks around to see if anyone is watching: Pololu A4988? Easily breadboarded and will support motors up to 1A w/o heatsink, 2A with. I've tinkered with it for speeding up execution time on nano's. What I'd really like is a way to send a number of steps and get an irq back when those steps have completed. wink wink, nudge nudge BM.

_________________
Studio 2.0.0.16 on Win 7 Home x64 updated daily - Original Roboclaw 5A V1.3.9
Mostly a Nano40 for prototyping, but I have others in my bins


Top
 Profile  
 
 Post subject: Re: hlep with stepper motors please
PostPosted: Thu May 10, 2012 10:12 am 
Offline
Master

Joined: Tue Jun 22, 2010 1:15 pm
Posts: 203
Don't forget acceleration/deceleration ramps. You can't expect a stepper to "jump" into motion.

Alan KM6VV

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO