Inventor_Tommy
Posts: 14
Joined: Sun Jun 01, 2014 8:26 am

Nema17 and LinuxCNC

Wed Jul 09, 2014 12:35 am

Hi

I am not a n00b to the Raspberry Pi, Python or programming. What I am new to however is using a stepper motor with the Pi.

I am looking to build a CNC machine that I can send a file to over Wireless and launch LinuxCNC (which I have compiled my own kernel) and start cutting.

What I have:
- 3 x Nema17 stepper motors
- 3 x HG7881 H-Bridge drivers
- 1 x Raspberry Pi with a custom LinuxCNC kernel
- All cabling required

The issue I am having is that the Nema17 stepper motors have 4 cables, the HG7881 has 4 inputs and 4 outputs and I have them wired the correct way around according to the polarity of the stepper motor however LinuxCNC only has 2 outputs per stepper motor configured with the Raspberry Pi settings I am using. 1 wire is step and the other is drive. How do I connect the Step/Drive (2 cable) setup from LinuxCNC to the 4 inputs on the HG7881 H-Bridge? Or do I need another piece of hardware in between the Pi and the Stepper motors to replace the H-Bridge, is that where I am going wrong?

This is the H-Bridge that I was talking about:
http://www.ebay.com.au/itm/190866391027 ... 1439.l2649


Regards
Tom O'Brien

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: Nema17 and LinuxCNC

Wed Jul 09, 2014 1:05 am

Hi Tom,
Inventor_Tommy wrote:1 wire is step and the other is drive.
How do you change a rotation direction ?

Obviously your current software and hardware are not compatible... you need to make a decision which side you're going to modify. If you'd like to change hardware, then you might consider using L297.


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

Inventor_Tommy
Posts: 14
Joined: Sun Jun 01, 2014 8:26 am

Re: Nema17 and LinuxCNC

Wed Jul 09, 2014 3:24 am

Hi Ivan

Are you able to point me in the right direction of a pre-made L297 stepper motor driver capable of driving 3 motors?

Regards
Tom O'Brien

Inventor_Tommy
Posts: 14
Joined: Sun Jun 01, 2014 8:26 am

Re: Nema17 and LinuxCNC

Wed Jul 09, 2014 4:58 am

Would something like the A4988 be OK?
http://www.robotdigg.com/news/26/Reprap-Stepper-Motor

EBay link:
http://www.ebay.com.au/itm/New-A4988-St ... e36&_uhb=1

I am looking for a cheap solution to the mess I have created. Otherwise can you please suggest a complete driver board that I might be able to use or a dummies guide to the L297 chip? I am keen to make this work as the LINUXCNC software is really great to use.

Tom

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: Nema17 and LinuxCNC

Wed Jul 09, 2014 11:47 am

Hi Tom,
Inventor_Tommy wrote:Are you able to point me in the right direction of a pre-made L297 stepper motor driver capable of driving 3 motors?
I'd need to google for it... But there are two issues with it - the first drastically decrease number of hits, because I do not buy at shops which don't provide proper data next to products. The second issues is that I don't know your requirements.
Inventor_Tommy wrote:Would something like the A4988 be OK?
I have no idea. To locate proper board you have to verify its capabilities with the motor's requirements. Therefore, without knowing the motor's requirements, one can only guess (and electronics frequently charges tax on guessing ;-) ).


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

Inventor_Tommy
Posts: 14
Joined: Sun Jun 01, 2014 8:26 am

Re: Nema17 and LinuxCNC

Fri Jul 11, 2014 2:55 am

I do have another solution with some hardware I have lying around from another project.

I have 2 x ULN2003 drivers with 2 x BYJ48 stepper motors.

I can drive these motors successfully in python with 1001, 1010, 1100 etc commands sent to the driver.

However there is no configuration available or a .hal file for linuxcnc that I can use to drive the motors in Linuxcnc. I have the right hardware but not the right configuration, maybe you could help out with that instead?

Return to “Other projects”