Author Topic: Please laugh with me, point sticks and tell me what is wrong  (Read 10917 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Please laugh with me, point sticks and tell me what is wrong
« on: January 11, 2013, 09:26:57 am »
We have been nutty enough to buy the attached circuit on strip board for an urgent project (despite the fact I could probably make it from scratch my way faster but you know.... management!)

Is it just me or is this circuit totally screwed up and causing about as many problems as it solves. It is supposed to be a thermostat for the relay of a compressor clutch for an air con system to work between 3 deg C and 23 deg C with a hysterisis of 3-4 deg C so that the clutch does not keep coming on and off. I am going around in circles, and it seems that it won't switch when the sensor reaches the higher range.

Resistance values on the chart are in K ohms

I am a little concerned that an op amp was used rather than a comparator, as far as I can tell it is an inverting amplifier with a gain of about 15 and a varying "0" point.
« Last Edit: January 11, 2013, 09:28:45 am by Simon »
 

Offline qno

  • Frequent Contributor
  • **
  • Posts: 422
  • Country: nl
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #1 on: January 11, 2013, 09:37:46 am »
What are the numbers in the sheet?

Why spend money I don't have on things I don't need to impress people I don't like?
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #2 on: January 11, 2013, 09:40:44 am »
you mean the ones on the left ? that is the value in K ohms of the sensor at different temperatures
 

Offline qno

  • Frequent Contributor
  • **
  • Posts: 422
  • Country: nl
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #3 on: January 11, 2013, 09:56:46 am »
Did you measure this in-circuit?
Why spend money I don't have on things I don't need to impress people I don't like?
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #4 on: January 11, 2013, 10:02:03 am »
no they were measured with the probe disconnected.
 

Offline TerraHertz

  • Super Contributor
  • ***
  • Posts: 3958
  • Country: au
  • Why shouldn't we question everything?
    • It's not really a Blog
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #5 on: January 11, 2013, 10:17:01 am »
It's supposed to have hysteresis, but the op amp feedback is connected to the inverting input. Giving linear operation.
Should be connected to the + input. Without even thinking about whether the values are sane.

Edit: So there's a teeny bit of hysteresis provided by the schmitt trigger input of the 4096. Which will vary with the supply voltage.
I wonder what geni-arse(sic) designed this?

Edit2: Also, I'm having trouble finding data in the IN5365 zener. What?! What voltage is it? And why is it there?
Purpose is maybe to prevent exceeding CMR on the op amp if the sensor is unplugged? But it will have some leakage current, and that's going to cause sensor inaccuracy. Same with the reversed IN4004, though not so much.

« Last Edit: January 11, 2013, 10:31:10 am by TerraHertz »
Collecting old scopes, logic analyzers, and unfinished projects. http://everist.org
 

Online blackdog

  • Frequent Contributor
  • **
  • Posts: 739
  • Country: nl
  • Please stop pushing bullshit...
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #6 on: January 11, 2013, 10:19:02 am »
Hi Simon, :-)


This will not work the way you want it...
There is no hysterisis, only gain.
The feedback resistor should be going to the + input of the opamp.
You have to do the math for the 51K and the 470K resistor for the 3C hysterisis.

Kind regarts
Blackdog
Necessity is not an established fact, but an interpretation.
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #7 on: January 11, 2013, 10:19:37 am »
It's supposed to have hysteresis, but the op amp feedback is connected to the inverting input. Giving linear operation.
Should be connected to the + input. Without even thinking about whether the values are sane.
You beat me to it. Exactly the same observation: the amp is working as an amp, not a comparator. It doesn't make sense in the context of this application - you want a comparator, not an amp per se.
You sure the feedback goes to the neg input actually?
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #8 on: January 11, 2013, 10:23:40 am »
yes it does go there, I suspect the person supplying the diagram is having us on in case we try to make it ourselves instead of pay him to, we in turn had it made by someone else cheaper and the result is that I've spent a week trying to work out what my employers is doing with the output, what control positions they want to do what and any errors made by the guy who made it.
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #9 on: January 11, 2013, 10:36:19 am »
Sure is a lot of work for an essentially trivial thing like that  |O
Just make it yourself and don't confess if they ask  %-B
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline TerraHertz

  • Super Contributor
  • ***
  • Posts: 3958
  • Country: au
  • Why shouldn't we question everything?
    • It's not really a Blog
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #10 on: January 11, 2013, 10:37:19 am »
I can sort of see his thought process. He used the op amp to scale the sensor signal, then low pass filtered it with an RC, then used the 4096 to provide a (roughly) constant amount of hysteresis. I bet the sensor is wired some distance away, right? And maybe the +12V supply is horrible - noisy and varying - especially when the output load (a relay?) is turned on or off. Thus feedback from output state to all the imperfections in the circuit, providing a complex behavior mess.
Collecting old scopes, logic analyzers, and unfinished projects. http://everist.org
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #11 on: January 11, 2013, 10:56:21 am »
I have wired up a second board and it is working now to a fashion although I still have heating and cooling reversed but that is probably due to use using a NC relay instead of a NO relay. The sensor could be some distance away and the power supply was in the box, we now have the op amp section working off 28V and the NAND gate working off 12V from a regulator (a mod the assembler made). The problem with this circuit is that it seems to be very convoluted and unless you wire it up just right it all goes very very wrong. This guy is very old school. I'd have used a micro probably as there are other circuits needed like fan speed controls. In any event it could have been more simply built with a proper comparator and using a mosfet on the output.
 

Offline qno

  • Frequent Contributor
  • **
  • Posts: 422
  • Country: nl
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #12 on: January 11, 2013, 11:25:23 am »
The inverter is there because the circuit is working in the oposite way.
As temperature rises the output will go low.
He should have connected the sensor between +12V and the input and swap the + and - input of the opamp.
The hysteresis resistor should go to the + of the opamp as described before.
Hysteresis is a bit variable due to the change in sensor resistance.
You will have to find a good compromise over the temperature range.
Power supply disturbance can be solved by operating the circuit on 5V generously decoupled.
You can stick the circuit on an experimenters board.
Is he using any of the other opamps in the LM124 or other gates of the 4093?
Why spend money I don't have on things I don't need to impress people I don't like?
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #13 on: January 11, 2013, 11:43:42 am »
he is using only one opamp and one gate. He seems to be using the gate for the hysterysis as we have establishded that at the moment the circuit is working as a differential amplifier essentially. So what I will do now is use another gate to re negate the output to what we want.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #14 on: January 11, 2013, 02:34:09 pm »
adding another not gate just kept the output permanently on, The guy doing the wiring has finally conceded to just swap his relay contacts (yes it took some bloody convincing) and I'll take the gate back out. I think the problem is that we now have the op amp on 28V and the logic gate on 12V and now that we realize that the gate is taking an analogue input in and is providing the hysteresis. Yes i could adapt it to power the whole thing from 12V but I've been told not to meddle any more in case we make more problems.
 

Online free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #15 on: January 11, 2013, 03:57:38 pm »
Really? 1/4 of an 424 and 1/4 of a 4093 to make an invertor ( schmitt i know )

Could be done usong 1 lm393... First half comparator , second half comparator with hysteresis. The delay is the rc constant between them...
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #16 on: January 11, 2013, 04:19:29 pm »
yep quite although this is a section of schematic from a larger schematic so it could be that the rest were used elsewhere. Yes I'd have just used a comparator, but what is the point of a comparator followed by another comparator with hysterysis, surely the first will output high or low making a following one pointless ?
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16284
  • Country: za
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #17 on: January 11, 2013, 04:27:43 pm »
He did say point sticks...... Simon could do better with half the parts anyway.

Anyhow you can use a comparator and do the logic right with it anyway first time.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #18 on: January 11, 2013, 04:41:49 pm »
Anyhow you can use a comparator and do the logic right with it anyway first time.

Quite, that is what I don't understand this guy is just converting levels from positive to negative and back to positive. Am I deluding myself or can the hysteresis be made to work either way round ?
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16284
  • Country: za
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #19 on: January 11, 2013, 05:15:25 pm »
Yes, it will do an offset on either the input or the reference depending on how you wire the comparator, and this provides the hysteresis. providing you are not using multiple comparators off the same point it has no effect otherwise.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #20 on: January 11, 2013, 06:10:52 pm »
whoever designed this is either very clever ( :-\) or does not have a clue what he is doing.
 

Offline miceuz

  • Frequent Contributor
  • **
  • Posts: 387
  • Country: lt
    • chirp - a soil moisture meter / plant watering alarm
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #21 on: January 11, 2013, 06:46:29 pm »
I've made similar circuit just yesterday  :D I've used LM35 temp sensor and LM358. As I needed it to work somewhat in range of 0 - 4 C, I've added two diodes in series on the ground connection of LM35. As diode voltage drop drifts with temperature, I've added the same two diodes to bottom of trimpot and have chosen trimpot value so current thru it would be equal to quiscient current of LM35, so diodes drift the same, that sets the temperature point, buffered it with half of LM358 and used second half as a comparator with hysetesis. Just works..

Offline helloworld922

  • Regular Contributor
  • *
  • Posts: 56
  • Country: us
    • My personal blog
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #22 on: January 11, 2013, 07:23:53 pm »
 :scared:

I always thought this was the recommended way for designing a comparator circuit with hysteresis (attached circuit).

Vhyst = R1 * (Voh - Vol) / (R1 + R2)

Voh is the high output level (in this case pullup to relay source voltage) and Vol is the low output level (assuming an actual open collector/drain comparator, this should be 0).

I have the pnp transistor in there which means if Vsense > Vref the coil will energize, otherwise it won't. You can of course just as easily have an npn transistor in there to do the opposite (or use MOSFET's instead).

R3 is your variable resistance temp sensor, R4 is to provide a voltage divider to get Vsense.

Reference:
Analog Devices: Curing Comparator Instability with Hysteresis
 

Offline lewis

  • Frequent Contributor
  • **
  • Posts: 704
  • Country: gb
  • Nullius in verba
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #23 on: January 11, 2013, 08:31:57 pm »
Simon, if you must use an op-amp instead of a comparator, use something like this (attached). I bet the designer of the original circuit stuck the logic gate in there because the output offset voltage of the op-amp when 'off' was enough to turn on the transistor driving the relay at all times. Putting a low value zener in the base circuit gets around this without resorting to a schmitt trigger. The 4.7K resistor provides enough pulldown to overcome the leakage of the zener. It might need to be lower, 1K-2.2K.

The 1N914 diodes provide ESD protection for the op-amp if the temperature sensor is mounted remotely. Another pair of diodes will need to go on the set-point potentiometer if that is mounted remotely too.

This circuit will energise the coil when the temperature is lower than the set point. If you want the relay to work the other way, reverse the inverting and non-inverting inputs, but move the feedback resistor to the non-inverting input and exchange the 1uF and 100nF caps. The 100nF is a bit low for noise smoothing, but speeds up the hysteresis action. Try changing it to 1uF. Or, just swap the temp sensor and it's pullup for the same effect.

You'll need to select the unlabelled resistors for your application.

You might want to run everything to the left of the relay coil from a voltage regulator if the supply is noisy or if it's likely to go over 32V, even transiently. The op-amp doesn't like it up it.

The diode in reverse parallel with the relay coil is a 1N4007, transistor can be TIP122 if the relay is a big bastard, or BC337-40 or something if <50mA coil current. No zener in parallel needed.

Remember, if you do use a comparator, it will probably have an open collector output and a pullup on its output will be necessary.

In theory it's easy to do with bugger all parts, but in the real world where there's noise, ESD and crap, additional protection components are required. I've probably forgotten something, I'm sure someone will point out if so!
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17816
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #24 on: January 11, 2013, 08:40:42 pm »
if it were me I'd use a comparator, I have no idea what the hell he thought he was doing. I'd rather do it with a micro-controller and then the hysterysis would not be needed because I can just stipulate in software that the coil has to be off for at least a minute before it can be turned back on again, as all it is about is not overwhering the compressor clutch or relay, although I'd swap that for a mosfet.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf