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

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • 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 #25 on: January 14, 2013, 11:47:00 am »
If I just reverse the op amp inputs what will happen ? I tried it and my output just stayed on.
 

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 #26 on: January 14, 2013, 02:51:38 pm »
Hi Simon, you need to make sure the feedback resistor always goes to the + input.

So if you just reverse the inputs on the diagram I attached, the feedback resistor will now go to the - pin. You need to change this so it goes to the + pin.

If you want it done with a microcontroller let me know. We do do customised design and product development on a daily basis, if you need things like this done on the cheap and very quickly, drop me an e-mail at www.abeltronics.co.uk/contact
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • 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 #27 on: January 14, 2013, 03:10:35 pm »
I meant swapping the pins on the circuit I posted.

we are sending these as they are (nuts I know, we have thermostats in stocks that cost a fiver each that we have used for years but they want this junk). Ultimately I am hoping to redesign the wholes thing myself with a micro to do thermostat, fan speed and a delayed power line to a small pump.
 

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 #28 on: January 14, 2013, 05:10:51 pm »
Hi Simon, should be the same thing in theory. I suspect the output offset voltage of the op-amp is just enough to keep the gate triggered in one direction. What supply voltage are you using? It says 12V on the diagram but also 24V/28V DC next to where it says 12V. Don't power the gate from more than 15-18V whatever you do...

I'd measure the output of the op-amp with a voltmeter while adjusting the preset pot, and do the same while heating the thermistor with your fingers or a soldering iron. Remember that circuit is configured as an amplifier, not a comparator, and is a complete lash-up. You're relying on the triggering threshold of the logic gate for the 'comparator' bit which is extremely variable. (Well, not extremely as such, but extreme enough). You need to see what the op-amp output voltage is doing when you adjust the op-amp's inputs.

I really really wouldn't recommend using that circuit, it is far from satisfactory. The offset voltage and schmitt trigger threshold will vary with temperature and if you have a marginal design on the bench it will almost certainly fail in the real world. The microcontroller idea is much better, I've replaced plenty of comparators with microcontrollers in commercial designs in the past.
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • 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 #29 on: January 14, 2013, 09:50:54 pm »
I tried using the schematic in the PDF that someone posted to make a quick breadboard circuit. It was a mess with no hysterysis. I still ended up with op amp type behavior (fading LED) from an LM339..... surely the only way to have histerysis is to put a resistor from output to +input so that as the output switched the resistor is put in parallel with either one side of the other of the reference voltage divider or (assuming compatible) voltage divider formed by the sensor resistor and it's accompanying fixed resistor.
 

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 #30 on: January 14, 2013, 11:44:44 pm »
Absolutely right! Were you using my circuit?
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • 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 #31 on: January 15, 2013, 06:43:27 am »
No I was trying to follow the analog devices pdf someone posted early on that gave formulas and everything but it had no histerysis when I tried it.

http://www.analog.com/library/analogDialogue/archives/34-07/comparators/
« Last Edit: January 15, 2013, 06:54:50 am by Simon »
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #32 on: January 15, 2013, 07:31:17 am »
I tried using the schematic in the PDF that someone posted to make a quick breadboard circuit. It was a mess with no hysterysis. I still ended up with op amp type behavior (fading LED) from an LM339..... surely the only way to have histerysis is to put a resistor from output to +input so that as the output switched the resistor is put in parallel with either one side of the other of the reference voltage divider or (assuming compatible) voltage divider formed by the sensor resistor and it's accompanying fixed resistor.
If you mean the hand drawn schematic then there is one small but crucial mistake: the comparator output is missing the collector pull-up resistor. If you use an LM339 or similar part, it has an open collector output that does not pull up actively. Thus the relay transistor is never driven properly, unless you insert a pull-up resistor into the circuit.
Otherwise the hysteresis part is correct: it is done using positive feedback. But that also will behave strangely if you dont pull the output up properly.
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • 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 #33 on: January 15, 2013, 07:53:26 am »
No I was referring to the Analog Devices PDF that I linked to above. Yes I did use a pull up resistor.
 

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 #34 on: January 15, 2013, 08:05:09 am »
You mean the one I linked to (edit: I guess you linked to it, too)? It has hysteresis, but I think comparators might have troubles sinking significant current so they may not be able to drive the relay coil directly.

My circuit used an additional transistor (I chose a PNP, but could be a P-channel MOSFET instead or the NPN/N-chan variant for opposite logic) to drive the coil.

The one possible issue is I wasn't quite sure where the pullup resistor should tie up to (R6). I picked the relay power source so the transistor will be fully off/on on both high and low levels, but this may cause havoc on the rest of the circuit (haven't calculated it). R5 is used to limit base current so it may not be required if using a MOSFET solution.

You do have the comparator in a positive feedback configuration, right?
« Last Edit: January 15, 2013, 08:07:55 am by helloworld922 »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • 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 #35 on: January 15, 2013, 08:10:27 am »
yes I'd use a transistor too (a mosfet not a flipping darlington like this old fart did) but my concern at the moment is understanding and getting the comparator to work WITH histerysis.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • 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 #36 on: January 15, 2013, 08:44:55 am »
The attached is what I deem to be a comparator with histerysis, the "sensor" could be any of those resistors to suit.
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: Please laugh with me, point sticks and tell me what is wrong
« Reply #37 on: January 15, 2013, 10:02:28 am »
Yep, sure is. You can tell by the Mk 1 eyball but attached a snap simulation confirming the same. Sorry about the ridiculous comparator symbol, that was the best Multisim could come up with a moment's notice.
By the way, you can't really have a voltage source connected to the comparator output. That will be an effective short when the output transistor conducts. I left that out and it simulates just fine without it.

P.S. scope traces are color coded in the schematic. All traces 5 V/div.
« Last Edit: January 15, 2013, 10:09:46 am by Kremmen »
Nothing sings like a kilovolt.
Dr W. Bishop
 

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 #38 on: January 15, 2013, 12:57:28 pm »

If you mean the hand drawn schematic then there is one small but crucial mistake: the comparator output is missing the collector pull-up resistor. If you use an LM339 or similar part, it has an open collector output that does not pull up actively. Thus the relay transistor is never driven properly, unless you insert a pull-up resistor into the circuit.
Otherwise the hysteresis part is correct: it is done using positive feedback. But that also will behave strangely if you dont pull the output up properly.

My circuit uses an op-amp, Simon seemed to want to use an op-amp.
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • 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 #39 on: January 15, 2013, 12:59:13 pm »
No I'm happy with a comparator, the idiot that designed the hand drawn schematic used an opamp, probably because he was using the other 3 for something else in the grander scheme of things.

I generally have LM339's knocking around for breadboarding.
 

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 #40 on: January 15, 2013, 01:09:00 pm »
The attached is what I deem to be a comparator with histerysis, the "sensor" could be any of those resistors to suit.

This circuit should work mate, what's it doing?
I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • 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 #41 on: January 15, 2013, 02:02:17 pm »
not tried it, we are currently bunging the nut jobs circuit in and forgetting it (along with some hashing up). Wrng i know, but I'm not in charge, I've already recomended we use the comercial thermostats we have around with the necesary protection circuitry added.
 

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 #42 on: January 15, 2013, 03:50:41 pm »
Quote
By the way, you can't really have a voltage source connected to the comparator output. That will be an effective short when the output transistor conducts. I left that out and it simulates just fine without it.

That's one of the "oddities" of using TINA-TI: you add in "voltage measurement" components (VM1).

Your circuit looks fine, though maybe a larger pullup resistor would work better? You're drawing ~12mA through the pullup when output goes low. The datasheet specs a min rated output current sink of 5mA which would cause Vo = 1.5V.

Quote
not tried it, we are currently bunging the nut jobs circuit in and forgetting it (along with some hashing up). Wrng i know, but I'm not in charge, I've already recomended we use the comercial thermostats we have around with the necesary protection circuitry added.

Yeah, it is funny why you guys don't use a commercial temperature trip sensor. These puppies have all this stuff built in and output a digital signal when the trip point is reached. Even have hysteresis built in :P I think Dave had a video where he ranted about dumb management (actually, a few different videos)...
« Last Edit: January 15, 2013, 03:57:27 pm by helloworld922 »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • 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 #43 on: January 15, 2013, 04:27:14 pm »
yea quite, it's called we conned ourselves out of the money we spent on them so now we must use them, we have commercial stats that do what we want but they won't use them.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf