How To Get The Best Results Using Ltspice For Emc Simulation Part 2
How To Get The Best Results Using Ltspice For Emc Simulation Part 2
Using LTspice for EMC and Signal Integrity Why Should Designers Care about
This is Part 2 of a series of three articles that provide LTspice EMC and signal integrity
® Signal Integrity?
simulation models. In “How to Get the Best Results Using LTspice for EMC Simulation— Signal integrity1 is much more than just having a working link for your prototype.
Part 1”, we provided LTspice simulation tools for power supply components, conducted Even if your link seems to be working, it’s advisable to perform an in-depth check
emissions, and immunity. of your signal quality, for the following reasons:
In Part 2, we will present a combination of LTspice and C-based programs to help the X Reliability: Distance, throughput, and environment might increase the binary
designer understand and improve wired network signal integrity. These tools will help error rate, reaching unacceptable values for the error correction mechanisms
the designer avoid multiple lab test iterations and expensive hardware redesigns. of your system.
Simulation models are provided for compliance with fieldbus communications (RS- X IEEE standard compliance: Compliance with the IEEE recommendations
485, RS-232), high speed backplane (LVDS), the ubiquitous USB standard, and the new ensures seamless interactions between members of the network.
single-pair Ethernet (SPE) enabling power delivery over data line (PoDL).
X EMC directives compliance: High slew rates and overshoots are often the
cause of noncompliance as they carry high harmonic content.
VISIT ANALOG.COM
Solving Signal Integrity Problems Using LTspice Some nonconformities will show up in very specific situations such as:
This article will help you to answer key questions such as: X Long sequences of consecutive bits
X Is my system likely to have adequate signal integrity? X Nonzero balanced sequences
X Which signal aspect should I improve first? Should I improve the signal slew X Crosstalk from other nearby transmission channels
rate, rigging, jitter, or matching? This means, for example, that if the data is generated using a random function you
X My system is working, but will it work reliably over time, temperature, and might have to use thousands of symbols to make sure you encounter a specific
component tolerances? 11 consecutive high level.
After reading this article, you should be able to: The PWL data format that LTspice expects is shown in Figure 2.
X Implement signal integrity analysis within LTspice
X Generate, import, and use representative test vectors and produce similar
analysis and output as shown in Figure 1
X Perform a statistical validation of your system over several randomized
parameters
// print sample
if (logicLevel == 0)
{
fprintf (pFile,"%fn\t%5.2f\n",(sample*symbolTime)+DELAY+transitionTime,voltageLow);
fprintf (pFile,"%fn\t%5.2f\n",((sample+1)*symbolTime)+DELAY-transitionTime,voltageLow);
printf ("%fn\t%5.2f\n",(sample*symbolTime)+DELAY,voltageLow);
}
else
{
fprintf (pFile,"%fn\t%5.2f\n",(sample*symbolTime)+DELAY+transitionTime,voltageHigh);
fprintf (pFile,"%fn\t%5.2f\n",((sample+1)*symbolTime)+DELAY-transitionTime,voltageHigh);
printf ("%fn\t%5.2f\n",(sample*symbolTime)+DELAY,voltageHigh);
}
}
Figure 3. An extract of the code used to generate a test vector.
2 How to Get the Best Results Using LTspice for EMC Simulation—Part 2: Improving Signal Integrity
There are many options to generate test vectors. For our simulations we picked
the C programming language.
With a few lines of code, you can easily generate large test vectors ready to inject
into your simulation. Figure 3 presents an extract of the code used to generate
the test vector and Figure 4 presents the waveform generated by the C program.
Figure 4. A generated test vector using C program. Figure 6. A USB signal captured using laboratory equipment.
Concepts used in wired communications, such as bit stuffing, can be imple- Figure 7 is a typical example of a dataset saved by an oscilloscope (the exact for-
mented with a few lines of code as illustrated in Figure 5. mat might differ but the given rules to import the data to LTspice will still apply).
[...]
VISIT ANALOG.COM 3
Using a Test Vector PWL File Once the simulation is finished and your signals are displayed, right click on the
To use your generated PWL file you can add a voltage source and file path to your horizontal (time) axis.
design, as shown in Figure 9. A dialog will pop up, displaying an eye diagram button as shown in Figure 12.
This pop-up window allows you to enable and tune the eye diagram display, with
self-explanatory parameters.
Both absolute and relative file paths will work, however, usage of relative paths
is advisable as this makes your simulation portable and ready to share with
your colleagues.
4 How to Get the Best Results Using LTspice for EMC Simulation—Part 2: Improving Signal Integrity
Fine tuning or implementation of your eye definition is also possible using the
provided fields.
A
B C
VISIT ANALOG.COM 5
For the purpose of validating a design over its tolerances, spice and by extension Monte Carlo Simulation
LTspice feature several amazing tools. A Monte Carlo simulation takes a random value from the tolerance range of each
The following sections present techniques for tolerance analysis using Monte specified component in your simulation circuit. All values within the component
Carlo and Gaussian distributions as well as the worst-case analysis within LTspice. tolerance range have an equal probability for circuit simulation.
LTspice includes a convenient built-in Monte Carlo function with a simple syntax.
For example, to create a 100 Ω resistor with 10% tolerance, you need to use the
following syntax:
{mc(100R, ToIA)}
.param ToIA = 0.10
Figure 20. Distribution of randomized values for the three main methods. Designator Range Syntax of Component Value (Monte Carlo)
(100+1/I(V1))/(100-1/I(V1))
PHY IC and Termination Inductive Power Clamping Common-Mode Choke Parasitic Capacitance of Signal Injection
Capacitive Signal Coupling Coupling Diodes Leakage Inductance EMC and Surge Protection Circuitry
C2 L2
V1
C1 R1 L1 C4 C5 C6
5 pF 25 pF 5 pF
AC 1 0
C3
L3
Figure 21. Common test circuit for Gaussian, worst case, and Monte Carlo–based on reference.4
6 How to Get the Best Results Using LTspice for EMC Simulation—Part 2: Improving Signal Integrity
To add the MDI return loss limit line to your plot (red line shown in Figure 23), from Where:
the Plot Settings Menu hit Save Plot Settings.
X 100R is the nominal value
Open the .PLT file using a standard text editor. Copy and paste the line definition X 0.1 is the tolerance (+ or – 10% here)
syntax as shown in the Excel file (Figure 22).
X 0 is the index of the parameter to vary, next component to vary will take index 1
Run the simulation circuit shown in Figure 21 with the expressions from the
following table instead of static component values:
Both .func binary(run,index) and .func wc(nom,tol,index) functions are needed If systems are designed for worst-case conditions, then components selection
to perform simulations according to the worst-case scenario, you need to place can be expensive.
them on your LTspice schematic sheet as a SPICE directive. However, using both worst case in conjunction with Monte Carlo or Gaussian simu-
.func binary(run,index) floor(run/(2**index))-2*floor(run/(2**(index+1))) lation can yield valuable system insights.
{wc(100R, 0.1, 0)} Worst-case analysis is best suited for a gross validation of behavior when simula-
tions are very long and when nominal behavior is already validated.
VISIT ANALOG.COM 7
Gaussian Simulation Conclusion on the Gaussian
LTspice includes a built-in Gaussian function, where the centered values have a The Gaussian distribution is very often the most relevant way to simulate the
higher probability of occurring, this Gaussian function has a simple syntax. variations of an electronic design.
{nominal_value*(1+gauss(tolerance/σ))} The Gaussian distribution of parameters around a nominal value remains the
most natural way to study the impact of tolerances.
Adjustments according to the standard deviation parameter σ of the Gaussian
distribution can be performed using the following expressions in Table 3. Unfortunately, this comes at a price. To be exhaustive, you will need a large num-
ber of simulation runs.
Table 3. Definition of Component Values and Tolerances
in with Gaussian Distribution Method This distribution will also pick values outside of the tolerance range, omitting the
sorting and binning operations performed by component manufacturers.
Expression Used Fraction of Samples within Tolerance
Figure 25. Gaussian distribution of samples vs. σ. The encoding used is PAM36, for pulse amplitude modulation 3 levels. Depending
on the desired reach and capabilities of the endpoints, the transmit signal ampli-
For example, to create a 100 Ω resistor with 10% tolerance, and 4σ probability of
tude can be adjusted to either 1 V or 2.4 V.
value within tolerance you need to use the following syntax:
On the cable side, the signal rise is 53.33 ns for a –1 to +1 transition, and the fall
{100R*(1+gauss(ToIA/4))}
time is the same.
.param ToIA = 0.10
Slew rate is deemed constant so 0 to 1,1 to 0, –1 to 0 and 0 to –1 should have a
Figure 26 provides the result of 128 runs of the simulation provided in Figure 19, nominal transition time of 26.66 ns.
with Gaussian simulation provided in Figure 19, with Gaussian distributed param-
To generate such a test vector, we will use the code in Figure 27.P3
eters using 4σ.
That will output a test vector of 5000 PAM3 symbols in a PWL format.
By feeding this test vector to our schematic, we are able to validate the various
parameters such as minimal coupling, interwinding capacitance, and many more.
Figures 28, 29, and 30 show the transformer-based termination for a 10BASE-T1L
link, the output of a PWL source voltage file, and an eye diagram display of the
PWL voltage source and cable side differential voltage. This can be used for con-
formance testing to the 10BASE-T1L standard.
Figure 26. Differential return losses of a SPE termination: 128 runs of Gaussian distributed
parameters.
8 How to Get the Best Results Using LTspice for EMC Simulation—Part 2: Improving Signal Integrity
// loop for every sample
for (sample = DELAY ; sample < (NUMBER_OF_SAMPLES+DELAY) ; sample++)
{
// Compute a sample
previousLogicLevel = logicLevel;
logicLevel = (rand() % 3) ;
transition = abs((previousLogicLevel - logicLevel));
switch (transition)
{
case 2 : // +1 to -1 transition or +1 to -1 transition
fprintf (pfile,"%E\t%5.2f\n",(sample*M_G_PERIOD),busvoltage[previousLogicLevel]);
fprintf (pfile,"%E\t%5.2f\n",(sample*M_G_PERIOD)+(M_G_RISE),busvoltage[logicLevel]);
break;
default :
break;
}
}
Figure 27. An extract of the code used to generate PAM3 test vector.
CWW1
VIN+ C4 VBUS+
470 nF
C2
150 pF L1 L2
C1 CWW2 C6 R1
V1 R2
100 R
100 nF 1000 pF 100 R
C3 L4 L3
150 pF
VIN– C5 VBUS–
CWW3
470 nF
PWL file = SPE-Testvector.txt .param CWW = 1 pF Lnom = 350 μH
.tran 0.2 ms k L1 L2 L3 L4 0.998
VISIT ANALOG.COM 9
3
Steve Knudtsen. “How to Model Statistical Tolerance Analysis for Complex Circuits
Using LTspice.” Analog Devices, Inc., August 2021.
4
Steffen Graber. “10 Mb/s Single Twisted Pair Ethernet.” IEEE, May 2017.
5
IEEE802.3-2022 clause 146 + annex 146
6
IEEE802.3-2022 annex 146A
Programs:
P1
C program generating simple randomized bitstream with limited consecutive
0 and 1
Figure 30. Eye diagram display of the PWL voltage source and cable side differential voltage. Sylvain Le Bras is a field applications engineer at Würth Elektronik special-
izing in power and electromagnetic compatibility. Prior to joining Würth
Conclusion Elektronik, Sylvain held various positions in research and development at
LTspice is a powerful and free simulation tool, which can be used in conjunction ABB and in Technology Transfer Laboratories. He received his M.Sc.Eng.
with waveform generators using standard C and JavaScript code. The end result degree from the Polytechnic School of the University of Nantes, France.
is a powerful wired communication signal integrity tool that can be used to save
time with lab experiments, guide end product design, and reduce time to market
for product developments. ADI and Würth Elektronik will provide this tool for engi-
Engage with the ADI technology experts in our online support community.
neers to design their wired links and help with understanding new standards such
Ask your tough design questions, browse FAQs, or join a conversation.
as 10BASE-T1L SPE.
References
1
“Signal Integrity Basics.” Signal Integrity White Paper. Anritsu, 2009.
Visit ez.analog.com
2
Joseph Spencer and Gabino Alonso. “LTspice: Worst-Case Circuit Analysis with
Minimal Simulations Runs.” Analog Devices, Inc.
For regional headquarters, sales, and distributors or ©2023 Analog Devices, Inc. All rights reserved. VISIT ANALOG.COM
to contact customer service and technical support, Trademarks and registered trademarks are
visit analog.com/contact. the property of their respective owners.