RPM Window & WOT switch, 2x lm2907 + lm111 voltage comparator ?

Thread Starter

carl0s

Joined Apr 25, 2010
40
Aw cool. I'm downloading LTspiceIV right now, will see if it works in wine.
My actual trigger is an engine that doesn't have an exhaust system yet, so I can't start it.
I'll get a schematic of my 555 timer circuit, but it's basically as simple as possible. 555 + 1 cap between pins 1 (gnd)+2, resistor between 2+7, short between 2 & 6, and a pot between 7 & 8 (vcc in).

On the output I simply have a resistor & led in series. I'll try to find/draw a schematic :)
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, well - did you see the instructions that I posted along with the .zip file?

Put the contents of the .zip file in the appropriate subfolders.

LTSpice also comes with quite a few sample simulations. Poke around in there and get your feet wet with them. Some of them are mighty interesting.
 

Thread Starter

carl0s

Joined Apr 25, 2010
40
OK, well - did you see the instructions that I posted along with the .zip file?

Put the contents of the .zip file in the appropriate subfolders.

LTSpice also comes with quite a few sample simulations. Poke around in there and get your feet wet with them. Some of them are mighty interesting.
I haven't downloaded your zip yet, just the LTSpice program and looked at a couple of examples. I'll get your zip file too now. Thanks :)
 

SgtWookie

Joined Jul 17, 2007
22,230
One somewhat odd quirk about LTSpice is that if you add .asy (symbol) files outside of LTSpice while it's running, it won't "see" them until you exit and re-start LTSpice.
 

SgtWookie

Joined Jul 17, 2007
22,230
Now that you've installed the model, symbols, and copied the .asc files to your LTSpice directory, you should be able to load and run them.

Load up:
LM2907-8 test.asc
The schematic should appear.
Click the "Run" icon on the menu bar (the man running). After a moment, you'll get a black pane titled "LM2907-8 test.raw" with numbers running along the bottom.
To make things a bit easier to deal with,
1) Click somewhere in the .asc frame to make sure it's selected,
2) On the menu bar, click "Windows", then "Tile Horizontally".
3) On the menu bar, click "View", then "Zoom to fit".

Then try clicking on various wires in the simulation, for example at "Out" and "Out2", and to the left and right of C3.

Try changing the frequency of V2. Right-click on the icon for V2, and change the frequency from .4k (400Hz) to 1kHz, and run the simulation again. Notice that the output voltage at Out2 is higher than when V2 was 400Hz.

If you set V2 for too high of a frequency for the components being used, odd things will happen that don't occur with the real IC.
 

SgtWookie

Joined Jul 17, 2007
22,230
Ahh, ok. Forgot that little detail.

In LTSpiceIV\lib\cmp, you will find Standard.dio
Make a new subdirectory, call it \backup
Copy standard.dio into the backup directory.

Then edit standard.dio using a text editor (it's just plain text)

Copy and paste the following into standard.dio:

*-------- begin added diodes
.model 1N5817 D(Is=31.7u Rs=.051 N=1.373 Cjo=190p M=.3 Eg=.69 Xti=2 Iave=1 Vpk=20 mfg=Motorola type=Schottky)
.model 1N5818 D(Is=31.7u Rs=.051 N=1.373 Cjo=160p M=.38 Eg=.69 Xti=2 Iave=1 Vpk=30 mfg=Motorola type=Schottky)
.model 1N5819 D(Is=31.7u Rs=.051 N=1.373 Cjo=110p M=.35 Eg=.69 Xti=2 Iave=1 Vpk=40 mfg=Motorola type=Schottky)
.model 1N746 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=3.3 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=3.3 mfg=Motorola type=zener)
.model 1N747 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=3.6 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=3.6 mfg=Motorola type=zener)
.model 1N748 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=3.9 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=3.9 mfg=Motorola type=zener)
.model 1N749 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=4.3 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=4.3 mfg=Motorola type=zener)
.model 1N750 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=4.7 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=4.7 mfg=Motorola type=zener)
.model 1N751 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=5.1 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=5.1 mfg=Motorola type=zener)
.model 1N752 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=5.6 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=5.6 mfg=Motorola type=zener)
.model 1N753 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=6.2 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=6.2 mfg=Motorola type=zener)
.model 1N754 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=6.8 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=6.8 mfg=Motorola type=zener)
.model 1N755 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=7.5 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=7.5 mfg=Motorola type=zener)
.model 1N756 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=8.2 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=8.2 mfg=Motorola type=zener)
.model 1N757 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=9.1 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=9.1 mfg=Motorola type=zener)
.model 1N758 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=10 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=10 mfg=Motorola type=zener)
.model 1N759 D(Is=.88f Rs=.25 Cjo=175p M=.55 nbv=1.7 bv=12 Vj=.75 Isr=1.86n Nr=2 Ibv=20.245m Ibvl=1.96m Nbvl=15 Tbv1=-21.3u Vpk=12 mfg=Motorola type=zener)
.model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=Motorola type=silicon)
*-------- end added diodes

It doesn't matter WHERE in the file you put them, however every .model entry needs to have a unique name. If you paste it in more than once, LTSpice will complain about it.

Then save the file. LTSpice will find it the next time you run the simulation.
 

Thread Starter

carl0s

Joined Apr 25, 2010
40
Ah, it's doing something. Hmm. That's very clever. For some reason I thought I was going to have to create some kind of input or something. Hmm. I need to think more about this but it looks like a really handy tool! I have been using breadboard/protoboard anyway, but this sure is a cool way of doing things! Kind of cheaper too, but I already bought the scope. oh well :D
 

Thread Starter

carl0s

Joined Apr 25, 2010
40
So SINE(0 .1 .4k) is the simulated frequency input? When I look at that, it looks like a constant frequency. Is that correct? Is it possible to make it like a ramping frequency, e.g steady increase form 8hz to 50hz over 500msec or something?
 

SgtWookie

Joined Jul 17, 2007
22,230
Yes; there is a special function under the "misc" directory called "modulate".

It takes DC level inputs and creates AM and FM output sine waves.

It's use is demonstrated in the Examples\Educational\PLL.asc file.

From the LTSpice help file:
------------------------------------------------------------------------------------
The MODULATE device is a voltage controlled oscillator. See the example schematic .\examples\Educational\PLL.asc. The instantaneous oscillation frequency is set by the voltage on the FM input. The conversion from voltage to frequency is linear and set by the two instance parameters, mark and space. Mark is the frequency when the FM input is at 1V and space is the frequency when the input is at 0V. The amplitude is set by the voltage on the AM input and defaults to 1V if that input is unused(connected to the MODULATE common).
------------------------------------------------------------------------------------
You can use the existing V2 to change the FM input. Just change the frequency of V2 to something slow, like .1Hz, and the voltage of 0.5 with an offset of 0.5.
Set the value of Mark=yourhighfrequency, and Space=yourlowfrequency.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Well, I was off just a bit - been a week or so since I've used the Modulate function.

Anyway, see the attached .asc and .png files. The green trace is the signal input.

Modulate is set up to output 2kHz at mark (1v in), 0Hz at space (0v in). V2 is set up to produce a 1Hz sine wave that measures 1V p-p, and is centered around 0.5v.

If you run the simulation with default SPICE parameters, you may receive a "Timestep too small" error message, and the simulation stops.

If so, go to "Tools", "Control Panel", and click on the "SPICE" tab.
Change Gmin and Abstol from 1e-12 to 1e-10
Change Chgtol from 1e-14 to 1e-12
Change Trtol from 1 to 7
and re-run the simulation.

You could also use PULSE instead of SINE.

Use inputs of 0, 1, 0, 1 (and blank for everything else) and run it.

See the 2nd image attachment.
 

Attachments

Last edited:

Thread Starter

carl0s

Joined Apr 25, 2010
40
Well, to complicate matters even more, I had forgotten that I also need to allow for a pressure switch. This is a 0 - 5v transducer (apparently), and I will want to enable the A/C when the sensor's voltage output is ~2.2 - 2.8v (for example).

So does this mean I need to change to a quad-comparator, i.e. a dual window comparator ? My circuit needs to switch "ON" when: voltage 1 (from f2v tach circuit) is between 2 & 4v, AND when voltage 2 (pressure) is between 2.2 and 2.8v. At all other times it must stay OFF.

I don't suppose you could give me some quick tips for where to start to understand how to configure these comparators ? i.e. I presume at its simplest it's a case of using a capacitor and resistor (or two) to set the "window" of the window comparator?

I am still trying to understand where to start with LTSpice, but it does look like the perfect tool for this sort of stuff..
 

Thread Starter

carl0s

Joined Apr 25, 2010
40
I seem to now understand the LTC1042 window-comparator "test fixture" in LTSpice. I can see how the input corresponds to both the WITHIN and ABOVE outputs :)
 
Last edited:

Thread Starter

carl0s

Joined Apr 25, 2010
40
Hey, this LTC1042 window comparator seems to be really really easy to use. Things like "Width" and "Centre".. How friendly, especially with LTSpice. It seems almost too easy though.. Is this an unusual window comparator, or do other comparators have things like "Width" and "Centre" for specifying the window ?

(BTW, only reason I am playing with LTC1042 is because that's the only Window Comparator I can see in LTSpice)
 
Top