Why doesn't this cct simulate without R7?

Discussion in 'The Projects Forum' started by towheedm, Jun 29, 2013.

  1. towheedm

    Thread Starter New Member

    Jun 16, 2013
    13
    0
    I've been at this for a while now and cannot seem to figure it out.

    With reference to the attached LTSpice cct. As it is, it works and both comparator switches. However, with R7 replaced with a short, comparator U2 does not switch. As you can see from the schematic, it's set to 1μΩ (effectively, a short?).

    Any help is greatly appreciated. Thanks.
     
  2. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    Not everyone uses LTSpice. Can you post the schematic?
     
  3. towheedm

    Thread Starter New Member

    Jun 16, 2013
    13
    0
    I'm not sure what format or netlist, so here's a JPG image of it. If you need it in a specific format, let me know.

    I'll probably retry it with NGSpice or GNUCap.
     
    • comp.jpg
      comp.jpg
      File size:
      224.3 KB
      Views:
      46
  4. LDC3

    Active Member

    Apr 27, 2013
    920
    160
    With the low resistance of R7, the voltage is influence by the voltage divider of the input and the voltage from the other op-amp. There are 2 reasons why the simulation does not work.
    1) Without the resistance, the voltage level is too low to ever trigger a change.
    2) The simulation does not accuracy match the real world and the circuit will work.
     
  5. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    Is this suppose to be a window comparator ... ensuring a voltage is within a prescribed value?

    I'm curious as to the function of R6, R11, R5, and R12 in your circuit. Those are not in a classical comparator.
     
    Last edited: Jul 1, 2013
  6. towheedm

    Thread Starter New Member

    Jun 16, 2013
    13
    0
    LDC3: I've had similar problems with different comprator ccts simulating with NGSpice and GNUCap. I've had to split a net into 2 with even a very small resistor for the cct to simulate. One of the reason I started using LTSpice was to avoid such unforeseen problems in the simulation. I'm new to Spice and EDA software on the whole. I know for a fact that the cct will work in the real world without R7. I'm just curious why it happens in 3 distinctly separate simulators.

    JoeJester: Yes, it is a basic window comparator. Those resistors are used to provide hysteresis for the upper and lower trip points. As the cct is, U1 goes high when V2 crosses 25Vrms and goes back low when V2 drops below 24.5Vrms. Similarly, U2 switches when V2 goes below 22Vrms and then switches back when it goes above 22.5Vrms. The combination of R6 and R11 provides the 0.5V hysteresis for the upper limit, while R5 and R12 provides the 0.5V hysteresis for the lower limit.

    Without R11 and R12, R5 and R6 becomes needlessly large. I guess without these, they are replaced by the output Z's of Vref-lo and Vin (am I correct?). They also allows a fairly constant hysteresis value across the range that can be set for the upper and lower limits as set by the position of the pots U8 and U7.

    In the real world, R7 is absolutely unnecessary, but again, is required for U2 to simulate properly.
     
  7. LDC3

    Active Member

    Apr 27, 2013
    920
    160
    If that is the case, then the model used to simulate the IC is incorrect. You will need to talk to the manufacturers of the IC to get a better model.
     
  8. towheedm

    Thread Starter New Member

    Jun 16, 2013
    13
    0
    Well I thought about the model being incorrect. But the same happens with the LM393 dual comp, the LM339 quad comp and the LM324 op-amp. Can all of them be incorrect? These models were D/L'ed from the TI site.

    I'll try with another manufacturer and see what happens.

    EDIT: Another way the cct will simulate is if I replace R7 with a unity gain non-inverting buffers.

    EDIT: I've tried with the model from ST's site. Same results.
     
    Last edited: Jul 1, 2013
  9. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    Last edited: Jul 2, 2013
  10. LDC3

    Active Member

    Apr 27, 2013
    920
    160
    You should try it with a resistance that works and decrease it until it the simulator fails. That way you will know what the minimum resistance is needed so you won't have problems like this in the future (which might not be so easy to find).
     
  11. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
  12. towheedm

    Thread Starter New Member

    Jun 16, 2013
    13
    0
    I will look at this tonight.

    BTW What simulation software are u using?

    tks for all your help.
     
  13. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    I use TINA ... education version ... software version 9.1 Tina-TI is texas instruments free version found at www.ti.com

    I know LTSpice's author does something to speed up the simulation, and that could be why your circuit didn't simulate without R7.

    If there is a reason for the variable resistors in the voltage regulators, that can be accomplished by putting the potentiometer between the two resistances and the arm connected to the Vref input to the TL341. If you don't absolutely need the potentiometers, I wouldn't use them.
     
  14. towheedm

    Thread Starter New Member

    Jun 16, 2013
    13
    0
    I've used them to allow adjusting the trip points. The high can be adjusted between 24.5 and 25.5 while the low can be adjusted between 21.5 and 25.0.

    I use Linux so I'm not sure if Tina will run under WINE. Guess I can try though.

    The same issue exists with both NGSpice and GNUCap.
     
  15. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    What frequency are you using, if any and you don't mind telling me ... and Is that the RMS values you stated?
     
    Last edited: Jul 2, 2013
  16. towheedm

    Thread Starter New Member

    Jun 16, 2013
    13
    0
    It's line frequency 60Hz. Those are indeed the RMS values. The input is from a 10-1 xfmr. It is part of your basic line voltage monitor.
    The other parts consists of a time delay and an over current trip with a 60s auto reset.
     
  17. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    ok...

    We can start with your basic circuit ... for Vin

    What tolerance are you looking to monitor? 5%?
     
  18. towheedm

    Thread Starter New Member

    Jun 16, 2013
    13
    0
    Lo end: 220V +/- 5V
    Hi end: 245V +/- 5V

    I don't want a fixed upper and lower limit around a nominal value. I would like to have the upper and lower limits independently adjustable.

    I've simulated your cct and this is the wavefornm for Vo lo. I've zoomed in to the switching points. You can see a distinct difference when compared to the Vhi waveform.

    As for the resistor series, I'm stuck with using the E48 series as the E96 and E192 are virtually impossible to get in my country. The only way for me to get those are from online stores, ie: if they ship overseas. Hence my resistor values seem to be E24 series. Just trying to work woth what's readily available to me.

    BTW: This is something I'm doing for fun. No real commercial application intended.
     
    Last edited: Jul 2, 2013
  19. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    I agree you need to work with whatever is available.

    So we agree that your output of the transformer is 22.0V +/0 0.5V on the low end and 24.5V +/-0.5V on the high end and the line frequency is 60 Hz.

    Are you planning on running the electronics from the same "transformer"?

    Are you planning to add a "missing pulse" detector to alarm when you have dropped cycles or half-cycles?

    Are you having visual and audible alarms or just collecting data?
     
  20. towheedm

    Thread Starter New Member

    Jun 16, 2013
    13
    0
    The power supply has it's own transformer/rectifer/regulator. There is no missing pulse detector.

    Here's V0.1 of the schematic. It's an EPS file. I've added the .zip ext to upload it.

    I'm redesigning the comps to switch low on an out-of-range voltage. This will allow me to use the comps to drive the LED's and hence eliminate the UNL2003 being used to drive the LED's.
     
Loading...