Weird Stuff With my Stepper (3D Printer)

Hello! (Sorry for my english, not my main language)

There is something really weird happening with my 3d printer.

I built this 3d printer myself, and I made the circuit board in a perfboard.

I'm using four EasyDrivers (Easy Driver stepper motor driver) to control de stepper motors, and an Arduino Nano.

Three of them are being powered by a 20V power source, and the forth (extruder) by a 12V power source. They are all connected to ground.

The drivers have a voltage regulator, so I don't need to feed them with 5V.

The problem began when all layers of the print were evenly shifted, like it was losing the same amount of steps each layer.

To check if the problem was the driver, I switched two of them, and the problem kept on the same motor.
To check the motor, I switched the motor cables, and the problem went to the other motor, wich made me think that the problem was on the stepper driver slot / motor cable conector.
Edit: When I switched two of the motor wires to change the motor direction, the shifting changed the direction too.

I remade all the conections from that slot, but the problem remained.

Then I noted that when the 12V Extruder driver (not the one with problem) is mounted apart in a protoboard, far from the circuit board, connected with some jumpers, the problem disapears.

To solve that, I tried to add a 100uF capacitors between M+ and ground for all drivers, as close as possible to them, but it did not work too.

I'm running out of ideas.

Pls hulp :slight_smile:

You need to give us a lot more detail

Post a link to the datasheet for your stepper motors (or several links if the motors are not identical)
Post your program (add the .ino file as an attachment if it is big).
Post a photo of the machine so that we have a good appreciation of the mechanics

Are you using GCode to control the system?

Are you saying that the problem only applies to one motor?

Have you written a short GCode program to move the print head in a rectangle?

How have you calibrated the number of steps required to get the correct real-world movement?

Have you either eliminated or compensated for backlash in your mechanism?

...R

Hi,
How have you got your drivers connected to the power supply?

Each driver connected individually back to the power supply terminals?
OR
The power supply wires daisy chained from driver to driver?

What is your power supply?

Can you please post a copy of your power connection circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please post a picture of your project so we can see your component layout?

Thanks.. Tom.... :slight_smile:

How are you routing the step and direction signals and their associated ground connections? These are
sensitive logic signals and must be kept well away from the motor wiring or motor supply wiring.

It sounds like everytime you fired up the z-axis some pulses are induced on the x/y signals step pin. Moving
the z-driver away cured it - so I'm thinking wiring layout here.

Hi,

Guigosoldadinho:
I built this 3d printer myself, and I made the circuit board in a perfboard.

Perfboard construction with logic signals and stepper current as @MarkT has said, and the fact that taking one of your circuits of the main board may mean an circuit layout problem.
Tom... :slight_smile:

I'm sure that the problem is not in the code, the problem keeps with differents ones.

"Each driver connected individually back to the power supply terminals?
OR
The power supply wires daisy chained from driver to driver?"

A: driver to driver.

It looks like the 12V driver is interfering with the Y one.

Sorry, but I don’t have the patience to display all those images for you. I will do the first one and leave you to do the others following this Simple Image Guide

a9db9ab5f28a77e9dd022f7c2996d1c8678df7d4.jpg

…R

I don't know what's in the other pictures but photos of circuit boards are rarely any use outside a photo-competition. If you want to discuss your wiring then please draw a schematic and post a photo of the drawing.

Guigosoldadinho:
I'm sure that the problem is not in the code, the problem keeps with differents ones.

The sort of consistent error that you describe in your Original Post

all layers of the print were evenly shifted, like it was losing the same amount of

does not seem to me likely to be caused by connection problems or crosstalk between drivers. I would expect those sorts of problem to produce random errors. If it is not a connection problem then it must be due to code or a mechanical shortcoming in your machine.

If you have not already done so post a photo of a printed piece that illustrates the problem.

I built a stripboard circuit with 3 x A4988 drivers for a small lathe and never had an electrical problem with it.

...R

OK looks like I found the source of the problem. It was the hot nozzle MOSFET. I was enabling it by PWM. I tried to control it by digitalWrite and the problem was gone. Is there anything I could do to keep using the PWM? Anyway, thank you guys for trying to help me :slight_smile: \o/

With filtering capacitors, bigger is not better. A small capacitor can only filter a high frequency. Theoretically a large capacitor will filter both high and low frequency but a larger capacitor has an unavoidable inductance so it cannot filter high frequency.

You need something more like 1uF or 0.1uF to filter digital noise. Sometimes you need several caps of several values.

Guigosoldadinho:
OK looks like I found the source of the problem. It was the hot nozzle MOSFET. I was enabling it by PWM. I tried to control it by digitalWrite and the problem was gone. Is there anything I could do to keep using the PWM? Anyway, thank you guys for trying to help me :slight_smile: \o/

Why do you need to enable it with PWM?

Does the device that the MOSFET is controlling have supression capacitors and or back EMF diodes fitted?
How much current does the MOSFET conduct?

The gnd to the MOSFET should come directly from the power input ground terminal, not the gnd strip running around the edge and connected at the END of the strip, all your MOSFET current is running around the board.
ggedited.jpg
Tom… :slight_smile:

Are those pairs of orange wires the step+direction signals? If so there's your problem right there, they
don't have a ground return wire running alongside them.

You need to route signals with their ground return, preferably as twisted pair, but in the very least
alongside. One ground return will serve both step and direction signals fine, so just add a ground wire
from an arduino ground, twisted with the step/dir wires to each of the stepper drivers directly.

The ground strip round the outside is too far away - you've basically turned your step/direction inputs
to the drivers into loop-antennas for picking up impulsive noise, hence they pick up the switching transients
from the MOSFET PWM load.

And of course its equally important to make the high current wiring to the hot nozzle twisted pair, since you want to reduce its noise radiation.

The aim in routing signals is to minimize loop area in the circuit, all loop area picks up noise, adds inductance,
and radiates noise out again. Unless you are specifically making a magnetic antenna, no large loops.