UNO for Bipolar Stepper Motor control Pt. 2

Hey all, I want to use an UNO to control a motor driver, specifically the SN754410 (click for datasheet) to get a bipolar stepper motor to run. This is very similar to my previous topic, since I’m using the same motor, same microcontroller, and same code. I thought the SN754410 would be easy to use, but the motor is not turning. In fact, it’s not doing anything. I can spin the axle freely with my hands, so it’s not even locked.

Currently, I have 5V from the UNO going to pins 1, 9, and 16. I have pins 4, 5, 12, and 13 tied to ground between my analog power supply and the UNO. I have pin 8 at 12V from the power supply. The remaining pins are either motor inputs or UNO outputs. I verified the voltages using an oscilloscope, so those are good. However, the motor inputs from the driver are all high at 12V all the time even though the UNO inputs are indeed alternating according to the code. I slowed the code down from 1 ms to 2 seconds to be able to see this on the scope.

The bipolar stepper will never run if its inputs don’t alternate since these require the coils being energized in precise pattern to step. Does anyone have any idea of what I should do? I appreciate any help. I attached some pictures. If you want me to take new ones, ask me.

Here is the code again for quick reference.

int positionOne = 8;
int positionTwo = 9;
int positionThree = 10;
int positionFour = 11;

void setup()
{
}

void loop()
{
  digitalWrite(positionOne, LOW);
  digitalWrite(positionTwo, HIGH);
  digitalWrite(positionThree, HIGH);
  digitalWrite(positionFour, LOW);
  delay(1);

  digitalWrite(positionOne, LOW);
  digitalWrite(positionTwo, HIGH);
  digitalWrite(positionThree, LOW);
  digitalWrite(positionFour, HIGH);
  delay(1);

  digitalWrite(positionOne, HIGH);
  digitalWrite(positionTwo, LOW);
  digitalWrite(positionThree, LOW);
  digitalWrite(positionFour, HIGH);
  delay(1);

  digitalWrite(positionOne, HIGH);
  digitalWrite(positionTwo, LOW);
  digitalWrite(positionThree, HIGH);
  digitalWrite(positionFour, LOW);
  delay(1);
}

cosined: I thought the SN754410 would be easy to use

A specialized stepper motor driver such as a Pololu A4988 would be easy to use. But I did mention that in your previous Thread.

...R

Robin2: A specialized stepper motor driver such as a Pololu A4988 would be easy to use. But I did mention that in your previous Thread.

...R

but how can you learn about H-bridges is you don't use them ?

obviously, the power can only go on one place, ditto the grounds, that is not the problem. motor coils, you have to make sure you have coils connected correctly

as a test, disconnect the motor.. I think the chip can operate without anything connected ??? some stepper drives will blow up without a load.

physically remove inputs from arduino.. your grounds to the power supplies and arduino should all be common.

test the outputs. no inputs, should be nothing.

power one input pin high, test the effect. one pin should go high, the other side of the coil should be low. bring that low, make sure the chip goes back to low on all outputs.

connect one other input pin, see if there is a change by connecting it. then bring it high, only that channel should be high.

my guess is that you have the one lead of the coils on the wrong pins.

Hi,

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

Tom..... :)

Robin2:
A specialized stepper motor driver such as a Pololu A4988 would be easy to use. But I did mention that in your previous Thread.

…R

Thanks Robin, I just figured that with the bountiful amount of resources available for the SN754410 that it would also be easy to use. Arduino’s sample circuit and program for bipolar stepper motors for example uses it. I ordered 10 of these, so I really want to be able to use them in projects.

dave-in-nj:
as a test, disconnect the motor… I think the chip can operate without anything connected ???
some stepper drives will blow up without a load.

physically remove inputs from arduino…
your grounds to the power supplies and arduino should all be common.

test the outputs. no inputs, should be nothing.

:o I removed all of the UNO outputs and the motor inputs are all still at 12V! What is going on here?

TomGeorge:
Hi,

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

Tom… :slight_smile:

I can do that. I’ll attach it to this post!

circuitschem.PNG

dave-in-nj: but how can you learn about H-bridges is you don't use them ?

I am quite happy in my ignorance :)

...R

Hi,

You have got the arduino gnd connected to the gnd of the 5V and 12V supplies?

Tom... :)

Hey Tom, yeah I have them tied together. Also, the "5V power supply" is the Arduino 5V output pin.

as you know an H-bridge is a very useful circut and pretty much requied for controlling a DC motor to spin forward and reverse.

instead of trying to run it as a stepper driver, test the chip as a dc motor driver.

bring all en pins high, give the chip 5v logic power and voltage for a single DC motor. gwet the motor to spin.

It may be that you have one bad chip?

Thanks Dave for the suggestion. I don't think the DC motor is going to run since both sides of the same coil are going to be high given that these motor inputs are always high regardless of the UNO outputs. Obviously 1 end of the motor needs to be high and the other low for it to turn. If both are high there is no voltage difference.

The funny thing is that I have a bunch of these chips! I prematurely ordered 10 of them. I already tried swapping 3 of them in and out, and they seem to be useless.

If I can't get these rascals to work, then I might just have to take Robin's suggestion of getting the Pololu A4988 or I might just order some of the TB6612FNG since that works.

very odd. all grounds tied together ?

bring one A pin high, one low....

bring enable pins low should bring the output low.

put in a simple dc motor, may it needs to be connected.

cosined: If I can't get these rascals to work, then I might just have to take Robin's suggestion of getting the Pololu A4988 or I might just order some of the TB6612FNG since that works.

lot of five is low on e-bay.

dave-in-nj:
very odd.
all grounds tied together ?

bring one A pin high, one low…

bring enable pins low should bring the output low.

put in a simple dc motor, may it needs to be connected.

Dave, I connected the ground of the 12V power supply and the Arduino together and then connected the 4 chip grounds to them too. I just tried the DC motor on one side of the chip and it did exactly the same thing (not work.) Both sides were getting 5V (this time I used 5V instead of 12V since the motor was different) so the motor did not spin. However, when I put the oscilloscope wire to either one of the input pins (A), the voltage at that pin dropped to close to zero and the motor started spinning. I think it’s because I might be shorting something.

Anyways, removing the high value from the enable pins (EN) still has the output pins (Y) high all the time! These 3 chips are surely trashed. They don’t follow the truth table at all. I think I am going to give up on these chips. I’ll test the remaining 7 and if none of them work, I’ll just order some different ones. If some do work, I’ll update you guys on it.

Thanks Tom, Dave, and Robin again for your help. I sincerely appreciate it. :slight_smile: