Bipolar Stepper powering problem

Hi all,

I have a problem that i can't figure out. My knowlegde of electronics is minimal and with some internet searching i couldn't figure it out.

The situation: I have a stepper motor hooked up to a h-bridge and then to the arduino all powerd by an ATX.

The problem: When i power the stepper with 12V from the ATX, the motor starts to twitch. But when i power it with the USB from my computer it runs smoothly.

What did i do: powered the Vcc2 with +12V 8A and then with +5V 25A from the ATX, this made a twitch.

disconnected the ATX used a +9V 1,5A adapter on the arduino an connecting the Vcc2 to the +5V on the arduino, this did nothing.

Used USB powering, worked perfect.

Hardware: Arduino UNO ST - 235ATX SN754410 QUADRUPLE HALF-H DRIVER and this stepper http://www.eztronics.nl/webshop/catalog/product_info.php/cPath/41/products_id/368

If some one could help me out i would appreciate it. And if i didn't include enough info please tell.

Thanks,

Roald

p.s. moved the topic from troubleshooting to here

Thanks for the reply,

I used the +12V first, powering the arduino and both steppers (the other is connected but i only use one at this moment). In my program i only used one stepper to test, so haven’t used the other stepper because this problem stopped me.

Because the USB power (which is +5V) made the stepper turn smoothly so i tried +5v from the ATX, it turned 180 and then twichted.

The circuit that worked looked like this.

Working on the regulated 5V

Working straight of the USB power

The voltage rating of the stepper is 6 - 12V

The code i used is:

#include <Stepper.h>
#define STEPS 400
Stepper stepper(STEPS, 8, 9, 10, 11);

void setup() {
  stepper.setSpeed(15);
  pinMode(13, OUTPUT);
}

void loop() {
  stepper.step(10);
}

I always like to have a separate power supply from my Arduino board and my power supply to the motors. From looking at the diagram you given, the Arduino draws some current from your motor power source which that could affect it. I'm just telling you this because what has worked for me in the past is a separate power source for the board and for the motors.

Well i tried a different wire from the ATX with 12V but it gave the same response.

But if the arduino draws 500mA and the stepper per coil 2.4A it would result in a 5,3A.. even with the 5V 22A i should have enough.

Could it be the electro magenets that build up to much ..... dont know what its called (wanted to say pressure). And i think i'm missing something within my circuit.

UPDATE: If i power both steppers through USB only 1 turns and the other move a bit and then stopped, after a retry also no reaction, maybe some left over power or something.

and some pictures of the setup...

http://www.roaldjoosen.nl/gfx/email/01.jpg http://www.roaldjoosen.nl/gfx/email/02.jpg http://www.roaldjoosen.nl/gfx/email/03.jpg

One of the reasons for "twitching" stepper motors is that your ground for the Arduino and ground from the ATX need to be tied together.

From your diagram, I am unsure whether or not this is the case. I always directly connect mine.

Ground is never exactly 0V. There's always some noise. There's also a situation where you end up with a "floating" ground... one that is not at the same voltage as a ground from another source. To eliminate these issues, all ground pins from all devices can be connected.

I measured from the h-bridge ground to the ATX ground and they are connected, it all goes via the arduino. ATX goes to VIN and GND and then GND goes to H-bridge togheter with 5V.

maybe some left over power or something.

No

Could it be the electro magenets that build up to much

No

What you have here is something that is counter intuitive, it works with the low current from the USB port (only 500mA maximum) but not from a stonking big supply. When this sort of thing happens nine time out of ten you find it is not actually working properly after all. What you need is more measurement, when it runs what voltage reading do you get from your supply, does it drop? Is the bridge switching correctly, how much current is each winding drawing (measure not calculate) It could be that the motor windings have been misidentified.

Ok, i will check these things and post the results, but this will be tommorrow evening,

What would be the best way to test such thing without having to much risk, already broke one arduino while testing.

And thanks for the reply

Hello there,

Thought i wouldn't have time in the morning, but guess i did.

I used a multimeter for the measurements, but i'm not very familiar with the results it gives. So these are the results.

Volt measured (dcV 20) : Blue - 0.8 (steady and sometimes varies between 0.2) Red - 0.9 some spikes to 3.6 Yellow - 0.8 Black - 0.8 / 1.4

Amps measured (dcA 20) : Blue - 0.24 Red - 0.18-33 (its less steady than the blue one)

Supplied voltage : +10.90V (ATX +12V 8A)

Arduino : (Different power supply, problem remains, grounds connected) +12V 1.5A (outputs 12.43V)

Thanks but that is not what I meant. You need to check the voltages to see if your coils are being switched on and off correctly. You can only do this with a voltmeter when the motor is not moving but the coils are energised. So you need to write a sketch that energises the coils, you take the measurments, then it energises the coils for the next step, you take the measurements and so on for all the steps of one cycle of the motor. Then you can tell if the coils are being turned on and off correctly and you haven't got a problem with the drivers.

By the way the current measurements of 0.25 A don't seem to square up with the 2.5 A that you put on your drawings are you sure both are correct?

okay,

The measurement where made the same way as the voltage measurement so that could be the problem. As i found it quite odd myself. I will do the measurements again, but they will be posted later this day (±18:00), i will try to make a video or photos of the testing, easier to see if i did something wrong.

Okay, i've tested the Amps and Volt drops.

For the test i used this piece of code

void setup() {
  pinMode(8,OUTPUT);
  pinMode(9,OUTPUT);
  pinMode(10,OUTPUT);
  pinMode(11,OUTPUT);
  pinMode(13,OUTPUT);
}
void loop() {
    digitalWrite(13,HIGH);
    delay(50);
    digitalWrite(13,LOW);
    delay(50);
    digitalWrite(8,HIGH);
    digitalWrite(9,LOW);
    digitalWrite(10,LOW);
    digitalWrite(11,LOW);
    delay(5000);
    digitalWrite(8,LOW);
    digitalWrite(9,HIGH);
    digitalWrite(10,LOW);
    digitalWrite(11,LOW);
    delay(5000);
    digitalWrite(8,LOW);
    digitalWrite(9,LOW);
    digitalWrite(10,HIGH);
    digitalWrite(11,LOW);
    delay(5000);
    digitalWrite(8,LOW);
    digitalWrite(9,LOW);
    digitalWrite(10,LOW);
    digitalWrite(11,HIGH);
    delay(5000);
}

The results are : The stepper draws 0.44 amps but decreases every time and i stopped at 0.33A

To measure the voltage i plugged the multimeter on the same wire as the stepper power. The results were 10,22 - 10,20V - 10,19V - 10,14

I'm uploading the test videos so i will post them later

Video: http://dl.dropbox.com/u/671839/arduino_stepper_amp.3gp 30MB http://dl.dropbox.com/u/671839/arduino_stepper_volt.3gp 17MB

UPDATE :

I found the datasheet... www.phidgets.com/documentation/Phidgets/3302Datasheet.pdf

I tried something different.

I also had a stepper from a previous project, this is a different stepper. The stepper is 12V, 0.33A with 200 steps. This one seemed to work.

This doesn't solve my problem because i need these steppers to work. For now i'm going to check some pin configurations.

Also found some more information, which proberly explains the 0.44A but not the twitching

42BYGHM810 Step angel :0.9 Motor Length L (mm): 34~48 Rate Voltage (V): 2.4~11.2 Rate Current (A): 0.4~2.4 Phase Resistance: 1~28 Phase Inductance (mH): 1.8~30 Holding Torque (g.cm): 1400~4800 Lead Wire (NO.): 4/6 Rotor Inertia:34~68 Detent Torque (g.cm): 180~260 Motor Weight (kg): 0.2~0.34

I got it working..... with the +5V 22A from the ATX, the arduino is powerd by an adapter +12V.

But the ATX seems to have problems with the power that is drawn. After a couple of rotations the fans starts to turn faster and then the motor is getting twitchy again.

So is there a way to control this? Or do i just need to get a stronger power supply(230watt seems to enough to me)

After a couple of rotations the fans starts to turn faster and then the motor is getting twitchy again.

If you have a 22A power supply struggling to supply current that you say is 0.4A then something is getting very hot and you are not noticing.
It took quite a long time to download the current reading video and it looks OK but I couldn’t see how your meter was wired up to show the current but that looks like it is fine.

As to the voltages:-

the results were 10,22 - 10,20V - 10,19V - 10,14

This suggests there is something wrong. However looking at the video I suspect that the reading was 10.22Volts. What you need to do is to measure the voltage across each coil at each stage in the process.

I assume that you were powering it from 12V when you took the readings. I would expect to see something like 11V or -11V across each coil in a sequence something like:-

coil 1 voltage, coil 2 voltage | 11, 11 | 11, -11 | -11, -11 | -11, 11

The fact you are not seeing a negative voltages would suggest that either your switching drivers are not working or you have misidentified the wires. Check with the meter that you have continuity between the pairs of wires you think are the coils.
On that video there is a chattering sound, was this running the code you posted earlier? If so then I would not expect to here the coils chattering during the delay. This implies that something is shutting down or oscillatin. I also can’t see any decoupling capacitors across the chip, that might explain the chattering.
The motor ratings of:-

Rate Voltage (V): 2.4~11.2
Rate Current (A): 0.4~2.4
Phase Resistance: 1~28

Looks odd, I am not sure what the ~ means. If it is “to” then I wouldn’t expect the bottom range of current at the top range of supply voltage.

It is also a bit much to expect solderless breadboard to cope with those sorts of currents, I suggest you wire it up properly and try and take the measurements across each coil.

If borrowed a Universal Netgerat EA-4000 (analog lab power supply) with this i could see how much amps it was pulling. And saw that with 12V it draws 2,4A but started to slow down, this is because the chip is only 1A, and yes it got hot. When i limited the power to 1A the motor runs smoothly and draws 4V, even though it set it to 12V.

The wires of the coils are correct. I've limited the current to 0.3A, just for safety. And it does return the -V and +V.

I've read somewere to enlarge the Amps of the h-bridge to piggyback them so the can cope with double the Amps. (feels like a patient playing internet doctor)

How is the decoupling resistor hooked up? Found your link : http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

I think i solved the problem, which was to asking to many amps from the h-bridge (1A with peak of 2A), it explains the amp drop (getting to hot, IC prob is screwed up, shorter life span). By using them parallel it adds up and it has 2A plus a peak.

Now it can run +5V and 2.4A, still getting a little hot, but that could also be my cold hands. With a heat sink that problem would be fixed.

If anyone with knowledge could approve this, it would be nice.

Thanks Grumpy_mike for the time and help.