Custom modelling

This is an advanced topic and this section will be filled out when time permits.

Learning to write good quality models is not easy.

Before trying to make models, it is first necessary to have a deep understanding of electronics in order to understand the devices that are desired to be modelled.

Unlike creating a commercial model which has to be good at modelling all the device performances, in custom modelling it is often useful to be able to select what is modelled and what is not as this can help speed up simulations and improve convergence. Therefore it is necessary to understand what parameters and behaviours are important and what can be simplified or even safely ignored. This is because some aspects of a device behaviour may not be important to model in some applications whereas they may be critical in others.

Then, to make a model it is necessary to have a deep understanding of how to use and edit the parameters of spice basic device models such as diodes transistors and - in LTspice - some of the clever resistor, capacitor, diode and switch models.

It is also necessary to have a very deep understanding of how to use behavioural sources, expressions and functions to model internal and even whole device behaviours.

The phrase “deep understanding” has been used three times already but that is because it is easy to make bad models but it is much harder to make good ones!

However, browsing through some of the EasyEDA in-house models can be informative because, although they do not come with a ‘How it works’ written into them, there is some documentation in their .subckt definitions that may give some insights into the wild and wonderful world of custom modelling.

Some examples to look through the netlists of are:

LDR test

Electret microphone model

Electret microphone model .subckt

Electret microphone model test jig

LM56EE demo jig

How to include a 5 Pin Comparator in a schematic