Barebones 08M stepper driving!

manuka

Senior Member
Those with an eye to bargains may know US firm Electronic Goldmine offer an appealingly small 5 wire 5 Volt stepper at attractive prices => http://www.goldmine-elec-products.com/prodinfo.asp?number=G14197.

These have appeared with good feedback in diverse Instructables => http://www.instructables.com/id/Drive-a-Stepper-Motor-with-an-AVR-Microprocessor/?ALLSTEPS & also ProfMason's increasingly Picaxe orientated site => http://profmason.com/?m=200612, so I grabbed a bunch at ~US$2 to suit student projects. Yes- $2 !Perhaps I was robbed, as they were earlier selling at US 99 cents ! I've only just given them a look see to find they're essentially just a 4 wire bipolar,rather than a CT unipolar, BUT with a current demands so low (~20-50mA) that direct PICAXE connection looked feasible. Naturally at least an NPN (BC547 etc) would normally be used as a current booster when driving from a PICAXE, much as shown P.238 in David Lincoln's PICAXE book.

Numerous steppers flood the market, many ex printers & floppy drives & free to a good home etc, but these are usually pretty power hungry (often 12V at ~a few Amps),& require MOSFETs & specialised motor driver ICs. Argh- the next thing you know grunty PSUs, parts $$($), rats nest layouts & much running around has occurred, all serving to daunt those keen to experience a few stepper basics. Typically this means schools where " £1 a head" project budgets prevail, & a single technician that has to service 1000 students spread over a dozen labs... Count yourself lucky the rest of you.

Hence it's with some "smell of a oily rag" satisfaction that I can report an ultra barebones setup worked a treat, with easy coil pair sequencing via timed PULSOUTs that even a baby 08 can produce. Initial trials of a clockwise & C-CW washing machine agitator action were voted most entrancing by an impressionable feline audience! An overnight soak test has so far revealed no ill effects - total current drain from the 3 x AA (4½V) supply was ~ a meagre 20mA (which naturally includes 3-5mA for the PICAXE as well). YMMV

Aside from some soldered header pins & hot melt glue reinforcement to the stepper leads, absolutely no other parts were needed at all! See => www.picaxe.orcon.net.nz/stepdemo.jpg with code => www.picaxe.orcon.net.nz/stepdemo.bas Stan
 

Attachments

Last edited:

Tom2000

Senior Member
ROTFL !!!

Stan, I hope you have a large, hi-res shot of Miss Kitty. That photo is a prizewinner!

Tom
 

manuka

Senior Member
With a little flag teasingly rotating away like that- what cat could resist! There's the bones of an externally funded research project here (I've seen flimsier...)- maybe " The effect of bipolar step rate on feline attention span"? Mmm -"Bipolar disorder"? Perhaps I should add a "GO ALL BLACKS" shaft flag title for our NZ rugby men in France... In fact any Kiwi PICAXERs after one of these darling steppers should let me know. NZ$5 (+ maybe a SAE) should cover things? Sorry Oz. - p&p probably too much across the pond, although if you fumble the rugby I may reconsider... Stan
 
Last edited:

Wrenow

Senior Member
Love it, Stan. One question, though, Did you try it with the motor under load or stalled? I would think that would change the draw a lot, wouldn't it? It sure does on regular old brushed motors.

Wreno
 
Sadly the $2 turns into something like $12 here in AUS, you have shipping, currency exchanging, insurance...

Great you pointed it out though!
 

manuka

Senior Member
Don't just buy a single stepper, but do as we did here in NZ & go shares with a mate on a few dozen. That way p&p is tolerable - I seem to remember it added ~an extra US$1 overall on a large order of other goodies.

Stall current: Rest easy! Naturally I'd considered this earlier,but even finger grip stalling of the shaft caused hardly a mumour to the average ( 3 x AA battery) supply drain, which went up a ~1mA from ~17mA to 18 mA.

I've since supervised dozens of these steppers being used like this to great effect. Not a mishap from any of them.
 

Wrenow

Senior Member
When my wife saw the pics, she immediately encouraged me to build one for ours and see what happens. Mine came in this weekend, plugged it up, and Voila! Set it on the floor, and one cat came in, got intensely interested, stayed interested for a while, then noticed the wires. You could see the wheels turning - "do those wires make this thing turn? What if I bite them?" and she proceeded so to do. We had to tell her NO a couple of times. The other cat then came running, stopped a couple of feet from it. Looked at it, looked at us. "Hmmm, you want me to play with this thing? Not while you watch, thanks." Turned and sauntered off.

Been playing with the wiring and timing a bit. I don't know if it has quite the torque I need to drive a prop on one of my smaller boats, but plan to try. It makes for some interesting possibilities. Use the remaining empty pin to read an Radio Control pulsin, which the program uses to adjust the speed of rotation by changing the pulse widths to the motor.

Thanks Stan,

Wreno
 

Mycroft2152

Senior Member
Wrenow,

Definitely worth buying a few, just to annoy the cats.

How strong is the motor? Strong enough to use in a small buggy?
 

Wrenow

Senior Member
Not a huge amount of torque, but perhaps enough for a small buggy, especially if geared a bit or hard tires on a smooth surface. I am hoping it is enough to swing a prop on a small ship. Remember, it is not using much power, though. Nice thing is that the RPM range is pretty good for direct drive of small wheels, if there is enough oomph. Fun to ply with, regardless. Be pretty easy to make a plug out of a dual DIP type header, too. I just put dip header pins in the plug and then used 4 MM servo cables to plug them in to one of the 08M starter boards that I put DIP Header pins on for quickie trials. Goldmine has some 3 pin ones that are dandy for this (hooking to servo cables). http://www.goldmine-elec-products.com/prodinfo.asp?number=G14767

They also have these, http://www.goldmine-elec-products.com/prodinfo.asp?number=G16033
that can be clipped to make 4 plugs for the motors.

I bet some of Stan's students have found some fun uses.

Cheers,

Wreno
 

wim

Member
Hi
I m using this mini-Goldmine-stepper to make a 90 degree move clockwise and after that 90 degree back so counter clock wise

the info and programs I found here, it will move but how to control to 90 degree.
i m using the Picaxe28x project board and connected the stepper directly to the pica chip so no driver, as written in the 08 example.
any help is welcome, thanks and regards
 

wim

Member
90 / degrees_per_step = number of steps required to move 90 degrees.
It really is that simple.
oke that is logic...
but i m struggling with the program to make 1 exact step.
the stepper is moving to many degree for one step..
I tried different programs and statements like pulsout and high, low etc
do you have an example program for 1 step?
thanks
 

BeanieBots

Moderator
It's probably easier to post the code you have and then modify from there.

0001 to 0010 is one step.
You're probably doing the full sequence from 0001 through 1000 which is four steps.

What is the degrees/step for that motor?
Typical is 1.8
 

wim

Member
It's probably easier to post the code you have and then modify from there.

0001 to 0010 is one step.
You're probably doing the full sequence from 0001 through 1000 which is four steps.

What is the degrees/step for that motor?
Typical is 1.8

Hi thanks in advance,
This is my code based on the half-step method mentioned on the instructables site, when i remove the half-step instructions, the stepper is still moving.
I connected the stepper directly to the picaxe28x on the project board


'28x1 with goldmine stepper

let outpins =%00000000 'init alle poorten naar 0
let b0=6 'pause duur in ms

main:

gosub rechts
pause 500

gosub links
pause 500

gosub links
pause 500

gosub rechts
pause 500

end



rechts:


'rechtsom draaien

let outpins =%00000001 'd0 blue
pause b0


let outpins =%00000011 'd1 blue+black
pause b0

let outpins =%00000010 'd1 black
pause b0

let outpins =%00000110 'd2 black+red
pause b0

let outpins =%00000100 'd2 red
pause b0

let outpins =%00010100 'd2 red+yellow
pause b0

let outpins =%00010000 'd4 yellow
pause b0

let outpins =%00010001 'd0 yellow+ blue
pause b0

let outpins =%00000001 'd0 blue
pause b0

let outpins =%00000000 'init alle poorten naar 0

return


links:

let outpins =%00010000 'd4 yellow
pause b0

let outpins =%00010100 'd2 red+yellow
pause b0

let outpins =%00000100 'd2 red
pause b0

let outpins =%00000110 'd2 black+red
pause b0

let outpins =%00000010 'd1 black
pause b0


let outpins =%00000011 'd1 blue+black
pause b0

let outpins =%00000001 'd0 blue
pause b0

let outpins =%00010001 'd0 yellow+ blue
pause b0

let outpins =%00010000 'd4 yellow
pause b0

let outpins =%00000000 'init alle poorten naar 0

return
 

BeanieBots

Moderator
Each "let outpins = .." statement moves the motor one step from the previous statement.
The sequence shown is actually half step.
The subroutines perform the full set of steps so you will need to break down the routine into individual steps. That will require keeping track of where you are in the sequence.

I'd probably use something like the branch command with a variable that keeps track of the current step.
Something along the lines of this:-

Make_Step: 'subroutine to single step.
Branch current_step,(Step_0001,Step_0010.....

step_0001:
outpins = %00000001
inc current_step
Return

Step_0010:
outpins = %00000010
inc current_step
Return

etc. etc.

Obviously you could expand that for half stepping and/or build a second routine with the sequence in the opposite direction and 'dec' current_step.
 

wim

Member
Each "let outpins = .." statement moves the motor one step from the previous statement.
The sequence shown is actually half step.
The subroutines perform the full set of steps so you will need to break down the routine into individual steps. That will require keeping track of where you are in the sequence.

I'd probably use something like the branch command with a variable that keeps track of the current step.
Something along the lines of this:-

Make_Step: 'subroutine to single step.
Branch current_step,(Step_0001,Step_0010.....

step_0001:
outpins = %00000001
inc current_step
Return

Step_0010:
outpins = %00000010
inc current_step
Return

etc. etc.

Obviously you could expand that for half stepping and/or build a second routine with the sequence in the opposite direction and 'dec' current_step.
thanks for your reply!!
did you actualy also used this stepper from Goldmine, i think there is the problem in this specific stepper
 

BeanieBots

Moderator
Nope, never used that one.
Didn't even check to see if it is uni or bi polar.
Assumed that you had already done that. The code is for unipolar.
Also didn't bother to see if it is OK to connect direct as you describe.

What is the voltage/current/resistance ratings of the coils?

What "problem" do you suspect?
 

BeanieBots

Moderator
Even using "for b0=1 to 1" Stan's code will still do the FULL sequence.

Code:
'Barebones PICAXE 0M stepper demo. Easily modified!
'Uses very small & efficient bipolar stepper(~US$2)
'Draws ~20mA at 5V when directly 08M pulse driven 
'Sourced  Electronic Goldmine. Ignore white CT wire
'via Stan Swan=> www.picaxe.orcon.net.nz  9/07
stepdemo:  
for b0=1 to 10 		'CW rotation
pulsout 0,5000:pause 10 'blue    Pin 0
pulsout 1,5000:pause 10 'black   Pin 1
pulsout 2,5000:pause 10 'red     Pin 2
pulsout 4,5000:pause 10 'yellow  Pin 4
next b0
for b1 = 1 to 10 		'C-CW rotation
pulsout 4,5000:pause 10 'yellow  Pin 4
pulsout 2,5000:pause 10 'red     Pin 2
pulsout 1,5000:pause 10 'black   Pin 1
pulsout 0,5000:pause 10 'blue    Pin 0
next b1
goto stepdemo
It needs something along the lines of my post# 16 to keep track of EACH step.
However, if it's a 24 step motor, then it WILL move 15degs per step. (7.5 for half step) even for a single step!
 

wim

Member
yes I tried this code and my stepper moves about 95-100 degree cw and then back again ccw when i use for b0=1 to 2 and b1 also

thanks for your suggestions and help!
 

BeanieBots

Moderator
The smallest movement you can get will be with half stepping along the lines of this:-

do
outpins = %00000011
pause 1000
outpins = %00000001
pause 1000
loop

It will move between the two smallest incremental positions.
(assuming the coils are wired incrementally to the outputs)
 

wim

Member
The smallest movement you can get will be with half stepping along the lines of this:-

do
outpins = %00000011
pause 1000
outpins = %00000001
pause 1000
loop

It will move between the two smallest incremental positions.
(assuming the coils are wired incrementally to the outputs)
thx I tried your code , the stepper is moving about 4 or 5 degree cw and then ccw
 

BeanieBots

Moderator
Well that confirms EC's post about steps/rev. (6 steps required for 90deg).
(IMHO a bit course)
All you now need to do is write the full code in the way I described using half steps.
 
Top