Help with opamps

Hi. I am trying to replicate a very old circuit that uses transistors to turn a 6v dc motor CW or CCW depending on what voltage is coming from 2 potential dividers.

If A > B go CW
If A < B go CCW
If A = B do nothing

The problem with the old circuit is the old transistors are no longer available and the equivalents have a different gain which are causing the motor to twitch a lot.

I was looking into using OPAMPS to compare the 2 input and switch on Darlington arrays that control the motor via 2 relays.

I haven't really used OPAMPS before and don't know which type would be best and how to wire them to function how I want them to.

Why not buy a mosfet H-bridge?
May be cheaper than power transistors plus opamps plus all the hassle to get it together....

About the simplest thing you can make with an op-amp is a comparator.

If the +input is greater than the -input, the output goes high (to the maximum). If the +input is less than the -input the output goes low (to the minimum).

You have one output (2 states) so you'll have to figure out how to control your relays.

You can add hysteresis (which is done with positive feedback) for better stability (no switching back-and-forth when the inputs are equal or about equal).

1 Like

@build_1971 How would a mosfet h-bridge work with 2 inputs that change.

Both inputs are sensors that change between 5 and 7 volts

That would be easy to implement with a microprocessor, but quite difficult with op amps, especially if A and B can take on any voltage between 5 and 7 V.

However, defining "=" is not trivial for any system where the voltages on A and B are variable.

Yeah... In the real analog world A will never exactly-equal B and there will be some noise/instability so hysteresis or a "dead zone" my be the answer.

...Similarly, with analog-to-digital conversion there is always the possibility of being on the hairy-edge between two digital values and the numbers can jump up & down by one count. And frequently there is noise, drift, or other instability, and the readings jump by more than one count.

Or three states (CW,OFF,CCW), with the hysteresis as an off-point between two comparators.

Funny; I was working on an old voltage stabilizer the other day that did this. There's a schematic of the control logic about halfway down this page: Solid as a rock – Fixing an old AC stabilizer – Koraks tinkers

It does pretty much exactly what you wrote; it compares a reading with a set value (pot meter), and then runs a motor in one direction if it's below the threshold or the other if it's above. There's a 'dead zone'/hysteresis in between where neither motor relay is switched. This hysteresis is settable with a second pot meter.

I traced the schematic mostly for amusements' sake and even ran some LTSpice sims on it. The defect I fixed was unrelated to the comparator setup, which still worked fine after 37 years in the field. It's all very simple electronics with discrete components etc.

Maybe you can take inspiration from it in some way.

1 Like

Heh. I was wondering about how an actual deadband might look.

Edit: What I like about this circuit is the configuration of the variable resistors with the "Voltage" VR providing the top comparator with a its threshold voltage, and the "Sensitivity" VR providing an offset from the other voltage to give the bottom comparator its threshold.

It might be easier to adjust your original circuit so it works with new transistors.
Do you have a schematic.

Yeah, that's the bit of interest. The input signal is half-wave rectified AC from a transformer.

It's a nifty circuit because it also prevents both relays from switching on at the same time, even if the hysteresis is set to virtually zero.

1 Like

Relay control board.PDF (20.7 KB)
Here is the circuit

If this were my project, I'd replace all the control circuitry with a single ATtiny, two small MOSFETs to drive the relays and a handful of resistors to lower the two control voltages (insofar as necessary) into the ADC. A small linear regulator can power the microcontroller.

Something with opamps and discrete components is of course also possible if you enjoy the engineering exercise. But if it's a "let's get this over with" kind of project, I'd lean towards the microcontroller solution.

Interesting.
Why a 12V feed into the rightmost potentiometer?
One extra resistor an 15V (rail supply) might be more handy....

There is no 12V feed in this drawing

To be clear, the partial schematic you refer to in @DaveX's post is from a voltage stabilizer unit built in the late 1980s. So we're talking about design decisions made by an anonymous engineer who, for all we know, may be retired or even deceased by now.

The sense of the 12V is that they used a 78L12 as a voltage reference. The 15V rail is made with a zener shunt regulator and will in practice drift, so was likely deemed insufficiently stable.

1 Like

If I can get this done with opamps then I'll go that way to learn how to use them.

It's a nice exercise. I'd recommend firing up a simulator of your choice and playing with some concepts until you've got something that works. Then build a prototype and evaluate it. I prefer to use LTSpice for this kind of thing, but I've been using it for...I dunno, way too long. It has a learning curve. There may be alternatives out there that are also quite capable and more user friendly.

I have LTSpice but haven't used it. I have Proteus that has a simulator in it.

Example of simulation with ltspice, for something close to your need:
3_led_comp

Sorry but I don't find the original simulation file, I just have this little image.

Ciao, Ale.