MrHeckles Posted December 17, 2005 Report Share Posted December 17, 2005 Hey everyone,I would like to design a setup that switches a PNP transistor on when a signal reaches near 0v (it would normally be either +ve or -ve), and then keeps that transistor on until the system is reset.My current thoughts on the matter are to have a window comparator to detect the near 0v, and have that feed into a schmitt trigger with a -ve reference for the turn off level (to keep it on). I figure the reset can be cutting the power to the schmitt trigger.Would this setup work, or is there a better, more simple way?BTW this is intended to be an inhibitor for a reverse switch on a motor controller. I hope to be able to interrupt the PWM to a half-bridge driver if reverse is selected while the motor is still turning (ie producing regen current), and then let the PWM pulse through once the motor has come to a stop. It should hopefully do the same when switching back to forward. Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 18, 2005 Author Report Share Posted December 18, 2005 Okay, here is a schematic for my idea.At the moment, the window is set between about 3.4v and 1.7v.My big question is.... will this work? Quote Link to comment Share on other sites More sharing options...
audioguru Posted December 18, 2005 Report Share Posted December 18, 2005 Hi Mr. Heckles,Your Schmitt Trigger comparator isn't doing anything. It just repeats the output of the window comparator.The comparators don't have any connection to the PNP transistor.The PNP transistor will have its base-emitter junction blown if the Signal voltage exceeds 12.7V (forward biased without current limiting) or less than 7V (reverse-biased avalanche breakdown) without current limiting. Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 18, 2005 Author Report Share Posted December 18, 2005 How about this?When the window comparator turns on, it pulls the + input of the right comparator below the - input, turning it on. The output of that right comparator pulls the + input low aswell, thus keeping it on (at least until power is removed from the whole circuit) even if the window comparator turns off again.Does that sound plausible?Also does shifting that 2k resistor provide some current limitation to protect the PNP transistor now? The signal is a PWM pulse to a half-bridge driver input. Quote Link to comment Share on other sites More sharing options...
audioguru Posted December 18, 2005 Report Share Posted December 18, 2005 When the window comparator turns on, it pulls the + input of the right comparator below the - input, turning it on. The output of that right comparator pulls the + input low aswell, thus keeping it on (at least until power is removed from the whole circuit) even if the window comparator turns off again.Does that sound plausible?Yes, I see the latching effect of the Schmitt-trigger now.Also does shifting that 2k resistor provide some current limitation to protect the PNP transistor now?On the very 1st day of my engineering job at Philips I was shown the datasheet of a silicon transistor that showed its Absolute Maximum Ratings. The emitter-base junction was rated at 5V. I was told NOT TO GO THERE!The emitter-base junction is tiny and therefore is not able to dissipate any heat like a zener diode when it has avalanche breakdown. Little hot-spots are melted/eaten in it which reduces the transistor's gain over time until it fails.You don't show if the PWM signal sinks or sources current so I don't know what the PNP transistor will do as a gate. Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 18, 2005 Author Report Share Posted December 18, 2005 So, is the schmitt trigger better with the diode, or the 10k resistor?The PWM signal should be sourcing from the left, and sinking to the right (if that makes sense).Should I set up a voltage divider to get 5v or so (my one has 6v emitter-base voltage) to the base of the PNP transistor.The idea is to make sure that the transistor is stopping the signal, until the window comparator turns it on (then it stays on), without affecting the signal in anyway. Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 20, 2005 Author Report Share Posted December 20, 2005 Okay, how about this setup? It should have a much lower voltage going to the base of the PNP transistor.I must admit though, I dont really understand how this whole emitter-base voltage limitation works. Quote Link to comment Share on other sites More sharing options...
audioguru Posted December 20, 2005 Report Share Posted December 20, 2005 I can't explain it until I know how high and how low is the voltage swing of the PWM signal. Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 20, 2005 Author Report Share Posted December 20, 2005 Okay - the PWM signal is generated by an SG3524 chip. The output is the 2 open emitters of the chip joined together.The datasheet says the emitter output voltage is typically 18v, though since the chip is being driven by 12v (or close enough to) I would say that it would be at most 13v (since my battery doesnt tend to give more than that).I would say that 0v would be the lower limit, unless there are some negative spikes in the PWM signal. I dont have an o-scope so I cant confirm that.That output connects to the input of an IR2184 half bridge driver, and a connection to ground via a 1k resistor.BTW this is all from my previous schematics that you have helped me with.I hope that clears things a little? If not, tell me what I need to find out (and how to, because we can be quite stupid here in NZ sometimes). Quote Link to comment Share on other sites More sharing options...
audioguru Posted December 20, 2005 Report Share Posted December 20, 2005 You are in NZ? Isn't everything upside-down there? ;DWhen the PNP is supposed to be off, when the PWM's voltage exceeds the divider's 5V by 0.6V then it turns on.When the PNP is supposed to be on, the LM339 feeds it a weak base current so it will be a resistance that might slow-down the rise and fall times of the PWM signal it passes. Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 20, 2005 Author Report Share Posted December 20, 2005 Yip, but we compensate by walking around on our hands alot of the time, and watching tv standing on our heads so we can understand our northern hemisphere brothers.That and the water swirls the opposite down the plug hole. Freaks alot of tourists out. They think its some kind of south pacific voodoo equivalent. If the PNP is going to turn on when the PWM pulse goes 0.6v above the voltage on the base of the transistor, wouldnt 12v with a current limiting resistor be better? Would that stop it from turning on?Would it be better to try and redesign the system to use an NPN transistor? If I could do that, is there a way to stop the voltage on the base of the NPN(to turn it on) from passing through and messing up the PWM pulse by making the IR2184 go high on the input? (or have I misunderstood things again with these bloody transistors) Quote Link to comment Share on other sites More sharing options...
audioguru Posted December 20, 2005 Report Share Posted December 20, 2005 If you want a transmission gate then use a transmission gate. A Cmos CD4066 quad transmission gate IC works well with a 12-13V supply and is about 100 ohms when on and infinite when off. 4 of them in the package can be paralleled for 25 ohms on resistance. The positive supply or a little less turns them on and ground or up to a couple of volts turns them off. ;D Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 20, 2005 Author Report Share Posted December 20, 2005 HA!Maybe I should start all my posts with "is there such a device that does this ....."Okay, i'll look up transmission gates and redesign it.Is the window comparator (with the negative reference for the lower end) and the schmitt trigger to keep it on all kosher? Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 20, 2005 Author Report Share Posted December 20, 2005 Hi guys, here is the latest incarnation of the inhibitor switch....Hopefully, it works like this (please correct me if I am wrong)....When the window comparator is outside the range of say -0.5v to +0.5v then it will be off. That will mean that on the next comparator the - input (9v) is greater than the + input (6v) so it will be on, thus grounding the CD4066 and turning the switch off, inhibiting the signal (and turning on the LED).When the Vin of the window comparator enters the above range, it should turn on, thus grounding the - input of the next comparator making it less than the + input and turning the comparator off. When it turns off, the + input should now be raised to about 9.5v through the 2k resistor, the LED (hence the drop) and the feedback line from the output. This should also turn on the CD4066 enabling the signal. The LED should also get very very dim at this point.Now even if the window comparator turns off again (being outside the range) the + input (9.5v) should still be greater than the - input (9v) and keep the comparator off and the CD4066 on.The only way to reset everything should be to cut power to everything.How does that all sound? Quote Link to comment Share on other sites More sharing options...
audioguru Posted December 20, 2005 Report Share Posted December 20, 2005 Your new circuit depends a lot on a low voltage across the LED (less than about 2V). It would be better if you used an opamp for the Schmitt trigger and have the CTRL input of the CD4066 driven very high and low by its output. Then you can use a little 8-pins LM393 dual comparator instead of the big LM339 quad comparator.You might as well parallel all 4 transmission gates in the CD4066. Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 20, 2005 Author Report Share Posted December 20, 2005 Just to clarify....Am I correct in thinking that your standard comparator can only sink current on the output (ie drag the output to ground), and that op-amps can either source or sink current on their output? Quote Link to comment Share on other sites More sharing options...
audioguru Posted December 20, 2005 Report Share Posted December 20, 2005 Just to clarify....Am I correct in thinking that your standard comparator can only sink current on the output (ie drag the output to ground), and that op-amps can either source or sink current on their output?Correct. A standard comparator has just the collector of an NPN transistor at its output. An opamp has a complimentary NPN-PNP set of emitter-followers with their emitters (and maybe a series resistor of about 75 ohms) at their output. Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 21, 2005 Author Report Share Posted December 21, 2005 Is it going to be alright to have a negative voltage as a reference on the window comparator?I vaguely remember seeing something in a datasheet saying inputs needed to not go below -0.3v. Quote Link to comment Share on other sites More sharing options...
audioguru Posted December 21, 2005 Report Share Posted December 21, 2005 It's a can of worms!I didn't notice the negative input voltage that is bad for the comparator. You could level-shift it up to a positive voltage with a voltage divider or inverting opamp circuit. Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 21, 2005 Author Report Share Posted December 21, 2005 Hmm, it might be more sensible to ensure that the Vin is always going to be +ve, then I could get away with a normal comparator instead of a window comparator.Is there such a device that can leave a +ve voltage alone, but change a -ve voltage to a positive one? Quote Link to comment Share on other sites More sharing options...
audioguru Posted December 21, 2005 Report Share Posted December 21, 2005 An inverting opamp can have a negative input voltage on its input resistor, and the negative feedback through its feedback resistor causes its output to be positive.The circuit can't have much gain to avoid having the opamp's input from becoming negative. Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 21, 2005 Author Report Share Posted December 21, 2005 Wouldnt an inverting op-amp cause any positive voltage on the input to change to negative?The Vin for the circuit is from the sense resistor from one leg of the motor H-bridge. Depending on what the motor is doing, it could be positive or negative.If it's positive, it needs to stay positive. If it's negative, it needs to be inverted. Quote Link to comment Share on other sites More sharing options...
audioguru Posted December 21, 2005 Report Share Posted December 21, 2005 An inverting opamp with only a positive supply will have a positive output voltage with a negative input voltage and its output will be close to ground with a positive input voltage. Quote Link to comment Share on other sites More sharing options...
MrHeckles Posted December 21, 2005 Author Report Share Posted December 21, 2005 So if the inverting opamp receives a decent +ve input, then it will still only be close to ground for the output?Have you had any experience with absolute value circuits? I think thats what I need, so I can preserve the value of the input (regardless of whether its positive or negative).That way I can set up current limitations for forward, reverse, forward regen and reverse regen on the motor. Quote Link to comment Share on other sites More sharing options...
audioguru Posted December 21, 2005 Report Share Posted December 21, 2005 A absolute value circuit is a full-wave rectifier that uses two opamps. Usually one of the opamps needs negative and positive supplies. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.