Behavioral model of optocoupler as LED, current sensor, and controlled current source
Simscape / Electrical / Semiconductors & Converters
This block represents an optocoupler using a model that consists of the following components:
An exponential light-emitting diode in series with a current sensor on the input side
A controlled current source on the output side
The output-side current flows from the collector junction to the emitter junction. It has a value of CTR·Id, where CTR is the Current transfer ratio parameter value and Id is the diode current.
Use the Optocoupler block to interface two electrical circuits without making a direct electrical connection. A common reason for doing this is that the two circuits work at very different voltage levels.
Note
Each electrical circuit must have its own Electrical Reference block.
If the output circuit is a phototransistor, typical values for the Current transfer ratio parameter are 0.1 to 0.5. If the output stage consists of a Darlington pair, the parameter value can be much higher than this. The Current transfer ratio value also varies with the light-emitting diode current, but this effect is not modeled by the Photodiode block.
Some manufacturers provide a maximum data rate for optocouplers. In practice, the maximum data rate depends on the following factors:
The capacitance of the photodiode and the type of the driving circuit
The construction of the phototransistor and its associated capacitance
The Optocoupler block only lets you define the capacitance on the light-emitting diode. You can use the Junction capacitance parameter to add your own capacitance across the collector and emitter connections.
The Optocoupler block lets you model temperature dependence of the underlying diode. For details, see the Diode reference page.
The block has an optional thermal port, hidden by default. To expose the thermal port, right-click the block in your model, and then from the context menu select Simscape > Block choices > Show thermal port. This action displays the thermal port H on the block icon, and exposes the Thermal Port parameters.
Use the thermal port to simulate the effects of generated heat and device temperature. For more information on using thermal ports and on the Thermal Port parameters, see Simulating Thermal Effects in Semiconductors.
Use the Variables section of the block interface to set the priority and initial target values for the block variables prior to simulation. For more information, see Set Priority and Initial Target for Block Variables.
The output side is modeled as a controlled current source. As such, it only correctly approximates a bipolar transistor operating in its normal active region. To create a more detailed model, connect the Optocoupler output directly to the base of an NPN Bipolar Transistor block, and set the parameters to maintain a correct overall value for the current transfer ratio. If you need to connect optocouplers in series, use this approach to avoid the invalid topology of two current sources in series.
The temperature dependence of the forward current transfer ratio is not modeled. Typically the temperature dependence of this parameter is much less than that of the optical diode I-V characteristic.
You may need to use nonzero ohmic resistance and junction capacitance values to prevent numerical simulation issues, but the simulation may run faster with these values set to zero.
[1] G. Massobrio and P. Antognetti. Semiconductor Device Modeling with SPICE. 2nd Edition, McGraw-Hill, 1993.
[2] H. Ahmed and P.J. Spreadbury. Analogue and digital electronics for engineers. 2nd Edition, Cambridge University Press, 1984.