Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
February 09, 2023, 12:12:28 00:12


Login with username, password and session length


Pages: [1]
Print
Author Topic: Problem importing simple PSpice model into Micro-Cap  (Read 525 times)
0 Members and 1 Guest are viewing this topic.
LithiumOverdosE
Senior Member
****
Offline Offline

Posts: 340

Thank You
-Given: 360
-Receive: 529


« on: January 14, 2023, 01:06:04 01:06 »

I imported all sorts of models into Micro-Cap 12.2.0.5 with more or less no issues by using Component Editor/Add Part Wizard.

However, IL300 linear opto model from Vishay (which is quite simple) is throwing back at me the following error: "Name 'IL300' not found in library 'C:\MC12\Library\IL300.lib'." although the name of .subckt  in IL300.lib is indeed IL300.
I also tried using Component Editor/Import Wizard and sure enough Micro-Cap simply states that library IL300.lib contains 0 Subckts and 0 Models.

The original Vishay IL300 model:
Code:
* Library of Linear Optocoupler IL300
* Copyright VISHAY, Inc. 2019 All Rights Reserved.
** Default K1 = 0.012, K3 = 1, K2 = K3* K1 = 0.012
* Node SYMBOL
*  1 LEDC
*  2 LEDA
*  3 PD1 cathode
*  4 PD1 anode
*  5 PD2 anode
*  6 PD2 cathode
**--------------------------------------------------**
.SUBCKT IL300  LEDC LEDA PD1_C PD1_A NC_1 NC_2 PD2_C PD2_A PARAMS: K1=0.012 K3=1

DLED LEDA 10 DEMIT
VV1  10 LEDC 0

FPD1 PD1_C PD1_A VALUE {K1*I(VV1)}
CPD1 PD1_A PD1_C 12P
RD1  PD1_A PD1_C 15G

FPD2 PD2_C PD2_A VALUE {K3*K1*I(VV1)} ;K2=K3*K1
CPD2 PD2_A PD2_C 12P
RD2  PD2_A PD2_C 15G

Rdummy1 NC_1 0 4G
Rdummy2 NC_2 0 4G

.model DEMIT D IS=1.51E-16 N=1.495822 RS=2.624361 BV=5 IBV=1U
+ CJO=15P VJ=1 M=0.5 EG=1.424 TT=500N
.ENDS



While Micro-Cap usually recognizes appropriate .subckt name, in this case it simply ignores it although the syntax in model appear to be correct.

Does anyone has some idea what could be the reason for Micro-Cap importer to ignore the name of .subckt IL300?
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4575

Thank You
-Given: 813
-Receive: 3883


There is no evidence that I muted SoNsIvRi


« Reply #1 on: January 15, 2023, 04:33:52 16:33 »

is it a sytax error in text in both upper and lowercase.
Logged

Note: I stoped Muteing bad members OK I now put thier account in sleep mode
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 911

Thank You
-Given: 224
-Receive: 892



« Reply #2 on: January 15, 2023, 05:33:13 17:33 »

In this thread another model for the IL300 is discussed. Perhaps this model will work for you
I have not tested it my self, but I have used the IL300 in some designs. At the time I used it, it was made by Agilent. And they stated that the accuracy was about what you get from a 12 bit ADC ish
https://maker.pro/forums/threads/il300-analog-optoisolator-model-problem.43736/
Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
LithiumOverdosE
Senior Member
****
Offline Offline

Posts: 340

Thank You
-Given: 360
-Receive: 529


« Reply #3 on: January 16, 2023, 10:55:38 10:55 »

is it a sytax error in text in both upper and lowercase.

The syntax shouldn't differentiate between upper and lower case but I tried it and it doesn't make any difference.
The subckt IL300 is not recognized.
I also tried changing the name of the model with the same unsuccessful result.
In fact for some reason MC doesn't recognize any subckt within that particular model.


In this thread another model for the IL300 is discussed. Perhaps this model will work for you
I have not tested it my self, but I have used the IL300 in some designs. At the time I used it, it was made by Agilent. And they stated that the accuracy was about what you get from a 12 bit ADC ish
https://maker.pro/forums/threads/il300-analog-optoisolator-model-problem.43736/

I tried that model with the same result - MC simply doesn't recognize subckt (regardless if one or two dots in are used at beginning of lines).


To me it looks like MC for some reason doesn't recognize subckt in both models or perhaps some part of the subckt.
However, usually if there is some part of the subckt not recognized MC should throw a different error.
It happened with some other models but then I knew exactly which component bothered it and solved it manually by adjusting the model.
Logged
optikon
Cracking Team
Hero Member
****
Offline Offline

Posts: 836

Thank You
-Given: 1064
-Receive: 1967


« Reply #4 on: January 16, 2023, 03:47:57 15:47 »

@lithium,

any chance you did a copy paste form somewhere and there is some non visible character in there that MC doesnt like?

How about try re-write the model starting simple: No header * comments and just write new a .subckt line and .ends.
The initial re-write wouldnt work of course but it makes it so simple as to narrow down the issue. And likewise, if it works, then keep adidng the guts until its done or you  find the problem.

What are you up to with the IL300.. some isolated amplifier? can you post a circuit for curious minds.. :-)
Logged

I can explain this to you. I can't comprehend it for you.
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 911

Thank You
-Given: 224
-Receive: 892



« Reply #5 on: January 16, 2023, 04:25:36 16:25 »

@lithium,

any chance you did a copy paste form somewhere and there is some non visible character in there that MC doesnt like?

How about try re-write the model starting simple: No header * comments and just write new a .subckt line and .ends.
The initial re-write wouldnt work of course but it makes it so simple as to narrow down the issue. And likewise, if it works, then keep adidng the guts until its done or you  find the problem.

What are you up to with the IL300.. some isolated amplifier? can you post a circuit for curious minds.. :-)

Try this link https://www.vishay.com/docs/83708/appnote50.pdf
The concept is quite nifty. The transfer function for a LED and a photo transistor is not linear. But they use a second photo transistor in a feedback loop to compensate for this error
Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
optikon
Cracking Team
Hero Member
****
Offline Offline

Posts: 836

Thank You
-Given: 1064
-Receive: 1967


« Reply #6 on: January 16, 2023, 04:33:22 16:33 »

Try this link https://www.vishay.com/docs/83708/appnote50.pdf
The concept is quite nifty. The transfer function for a LED and a photo transistor is not linear. But they use a second photo transistor in a feedback loop to compensate for this error

Yes, Ive used the part before.. Ive made an isolation amplifier and other things with it. It has some interesting application possibilities. However, it wont be great for high precision, it will only be as good as the feedback diode matching - which isnt great, but good enough for say woodworkers.. :-)

I never used a spice model for it but it could be handy if the bugs can get worked out of it for Microcap.

Logged

I can explain this to you. I can't comprehend it for you.
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 911

Thank You
-Given: 224
-Receive: 892



« Reply #7 on: January 16, 2023, 08:34:38 20:34 »

I never used a spice model for it but it could be handy if the bugs can get worked out of it for Microcap.
Well yes and no. In this case I think the spice model is way to perfect. And as I have said before the performance of the IL300 kind of comparable to a 12 bit ADC ( this is from the Agilant data sheet way back in time). I have never used Micro Cap so I do not know what to fix this issue. But I agree with Pickit I think it is perhaps a upper lower case typo some place here.
Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
LithiumOverdosE
Senior Member
****
Offline Offline

Posts: 340

Thank You
-Given: 360
-Receive: 529


« Reply #8 on: January 17, 2023, 10:09:16 10:09 »

@lithium,

any chance you did a copy paste form somewhere and there is some non visible character in there that MC doesnt like?

How about try re-write the model starting simple: No header * comments and just write new a .subckt line and .ends.
The initial re-write wouldnt work of course but it makes it so simple as to narrow down the issue. And likewise, if it works, then keep adidng the guts until its done or you  find the problem.

What are you up to with the IL300.. some isolated amplifier? can you post a circuit for curious minds.. :-)


I used Vishay model without any changes but your idea on working my way up from empty subckt is an interesting one that I'll try and see what happens.

I'm designing a two quadrants HV amplifier with first quadrant being realized as active (flyback) and second quadrant realized by using passive resistive current sink.
As part of the device's function in a more complex setup discharges/transients sometimes appear on common rail which is a problem for MCU which is used for ADC measurement/calculations.
So I decided to use linear opto to entirely separate amp output from MCU and found out that IL300 is commonly available pretty much everywhere.
Micro-Cap supports nonlinear magnetic cores so it was a logical choice for sim and so far it pretty well corresponds with reality.
Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 911

Thank You
-Given: 224
-Receive: 892



« Reply #9 on: January 17, 2023, 01:24:39 13:24 »

This is what you must do. I do not know why exactly
1 Create a new *.lib file
 2 Copy and past the model file into this file
3 Save it
4 Now you can use the add part wizard
PS as the spice model source I used cut and paste from this post (code window)
Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
LithiumOverdosE
Senior Member
****
Offline Offline

Posts: 340

Thank You
-Given: 360
-Receive: 529


« Reply #10 on: January 18, 2023, 10:51:56 10:51 »

This is what you must do. I do not know why exactly
1 Create a new *.lib file
 2 Copy and past the model file into this file
3 Save it
4 Now you can use the add part wizard
PS as the spice model source I used cut and paste from this post (code window)

It works!
It never occurred to me to copy subckt section into a new file.
I guess Vishay model contains some additional special characters. Roll Eyes
Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 911

Thank You
-Given: 224
-Receive: 892



« Reply #11 on: January 18, 2023, 02:03:32 14:03 »

It works!
It never occurred to me to copy subckt section into a new file.
I guess Vishay model contains some additional special characters. Roll Eyes
Took a look at it in a hex editor. It looks like it is coded in UTF16 but not the first char that is UTF8. And it also look like micro cap terminate reading  files when it finds 0x00. So it is really messed up from Vishay. Well what todo. Open such file in notepad. Save it as a UTF8 file. Drag and drop it into micro cap. Edit the first line, as it is somewhat garbled in the first ASCII chars. Save and you are good to go
Edit: A way to check this is to just drag and drop the file into Micro-Cap. If it do not show up as expected just do as described. You can not open the file in say notepad and when cut and paste in Micro-Cap if the source is UTF16. I was kind of lucky in my first attempt because the file in the code windows in your post was actually converted to UTF8 somehow. So the file must be converted to UTF8
« Last Edit: January 18, 2023, 08:42:26 20:42 by Sideshow Bob » Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
LithiumOverdosE
Senior Member
****
Offline Offline

Posts: 340

Thank You
-Given: 360
-Receive: 529


« Reply #12 on: January 19, 2023, 11:00:55 11:00 »

Thank you for the thorough analysis.  Wink
I never drag and drop files into MC otherwise I might have seen it.  Roll Eyes
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC