A4988 with raspberry: floating step during boot

Hi,

I’ve got a stepper motor hooked up to a Raspberry Pi using the A4988 driver. I’ve made a little python script that controls the SLEEP and STEP pins, so I can make the motor rotate and also put it to sleep. DIR and RESET are always HIGH resp. LOW.

I’ve attached a drawing of the wiring below.

Now I have two questions:

1/ when nothing’s hooked up to the STEP, the motor is rotating out of it’s own. Now that may be normal (?) as the specs tell not to leave STEP floating. (btw, I have the impression it’s responding to a fake STEP signal of someting in the range of 10-100 Hz, maybe the 60Hz power frequence is popping in somehow??)

2/ when booting up the raspberry pi, all pins are floating, but I’d like my motor NOT to start rotating until I tell it so. This is how I think to proceed: connect the VDD to some other Raspberry output pin (i.o. the 3.3V pin now), which will be also floating during boot, but which may prevent the driver from starting up at all, until I set the VDD-pin to high and take control.

So my question: what would happen if I connect VDD to a floating Raspberry pin? Will this prevent the driver from rotating the motor based on an equally floating STEP signal?

Or should I take another approach?

Best regards,
Vic



wiring scheme : https://goo.gl/photos/NrKmEvMU2GnGPwsMA

Hello, Vic.

There are no pull-up or pull-down resistors for the STEP pin on the carrier board. It is possible that (at some point) the Raspberry Pi GPIO pin is configured as a high impedance input, in which case the lead to the STEP pin (which is also a high impedance input) could act as an antenna and noise could cause the STEP pin to toggle. In this sort of situation, adding a 10k Ohm pull-down resistor to the STEP pin should force it to GND when the line is not being actively toggled. Generally, keeping leads as short as possible helps to reduce noise as well. Using a pull-down resistor on the SLEEP pin is also probably a good idea and should ensure that the driver sleeps when not being actively controlled.

The A4988 has low enough logic current draw that it might be possible to power VDD with one of the GPIO pins although, in general, that sort of thing is not a good practice and it does not sound like it is necessary to fix this problem.

-Nathan

Hi Nathan,

that works perfectly! From now on, this is obvious stuff for me as well :slight_smile:

Best regards,
Vic