NJM2670 Dual H-Bridge Chip
GMan
Posts: 19
Has anyone used the NJM2670 dual H-Bridge chip with a stamp 2 to run bipolar steppers?· I've ordered a number of these since they seemed to be exactly what I needed.· I was wondering if there's any hidden gotchas.· These would also see to be a pretty good solution for running two brushed motors.
Comments
In short I was less than impressed.· Nothing happened.· So I double checked the wiring.· There were no missed connections.· Then I hooked some LED's up to the BS2's output pins to make sure it was functioning as expected and sure enough, it was switching the pins as anticipated.· I then pulled the stepper motor and replaced it's windings in the circuit with bipolar (two color) LED's and current limiting resistors and fired the circuit up again... There wasn't a glimmer of life to be seen.· So I replaced the chip with another only to get the same result.·
What is this datasheet telling me that I'm not smart enough to catch?·
I've wired the H-Bridge chip's input pins (INA1, INA2, EnableA, INB1, INB2 & EnableB) directly to the stamp's pins as indicated in the schematic.· Is there some interface circuitry needed beyond that perhaps?
I've attached the schematic for your reference.· Any help would be greatly appreciated!
Inable A/B have to be at a high state at all times.
By using jumpers, you take the stamp out of the loop for trouble shooting.
You can put leds on control pins to check your program logic on the stamp.
Also the bipolar phasing has to be correct, or the stepper will just vibrate, or not do anything..
Bob
All Enables High?
Any readings on the OUTS without the motor pressent?
What is TSD(shut down pin maybe ?) set at?
The VCC & TSD pins are used for feedback of a thermal shutdown condition. TSD will go high (i.e. show VCC) in the event of a thermal shutdown (if I'm reading the atasheet correctly that is).
VSA & VSB are connected to a 12 V Supply, & the stamp is connected to a 9V supply & the grounds of both of these supplies are common.
I've not attempted jumpering the HBridge's inputs (yet, thanks for the idea)·but I'm not reading any voltage from the outputs, even with the stamp in a static output configuration.
The enables however should not be high in all cases.· If the winding is to be unpowered (i.e. 0 in the phasing), I've pulled the enable low, otherwise the H-Bridge would be in a shorted (braking) or active configuration on that winding (per the truth table) causing the stepper not to step.
EDIT:
Available current to VSA & B is·1.5 Amps (a fully charged 1500mAH 12v lead acid battery).
Post Edited (GMan) : 8/11/2006 4:59:30 AM GMT
Here's a question (sorry if it's a dumb one but I am still rather new to the stamp) When you set one of the stamp's pins to "low" is it actually set to ground potential (VSS) or does it just float?
I ask this because if I allowed an H-Bridge input to just float (i.e. just didn't hook it to anything). I didn't get any output from the H-Bridge. If I grounded the inputs that were supposed to be at logic 0 rather than leaving them float, the output appeared as anticipated.
Was I incorrect in thinking that setting a stamp pin to "low" actually presented VSS at the pin?
Are you just setting the pin low or using the LOW command? The latter will probably resolve your problem. If you use the former, it's your responsibility to make sure the pin is set to OUTPUT mode, otherwise the pin may indeed float.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Are you saying that is still doesn't work with the Stamp or is working now?
'VERY Simple bipolar Stepper/Dual H-Bridge Test
'
'H-Bridge Truth Table
'InA1/B1···· InA2/B2···· EnA/EnB···· OutA1/B1···· OutA2/B2
'· L··········· L········· H············ L··········· L
'· L··········· H········· H············ L··········· H
'· H··········· L········· H············ H··········· L
'· H··········· H··········H············ H··········· H
'
'H-Bridge to BS2 Pin Mappings
'INA1· INA2· EnA· INB1· INB2· EnB
' 3···· 4·····5··· 6···· 7···· 8
'
'Set our pins to outputs
OUTPUT 3·
OUTPUT 4
OUTPUT 5
OUTPUT 6
OUTPUT 7
OUTPUT 8
DO
· 'Step 1 Coil A +
· LOW 3
· HIGH 4
· LOW 6
· LOW 7
· 'Set Enables·
··HIGH 5
· LOW 8
· PAUSE 20
· Step 2 Coil B +
· LOW 3
··LOW 4
· LOW 6
··HIGH 7
· 'Set Enables·
··LOW 5
··HIGH 8
· PAUSE 20
·
· Step·3 Coil·A -
··HIGH 3
··LOW 4
· LOW 6
··LOW 7
· 'Set Enables·
··HIGH 5
··LOW 8
· PAUSE 20
··
· Step·4 Coil B -
· LOW 3
··LOW 4
··HIGH 6
··LOW 7
· 'Set Enables·
··LOW 5
··HIGH 8
· PAUSE 20
LOOP
So what am I doing wrong here folks?· This shouldn't be this hard!· At this point·I know the H-Brigde chip is properly wired into the circuit, because I can manually trigger the inputs.
You want to avoid "shoot through" so maybe you should turn all outputs off before the next string, but you can try it without the commands. I would test with Leds via 200-470 ohm to GND on all 6 outs to get a visual of the sequences before trying the motor driver. Let us know if LEDS work in the correct sequence so as to rule out your program.
Seq VAR OUTA 'pins 0, 1 , 2, 3
Ena VAR OUTB 'use pins 4, 5 for Ena
PauseTime VAR NIB
DIRS = %0000000000111111 ' sets pins 0-6 to outs
Main:
PauseTime = 20
Do
Ena = %1000
Seq = %0100 'recheck all these pins visually with leds
Pause = PauseTime
Seq = %0000
Ena = %0100
Seq = %0001
Pause = PauseTime
Seq = %0000
Ena = %1000
Seq = %1000
Pause = PauseTime
Seq = %0000
Ena = %0100
Seq = %0010
Pause = PauseTime
Seq = %0000
Loop
So, when seperated, each piece functions as one would expect.· That means this comes down to the connection itself between the H-Bridge & the stamp.· In some way, just wiring output to input doesn't do the trick.· Is there some rating in the H-Bridge Chip's characteristcs (attached) that the stamp doesn't meet?
I'm not doubting your wiring ability, or your ability to read a schematic. However, that being said there is a potential nasty GOTCHA in the Typical Appilcations wiring diagram in the data sheet. I only caught it because _I_ read it WRONG at first.
I can envision someone else also reading the schematic to show that ENB is connected to GROUND. You haven't done that have you?
Also, do you have SENSE A and SENSE B tied to the motor ground (Vmm) as indicated?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Here's another stab-in-the-dark. What DC voltages are you reading between these points:
Vcc --> Ground
Vmm --> Ground
Stamp Ground --> H-Bridge Ground
Since this has happened more than one recently with oddball LED's, your LED's are properly oriented (polarity) aren't they?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Post Edited (originator99) : 8/12/2006 5:51:19 PM GMT
"do you have any transistors around that you could buffer with?"
I have·a lot of the standard general transistors (i.e. 2222, 3906, 3904, 3907)· I also have mosfets (N&P CHannel IRF520 & 540's) and darlingtons & darlington arrays.
What I don't have lots of are·the 4000 or 7400 series chips.· My selection there is pretty limited.
So pick your poison...· What do you suggest?
**EDIT**
Actually after looking, I did find a few 4049's (Hex inverting buffers)· So I droped one of those on the breadboard to buffer the stamp's output along with a 7805 to provide plenty of 5V power from the motor supply for the buffer.· I then inverted the program's logic (i.e set all highs to lows and lows to highs).· Unfortunately that didn't wake this thing from it's slumber either.· I was able to trace the signal through the buffer and everything looked alright (I slowed the phasing way down), but there still wasn't any power coming off the H-Bridge to the coils.
Post Edited (GMan) : 8/12/2006 8:15:30 PM GMT
Start from scratch with one test at a time, Make INA1 High from the Stamp, and INA2 LOW from the stamp and leave it there while checking both the Stamps output (read the +lead off INA1 input and -lead off INA2). Then read the hbridge outs OUT1A and B. Try a combination of ENABLES from the Stamp and from hard wires to + and GND as needed. It looks like the Enables are just inputs to an internal AND gate, so they should be HIGH to operate. Make sure all senses are at GND.
I wonder if the Vcc should go to +5 as well, maybe there is something missing there besides just thermal. The reason I suggest it is there is some logic going on possibly in the buffering internally. Can't hurt.
***Data sheet shows minimum Vcc is 4.75, lets try that first if you have been letting it float**
Post Edited (originator99) : 8/12/2006 9:26:26 PM GMT
The Vcc connection does need to be hooked up. When I connected this to the +5v supply attached to the 4049 the stepper started stepping! So then I eliminated the 4049 and hooked the H-Bridge's VCC up to the stamp's Vdd, reconnected INA1, INA2, INB1, INB2, ENA & ENB back up to the stamp (I'm usin the OEM board BTW) and downloaded the non-inverted version of the code. Guess what happened... It steps! So in short the solution goes like this. The Vcc connection needs to be connected even if the datasheet says it doesn't.
With that small documentation problem eliminated... These appear to be some pretty good little H-Bridge chips, especially at the low low price of $4.80 each!
It's not connected on the schematic.
**Edit**
After running this thing for a while, the only heat I'm finding is coming off the voltage regulator on the BS2.··So perhaps it's best if the stamp's outputs are buffered.
Post Edited (GMan) : 8/13/2006 12:11:36 AM GMT
"I am not sure where you got off the data sheet that it didn't need to be conected"
It's not connected on the schematic.
Yes it is, it's on the one you uploaded (HBridge.jpg).· It doesn't show a "wire" coming off it, but it's labelled so (VCC).· It's not the most apparent style, but it's there.· Best of all: you found it and you did it without using a cry-baby emoticon (*****).
The heat on the 7805 is the result of: ( VIN - VREG_OUT· ) X ILOAD.· [noparse][[/noparse] P = E X I ]·
Post Edited (PJ Allen) : 8/13/2006 2:30:13 AM GMT
Thanks for the info.
note: some meters require you change the cables to a different hole to read amps.
note 2: it is generally understood that any Vss,Vdd,Vcc, Gnd etc are to go somewhere regardless of schematic implications, unless otherwise and specifically noted to the contrary.
As I said earlier the draftsman who drew that chip schematic should be SHOT! If you believe the drawing, Vcc is connected PHYSICALLY INSIDE THE CHIP, and not to anything EXTERNAL. The physical connection to what SHOULD be "outside", is INSIDE the outline of the chip. I can see exactly how GMan wa sucked in by that one.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
I only piked it up since there is logic going on inside the chip that requires a fixed Vcc, and doubting there is a regulator inside to set a voltage derived by the bridge transistor Voltage Source, there must be some other power requirement to operate the logic.
For many reasons I can't get excited about this NJM2670 chip at all. Here are just a few of the reasons.
For less than $3.00 US, in one-off quantities, you can purchase the L298 which is good to 4 amps, can have its outputs parallelled (per the documentation), has USABLE SENSE pins, the schematics and documentation are complete, and unambiguous, it comes with a built-in heat sink, it has a proven world-wide track record, it's available from multiple manufacturers, and it's readily available from most distributors.
What's the point of the NJM2670, after learning all that- frustration?
Attached, please find a data sheet for the L298.
Regards,
Bruce Bates