LT-Spice .ckt model import question

Thread Starter

Janis59

Joined Aug 21, 2017
1,834
Especially Crutschow probably may help me at glance now. Last time I imported sth in LT-Spice was more than year ago thus I completely forgot how to. So, I got a modell from Ti.com the LMV721.ckt. Then I pushed that into C/Programs... /LTSpice4/lib/sub under name LMV721.ckt. and restarted Spice.
At last I draw the schematics using the "custom opamp" for what right mouse and clear off all descriptors, thus the instance name =Op1 (Actually I have a complete opamp cemetery there, all dosen are identical and differs only with Op1, Op2, Op3....); Value =LMV722, Value2 =empty, Spice line =tried as empty as LMV722, Spice line2 =empty. At right on desktop .op icon and wrote .lib LMV722.ckt and put on the circuit corner.
When I ask to Run, those small black man icon in shade said [Could not open library file "LMV722.ckt"] and looked on me with despair :)
So.... Where I hide my deadly mistake??
Thanks in advance for help.
 

Thread Starter

Janis59

Joined Aug 21, 2017
1,834
PS
This is damn interesting project, where my intention is to use LMV722 for Intrumental Amp input part (I mean https://en.wikipedia.org/wiki/Instrumentation_amplifier) where those third opamp the summing one is interchanged by Burr-Brown adviced full-wave rectifier with fourth opamp in loop with one diode (I mean Fig.9 from https://cdn.hackaday.io/files/1524906524132160/PrecisionRectifiers.pdf). Intuition says, the first two opamps ought see no difference of this third. This summing opamp I have added integrator capacitance, thus the output DC should be straight proportional to input AC. But all those opamaps has floating grounds, inputs rather near to the rail voltage, and operates at rather high frequencies, thus the principle "no a step without proper modelling" ought be mandatory observed.
 

Thread Starter

Janis59

Joined Aug 21, 2017
1,834
721 is exact half of 722, which is double.
Hmmm, probably indeed I taped as thought. At morning will check; now its one o clock night. Just got ready to watch of last 5th of Chernobil. Great movie. May recommend!
Anyway, thanks. Shall tell what will turn out.
 

Thread Starter

Janis59

Joined Aug 21, 2017
1,834
Yepsssk. Now I changed to 721 but still it looks with disgrace to me.
Tried:
.lib C:\Program Files\LTC\LTspiceIV\lib\sub\LMV721.cir
.lib "C:\Program Files\LTC\LTspiceIV\lib\sub\LMV721.cir"
.lib LMV721
.lib "LMV721"
.lib LMV721.cir
.lib "LMV721.cir".... Nothing helped. Which one is right? Or all?
Then I swept off the drawing`s parameter box (attribute) line "Spice Line".
Now at least it finds the .cir but is angry to me that opamp has too much leads. Probably it means to the Vcc and gnd. Shall check about another drawing having no those feet. However - how I shall tell then I have so small as 3V3 Vcc? See screenshot in attachment.
P.S.OK, now I changed it from Opamp2 drawing to Opamp and it is angry because feet count is too small !! How it stands, if with Vcc+gnd its too big and if without its too small???
PPS: just set back to Opamp2 and averything started to work.... Have no idea why, but if works then works. Better is to not breathe until the main job is done. :)
 

Attachments

Last edited:

Thread Starter

Janis59

Joined Aug 21, 2017
1,834
Oh my poor brain, it just burned out. After half day pain over "damn why it working so much wrong" I realized why.
To verify reason, I turned gain giving resistor of transimpedance input to eternal, means gain is by definition =1 but signal on U1 and U2 outputs not correlates with U1 and U2 input even not near. As may notice, the second half have nullified integrator, but it is not interfering any way with U1 U2. Thus, seems the the .cir model is those giving the wrong results. Why???? Texas Instruments sucks or another reason? Probably one sckt may not serve simultaneaously for more than one OP, so it counts sth average between all four OPs??

The .asc file is here in attachment. So...help help help, please. Ah ya, the Ti given .cir definitions file is attached here too.

P.S. Crutschow, if You succeed to solve this, You have be earned at least a beer from me and day long free excursion at Riga and Jurmala best places by car, if anytime You will come here by fate. If I understood correctly You are my near neighbour, only 800 km eastsouthward with one boarder crossing? Feel be invited. I have friend with house at seashore, You may reserve his place there for very moderate cost indeed, our beach is very fine especially now, when +30C outside, plenty of semi-nude ladies, white soft sands, warm air and cool water at the pine-grown dunes.
 

Attachments

Last edited:

Alec_t

Joined Sep 17, 2013
14,280
You are driving the inputs with 3.3V, but the common mode input voltage range is probably only about 2.4V (interpolated from the 1.3V and 4.1V datasheet input range values for 2.2V and 5V supplies respectively).
 

Alec_t

Joined Sep 17, 2013
14,280
The TI model needs editing to make it behave properly. The problem is that, if you've used the LTspice opamp2 symbol, the LTspice pin order doesn't match that of the TI model. Replace the first line of the model with
.SUBCKT LMV721 3 2 4 5 6
 

Thread Starter

Janis59

Joined Aug 21, 2017
1,834
RE: Alec_t: wow!! OK, shall change feet numbers.
RE: Chrutschow: is said 50 mV far from the rail, approximately rail to rail? Or we have different versions of "datashit". Shall look for another versions, as if so, then it is problem for sure.
RE: reason - seems the main problem is negative signal impossibility. I must make a level shift let it never be negative.
RE: other solutions - tried current sense OP like Max9643 - but it is discontinued while this design is intended to be used for years and years. Then tried LMP8640, however it is 1) much slower, 2) have 30 dB CMMR instead of 125 dB, and have no ability for negative inputs. So, the new and fashioned stays several thousand-fold worse than those obsolete.
Anyway, seems LMP is wrong way, and Max too. But to shift to bipolar PS Im not agree as available is only +3V3 and nothing other. To reset both polarizing signal sources to lower voltage is too much difficult, because that means need for another PS again, whilst the place available is hardly small.
 

Thread Starter

Janis59

Joined Aug 21, 2017
1,834
So, I changed the feet numbers and file started to work MUCH better. Now I can work with a levels and biasing. But that at Monday not before. Now is time for beaching two days.
Alex, as I told, You have earned one my day services to You. If any plans to visit Baltic sea, just give me a message. Englishmen are saying Riga is very attractive destination (except them are predominantly drinking too much and having no interest about anything else like culture, nature, history, architecture, exhibitions - only drink - oh those cheap alcohol). Pint of bear costs 0,5-1 Eur; 500 ml vodka 3...6 Eur depending on quality. I am sitting the last minutes at work and outside some 100 Englishmen are now singing the drunk song at the pub across the street in downtown, whilst I am meditating about high matters and IC. Funny, huh?
 

Thread Starter

Janis59

Joined Aug 21, 2017
1,834
I found an another much better solution namely iNA170. Probably alone on the planet current monitoring OP permiting to measure true bipolar current. It is different from other current monitoring OP~s what demands let one feet be more positive than other permanently, or even more worse - link the Vcc to measure circuit (what in my case is AC). Seems the iNA170 is ultimate cure for all problems on this planet, probably. Thus, I made 1 and 2 feets to measure resistor 1,25 Ohm, 3 to 1,24V reference from TLV431, 4 is gnd, 5 via 18k to gnd, 6 is output via 20k, 7 is NC, 8=3V3. Output goes to biquadrant detector by LMV722 (all 20k) where summing/integrator cascade takes 20k input and 47k in loop with 10 uF. It will be part of mass product for dairy cow milking machine what tells worker when the machine-overmilking phase is beginning. One EU sponsored industrial research project. So, cows may feel true lucky. Thanks for shaping my mind!
 

Thread Starter

Janis59

Joined Aug 21, 2017
1,834
Alec_T!
Now I got the iNA170 P-Spice pack containing .DSN and .OLB and .LIB and .opj.
I now know what to do with lib, but what to do with those other, or let `em lie in one bin. But how now to write the LT-Spice directive?
 

Alec_t

Joined Sep 17, 2013
14,280
.... or if you just want to play with the Pspice lib file you could edit the first non-comment line to read .SUBCKT INA170 1 2 4 8 3 5 6 to correct the pin order to suit LTspice, assuming you left LTspice to generate the symbol.
 

Thread Starter

Janis59

Joined Aug 21, 2017
1,834
RE:Bordodynov "You'll make your life easier if you install my libraries"

Thanks a lot. This week a mountain of other fire-like jobs was fallen on me, but next week I shall sit again back to the modelling.
 
Top