LTspice-library: include component and change parameters

Discussion in 'Programmer's Corner' started by Leo Silver, Oct 7, 2016.

  1. Leo Silver

    Thread Starter New Member

    Apr 27, 2016
    26
    0
    Hi all,
    I am new to LTspice and I wanted to know if I could change the parameters of a material. I tried to just open the standard.dio library at the ...\lib.cmp as a .txt, write a new line of a diode with the same syntax as the rest of the components and save it. When I right-click a diode in my schematic in order to pick one of my library, I cant find the new diode I created. Is this the wrong way to do it? Sometimes this change also leads to not been able to select my library. The LTspice will browse and ask me to choose a library. When I select the standard.dio it just doesnt accept it. What am I doing wrong?
     
  2. ci139

    Member

    Jul 11, 2016
    341
    38
    before you start hacking your standard.dio backup/copy it to standard.dio.bkp or alike
    then open file in LT Spice by all files file mask *.* from G:\USER\Programs\LTC\LTspiceIV\lib\cmp (in my case)
    don't use existing model names
    if you want to alter few parameters only use as in .bjt
    .model FZT849 NPN(IS=5.8591E-13 .... ; (C) 1993 ZETEX PLC, Last revision 14/3/97
    .model ZTX849 ako:FZT849 NPN(Vceo=30 Icrating=7 mfg=Zetex) <-- altered fields for a new model the ZTX849
    for diodes there's obviously modelName D(params ...
     
  3. Leo Silver

    Thread Starter New Member

    Apr 27, 2016
    26
    0
    Hello and thanks for your answer. Unfortunately this doesnt seem to work. When I change something in my library it doesnt appear on the components list in LTspice. I also tried to include the library in the path of spice in Tools/control panel...this didnt work either...any ideas?
     
  4. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,801
    1,105
    Where is your amended library located? By default, LTspiceXVII will look in the .....User\Documents\LTspiceXVII\..... folders.
     
    Leo Silver likes this.
  5. ci139

    Member

    Jul 11, 2016
    341
    38
    ok
    ups!
    ??? You may not upload any more files with this message. You may attach 10 files in total. -- so why don't you do this MF-s -- people like wasting other people time . . . AH-s
    SC107436.png SC107469.png SC107483.png SC107550.png SC107587.png SC107615.png SC107832.png
     
    Leo Silver likes this.
  6. ci139

    Member

    Jul 11, 2016
    341
    38
    follows
    SC107849.png SC107902.png SC107926.png SC107954.png SC107968.png SC107980.png SC107992.png
     
    Leo Silver likes this.
  7. Leo Silver

    Thread Starter New Member

    Apr 27, 2016
    26
    0
    I get this message when I try to save in the directory:
    C:\Program Files\LTC\LTspiceXVII\lib\cmp
    but there seems to be another path in documents that allows me to save:
    C:\Users\leonidas\Documents\LTspiceXVII\lib
    ps. thank you so much for all your effort and the attached images step by step
    upload_2016-10-9_14-21-27.png
     
  8. Leo Silver

    Thread Starter New Member

    Apr 27, 2016
    26
    0
    Hi Alec I tried to do the same there doesnt work either..I dont know what I am doing wrong..Is it my laptop?
     
  9. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,801
    1,105
    Have you checked that the file or folder isn't write-protected?
    Do you have admin rights for write-access to the file?
     
  10. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,810
    834
    I am not near my computer, but as I remember, to use customized components you must have your library tree location in the Users directory. AND you must tell LTSPICE that you have changed your default location.

    This is where not having access to my computer is going to be a liability. I can't confirm how to change the default location. Perhaps someone else can help. It is modified under your system preferences.
     
  11. crutschow

    Expert

    Mar 14, 2008
    13,028
    3,237
    Have you closed and reopened LTspice after the change?
     
  12. Leo Silver

    Thread Starter New Member

    Apr 27, 2016
    26
    0
    Thanks eveyone!Sooo I fixed it but still I dont understand fully what was its issue. For someone who may have the same issue in the future what I did was to include the path of the library for the diodes which was in the Documents in the control panel of ltspice and completely remove the library from the program files/LTC/library/cmp direction. Then when I right clicked the component and it asked me for the library and I showed it the one that I stored in the documents. Now every time I change something in the library I just restart LTSpice and there it is! This way I managed to avoid the limitations of rights (which I dont understand as I am the administrator and I dont have any issues with other folder access..)
    Thank you all and I hope this will help someone else too because it took me almost a day to set it!
     
  13. ci139

    Member

    Jul 11, 2016
    341
    38
    if your OS is windows you can try right-clicking the folder and uncheck the read only opening the explorer with admin rights 1-st

    adding a random component only has some point if you can confirm all of it's relevant behavioral aspects for your simulation that are usually not fully determined by product data sheet
    the newer v.-s of spice list a lot of components that you can adapt the substitute for your needs (except for some a special purpose transistors and diodes)

    only mod i have found practical so far is defining a new transistor -- based on nearest subst. -- with new (lower) hFE (if i will use such a lot)
     
Loading...