AccelStepper for 3 wire step motors

510 views
Skip to first unread message

Yuri Ivatchkovitch

unread,
Dec 17, 2012, 7:36:42 AM12/17/12
to accels...@googlegroups.com
Hello everyone!

First of all, thanks for this lib, Mike! It is outstanding!

Well, I was trying to control a HDD spindle motor using this lib, but my motor haves 3 control wires and a common. I made some modifications to the original code to control it and the code is attached to this post - someone may be interested on using it.

I must say that I was unable to achieve high RPM on the spindle using my implementations of FULL3WIRE neither HALF3WIRE, although they work for slower speeds.

Regads,
Yuri I
AccelStepper.cpp
AccelStepper.h

Mike McCauley

unread,
Dec 18, 2012, 1:31:00 AM12/18/12
to accels...@googlegroups.com
Hello Yuri,

thanks for posting your code.
Do we have your permisison to include it in the AccelStepper mainline?
If so I should be able to add it towards the end of this week.
Do you have any info about the electrical connections for 3wire?


Cheers.

Yuri Ivatchkovitch

unread,
Dec 17, 2012, 3:39:16 PM12/17/12
to accels...@googlegroups.com
Hi!

Sure you can! I would be pleased to collaborate!!!

Doing some tests on the spindle motor, I concluded that my motor have a wiring similar to this one:

As the steps move the axis by 20 degrees the inertia of the attached things make impossible to control it at too low or high speeds... at least with the logic that I used.

Regards,
Yuri.

Mike McCauley

unread,
Dec 22, 2012, 5:35:29 PM12/22/12
to accels...@googlegroups.com, Yuri Ivatchkovitch
Hi,

thanks.
New version 1.28 now has your contribution. I took the liberty of making some
slight changes and adding doc.

Cheers.

On Monday, December 17, 2012 12:39:16 PM Yuri Ivatchkovitch wrote:
> Hi!
>
> Sure you can! I would be pleased to collaborate!!!
>
> Doing some tests on the spindle motor, I concluded that my motor have a
> wiring similar to this one:
>
> <http://static.electro-tech-online.com/imgcache/294-sterownik_1920.jpg>
--
Mike McCauley mi...@open.com.au
Open System Consultants Pty. Ltd
9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.open.com.au
Phone +61 7 5598-7474 Fax +61 7 5598-7070

Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, NetWare etc.

Alan Bork

unread,
Aug 21, 2014, 3:03:58 PM8/21/14
to accels...@googlegroups.com, mytos...@gmail.com
I have been trying to use this library to push a HDD motor and have been using the 3-wire interfaces for that.  But I have noticed some of Yuri's code is missing from the distribution.

Please review Yuri's code on methods:
void AccelStepper::setOutputPins(uint8_t mask)
void AccelStepper::enableOutputs()

Thanks.

Mike McCauley

unread,
Aug 21, 2014, 4:59:58 PM8/21/14
to accels...@googlegroups.com, Alan Bork, mytos...@gmail.com
Hello Alan,

thanks for bringing this to our attention. New version 1.27 has the missing
code in it. PLs let me know how you get on.

Cheers.
> > Radiator: the most portable, flexible and configurable RADIUS server
> > anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
> > Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
> > TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
> > DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, NetWare
> > etc.

--
Mike McCauley VK4AMM mi...@airspayce.com
Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.airspayce.com
Phone +61 7 5598-7474

Alan Bork

unread,
Aug 21, 2014, 5:59:34 PM8/21/14
to accels...@googlegroups.com, aeb...@gmail.com, mytos...@gmail.com
Sorry, I don't understand your request.  

I was having problems using this library with my HDD motor and went digging into the code and checking the forums.

When I compare the latest version (1.41) with Yuri's attachments, I found code from Yuri files not in the latest version (specifically to the two methods I listed above).  Later today I will make changes locally in my development environment and will let you know if all works out.

Yuri Ivatchkovitch

unread,
Aug 21, 2014, 6:09:35 PM8/21/14
to Alan Bork, accels...@googlegroups.com

Hey Alan!

Just to explain one thing about the implementation: it works and spins the motor, but I've never been able to spin it at high rotations. To achieve high rotations a much more ellaborated code need to be done, using the same pins as inputs to detect the motor step and synchronize the next one according to the interrupt... Or use a specialized IC.

If you get it working well, please let me know!

Regards,
Yuri I.

Mike McCauley

unread,
Aug 21, 2014, 7:12:13 PM8/21/14
to accels...@googlegroups.com, Alan Bork, mytos...@gmail.com
Hi,

Sorry. I meant new version 1.42 just released has the code that was missing
added into the mainline.

Please let me know if it works OK for you.

Cheers.

Alan Bork

unread,
Aug 24, 2014, 8:45:46 PM8/24/14
to accels...@googlegroups.com, aeb...@gmail.com, mytos...@gmail.com
I seem to be a little dense here...but I can't find out to get to the 1.42 version of code.  The main page is still linking to 1.41.

Mike McCauley

unread,
Aug 24, 2014, 8:56:00 PM8/24/14
to accels...@googlegroups.com
Ooops, our mistake.
Should be there now.

Cheers.
Reply all
Reply to author
Forward
0 new messages