DesignSoft
January 20, 2018, 01:16:50 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to TINACloud, the cloud based version of TINA, running in your browser without any installation and anywhere in the world. For limited time, now you can get it for free if you purchase a new license or upgrade to v10 version of TINA at www.tinacloud.com.  With this great extension you can present or modify your designs wherever you are in the world and even while travelling.

We are eager to hear from you any comments and feedback.
 
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: optocoupler model  (Read 1232 times)
Robyn Aston
Newbie
*
Posts: 2


View Profile
« on: February 07, 2016, 02:49:39 PM »

The opto-couplers offered in the standard library are both Darlington high CTR types (4n33) so I've trawled for PSpice models of the CNY17-1 for instance. Particularly, I've visited the TI simulation forum where staff have offered corrections to available netlists. With these corrections I've been able to create models but they don't work (always transistor passing high current with no input).

As a test, I exported the existing 4N33 netlist, saved it as a .cir file and tried to reimport it. It produced an error in the new macro wizard much as others I've tried. Any idea why?

I know from the web that many have had this problem. Has anybody solved it?

Please post a link to a working single transistor opto-coupler model if you know of one.

Robyn Aston.
Logged
pwediyfx
Newbie
*
Posts: 6


View Profile
« Reply #1 on: December 05, 2016, 11:27:30 AM »

First ... simply 'Double Left Mouse Button Click' or 'Right Button Click' on any component to access its structure and modify ...
Enter Macro will appear to reveal its Spice Model if it is accessible ...

A NETLIST DESCRIBES SCHEMATIC PIN CONNECTION ORIENTATION OF ITS COMPONENTS ...
AND INCUDES 'SIMULATION RUN' INFORMATION
IN THIS INSTANCE "XODAR1" IS AN 'EMBEDDED' SPICE LIBRARY MODEL ...
"X" OR "Q" OR "J" ARE PREFIXES FOR SCHEMATIC EDIITOR AUTO-ACCESSED (EMBEDDED) SPICE FILES WITHIN A .LIB FILE

THE TERM .END IS ONLY VALID FOR A .MOD TYPE FILE (MODEL)
THE TERM .ENDS IS USED FOR  A .CIR TYPE FILE (COMBINED .MOD FILES AND PARAMETERS)
THE TERM .LIB ALLOWS INCUDING A SET OF SPICE MODELS AND SUBCIRCUITS INTO ONE FILE (BOTH .CIR AND .MOD) ...

Here is what a 'Netlist Export' is for the 4N33 ... with no connections ...

**************************************
.TEMP 27
.TRAN 1P 1U

XODAR1      3 4 2 1 5 4N33

.END
**************************************

BELOW IS THE ACTUAL 4N33 PSPICE MODEL

*Model 4n33
*FORMAT:  SPICE3
.subckt 4n33 4 5 3 1 2
* 4 -> LED ANODE   5 -> LED CATHODE
* 3 -> EMITTER     1 -> COLLECTOR   2 -> BASE

DIO  4  10  D4n33_dio
VD  10  5  0V
RD  4  5  6e7
*FDD  0  2  VD  0.15
*RF  2  0  1e9
V1 3 30 0
FDD  30  2  VD  0.15
RF  2  30  1e9
CF  1  4  1e-12
XDAR  1 2 3  4n33_dar
RDAR  1  3  4e9
* MODEL FORMAT: SPICE3
.MODEL D4n33_dio d
+IS=2.90836e-12 RS=1.81548 N=2 EG=0.644108
+XTI=3.99996 BV=1000 IBV=0.0001 CJO=2.02387e-11
+VJ=0.4 M=0.271299 FC=0.5 TT=1e-09
+KF=0 AF=1

.ends 4n33

**********

Below is my modified version of the NSL-32 Optocoupler .PSpice Model (subcircuit type .CIR)
It is an LED with Photoresistor with additional 1N4678 Zener Diode for control voltage reguation ...

The NSL-32 is a 'Vintage' Analog Optocoupler used in Musician Sound Effects Pedals to eliminate potentiometer noise and wear!
I believe it is still available ... although very 'rare to find'


Use Schematic Symbol Editor to create a 4-Pin Symbol
Name the Pins Simply: 1 2 3 4
1 = LED Anode
2 = LED Cathode
3 and 4 = Photoresistor

Save the File as NSL-32.DDB to Desktop or My Documents ...
YOU CANNOT SAVE TO THE TINA PROGRAM (x86) FOLDER DIRECTLY!
After you have created and saved the .DDB File elsewhere Copy it to the main TINA Program Folder ...
YOU MUST HAVE ADMINISTRATOR PRIVILEGES AND YOUR USER ACCOUNT CONTROL (UAC) IN CONTROL PANEL SET TO MINIMUM!
YOU MUST PLACE THE .DDB SYMBOL FILE INTO TINA MAIN FOLDER BEFORE USING SCHEMATIC EDITOR TO USE IT!

Copy and Paste PSpice Circuit below into Notepad ...
Type Filename: NSL-32.CIR
Use File drop down list to "Save As" / Click On  Save as type: All files (*) ...
Press "Save" and save to Desktop or My Documents

In TINA Schematic Editor
Open "Tools / New Macro Wizard"
Create a Macro with same name ... NSL-32
Select "From file" ...
Click On the folder on the right and from the "Files of Type" drop down list select "PSpice subcircuit file" ...
On the top bar use the "Look in" selector to locate the NSL-32.CIR File ...
Click 'Next' and coninue ...
Locate and use the NSL-32.DDB Schematic Symbol ...
Save Macro to Desktop or My Documents
Insert Macro into Schematic to use ...



* NSL-32 Optocoupler
*
* SPICE (Simulation Program with Integrated Circuit Emphasis)
* SUBCIRCUIT
*
* connections:
***************   + - R R
.SUBCKT NSL-32    1 2 3 4
BLED 1 5 I=EXP(V(1,2)*24.154-46.803)
VID 5 2 0
BLOGIVD 6 0 V=LN(I(VID))
RHLOG 6 0 1
BCELL 3 4 I=V(3,4)*(EXP(V(6)*(-0.092947*V(6)-0.54364)-4.6619))
D1 2 1 1N4678
.MODEL 1N4678 D(IS=6.299653E-010 N=2.15352 RS=1.475356E-006
+ CJO=170.00E-12 M=.3333 VJ=.75 ISR=5.577980E-006 NR=4.00204
+ BV=1.9860 IBV=66.506E-3 TT=193.90E-9)
.ENDS


HINT: ADDING A 1G (1 GIGAOHM) RESISTOR TO SOME SCHEMATICS ENABLES A 'HIDDEN' GROUND ("0" NODE) CONNECTION TO ALLOW THE CIRCUIT TO WORK! FOR INSTANCE .. ATTACH A 1G OHM RESISTOR TO A METER GROUND CONNECTION OR TRANSFORMER TO ENABLE SIMULATION RUN! 1G OHM IS LARGE ENOUGH TO ACTUALLY HAVE LITTLE OR NO OTHER ADDITIONAL EFFECT ON ALMOST ANY  CIRCUIT.
« Last Edit: December 05, 2016, 01:08:29 PM by pwediyfx » Logged
CDRIVE
Full Member
***
Posts: 168


South Florida USA


View Profile
« Reply #2 on: December 21, 2016, 07:47:28 AM »

pwediyfx, you did a lot of fine work for the OP. Sadly, after nearly a year has passed since he made that post, it may be falling on deaf ears. On the up side there are probably others that will eventually make good use of your hard work.

The forum has long needed a member that's proficient in pcode, spice models, .mod, .cir and .lib files. Welcome aboard!

Chris
Logged

___________________________________________
Working with electricity can be dangerous. Any information that I post, including schematics and or code are intended for educational purposes only. No warranty of circuit or code suitability is expressed or implied. Proceed at your own risk.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!