Pages: [1]   Go Down
Author Topic: Stepper Datasheet defies Ohms Law???  (Read 926 times)
0 Members and 1 Guest are viewing this topic.
Heisenberg won't tell me.
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arrrrrgghh!!!! Duino.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello!

I've got my Arduino driving an L298 H-bridge, using the "stepper.h" library. I've now aquired a PM35S-048 bi-polar stepper (pinched out of a Dell Scanner/Printer). But I'm having trouble understanding the datasheet:
http://www.nmbtc.com/pdf/motors/PM35S048.pdf

It says it's 24V, 600mA per coil, and 6.6 ohm (multimeter measures as 17ohm per coil, but I assume this is a resistance/inductance issue due to it dropping during rotation). If it's 6.6ohm and I put 24V across it, surely I'd get 3.6A due to ohms law? Too much for my L298 and more than the 600mA the stepper datasheet says. I can run it down at 7V say (near the lower end of what my 5V regulator will take), but then I'd still be getting just over an amp, still more than the 600mA per coil from the datasheet.  smiley-eek

What gives? Am I supposed to use PWM into the L298 logic 1-4 inputs, and hence pulse the output? Would that even work? Or am I supposed to use PWM into the enable pins of the L298, which would make more sense, but still seems odd? If so do you set PWM and a rate on all the stepper pins, then just use the stepper library as per normal after?

Help! Confused!  smiley-confuse
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Have a look at this wiring diagram for NMB motors:

http://www.nmbtc.com/pm-step-motors/engineering/pdf/Drive-Circuitry-and-Wiring.pdf

There are several ways of measuring the coils: outer-to-outer, outer-to-center, etc. It's possible you were measuring outer to outer so that 2x6.6=13.2 is within an earshot of 17 ohms (and also it depends how accurate/expensive your DMM is when measuring that low). I don't think the resistance and inductance change appreciably while it's running.

You would NOT put a straight 24V across a 6.6 ohm winding as you would indeed get 3.6A, hence Minebea saying it is a "bipolar chopper" drive. A chopper drive applies a higher-than-rated voltage but turns it on and off at a certain duty cycle to get a lower average voltage. This is the idea behind pulse-width modulation (PWM) as implemented with the analogWrite() function.

So it's OK to apply 24V as long as you use analogWrite() to set a duty cycle of no more than 16%: this is 1/6 of 24V, or 4V, and 4V across 6.6ohms is about 600mA.

Of course you could apply 12V and a duty cycle of 32%, etc.

So to answer your question, yes, you are supposed to use PWM into the enable pin of the L298. Then you can just use the stepper library as normal to control the direction pins.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons
Logged

United States (Texas)
Offline Offline
God Member
*****
Karma: 3
Posts: 525
Arduino socks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

those are probably maximums individually. you can have 24 volts max voltage and 600 milliamps max current. however to get 600 milliamps the voltage may be smaller.   most stepper drives use a high voltage to overcome the inductance of the coil initially, then ramp down the voltage to limit the current. so i guess what im saying is that you can have a 24 volt pulse not reach 600 milliamps initially, but you need to make sure that at all times both those limits are not exceeded.
Logged

Heisenberg won't tell me.
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arrrrrgghh!!!! Duino.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the advice and clarification! I'd gone ahead and attempted this idea whilst I was waiting for an answer and changed the C code so I used PWM outputs to the enable pins.  Still slightly concerned though. I tried 12V (since my 5V regulator doesn't like going up to 24V). I set analogWrite(5, 38) = 15% duty cycle, which should therefore give me approx. 2V into 6.6ohms = 300mA, rather than going for 76 (of 255) for the 30% duty cycle.

Sod all happened!  smiley-cry Tried reversing a pair of pins and still nothing (it wasn't twitching even). I could still easily rotate it with my fingers. I just expected at least some movement or added stiffness to rotate it at half max rating?

I considered going up to the full 30%/600mA but then I noticed the ATmega328 seems to be getting very warm. I disconnected it as soon as I noticed, which was pretty quick. Definitely no shorts I can find, but I have another Arduino here and that runs cool running the same code but nothing connected. Disconnected the "hot" Arduino from all the drive circuits and it still gets hot. Any guesses? I don't want to connect this other one if I've fried the hot one. I've already blown up one Arduino board already this week (an accident involving 12V the wrong side of the 5V regulator; so I've been stupidly careful all of today  smiley-red). Stepper's fine as I connected it to a PSU with current limiting on, and it happily did individual steps as I touched the wires. Circuit seemed fine as I checked it all with a multimeter.

The only other thing I can think of is my diodes from the H-bridge aren't fast types, just unknown regular silicon ones, and the current rating is only 1A, not the 2A suggested. I figure if I only want 600mA from the L298, rather than it's stated max of 2A they should be ok though? Does the diode switching speed make any difference? I've ordered some 2A Schottky ones which are also higher voltage, but they're not here yet.

Thanks for the link to the wiring diagram too. Hadn't found that on the NMB website! smiley
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Disconnected the "hot" Arduino from all the drive circuits and it still gets hot. Any guesses?

Yes, it's fried smiley-sad  Somehow 12V managed to find its way to the microcontroller -- that's my theory. It's time to tear this down and try something simpler, perhaps with a different L298 as well (if that's damaged it can pass 12V through to its 5V input pins).

The diodes are not a likely culprit here, not at 600mA (or less) levels.

If it were me I'd start over with a 5.5V motor supply, fresh microcontroller and L298, and "dummy" 1k resistor load instead of motors. Then see if there's any 5.5V showing up at microcontroller pins. That's high enough to indicate a fault in wiring (or something) but not high enough to damage the microcontroller. Then go from there....

--
The Quick Shield: breakout all 28 pins to quick-connect terminals
Logged

United States (Texas)
Offline Offline
God Member
*****
Karma: 3
Posts: 525
Arduino socks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

indeed, i've had a hot atmega several times. just a bit hotter... and with more fire... stupid ground faults on cable lines. anyway, its pretty likely it needs to be replaced. if you can post a schematic of how you wired it (or just draw it on paper and take a pic) it would help us alot. be sure to draw it like you have it connected, not how you would like it connected.
Logged

Heisenberg won't tell me.
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arrrrrgghh!!!! Duino.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'll try and sort a diagram soon but I'd have to draw it out on the computer or find my camera. But basically it's
Arduino                          Circuit
5 (PWM)                        L298N Enable A
6 (PWM)                        L298N Enable B
8                                  L298N Input 1
9                                  L298N Input 2
10                                 L298N Input 3
11                                 L298N Input 4
12 (Digi Input)              Momentary push switch
13                                 MAX485 Tx enable (not present when it went hot)

All other connections/caps/etc are exactly as the L298 datasheet diagram except using the ATmega instead of the L297 and the emitter outputs connected directly to ground rather than having 0.5Ω current sense resistors.

I put 1kΩ resistors and LEDs on the L298 outputs at lunchtime, and went around all the pins with a multimeter on 40mA current setting between 0v and each pin, and 5V and each pin  (with the atmega removed). The most I could get on any pin was 100µA, which was one with a pull-up/down resistor. All the other pins would happily switch on/off the output LEDs and only sink/source 10µA.

As a precaution I've now put 1kΩ resistors in the send lines to the L298N so even if it tries to send 12V back into the ATmega it'll be low enough current it shouldn't pop it. I'm still loathe to connect up my last working ATmega until the new ones arrive though (hopefully tomorrow).  I retried the "hot" ATmega with the LEDs on the output of the L298 and the enable lines connected to 5V. They worked fine. I tried connecting the PWM outputs 5&6 to the enable lines and 2 LEDs cycled at a lower brightness (yay!), and 2 didn't work (boo!). The ones that didn't work were from output 5. I tried using output 3 instead of 5 but still no joy. I don't know the internal structure of the ATmega so they may have something in common that's blown. I dunno.

Could it be ESD related? Or the ATmega has to be powered before or after the other board in case 5v floating lines upset the ATmega if it's not powered or something? I don't know how fragile these things are!
Logged

Pages: [1]   Go Up
Jump to: