OP-Amp Motor Controller doing strange things

Thread Starter

Danlar81

Joined Apr 19, 2019
87
Hi Guys,
I reasonably new to the circuit design and I have recently built a LM741 motor controller configured in the inverting summing mode. Essentially I am using a temperature sensor as a reference on V1 and then I have a resistor/potentiometer divider network set up on V2 which gives a temperature set point control between 18 to 30 degrees Celsius. The set point range has a voltage from -2.91 to -3.03 volts with the temperature sensor outputting 2.97 volts at 24 degrees Celsius.
The output stage is BJT push pull class B configuration.
I used the following transfer function to determine the output voltages Vout = -Rf/R(V1 + V2)
What I wanted to acheive was only +/- 6 volts out worse case and by that I mean if the temp sensor was reading 24 degrees (2.97 volts) and the set point was at either end of the extreme of the potentiometer the max would be 6 volts out. To achieve this the gain is set to 100 via R1 and R2 being set at 6k8 and connected to the inverting input, The non-inverting connected to common and Rf 680K.
I have set this up in the simulator LTSpice and everything seems to be working fine with +/- 6 volts when in the conditions just mentioned, however when I implemented this on the breadboard and after I begin to adjust the set point control at the 0.6 volt mark when the transistor begins to switch on the motor is violently switched forward and reverse continually and I can not for the life of me understand why. The output transistors are BD 139 and 140 respectively and the Op-Amp is being supplied with +/- 12 volts DC.
Would appreciate any advice or things I may be able to try.
Regardd
Dan
 

KeithWalker

Joined Jul 10, 2017
3,063
Hi Guys,
I reasonably new to the circuit design and I have recently built a LM741 motor controller configured in the inverting summing mode. Essentially I am using a temperature sensor as a reference on V1 and then I have a resistor/potentiometer divider network set up on V2 which gives a temperature set point control between 18 to 30 degrees Celsius. The set point range has a voltage from -2.91 to -3.03 volts with the temperature sensor outputting 2.97 volts at 24 degrees Celsius.
The output stage is BJT push pull class B configuration.
I used the following transfer function to determine the output voltages Vout = -Rf/R(V1 + V2)
What I wanted to acheive was only +/- 6 volts out worse case and by that I mean if the temp sensor was reading 24 degrees (2.97 volts) and the set point was at either end of the extreme of the potentiometer the max would be 6 volts out. To achieve this the gain is set to 100 via R1 and R2 being set at 6k8 and connected to the inverting input, The non-inverting connected to common and Rf 680K.
I have set this up in the simulator LTSpice and everything seems to be working fine with +/- 6 volts when in the conditions just mentioned, however when I implemented this on the breadboard and after I begin to adjust the set point control at the 0.6 volt mark when the transistor begins to switch on the motor is violently switched forward and reverse continually and I can not for the life of me understand why. The output transistors are BD 139 and 140 respectively and the Op-Amp is being supplied with +/- 12 volts DC.
Would appreciate any advice or things I may be able to try.
Regardd
Dan
Please post a diagram of your circuit. It will make it much easier to understand what you are doing and to answer your questions.
 

Zeeus

Joined Apr 17, 2019
616
Hi Guys,
I reasonably new to the circuit design and I have recently built a LM741 motor controller configured in the inverting summing mode. Essentially I am using a temperature sensor as a reference on V1 and then I have a resistor/potentiometer divider network set up on V2 which gives a temperature set point control between 18 to 30 degrees Celsius. The set point range has a voltage from -2.91 to -3.03 volts with the temperature sensor outputting 2.97 volts at 24 degrees Celsius.
The output stage is BJT push pull class B configuration.
I used the following transfer function to determine the output voltages Vout = -Rf/R(V1 + V2)
What I wanted to acheive was only +/- 6 volts out worse case and by that I mean if the temp sensor was reading 24 degrees (2.97 volts) and the set point was at either end of the extreme of the potentiometer the max would be 6 volts out. To achieve this the gain is set to 100 via R1 and R2 being set at 6k8 and connected to the inverting input, The non-inverting connected to common and Rf 680K.
I have set this up in the simulator LTSpice and everything seems to be working fine with +/- 6 volts when in the conditions just mentioned, however when I implemented this on the breadboard and after I begin to adjust the set point control at the 0.6 volt mark when the transistor begins to switch on the motor is violently switched forward and reverse continually and I can not for the life of me understand why. The output transistors are BD 139 and 140 respectively and the Op-Amp is being supplied with +/- 12 volts DC.
Would appreciate any advice or things I may be able to try.
Regardd
Dan
"The design of a 741 opamp is 53 years old! Why use it today? Kiss it goodbye and bury the old thing." AudioGuru
 

Thread Starter

Danlar81

Joined Apr 19, 2019
87
Thanks for the reply Zeeus,
I am learning about some different configurations and I have them at home so I thought I would try them. Understood that it's not cutting edge, however good to get an understanding of the basic concepts.
Regards
Dan
 

cmartinez

Joined Jan 17, 2007
8,218
Hi Keith,
I have uploaded a diagram, I just sketched it up freehand so it's not perfect, but you will understand it easily enough.

Regards
Dan
Here's your diagram, rotated and in full image view. I suggest you download LTSpice, it not only lets you draw diagrams, but you can also sim with it. Plus, it's got the perfect price: free!

upload_2019-5-30_10-20-22.png
 

crutschow

Joined Mar 14, 2008
34,281
All those resistors to ground from the summing junction do nothing, since the summing junction is already essentially at ground potential.

You need to connect the resistors to a negative voltage if you want to create a set-point for the positive voltage out from the sensor.
(Why so many resistors in series?)
 

Daniel Sala

Joined May 28, 2015
65
Hi,

Why so many resistors in series?
Despite being unnecessary - if you say so, I believe you. Could it be: make the summed value meet the maths with what resistor values one has to hand? I don't know if 24k4 +-1k is a standard value, I guess not but 22k + 2k2 + 220R + a 2k2 trimmer set midpoint would achieve the same.
 

KeithWalker

Joined Jul 10, 2017
3,063
Hi Keith,
I have uploaded a diagram, I just sketched it up freehand so it's not perfect, but you will understand it easily enough.

Regards
Dan
The motor will draw a lot of current on start-up which could cause the supply voltages to the op-amp to sag. This will change the set point. I recommend that you add a couple of rectifier diodes CR1 and CR2 and electrolytic capacitors C1 and C2 to maintain the voltage of the supplies during motor start-up surges.
The commutator in a brushed DC motor can cause a lot of fairly sharp back-EMF voltage spikes to be fed back to the op-amp through the supplies. The addition of diodes CR3 and CR4 will supress a lot of this interference.
See the attached drawing:

Motor Control.jpg
 

Thread Starter

Danlar81

Joined Apr 19, 2019
87
Hi Keith,

I tried the circuit addition and still had the same problem so I am unsure as to why that is. It does work as expected without the output stage connected so maybe it does not like the inductive load?
Anyway I tried a different circuit configuration. I made a difference amplifier and incorporated the addition and it works ok, however I was hoping to get clarity on what is happening.
I used the formula for a difference amplifier Vout = Rf/Rin(V2 - V1)
I get an unexpected result on the output with the circuit I built. I set a reference for V1 as 2.98 volts which is 25 degC from temp sensor and then set up a resistor divider for V2 which gave me a voltage of 2.97 volts. With a gain of 13.5 due to resistor values I have lying around I expected approx 135 mV. I simulated this in LTSpice and received a voltage of -2.87. I also built the circuit on the breadboard and received a similar voltage. Why?
I am new to all of this so this is very puzzling and I can no explain what is occurring. I was hoping you may be able to provide some input?
In LTSpice I used an LM308 as I didn't have a model for the LM741 which is what I used in practice but the results are the same. Also I don't have a model for a motor in Spice so I put a 100 ohm load just for the simulation, but I don't see this being the issue.
I have attached a photo of the spice circuit diagram.
Regards
Dan
 

Attachments

Daniel Sala

Joined May 28, 2015
65
Hi,

A crummy way of modelling a motor is a resistor and an inductor in series with a capacitor in parallel to the inductor. Not great but an approximation.
 

Daniel Sala

Joined May 28, 2015
65
First op amp is in inverting configuration, - (R5/R4) * Vin. Therefore I get - (100k/100k) * 2.98V = -2.98V. Is that what you want as "Vin"?

Vref works out at ~ -2.97V to me.

...And to cut a long story short I must/may have got muddled with the difference amplifier maths as I got ~ +30V out.

Used this schematic for the diff. amp formula. An-31 is a handy cookbook/cheatsheet for OA formulas.

Re-reading your first post - What should the motor do exactly: switch on at over x temperature (voltage ref.) and off at under x temperature (voltage ref.), which are the same value in that circuit ((...See the problem there...?*)) OR rotate faster and slower across x to z temperature range?

* "Chatter". If it is continually turning on and off all the time, it would need a hysteresis range such as x voltage = off and y voltage = on. Not sure if hysteresis is easy with op amps but it is "easy to implement" with a comparator. Op amp as comparator is not a preferred method but is pretty typical to the point it even appears in some op amp datasheets in the typical applications section.
 

Attachments

Last edited:

Thread Starter

Danlar81

Joined Apr 19, 2019
87
Hi Daniel,
Thanks for the reply.
Yes I wanted to invert the 2.98 volts as it is originally positive from the sensor. And yes I also got -2.97 for my reference. I have since learned that there is a thing called common mode rejection and ideally there should be zero on the output in this situation as that's what happens mathematically, however in practice this is not the case which is why I am seeing -2 volts out.

I have since made Vref adjustable by using a pot and this allows me to zero out the output. I was not aware of common mode rejection until just now.
I'm still going to investigate why I continue to have problems when it is configured in summing mode.
Thanks for your input.
Regards
Dan
 

Thread Starter

Danlar81

Joined Apr 19, 2019
87
Hi Daniel,
The motor should spin clockwise if the temperature rises and gets faster the higher it rises and spin anti-clockwise if the temperature is lower and speed up in the opposite direction.
I noticed that the formula Vout = Rf/Rin(V2 - V1) I cannot use because R8 is not equal to R4 and R3 is not equal to R1.
 

crutschow

Joined Mar 14, 2008
34,281
If you want diodes D1 and D2 to protect against voltage sag from the motor current then the power supplies need to be connected on the other (motor) side of the diodes with some large decoupling capacitors (>100μF) on the left side of diodes.

As connected, all the diodes do is reduce the voltage to the motor slightly.
 
Top