Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Optocouplers SPICE models for Proteus

Status
Not open for further replies.

a_leo

New Member
Hi all,
It's already more than one month I'm struggling to have models for optocouplers VO2630 and HCPL-2430 working on Proteus 8.13. Following the examples in the Proteus help, in the past I successfully realized various models for transistors and components I needed, though my knowledge about SPICE itself is very poor. This time, despite I searched all over the web, finding some 10 different though related models for the VO2630, I wasn't able to have any working, and different errors for each of them.
I also tried to get rid of this starting with a simpler 6N137, that is the half model of VO2630 and also present in the Proteus library, hoping to understand by comparing the existent(and working) model with a downloaded one. No way. I then tried to plainly study the SPICE3F5 which is addressed as compatible to Proteus, bu I found again sintax errors due to different sintax styles.
The main problem is that I never was able to find a complete and organic list of all the Proteus SPICE commands, while that can be found for, say, Orcad. So, my first request is where I can find such a list, without it I cannot go far.
The SPICE examples given in the Proteus help are very limited and too few, for example I wasn't able to find an example for the simulation and installation of a digital part, the only label used is analog,subckt, trying digital,subckt gives an error. Then there are problems with the digital supplies: some explicitly use DPWR,DGND and I don't know how to translate it into Proteus. Not to speak about behavioural sources, that seem to have quite different sintax, and are very likely the true error cause. So I'm quite stumbling around in the dark of my unwanted ignorance. Instead of adding here some of the lots of wrong things I tried, I prefer to focalize on two model files I found on the web, hoping someone can tell me how to successfully modify and install them. Please note that to be allowed to upload the VSH_OPTO_10M file I had to change its extension from .lib to .txt, that wouldn't give any problem.
While making the device, for HCPL-2430 I have set pins A1,A2,C1,C2 as Passive; GND,VCC as Power; VO1,VO2 as Output.
Then I chose SOIC254P1030X508-8, DIL08 for PACKAGE; PRIMITIVE ANALOG,SUBCKT; SPICEFILE BrcmHCPL2430_MOD.txt;
SPICEMODEL HCPL-2430; SPICEPINS A1,C1,C2,A2,GND,VO2,VO1,VCC.
For VO2630, I set all pins as passive, except for VCC and GND, as it has open drain outputs, but am not sure it's right, because looking to the 6N137 already present in library, it has the output declared as output instead, and it's working fine. The other fields are as follows: PACKAGE SOIC254P1030X508-8, DIP762W50P254L977H451Q8; PRIMITIVE analogue,subckt; SPICEFILE VSH_OPTO_10M.LIB; SPICEMODEL VO2630; SPICEPINS A1,C1,C2,A2,GND,VO2,VO1,VCC.
To test them I used for both the same circuit shown below. The HCPL-2430 doesn't give errors on simulation, but while the LEDs give reasonable voltage and current when switched on, both outputs remain to the same voltage,around 2.26V if left open, very close to zero if connected to GND via a 1k resistor. That makes me think there is no proper value or some open connection around the behavioural block, but I'm not so skilled to fix it.
Things go worse when testing the VO2630: the simulation crashes at start, giving the errors:
SUBCKT '' used in ':U1:U11' but not found.
SUBCKT '' used in ':U1:U12' but not found.
Failed to expand subcircuits.
Simulation FAILED due to fatal simulator errors.
For what I have understood, there are errors in the AND subcircuit, just as a subcircuit lacked its name. Then I see names like $G_DPWR $G_DGND that I suspect are reserved and unsupported by the Proteus version.
Could I run this simulation step by step, I could better see when and why it crashes, but I'm not aware of such a function, neither in Proteus, nor elsewhere.
Kind regards
 

Attachments

  • HCPL-2430.PNG
    HCPL-2430.PNG
    23.3 KB · Views: 362
  • VSH_OPTO_10M.txt
    5.4 KB · Views: 306
  • BrcmHCPL2430_MOD.txt
    5.3 KB · Views: 311
Last edited:
Hi all,
It's already more than one month I'm struggling to have models for optocouplers VO2630 and HCPL-2430 working on Proteus 8.13. Following the examples in the Proteus help, in the past I successfully realized various models for transistors and components I needed, though my knowledge about SPICE itself is very poor. This time, despite I searched all over the web, finding some 10 different though related models for the VO2630, I wasn't able to have any working, and different errors for each of them.
I also tried to get rid of this starting with a simpler 6N137, that is the half model of VO2630 and also present in the Proteus library, hoping to understand by comparing the existent(and working) model with a downloaded one. No way. I then tried to plainly study the SPICE3F5 which is addressed as compatible to Proteus, bu I found again sintax errors due to different sintax styles.
The main problem is that I never was able to find a complete and organic list of all the Proteus SPICE commands, while that can be found for, say, Orcad. So, my first request is where I can find such a list, without it I cannot go far.
The SPICE examples given in the Proteus help are very limited and too few, for example I wasn't able to find an example for the simulation and installation of a digital part, the only label used is analog,subckt, trying digital,subckt gives an error. Then there are problems with the digital supplies: some explicitly use DPWR,DGND and I don't know how to translate it into Proteus. Not to speak about behavioural sources, that seem to have quite different sintax, and are very likely the true error cause. So I'm quite stumbling around in the dark of my unwanted ignorance. Instead of adding here some of the lots of wrong things I tried, I prefer to focalize on two model files I found on the web, hoping someone can tell me how to successfully modify and install them. Please note that to be allowed to upload the VSH_OPTO_10M file I had to change its extension from .lib to .txt, that wouldn't give any problem.
While making the device, for HCPL-2430 I have set pins A1,A2,C1,C2 as Passive; GND,VCC as Power; VO1,VO2 as Output.
Then I chose SOIC254P1030X508-8, DIL08 for PACKAGE; PRIMITIVE ANALOG,SUBCKT; SPICEFILE BrcmHCPL2430_MOD.txt;
SPICEMODEL HCPL-2430; SPICEPINS A1,C1,C2,A2,GND,VO2,VO1,VCC.
For VO2630, I set all pins as passive, except for VCC and GND, as it has open drain outputs, but am not sure it's right, because looking to the 6N137 already present in library, it has the output declared as output instead, and it's working fine. The other fields are as follows: PACKAGE SOIC254P1030X508-8, DIP762W50P254L977H451Q8; PRIMITIVE analogue,subckt; SPICEFILE VSH_OPTO_10M.LIB; SPICEMODEL VO2630; SPICEPINS A1,C1,C2,A2,GND,VO2,VO1,VCC.
To test them I used for both the same circuit shown below. The HCPL-2430 doesn't give errors on simulation, but while the LEDs give reasonable voltage and current when switched on, both outputs remain to the same voltage,around 2.26V if left open, very close to zero if connected to GND via a 1k resistor. That makes me think there is no proper value or some open connection around the behavioural block, but I'm not so skilled to fix it.
Things go worse when testing the VO2630: the simulation crashes at start, giving the errors:
SUBCKT '' used in ':U1:U11' but not found.
SUBCKT '' used in ':U1:U12' but not found.
Failed to expand subcircuits.
Simulation FAILED due to fatal simulator errors.
For what I have understood, there are errors in the AND subcircuit, just as a subcircuit lacked its name. Then I see names like $G_DPWR $G_DGND that I suspect are reserved and unsupported by the Proteus version.
Could I run this simulation step by step, I could better see when and why it crashes, but I'm not aware of such a function, neither in Proteus, nor elsewhere.
Kind regards

Please post your proteus project file.
 
Hi eTech, thank you for your reply.
I would have already posted that files, but presently I'm not able to attach the .pdsprj files , as this extension is disallowed to attach.
Can you show me another way to upload it?
Kind regards
 
I don't know if it can work, I try to rename the .pdsprj as .txt and then attach here.
Of course the extension has to be back-changed after download
Kind regards
 

Attachments

  • HCPL-2430-test.txt
    13.2 KB · Views: 296
  • VO2630-test.txt
    13.9 KB · Views: 284
The files are not readable by a text editor, so although I'm a spice expert, I can't help you — sorry.
 
Hi Papabravo, thank you for your reply.
After your post I recontrolled the uploads I did, and with my great surprise I found them corrupted.
I never did it before, trusting the fact I controlled both just before uploading.
Now I have re-uploaded the same files, and also tried to download and read with notepad++, and I succeed in reading both. I cannot understand what happened before, and hope that it doesn't repeat this time. Please try downloading them again.
Kind regards
 

Attachments

  • BrcmHCPL2430_MOD.txt
    5.3 KB · Views: 271
  • VSH_OPTO_10M.txt
    5.4 KB · Views: 277
Hi eTech, thank you for your reply.
I would have already posted that files, but presently I'm not able to attach the .pdsprj files , as this extension is disallowed to attach.
Can you show me another way to upload it?
Kind regards

Try creating a.zip file, then upload the .zip
 
In many cases Pspice models are compatible with LTspice. the use of $g_dpwr and $g_dgnd appear to be references to "Global digital Power" and "Global Digital Ground". Since LTspice does not have that feature it is necessary to be able to pass those nodes to lower subcircuit levels. I'd have to do some digging to recall how that can be done. Also there is the use of internal logic elements which are NOT syntactically compatible with those in LTspice, but may in fact be semantically compatible. Again, research would be required.

I do have 6N137 models which do not depend on particular pspice features if that is of interest to you, and I have behavioral models of other optos as well.
 
This is what I have working on my system:
1674255098608.png
 

Attachments

  • 6n137_FuncTest.asc
    3.5 KB · Views: 302
  • 6N137.sub
    585 bytes · Views: 316
  • 6n137.asy
    1.4 KB · Views: 291
Thank you a lot, Papabravo!
But I'm not sure that Proteus uses the same SPICE dialect as LTSPICE, in the past I tried to use some LTspice models on it, but they didn't work. Anyway I can well take your 6N137 models and give them a try.
Then I'll report the result.
 
Here I'm again...
I tested your 6N137.sub, that I renamed 6N137-ppbv.txt.
As usual, I made a new device starting from the Proteus library 6N137 part, that is functioning, substituting the SPACEFILE property with 6N137-ppbv.txt.
The simulation crashes at start with the following messages:

PROSPICE 8.13.00 (Build 31499) (C) Labcenter Electronics 1993-2021.
Loaded netlist 'C:\Users\Alberto\AppData\Local\Temp\LISA0872.SDF' for design '6n137bad.pdsprj'
Syntax error (prec table - token types 8 and 0).
Syntax error (prec table - token types 8 and 0).
[SPICE] Error 11 - parameter value out of range or the wrong type.
Real Time Simulation failed to start.

It is very likely that to install a SPICE model that uses tables Proteus required a syntax different than that explained in its help example, as usual I don't know where to look for...
Can you please suggest me where to look for an up-to-date reference manual?
I attach below the zipped project file.
Kind regards
 

Attachments

  • 6n137bad.zip
    13.4 KB · Views: 290
That was not the only model that I had. Let me look for one that does not use tables.
 
Thank you, Papabravo, but instead of looking for the 6N137, that anycase is on the Proteus library, can you please look for the two, HCPL2430 and VO2630 (or equivalent) that instead are not present?
Or are you willing to find a working 6N137 first to then extend the model to VO2630?
 
Last edited:
sorry I could not find one that did not use tables. I did find a hierarchical schematic of the implementation which might be helpful to you in constructing a model suitable for your purposes. First is the implemntation similar to the one with the subcircuit.
1674317555633.png

You can see the behavior is identical. Now here is a hierarchical schematic of the 6N137
1674317694187.png

One of the tables is used to implement the enable function without using a logic gate. The other table implements a behavioral current source. You may be able to infer the purpose and translate it into an appropriate structure for your implementation.

As I understand tables, they are just pair of values which the spice ending uses to do a piecewise linear interpolation. From the LTspice Help file:

B. Arbitrary Behavioral Voltage or Current Sources
table(x,a,b,c,d,...)
Interpolate a value for x based on a look up table given as a set of pairs of points.
I hope this is all helpful to you.
 
Thank you, Papabravo, but instead of looking for the 6N137, that anycase is on the Proteus library, can you please look for the two, HCPL40 and VO2630 (or equivalent) that instead are not present?
Or are you willing to find a working 6N137 first to then extend the model to VO2630?
I will look further for you.
 
Thank you a lot again!
I'll look at the LTSpice help you say
Just a question yet: is it possible to pass back from the external model to the internal hierarchical model?
This could allow me to study the internals of the 6N137 of the Proteus library
Kind regards
 
I'm not sure what you are asking, but LT spice lets you treat subcircuits as hierarchical schematics and this allows you to debug a subcircuit during development. Once the design is verified turning itn to a subcircuit is quite straight forward.
 
I did find a model of the HCPL-2430 on the Broadcom website and it works well in LTspice as the following demonstrates:
1674322623396.png

The symbol was auto generated and then manually edited to rearrange the pins for a convenient schematic layout. the default CTR = Current Transfer Ratio defaults to 0.5. It is possible to change this on the schematic.
 

Attachments

  • HCPL-2430_Tester.asc
    3.9 KB · Views: 271
  • hcpl-2430.asy
    691 bytes · Views: 273
  • BrcmHCPL2430_MOD.sub
    5.3 KB · Views: 258
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top