Maker Pro
Maker Pro

Unexpected signal in circuit.

Hi all,

I have been messing around with a simple voltage regulator circuit on a breadboard.

What it's supposed to do is take a 5V square wave (microcontroller PWM output) give it some set voltage gain, current gain and load regulation. The final circuit would more complex, this is simplified for breadboarding. The circuit works in SPICE (with some oddities such as a kind of overshoot on the rising edge with a diminishing oscillation before it stabilises on the correct "on" voltage)

In lieu of any real power supply, I'm using a spare one I have from a printer, which puts out +15V and +32V with a common ground. Looking at the power supply on a scope, there's no real noticable 50Hz noise on it that the circuit might be amplifying. However, within my regulator's feedback loop, there's a 50Hz half wave rectified sine wave swamping my actual signal, and I can't work out where it's coming from. This is present even when there is no input signal.

A schematic is attached, the +12V is really +15Vdc, and the +24V is really +32Vdc, the diodes are there to bias T1 and allow it to go into cut off, since in SPICE the TL074 output won't swing down below a couple of volts above its negative rail, although they seem to make little difference so far on the breadboard.

Any ideas where this noise is coming from?

Cheers,
Matt

PS. The final circuit may well end up as a separate regulator and transistor switch, this one's just something i wanted to try out
 

Attachments

  • regulator.png
    regulator.png
    16.9 KB · Views: 137
Matt,

A couple of suggestions:

I'm not sure about why you are getting the 50 Hz signal in your circuit, but the circuit has other problems that would keep it from working correctly. You definitely need to corrrect the DC bias for the op-amp inputs, and then may need to address feedback loop stability problems.

The TL074 op amp does not work correctly with its inputs at the negative supply voltage. The TI data sheet calls for about +4V or more on the inputs, relative to the negative supply voltage. ( The op amp inputs should both be near ground when your PWM signal is low.)

These parts are rated for use with plus and minus 15V DC supplies. They will work with a single supply, but the correct input DC bias is required for them to function as amplifiers.

Actual parts usually will work with the inputs closer to the supply pins than the data sheet's "Common-mode input voltage range", but will not work all the way down to the negative supply voltage. ( At the positive supply end, TL074 inputs will often work even slightly above the supply voltage, though the part may no longer meet other specs. )

So, the TL074 inputs may function at the positive rail, but they definitely will not work at the negative rail. A "rail to rail" op amp, or even an LM324 might do what you need. ( The LM324 is happy with the inputs at the negative rail, but not the positive.)

If the TL074 is the only part you have at hand, a small negative supply voltage, even -3V from a couple of flashlight batteries, might do for testing. Three cells might be better; or a 9V battery might be used here.

Once your op-amp is biased-up so the DC voltages are within its specs, you may then have problems caused by too much phase shift. The two transistors, and even the output load, are within the AC feedback loop around the op amp. Together, they may shift the phase too far for stability.

As to the source of your 50Hz signal, make sure of your common connection between the microcontroller and this circuit. Try connecting the op amp circuit's input directly to either common or +5V, and see what the output does. ( After correcting the DC bias problem and establishing stability.)

You have not revealed the actual requirements for your circuit, but you might have better results using a higher current op amp, without any extra transistors, or possibly using just a single emitter follower transistor to drive the load. The op amp itself should have plenty of voltage gain; the additional common emitter transistor, T1, should not be necessasary.

I wonder why the SPICE simulation appeared to work. Perhaps the model for the TL074 does not address the common mode input range limitations.

Good luck getting this working.

Ted
 
Thanks for the replies

The reason I was prototyping at this stage was mainly because of the inadequacies of the SPICE models, so I'm not surprised there are issues like these. The components used here are just what I could grab from Maplin on the way home from work, so they're far from ideal choices.

I don't really understand how to calculate the opamp output voltage at any one time with this circuit (and that's probably the crux of my problem), I got the basic circuit from here, but adapted to use BJTs because of the MOSFET's input capacitance. Initially, I wasn't using PWM but trying to just use a microcontroller controlled voltage source, but found that it was too inefficient for the currents it needed to pass. It needs to supply 25.5V peak output (PWM'd down to useful voltages in 0.1V increments controlled by a microcontroller) at up to several amps. T1 is there to allow the output voltage to be higher than the opamp's output voltage and therefore higher than the opamp's supply voltage, T2 is there to buffer the current. C3 is supposedly to stop the opamp from oscillating, although I don't know how you would calculate the right value. I tried this with no capacitor, 100nF and 1uF, and the output was definitely cleaner with either of the capacitors than with none.

I wasn't aware that BJTs shift phase at anything other than near 180 degrees or that any phase shift would be frequency dependant or significant enough to accumulate to cause positive feedback in only 2 transistors. I expected capacitors would cause this problem, I take it it's down to parasitic capacitances such as junction capacitance, but AFAIK that's tiny (relative to something like the input capacitance of a MOSFET). So that would need more thought that I expected.

I had low expectations for the circuit, it was just a quick thing to test the theory rather than get decent results; it’s just when I was doing it I got this 50Hz half sine wave even though my power supply (most likely SMPS) has no discernable 50Hz right down to the noise floor and that really got me intrigued. The input voltage is actually from a function generator outputting a square wave of 5V pk with the negative tied to the breadboard ground and the positive at Vin on the breadboard. Perhaps the ground loop between the 2 mains powered devices is something to do with it.

Right now, in order of decreasing likelihood, I'm looking at either:
1. just using an LM338 for regulation of the "on" voltage for the PWM and using a BJT based switch similar to the transistor section of this one for interfacing the microcontroller;
2. this circuit (with an unregulated DC supply) unless someone can point out a major problem with it (the load regulation's fairly good and I believe it can be improved with a darlington triplet or adjusting resistor values to allow more current through R4); or
3. using unregulated DC and just using the microcontroller to monitor the output voltage via a low pass filter and provide negative feedback by software adjusting the pulse width, which is probably the most efficient in terms of heat wasted in ICs and transistors, although I would have to use a higher PWM resolution than 8 bit.

Cheers,
Matt
 
Last edited:
Matt

I'm trying to understand your application and its requirements. I wonder if trying to troubleshoot the posted circuit isn't an attempt to solve the wrong problem…

Would you be willing to share your actual purpose? We might be able to provide better help.

Does your load tolerate the PWM signal? For efficiency, this would be a rectangular waveform switching between 0 and + 22.5V? ( A resistive heater element would be such a load.) Or does the output, at the load, need to approximate a DC voltage?

Does your application require good line and load regulation? Accurate output levels?

I wonder how many amps "several" might be… And how low does the output voltage need to go? How rapidly will the output be changing? Are you just setting the DC level, or is there some sort of "signal" being put on the output?

To get good efficiency, the power switch for the PWM output needs to switch either completely off, or hard on.

The posted circuit appears to be meant to provide an output with a value determined by the DC value of VIN. In other words, it's a linear power amplifier.

This circuit makes no sense, if its VIN is a rectangular waveform switching between 0 and +5V.

> I don't really understand how to calculate the opamp output voltage at any one time with this circuit

If the circuit is modified to work, the opamp output voltage doesn't matter, very much. It will depend on the temperature, the gain of T1, and perhaps the phase of the moon. To a first order approximation, this voltage will go to whatever value is required to make the rest of the circuit cause the opamp inputs to be equal. We would hope that this would occur when VOUT is twice VIN. This would be determined by the ratio (R1+R2)/R2.

As to the opamp output values seen just after VIN changes, while the output is slewing to the new value, that's going to be pretty complex! Your simulation might just be the best way to look at this. ( Sort of a lazy answer…)

I hope all this is of some help to you.

Ted
 
Thanks Ted,

I'm sure the above circuit is really the wrong solution to the problem. I'll explain how I got here:
I want to be able to power a heater filament and measure the current drawn by it. More specifically, I want to measure a variety of different heaters, powered at different voltages up to 25V and currents up to 5A. Devices with higher currents tend to have lower voltages and vice versa, so the power dissipated in them isn't as huge as it may first appear. The voltage is set once, and the current measured over time for a short while, and it's all set and measured by a microcontroller.

In an unrelated part of the instrument, I have a voltage controlled voltage source similar to the one above, and initially I thought I could just do the same, but tweak it for the different current requirements. As the potential range of heaters to test increased, it became apparent that some of them required the voltage source to drop a lot of volts at a high current, and therefore they would dissipate far too much.

So I thought of using PWM, and the first thing I did was simply change "Vin" in my simulation to an equivalent square wave and see that dissipation in the pass transistor indeed was dramatically decreased. 8 bit PWM would provide 256 voltage increments, and I needed to supply up to 25.0V for some devices, so I thought a range of 0-25.5 in 0.1V increments would be suitable. I failed to remember at this point that there would be a variation in my DC supply voltage depending on line voltage or load current.

I did immediately also do a simulation with a separate voltage regulator circuit made of discrete components like this one but a separate transistor based switch for the PWM, expecting that to be necessary. But I felt the chance that it could work with these few parts (as it had worked in some simulations) was worth exploring. While simulating I noticed so many strange things going on with the opamp models and between different models, I decided the only way to know for sure if it would work is to build a very simple 5 minute circuit with what I had or could get easily. And that led me to the weird 50Hz thing, which is off-topic but I couldn't work it out, and thinking it might be a real problem in the end, thought I'd ask some more knowledgeable people's opinions.

The point of the regulator was that the supply voltage to the load device has to be known for the current reading to be valid, and with an 8 bit PWM, only being accurate to 0.1V would cause problems if the "on" voltage could change. Later I replaced the regulator in the simulation with a monolithic LM338. This is still significantly more efficient than providing a regulated variable DC output, and should work, although it needs a lot of heatsinking and cooling, so that's plan B now.

However, as you say, the whole point of PWM is that it's either on or off, nothing in between as anything in between wastes power. I think if I use a 16bit PWM and monitor the voltage with the microcontroller, I can use software to adjust the pulse widths to correct for line/load variations (i.e. software negative feedback) and then it will just be a case of using BJTs to convert the output of the microcontroller into PWM for the load device with minimal dissipation in the transistors. That's my plan A.

I really do appreciate all the help you guys are giving me, I'm not trying to hide details of the project while asking for help at the same time or something, it's just the original reason I posted was that I knew I had a rubbish circuit, but regardless of that, was stumped as to where that 50Hz was coming from. I suppose really I shouldn't have mentioned the fact that I was trying to test a circuit designed for a steady analog input voltage with the wrong input at the time I noticed the peculiarity, as it's not really relevant and it had this 50Hz noise with a fixed DC voltage on the input (which it did), especially as elsewhere in my project the same circuit does have a steady voltage input and that circuit would suffer from this 50Hz thing if it isn't just due to my use of a printer's SMPS.

Cheers,
Matt

(PS. I had asked here before and been told the heater should work ok on PWM, although I'm not sure about the current measurement. I'm hoping low pass filtering a current measurement will provide the correct analog voltage as if it was powered by pure DC and a voltage difference measured across a resistor. Even if it's not, it should be OK as long as different devices can be measured in the same way for comparison.)
 
Last edited:
Top