5534 as comparitor with dead zone

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.

indianajo

Can I use NE5534 op amps as open loop comparitors? No feedback. Two of them, with a dead zone for equality? I have two low frequency voltages between 4 & 10 v, A & B. When A>B, I want the DC gearmotor to increase B by turning a pot. When B>A I want the motor to decrease B by running backwards. When A=B, I want the motor to do nothing. So I thought I could use the input offset pins to make one 5534 switch a little above the the input of the other 5534. So when the A & B voltages are approximately equal, both op amps are at negative state or "off". Op amp 1 high is forwards. Op amp 2 high is reverse. Both low is stop. The TI datasheet paragraph 9.1 says how to bias the input, but not how much voltage offset you can get. I want about 0.2 v. Is this doable?
I don't have any 741 not soldered on junk boards & leads cut short. I have LM339 comparitors but I can't figure any way to make a dead zone when A is close to B for the motor to coast to a stop.
Voltage A is the sum of 8 CCS (constant current source), from a foot pedal controller with positions 1 to 8. "Swell roller". 1 is one 13.6 v input on 7 off, 3 is 3 inputs on 5 off, , 6 is 6 inputs on, 8 is 8 inputs on none off. I run the 8 inputs into 8 ccs. Summing the 8 CCS with a resistor gets voltages from 4 to 10, or voltage A. 1 input is 4.6 v, 2 is 5.2 v, 3 is 5.8 v, etc. The power supply is 14 vdc, 50 amps available.
Voltage B is a 1 k pot connected by chain & sprocket to the gearmotor output shaft. I can arrange for the track end voltages to be 4 to 10. So neither op amp sees any voltage on input within 4 v of the 14 v power supply. No minus supply required.
The pot is reliable without dropouts, the organ company sold hundreds of these appliances. Unfortunately the control board that decided what to do next had a hole burned in the middle of it by a burning power wire. The new board came with 25 counterfeit transistors, and when I replaced all those, it still doesn't work. It tries to go forwards, & backwards, fast and slow, all at once. I can't figure it out, the engineer that designed it in 1982 is retired or dead, and the lady on the phone knows how to build them but not how it works. New swell engines are \$1000 which the church doesn't have. The motor gearbox relays & chassis are fine. Part of the dingbat original design involved making -14 v with an oscillator, then running 4 741's with +10 -7 on power pins ????
The inputs to the relay motor controls are "run" and "reverse", 14 v 200 ma signals. I'm using CMOS 4093 nand gates to turn the two 5534 outputs "forwards" and "reverse" into logic "run" and "reverse" levels. Then I'm using nfets driven by 2 nand gates to power the relays, run & reverse.
This all fits on one 6" x 8" board instead of 3 boards the way it was originally.

Last edited:

Osvaldo de Banfield

Yes, you are searching for "window comparator", but it is better to use a comparator, single, dual or quad, like LM393 or LM339, or still better IMHO, their CMOS counterparts several times faster and light power.

The outputs must be used separately, ORed or ANDed as your design needs.

indianajo

Thanks. I looked up "window comparitor" on wikipedia, didn't help me much. I have the CMOS nand gates figures out. I'm looking for A-B>.15v as "forwards" in cmos logic, and A-B<-.15v as "reverse". Both comparitor outputs low is "not run". (Actually I reversed comparitor inputs because I have nand gates instead of and gates, cuts logic down to 1 IC package. )
I can't figure out how to wire the .15 v offset in there with LM393 (which I have). Offset might be .2 v or .3 v if the motor coasts down very slowly. Wondering if NE5534 will offset 200 mv, and if it latches up or oscillates or something no feedback resistor, which I've read someplace about some op amp.
More speed is not necessary: the motor takes about a half second to move the shutters after the organist moves the volume pedal.
I realize I could use 16 comparators (4 IC) to determine B>6.4+.15 (four inputs on is 4+2.4 v) for 8 voltages forwards and 8 different voltages reverse, then use 8 input nor gates for run decision: but I'd have to use 16 pots to make the voltages, and pots are not very reliable long term, the wipers oxidize. Figuring out 16 resistor combinations to make the pot voltages would be a nuisance. With the two 5534 design, I tweak the offset with two pots, then replace those with fixed resistors, a couple hours. If two 5534 would work at all.

Last edited:

Osvaldo de Banfield

A window comparator will do the job. It has 3 inputs: a reference, and two variables. if one of them is above the reference, the output will give an output according the the relation between them and the wiring of the amp inputs (Inverting and non inv.). The other will do it in the opposite direction, say, when the variable is below the reference. So you will have a direction to the motor. When bot are in the same level as the reference, you will detect it by some means to stop the motor driver. It does not do it by itself. Hysteresis can be added to help fast and well defined transitions between states.

egellings

You could use the 5534, but it's overkill, and for a window comparator, you'd need 2 pieces. It could oscillate during the transitions, although adding hysteresis would minimize that. I agree with Osvoldo--use IC's specifically designed for that kind of service. 5534s cannot be wire or'ed since they have active pull up & pull down. LM339 et. al. are open collector (needing a pullup resistor) and can be or'ed.

Gnobuddy

Can I use NE5534 op amps as open loop comparitors? No feedback.
The 5534 is a particularly bad choice for use as a comparator - it cannot tolerate a differential input voltage more than 0.6 volts (see attached portion of 5534 datasheet.) Comparators need to tolerate several volts of differential input voltage.

Some op-amps can be used as comparators, but they are not very good at it, and using one open-loop is a very bad idea. The enormous voltage gain (usually between 100000 and 1000000) means the slightest noise on the input will trigger the output to flip back and forth, rail to rail, as the voltage at the (+) and (-) inputs become nearly equal. Instead of one clean logic level change, you'll get a long stream of pulses as the inputs cross each other's voltage. Not at all what you want!

Much better to use an actual comparator, as the others said.

-Gnobuddy

Attachments

• 5534_Datasheet_Excerpt_001.gif
65.3 KB · Views: 195

LM324 works great

benb

I agree with Gnobuddy, it's got (anti-parallel) back-to-back diodes across the inputs, making it Even Worse than other op-amps used as a comparator.
LM324 works great

As a comparator? I hope so, it doesn't work very well at its intended use as an op amp.

Gnobuddy

(LM324)...it doesn't work very well at its intended use as an op amp.
First released 1972. It was the bee's knees back then, and people even talked themselves into believing that a 0.5 V/uS slew rate was sufficient for full-bandwidth audio. But, like bell-bottoms, platform shoes, and Prince Charles, it has not aged gracefully.

-Gnobuddy

wg_ski

The 324 (358) input stage is exactly what you want for comparators. It common modes down to the negative rail (ground for single supply) and tolerates high differential input voltages without a large change in input current. The other useful feature is that it’s output will go to zero (or negative rail) in the low state. Most other op amps will sit a couple of vbe above ground, sometimes requiring workarounds, depending on what it is driving. The 339 input stage is similar, and is more of a traditional comparator - with no compensation cap to slow it down, and uncommitted outputs. The 324’s slew rate is very slow, but for many applications it works fine and doesn’t need a ton of hysteresis to keep stable because of the low speed. For high(er) speed application you need the 211/311.

sgrossklass

OP may also want to look for a "Schmitt trigger", which is the kind of comparator circuit with hysteresis that seems to be required.

indianajo

I already have an or function with schmitt trigger, the CD4093 CMOS schmitt trigger 2 input nand gate. Said so in first post.
Thanks gnobuddy for info on protection diodes on 5534. Oscillation in maybe state wouldn't affect a 5 lb DC motor but could be bad for serial input decode solenoid driver boards (pipe valves) 10 feet away.
Trying to finish this week out of stock items, while the weather is bad. Ordering some new IC would get here Monday if I don't spend \$30 in freight. I have no debit card money till Thursday either, bought a \$5000 crane last month.
Going to use 5534 as adder, adding .15 v to the 0.6 to 4.8 v input signal, or another 5534 as subtractor, subtracting .15 v from that signal.
Then run those two signals into two 393 comparator sections, to compare to the position voltage from the pot attached to the gearmotor. One high, forwards, other high, backwards. Neither high, do nothing, stop. Will use CD4093 nand gates to turn those logic voltages into run and reverse as required by the relays. CD4093 drives nfet to drive the relays. Hope being 1" from a DC gear motor with commutator doesn't drive the comparator or CMOS logic crazy.

Last edited:

Osvaldo de Banfield

It isnt the same. Smitt trigger in the input will give you fast transitions and the stop motor level you need. If you add it later in the circuit, the overall behavior isn't the same. Is in any case good to put an EL34 before an ECC83?

wrenchone

Opamps as comparators are a bad deal, since in operation you are forcing them to saturate. Best to use a real comparator, which is designed to saturate, and in many cases, has an output that can be easily interfaced to standard logic. The LM393/339 series is a good cheap choice - not too fast, but the inputs have a common mode range that includes ground - not sure that that's an absolute necessity for a window comparator application. The LM311 is better and faster, and the LM319 is faster yet. ADI, Maxim, TI and the like have have specialty devices with better specs if needed.

Gnobuddy

...two low frequency voltages between 4 & 10 v, A & B. When A>B, I want the DC gearmotor to increase B by turning a pot. When B>A I want the motor to decrease B by running backwards. When A=B, I want the motor to do nothing.
Maybe I'm misunderstanding, but it sounds to me as though a straightforward analogue servo would do what you want? Differential input (the usual three-opamp instrumentation amp configuration), one input to A, one input to B, loop-shaping for stability (PID or PI controller), an H-bridge to drive the motor, in such a way as to always try to make A = B. Wouldn't that do what you want?

How big is the motor (in terms of current and voltage requirements), and how is it currently driven? Is it driven and reversed by an H-bridge, or by relays?

-Gnobuddy

indianajo

last time I worked on servo motors, the repaired driver assemblies were \$1800 from the shop, and the motors were \$1200. Woodman packaging machines. ??
A whole new shutter driver from Peerless organ is \$1000. Which the church doesn't have. the minister just quit because the church was drawing down their endowment to pay them. Reason I'm designing this, it is the same problem as an 8 speed bicycle gear shift, which I also need. Arthritis in my thumb from thumb shifter or twist shifter is killing me. \$3000 shimano or SRAM electric shift is only for 11 speed drop handlebar bikes with hydraulic brakes.
The organ shutter driver is about a 1/6 hp gear motor, 14 v 4 amps, driven by two relays off the existing burnt control board. Coil of relays are "run" and "reverse". Reverse no current means motor runs forwards. Pulls or releases a cable attached to shutters, 4 lb weight on pulley is on other end. 3" stroke determined by length of crank on motor shaft.
A usual DC motor actuator are driven by relays, 2 wire forwards relay, and a reverse relay. Could buy one but 2" stroke is \$160. Don't trust any potentiometer I could buy these days to encode motor shaft position. Oxide on wiper could make another potentiometer drop out in 3 years. This used potentiometer from 1982 is doing that function fine, but I will capacitor smooth the output before going to 5534 input. The factory that made this potentiometer (and the other 18 in the device) is probably a vacant shopping mall now.
Oscar, no EL34 or ECC33 involved. All 14 v power supply, 50 amp available. With 5534 used as unity gain adders doing less than greater than DC math, should be no oscillation I hope. Even if they do oscillate for <0.2 second, the motor doesn't care. The control drive from the syndyne serial-parallel boards is 1 to 8 of 8 wires (6 hot for level 6) , open collector outputs, up to 500 ma on, no current off. Am conditioning the control inputs with a 3300 ohm resistor and LED to ground to prevent RF noise pickup on the 10' unpaired wires from the control board.

Last edited:

Gnobuddy

I think you can build a crude "servo" around your existing swell motor and forward/reverse relays.

The attached image shows my idea (LTSpice simulation). The three op-amps together form a classic instrumentation amplifier, with high-impedance differential inputs. For simulation purposes, I've set one input (V_A) to 7 volts (halfway between 0 and 14 V), while the other input (V_B) ramps from 6 volts to 8 volts and back (green line.)

As you can see from the image, if the green line (V_B) drops a little below V_A, then the forward relay is turned on (blue line - forward relay current - leaps up from zero to max.) The reverse relay stays off (red line - reverse relay current - is zero.)

If the green line rises a little above V_A, the situation flips to the opposite state. The forward relay is turned off (blue line drops to zero relay current), while the reverse relay is turned on (red line jumps to full relay current.)

The "dead zone" (how far V_A has to depart from V_B before the output switches) is set by the value of R1 (smaller R1 equals smaller dead-zone), so it should be possible to tweak it to the amount you want. If R1 is too small, the relays might chatter, rapidly switching the motor backwards and forwards, which would be hard on the motor and relays. So best to start with R1 too big, and gradually adjust downwards in value.

The two 10-volt zeners are there to make sure that only one relay drive transistor is turned on at a time - op-amp U3's output has to be about 10.6 volts away from either ground or Vcc before one of the transistors will switch on. If U3's output is somewhere in between those levels, both relays stay off (creating that dead-zone you wanted, in conjunction with the gain of the 3-op-amp circuit, set by R1.)

The relay drive transistors have to have enough current gain to close their relays when driven by the few milliamps of current from U3's output. They may need to be Darlington pairs, in which case, the 10V zeners should probably be replaced with 9V zeners to allow for the extra 0.6 volts Vbe drop.

I must make a disclaimer: I have NOT built this, and it's completely untried, other than the LTSpice simulation shows that the concept works on paper.

I have no idea if you'll find this useful, but I gave it a shot.

-Gnobuddy

Attachments

• idea001_screenshot.gif
48 KB · Views: 113

indianajo

Thanks gnobuddy. I tend to think of "servo" as a 3 phase DC motor where the phases are controlled by an external controller, originally another DC 3 phase motor. The servo controllers in the Woodman packaging machines turned a Z80 produced DC voltage between 0-10 v into a circular position, 0-360 degrees, produced by half horse servo motors. People on diyaudio think of a "servo" as a feedback circuit that puts the center rail of an amplifier at the center of two power rails. None of the amps I've built or repaired has one.
I have TL082 IC in DIP8 package, so this may be buildable. Simpler than what I dreamed up which has 4 IC's, barely within the room on board I have. Run relay is driven by a TO3 darlington already, I'd have to modify the 14 ga wire harness with crimped pin headers to get rid of that.
Been studying "wikitechy" as to what makes an op amp a schmitt trigger. Positive feedback apparently.

Last edited:

Gnobuddy

I think of a servo in more general terms - an automatic device that uses error-sensing negative feedback to force a target output to match the value of a supplied input. A control system.

A very early one was James Watt's centrifugal governor, which sensed throttle position (input), steam engine rpm (output), and adjusted the amount of steam to make the two agree. Another one which we're all familiar with keeps our 'fridge at the selected temperature (input = temperature set dial, output = actual 'fridge temperature). And then there's the one you're planning to build - it has to match the position of the swell motor potentiometer (output) to the output of your current sources (input).
People on diyaudio think of a "servo" as a feedback circuit that puts the center rail of an amplifier at the center of two power rails.
It isn't hard to get the output of a discrete SS power amp within a few tens of millivolts of zero volts, and a couple of milliamps of DC through a speaker makes no difference whatsoever, so I can't think of any good reason to need an actual servo to zero the amplifier offset voltage.

I did need to build an offset servo like that once, though, for a lab experiment using a photodiode. I needed to measure slow ( about 1 Hz) changes in the photocurrent, and I had no control over ambient light level, which means the quiescent DC current through the photodiode wasn't under my control. The solution I came up with was a very slow servo, which supplied a compensating current to zero-out any offset from the photodiode amplifier. Flick on the light-switch in the room, and the servo would go into action, zeroing out the offset over a period of a minute or so.
Run relay is driven by a TO3 darlington already, I'd have to modify the 14 ga wire harness with crimped pin headers to get rid of that.
If there are already external NPN relay drive transistors, you can probably use a small-signal PNP (instead of a power one) in my circuit, to drive one of them.
Been studying "wikitechy" as to what makes an op amp a schmitt trigger. Positive feedback apparently.
Exactly, a bit of positive feedback to enforce fast switching between states, and add a bit of hysteresis (threshold for switching "on" is not exactly the same as the threshold for switching "off", to avoid chatter/ hunting problems.

The circuit I came up with in my last post has some hysteresis, but doesn't use any positive feedback. Instead, the hysteresis is created by the two zener diodes in series. Because neither zener will turn on with less than 10 volts across it, the pair of them have a "dead band" between roughly 3V and 11V. If the output of U3 is in that roughly 8-volt region, neither zener conducts, and both relays stay off.

U1 / U2 have some voltage gain, so the hysteresis between V_A and V_B is less than the 8 volt dead-band created by the zeners.

I have never seen this idea used before, so if it works for you as LTSpice predicts, I'll be quite pleased.

-Gnobuddy

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.