Arduino CNC shield - inconsistent direction

Hi All

This is my first post to this forum. I have just built a new machine and am using an Arduino Uno R3 controller with a motor shield such as the one at this link:

http://www.zyltech.com/arduino-cnc-shield-instructions/

I have used the jumpers as directed - a jumper over each Z pin so that I can clone the Z axis onto the A driver.

When I test, the motor connected to the A driver works fine, but I then have issues with the Z driver.

I use the Universal GCode sender and send the sequence of commands:

G0 Z1 Direction = UP, all good G0 Z2 Direction = UP, all good G0 Z0 Direction = DOWN, all good G0 Z1 Direction = DOWN, incorrect direction

You can see in the last step, that the direction is down instead of up. With all connected, this causes my 1 Z axis motor to move the Z axis up while the other moves down - not a good experience for my machine.

Can anyone please suggest what the issue could be here?

Thanks MIKE

Try reversing the plug from one of the motors to the motor driver header. That should the reverse the one motor direction. Pull the plug off, rotate 180 degrees and plug back on.

MAKE SURE THE MOTOR POWER IS OFF before unplugging the motor or motor driver will be killed.

Hi...Thanks for your reply.

If you notice in the sequence that I posted earlier, the direction is inconsistent.

The command G0 Z1 should make the gantry go up, instead it went down, when previously it did go up.

I am aware that it is easy to reverse the direction of the motors by reversing the polarity of a phase.

mikkythomeon: Hi...Thanks for your reply.

If you notice in the sequence that I posted earlier, the direction is inconsistent.

The command G0 Z1 should make the gantry go up, instead it went down, when previously it did go up.

I am aware that it is easy to reverse the direction of the motors by reversing the polarity of a phase.

Are you sure you should not be using negative numbers to move the Z the other direction?

Paul

Hi Paul,

Thanks for the reply...its a weekend now so I will try that and post back once I have looked at this again.

Hi....

Still no joy with this. I tried replacing the A4988 driver and updating from grbl version 0,9 to the latest version 1.1. Still the same response. This is really making me regret that I chose to design and build a machine with two z axis motors.

I am using a 12V ATX power supply to power the machine not sure if this low voltage could have some part of this problem.

To prove that its not my gcode that is the issue, I used Universal GCode sender, and jogging the z axis A driver, I get the same result. UP is not always UP and DOWN is not always DOWN. I also double checked the wiring again.

Well the latest on this is that I have decoupled the motor from the machine, so the machine is running at no load.

Here is a list of instructions that I send to the controller. It seems that the direction is random. Any ideas how to solve this?

G0 Z45 anti-clockwise G0 Z0 clockwise G0 Z45 anti-clockwise G0 Z0 anti-clockwise G0 Z45 anti-clockwise G0 Z0 anti-clockwise G0 Z45 anti-clockwise G0 Z0 clockwise G0 Z45 clockwise G0 Z0 anti-clockwise G0 Z45 anti-clockwise G0 Z0 anti-clockwise G0 Z45 anti-clockwise G0 Z0 anti-clockwise G0 Z45 clockwise G0 Z0 anti-clockwise G0 Z45 clockwise G0 Z0 anti-clockwise G0 Z45 anti-clockwise

It seems that my problem could be similar to http://forum.arduino.cc/index.php?topic=234099.0

Perhaps I can simulate the direction by setting the driver direction pin low. Can anybody tell me how I can do this with the driver plugged into the CNC shield?

Reading a bit more, maybe its an end stop issue. My end stops are normally closed. I will run a test without end-stops and see that transpires.

https://reprap.org/forum/read.php?13,384547

Hi, please can you check if my jumper configuration is correct to clone the Z Axis in the attached picture (step and direction pins bridged)

Thanks in advance…

pinout.JPG

Latest update...

Well, now I have disconnected the end stops, and tried mirroring the second Y axis stepper onto the A driver. Same problem.

I placed a multimeter pin on the jumper that controls the Direction of the A driver, and measured that voltage each time I changed direction from the PC, and the toggling of direction is fine, toggles hi and low without issues. So, the arduino is fine.

I did try replacing the driver with another, but I got the same problem.

Next Steps...

I am going to try measuring the direction voltage directly on the Driver's direction pin. If this does not toggle, then the CNC shield is faulty.

I am also going to disable end stops in firmware as well to see if these steps resolve the issue.

If anyone has any other ideas or experience, that would great.

Well, if anyone is interested....

I measured the voltage on the A driver's direction pin, and it toggles correctly between 5V and ground each time I send a sequence of G0 Z1 and G0 Z0, G0 Z1 and G0 Z0 and so on.

So, there is nothing wrong with the arduino, grbl, the CNC shield, or the UGS software in setting the direction of travel. The problem then appeared to be a driver problem. So, I swapped out the driver onto the Y axis and there was no problem with the driver on the Y axis slot.

So, I guess the next step that I have left is to disable the end stops in grbl.

Failing that, I will try connecting the driver as shown in

https://lastminuteengineers.com/a4988-stepper-motor-driver-arduino-tutorial/

WOW a lot going on here but it seems so hard to do 1 thing.

I buggered up my board on my reprap pro very old printer. I used a Arduino mega with a ramps 1.4 but it didn't like running the 2 stepper motors of one driver so all I did was changed one line in Configuration_adv.h.

//#define Z_DUAL_STEPPER_DRIVERS to

define Z_DUAL_STEPPER_DRIVERS

Haven't we got the same for cnc?

Second Z driver is on E1

If not why not?

Hi there I’m going through the exact same problem and tried changing the driver (drv8825) and that didn’t work too ,I wanna no if you found a solution