Page 1 of 1

4 Phase Stepper Motor and CNC Application

Posted: Sun Jun 01, 2014 8:32 am
by Inventor_Tommy
Dear All

I am not a newbie by any means to Python, the RPi or real world applications. However I have hit a road block and wondering if there is any way around my problem that follows without purchasing new hardware?

I am trying to build a CNC machine from my Raspberry Pi. I did some research, purchased some 4 phase stepper motors (28BYJ-48) with a ULN-2003 driver board. I can move these motors fine with a python script using [1,0,0,1] [1,0,1,0] etc except when I try to apply this to the real world I hit a road block. So in a nut shell I know I can move the motors smoothly with a 0.004 second delay however all applications so far with examples on the net with python all show a bipolar motor setup. I even tried compiling my own kernel with LINUXCNC drivers etc, the application works but it require 2 pins only for drive/step. I clearly need 4 GPIO pins per phase.

Can anyone help with a solution around this or should I just bite the bullet and buy some 2 phase motors?

Thanks in advance and I look forward to your replies :-)

Tom

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jun 02, 2014 10:33 pm
by MrGreg
Bite the bullet and go for bipolar.
They are deal easier to use and if you are building something cnc, likely you will need all the IO you can muster for other functions.

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jun 02, 2014 11:58 pm
by Inventor_Tommy
No problems. Thank you for your quick answer. I will get some bipolar stepper motors and see how I go :-)

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jul 14, 2014 12:43 am
by Inventor_Tommy
OK

So I got the following motors that are "made for CNC applications". However they still have 4 wires. Anyone know of a driver I can use with the raspberry Pi to interface with these stepper motors?

http://www.ebay.com.au/itm/231162408535 ... 1439.l2649

Tom

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jul 14, 2014 9:47 am
by FLYFISH TECHNOLOGIES
Hi,
Inventor_Tommy wrote:However they still have 4 wires.
... because they are bipolar stepper motors.
Inventor_Tommy wrote:Anyone know of a driver I can use
You (obviously) need a driver for bipolar stepper motors. Add word "bipolar" in your google search string.


Best wishes, Ivan Zilic.

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jul 14, 2014 9:51 am
by Inventor_Tommy
Ivan

At the risk of sounding even more like an idiot I can only find drivers that have a parallel interface. The raspberry pi does not have that.

However I did find on eBay a driver that has a step/drive input and apparently it does the translation and it has the A-, A+, B-, B+ outputs. It is the A4988 I briefly mentioned earlier. I will post back if this piece of hardware works with my custom kernel.

Tom

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jul 14, 2014 10:06 am
by FLYFISH TECHNOLOGIES
Hi Tom,
Inventor_Tommy wrote:II can only find drivers that have a parallel interface. The raspberry pi does not have that.
The RasPi GPIO is parallel interface. (Parallel <> Centronics)


Best wishes, Ivan Zilic.

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jul 14, 2014 10:08 am
by Inventor_Tommy
Can you point me in the direction of some information in regards to interfacing the Pi with the parallel interface of a bipolar driver?

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jul 14, 2014 10:21 am
by FLYFISH TECHNOLOGIES
Hi,
Inventor_Tommy wrote:Can you point me in the direction of some information in regards to interfacing the Pi with the parallel interface of a bipolar driver?
Parallel interface is interface containing parallel signals. This is actually primary GPIO interface, but some GPIO pins are capable (additionally) to provide some other interfaces.

So, if (for example) your parallel interface is 8-signals wide, you need 8 GPIO signals. Let's simplify that the driver board signals (mentioned 8) are named as A, B, C, ... and H. And you connect them to GPIO 1, 2, 3, ... 8 (pick proper numbers, this is for easier explanations)...

Ok, then you find out that according to the driver board capabilities and motors connected, you rotate one stepper in one direction with the sequence:
A B C D E F G H
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
...
...

You then need this to directly map int your pins (just substitute A, B, ... with GPIO 1, 2, ...) and you get your sequence to be executed by the code.


Best wishes, Ivan Zilic.

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jul 14, 2014 11:34 am
by Inventor_Tommy
Ivan

Perfect mate, that is definitely something I understand. Wish me luck creating my interface cable.

Thank you so much for your time :-)

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jul 14, 2014 11:39 am
by joan
I'm not sure if building a "Centronics" port will automagically make the port work under LinuxCNC.

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jul 14, 2014 11:43 am
by FLYFISH TECHNOLOGIES
Hi,
joan wrote:I'm not sure if building a "Centronics" port will automagically make the port work under LinuxCNC.
Just to clearify... I mentioned earlier that "parallel" is not equal to "Centronics". (Centronics is just one type of parallel interfaces.)


Best wishes, Ivan Zilic.

Re: 4 Phase Stepper Motor and CNC Application

Posted: Mon Jul 14, 2014 11:47 am
by joan
FLYFISH TECHNOLOGIES wrote:Hi,
joan wrote:I'm not sure if building a "Centronics" port will automagically make the port work under LinuxCNC.
Just to clearify... I mentioned earlier that "parallel" is not equal to "Centronics". (Centronics is just one type of parallel interfaces.)


Best wishes, Ivan Zilic.
Yes, I understood that.

I was just wondering if the OP plans to use his steppers under LinuxCNC.

Re: 4 Phase Stepper Motor and CNC Application

Posted: Sat Jul 19, 2014 2:53 pm
by RaspISteve
Tommy,

Did you really look at the stuff I pointed you at in http://www.raspberrypi.org/forums/viewt ... 29&t=80766? Heard nothing so I assumed you'd cracked it. I see now you still have some way to go.

Those modules (and a big power supply) will solve most of the problems. You will maybe need to add some mosfet type devices between the PIO output pins and the real world motor drivers. Also remember that with step-motors you are switching some big currents and higher voltages which means a lot of thought with wiring and layout.