\chapter{Creating a Spice Cable Bundle Model} \label{creating_a_spice_cable_bundle_model} This chapter describes the creation of a spice cable bundle model from a previously defined cable bundle and additional specifications which are required to define the spice model. This section also describes how a validation test case is defined which enables the performance of the model to be assessed in either an a.c. or transient analysis. The format of the files relating to the spice cable bundle model building process are described in section \ref{Spice_cable_bundle_spec_file_formats}. \subsection{Incident field excitation} The transmission line model may incorporate an incident field excitation which takes the form of a plane wave. The plane wave incident field may be a continuous wave for a.c. analysis or a pulse for transient analysis. When a plane wave excitation is required the spice sub-circuit model has an additional two nodes defined, the voltage between these nodes specifies the Electric field of the plane wave. For the purposes of incident field excitaton analysis the axis of the cable bundle is assumed to be in the z direction. The direction of the incident field plane wave is specified by its wave vector in polar coordinates (figure \ref{fig:Incident_field_1}) % \begin{figure}[h] \centering \includegraphics[scale=0.75]{./Imgs/Incident_field_specificaton.eps} \caption{Plane wave incident field excitation of a cable bundle} \label{fig:Incident_field_1} \end{figure} % \begin{equation} \begin{array}{c} k_{x}=\sin(k_{\theta})\cos(k_{\phi}) \\ k_{y}=\sin(k_{\theta})\sin(k_{\phi}) \\ k_{z}=\cos(k_{\phi}) \\ \end{array}{c} \end{equation} % where $k_{\theta}$ is the angle of the wave vector from the z axis and $k_{\phi}$ is the angle from the x axis as shown in figure \ref{fig:Incident_field_2}. Given this k vector, unit vectors in the $\theta$ and $\phi$ directions can be identified. The Electric field polarisation direction is specified in terms of these vectors ($E_{\theta}$ and $E_{\phi}$) as shown in figure \ref{fig:Incident_field_2}. % \begin{figure}[h] \centering \includegraphics[scale=1.5]{./Imgs/k_incident.eps} \caption{Specification of the incident field polarisation} \label{fig:Incident_field_2} \end{figure} % It is important to note that the angles $E_{\theta}$ and $E_{\phi}$ specify the polarisation direction only, the amplitude of the Electric field is specified separately i.e. the polarisation vector is normalised to unit length and only the relative amplitudes of $E_{\theta}$ and $E_{\phi}$ is significant in determining the polarisation direction so setting $E_{\theta}=1$ and $E_{\phi}=1$ will give the polarisation vector as specifying $E_{\theta}=\frac{1}{\sqrt 2 }$ and $E_{\phi}=\frac{1}{\sqrt 2 }$. % A wave in the +z direction with the Electric field polarised in the +x direction is therefore specified by $k_{\theta}=0^{\circ}$ $k_{\phi}=0^{\circ}$ $E_{\theta}=1$ $E_{\phi}=0$ A wave in the +z direction with the Electric field polarised in the +y direction is therefore specified by $k_{\theta}=0^{\circ}$ $k_{\phi}=90^{\circ}$ $E_{\theta}=1$ $E_{\phi}=0$ A wave in the +x direction with the Electric field polarised in the +z direction is therefore specified by $k_{\theta}=90^{\circ}$ $k_{\phi}=0^{\circ}$ $E_{\theta}=-1$ $E_{\phi}=0$ A wave in the -y direction with the Electric field polarised in the +z direction is therefore specified by $k_{\theta}=90^{\circ}$ $k_{\phi}=-90^{\circ}$ $E_{\theta}=-1$ $E_{\phi}=0$ A wave in the -y direction with the Electric field polarised in the +x direction is therefore specified by $k_{\theta}=90^{\circ}$ $k_{\phi}=-90^{\circ}$ $E_{\theta}=0$ $E_{\phi}=1$ \subsection{Transfer impedance model} The spice cable bundle model is based on a domain decomposition method where a domain is formed by the set of conductors within a shield separating them from a possible external domain (if it exists). The domains are modelled independently i.e. signals propagate within domains and do not couple between domains through cable shields unless specifically requested. The spice cable bundle model uses a weak form of transfer impedance coupling thus a source and a victim domain must be specified for the inclusion of a transfer impedance model. The transfer impedance of cable shields and overshields will have been specified in the individual cable models as a conductor impedance model for a shield (section \ref{FD_transfer_impedance_model} ). This will automatically be included as a loss in the propagation algorithm for signals propagating on the inside and outside of the shield. The model extracts the d.c. resistance of conductors and includes this directly on each conductor therefore coupling between domains does exist in the model due to the d.c. transfer impedance. However as a default no coupling between the internal and external domains is included apart from that which results from the d.c. component of the transfer impedance. In order to include a transfer impedance model the conductor number of the shield of interest must be specified along with the direction of the coupling. The coupling direction is specified in the \textbf{name.spice\_model\_spec} file as either +1 or -1 where +1 indicates coupling direction from inside the shield to outside and -1 indicates coupling from the outside to the inside. An example of the specification of the specification of transfer impedance coupling within a spice cable bundle model is seen in section\ref{Spice_cable_bundle_spec_file_formats} \subsection{Spice cable bundle subcircuit node numbering} The subcircuit node numbering is as follows: \begin{enumerate} \item End 1 (- z end) conductors in order of the conductors in the bundle specification \item End 2 (+ z end) conductors in order of the conductors in the bundle specification \item If an incident field excitation is required, there are two additional nodes to specify the incident (Electric) field excitation function. The incident electric field is equal to the voltage between these two nodes. \end{enumerate} \subsubsection{Spice 'node zero'} Care may be required in specifying node zero in spice circuits containing transmission line models. Figure \ref{fig_node_zero_fig1} shows a typical circuit configuration in which two termination sub-circuits are connected via a three conductor transmission line. \begin{figure}[h] \centering \includegraphics[scale=0.7]{./Imgs/node_zero_fig1.eps} \caption{Example circuit using a transmission line sub-circuit model} \label{fig_node_zero_fig1} \end{figure} \begin{figure}[h] \centering \includegraphics[scale=0.7]{./Imgs/node_zero_fig2.eps} \caption{Example circuit with node zero in one termination circuit only} \label{fig_node_zero_fig2} \end{figure} \begin{figure}[h] \centering \includegraphics[scale=0.7]{./Imgs/node_zero_fig3.eps} \caption{Example circuit with node zero in both termination circuits showing how node zero at both ends will short out any resistance in the reference conductor} \label{fig_node_zero_fig3} \end{figure} Figure \ref{fig_node_zero_fig2} shows a depiction of a spice model of this configuration in which termination 1 includes node zero and termination 2 does not include node zero. This circuit will work with the transmission line model operating as it is designed to, even if there is some loss in the reference conductor. It is important to note that voltages in termination circuit 1 should be measured relative to node zero however voltages in termination circuit 2 should be measured relative to the local reference node, in this case node $n1,2$. Figure \ref{fig_node_zero_fig3} shows a depiction of a spice model in which both termination 1 and termination 2 include node zero as a reference. In this case, the d.c. resistance, $R_{dc_ref}$, of the reference conductor is effectively short circuited as depicted by the heavy line in figure \ref{fig_node_zero_fig3} and the transmission line model will not give accurate results. If the reference conductor has no loss (a perfect ground plane for example) then having node zero at both ends of the transmission line sub-circuit will not affect the results (since $R_{dc_ref}=0$ in this case). To conclude, we recommend that node zero is only included in one transmission line termination circuit and that all voltages in a transmission line termination are measured relative to the local termination reference node. Node zero should only be present at both ends of a transmission line sub-circuit if there is no loss in the reference conductor. \section{Spice Cable Bundle Specification File Formats} \label{Spice_cable_bundle_spec_file_formats} This section describes the spice cable bundle specification file formats used as the input to the spice cable bundle model building process. Spice cable bundle specification files have the extension \textbf{name.spice\_model\_spec}. The input file to the spice cable bundle building processs includes the bundle name, bundle length, incident field specification (if required) and the specification of the validation test configuration. In addition information regarding the transfer impedance models to be included and also information to control the transfer function fitting process can be specified. The validation test configuration is shown in figure \ref{fig_validation_test_case_config} \begin{figure}[h] \centering \includegraphics[scale=0.7]{./Imgs/V2_validation_test_case_configuration_portrait.eps} \caption{Validation test case configuration} \label{fig_validation_test_case_config} \end{figure} In addition to the data required to specify a cable bundle, additional flags may be specified to influence the operation of the software. These flags are as follows: \begin{enumerate} \item 'verbose' output detailed summary of the software operation and calculation results.\\ \item 'use\_xie' use Xie's model for incident field excitation of shielded cables.\\ \item 'no\_s\_xfer' For first order frequency dependent models (transfer impedance, propagation correction) we may use a passive circuit implementation for frequency dependent transfer functions instead of s-domain transfer functions. This may be of use in Ngspice models which fail to run.\\ \end{enumerate} The file format with no transfer impdance models or transfer function fitting information is as follows: \begin{center} \begin{tabular}{ | p{1.5cm} | p{4.5cm} | p{2.5cm} | p{5cm} |} \hline Line number & Typical value & Unit & Description \\ \hline 1 & \#MOD\_cable\_lib\_dir & - & Comment line \\ \hline 2 & . & - & Directory to read the cable model file to \\ \hline 3 & \#MOD\_bundle\_lib\_dir & - & Comment line \\ \hline 4 & . & - & Directory to read the cable bundle model file from \\ \hline 5 & \#MOD\_spice\_bundle\_lib\_dir & - & Comment line \\ \hline 6 & . & - & Directory to write the spice cable bundle model file to \\ \hline 7 & \# two wires over ground plane, crosstalk model & - & Comment line \\ \hline 8 & two\_wires\_over\_ground & - & Cable bundle name Note there should be nothing else on this line \\ \hline 9 & \# bundle length & - & Comment line \\ \hline 10 & 2.0 & metres & Cable bundle length \\ \hline 11 & \# incident field specification & - & Comment line \\ \hline 12 & 0.0 & V/m & Amplitude \\ \hline 13 & 90.0 0.0 & degrees & Wave vector angle k$\theta$ k$\phi$ \\ \hline 14 & 1.0 0.0 & degrees & Polarisation E$\theta$ E$\phi$ \\ \hline 15 & \# End 1 termination model & - & Number of sources and resistances = number of conductors-1 \\ \hline 16 & 1.0 & V & End 1, conductor 1 voltage source amplitude \\ \hline - & 0.0 & V & End 1, conductor 2 voltage source amplitude \\ \hline - & 0.0 & V & End 1, reference conductor voltage source amplitude \\ \hline - & 50.0 & $\Omega$ & End 1, conductor 1 resistance \\ \hline - & 25.0 & $\Omega$ & End 1, conductor 2 resistance \\ \hline - & 0.0 & $\Omega$ & End 1, reference conductor resistance \\ \hline - & \# End 2 termination model & - & Number of sources and resistances = number of conductors-1 \\ \hline - & 1.0 & V & End 2, conductor 1 voltage source amplitude \\ \hline - & 0.0 & V & End 2, conductor 2 voltage source amplitude \\ \hline - & 0.0 & V & End 2, reference conductor voltage source amplitude \\ \hline - & 50.0 & $\Omega$ & End 2, conductor 1 resistance \\ \hline - & 25.0 & $\Omega$ & End 2, conductor 2 resistance \\ \hline - & 0.0 & $\Omega$ & End 2, reference conductor resistance \\ \hline - & \# Type of analysis & - & Comment line \\ \hline - & AC & - & AC or TRANS \\ \hline \\ \hline For AC analysis: & & & \\ \hline - & lin & - & logarithmic (log) or linear (lin) frequency scale \\ \hline - & 1e3 1e8 1000 & Hz Hz integer & min frequency, max frequency number of frequencies \\ \hline \\ \hline For TRANSIENT analysis & & & \\ \hline - & 0.01E-9 100E-9 & seconds seconds & \# timestep runtime \\ \hline - & 1e-9 50e-9 & seconds seconds & \# pulse risetime pulse width \\ \hline \\ \hline - & \# Output\_conductor1 output\_conductor2 and end number & - & Conductor\_2 can be left out in which case the voltage is relative to the reference conductor \\ \hline - & 1 1 & integer integer & Output conductor number and end number \\ \hline - & lin & - & For AC only: Output voltage scaling, linear or dB \\ \hline \hline \end{tabular} \end{center} \vspace{5mm} \textbf{\underline{AC example}} \begin{verbatim} #MOD_cable_lib_dir LIBRARY_OF_CABLE_MODELS #MOD_bundle_lib_dir LIBRARY_OF_BUNDLE_MODELS #MOD_spice_bundle_lib_dir #LIBRARY_OF_BUNDLE_MODELS/two_wires_over_ground ./ #spice_symbol_dir SYMBOL_DIR # Specification for spice model of single wire over ground, no loss two_wires_over_ground # cable bundle length (m) 2.0 #Incident field specification 0.0 amplitude (V/m) 90.0 0.0 ktheta kphi (degrees) -1.0 0.0 Etheta Ephi # End 1 termination model 1.0 End 1 voltage source list 0.0 0.0 100.0 End 1 impedance list 25.0 0.0 # End 2 termination model 0.0 End 2 voltage source list 0.0 0.0 75.0 End 2 impedance list 50.0 0.0 # Type of analysis AC log # frequency scale (log or lin) 1e3 1e8 1000 # fmin fmax number_of_frequencies # Output conductor number and end number 1 1 lin # output type (lin or dB) \end{verbatim} \vspace{5mm} \textbf{\underline{Transient example}} \begin{verbatim} #MOD_cable_lib_dir . #MOD_bundle_lib_dir . MOD_spice_bundle_lib_dir . #spice_symbol_dir SYMBOL_DIR 2 # number of conductors, n. Conductor n is always the reference conductor 2_wire # cable bundle length (m) 2.0 #Incident field specification 0.0 amplitude (V/m) 90.0 0.0 ktheta kphi (degrees) -1.0 0.0 Etheta Ephi # End 1 termination model 1.0 End 1 voltage source list 0.0 50.0 End 1 impedance list 0.0 # End 2 termination model 0.0 End 2 voltage source list 0.0 50.0 End 2 impedance list 0.0 # Type of analysis TRANS 0.01E-9 100E-9 # timestep runtime 1e-9 50e-9 # pulse_risetime pulse_width # Output conductor number and end number 1 1 \end{verbatim} In the case of frequency dependent models and transfer impedance coupling models then the above file format can be adapted to include additional information required to drive these models. A weak form of the transfer impedance is implemented in this work hence the direction of coupling must be specified. In order to include a transfer impedance model the conductor number for the shield whose transfer impdeance is required. In addition to this the direction of the transfer impedance coupling must be specified. The direction is specified as an integer where +1 indicates coupling from inside the shield to outside and -1 indicates coupling from the outside to the inside. The frequency dependent propagation correction takes the form of a s-domain transfer function in the spice model. These propagation correction transfer functions are derived using a rational function fitting process. This process provides a best fit model of specified order over a specified frequency range. As a default the model order is 0 i.e. no frequency dependent propagation correction. The model order can be specified in two ways: \begin{enumerate} \item The order is specified as a positive integer and this is the order used \item A negative integer is specified. In this case the order is chosen using an automatic algorithm which attempts to choose the best order from 0 up to |specified order| \end{enumerate} The frequency range for the model fit may also be specified as can the use of a log or linear frequency scale. If the frequency range is not specified then it is derived from the definition of the validation test case. The format is descibed below followed by an example. \begin{center} \begin{tabular}{ | p{1.5cm} | p{4.5cm} | p{2.5cm} | p{5cm} |} \hline Line number & Typical value & Unit & Description \\ \hline 1 & \#MOD\_cable\_lib\_dir & - & Comment line \\ \hline 2 & . & - & Directory to read the cable model file to \\ \hline 3 & \#MOD\_bundle\_lib\_dir & - & Comment line \\ \hline 4 & . & - & Directory to read the cable bundle model file from \\ \hline 5 & \#MOD\_spice\_bundle\_lib\_dir & - & Comment line \\ \hline 6 & . & - & Directory to write the spice cable bundle model file to \\ \hline 7 & \# two wires over ground plane, crosstalk model & - & Comment line \\ \hline 8 & two\_wires\_over\_ground & - & Cable bundle name Note there should be nothing else on this line \\ \hline 9 & \# bundle length & - & Comment line \\ \hline 10 & 2.0 & metres & Cable bundle length \\ \hline 11 & \# incident field specification & - & Comment line \\ \hline 12 & 0.0 & V/m & Amplitude \\ \hline 13 & 90.0 0.0 & degrees & Wave vector angle k$\theta$ k$\phi$ \\ \hline 14 & 1.0 0.0 & relative amplitudes & Polarisation E$\theta$ E$\phi$ \\ \hline 15 & \#Transfer impedance terms & - & this line must inlcude the words 'transfer impedance' to indicate that transfer impedance information follows \\ \hline 16 & 1 & integer & \# number of transfer impedances to include in the model \\ \hline - & 3 +1 & integer integer & \# shield conductor number and coupling direction for transfer impedance model 1 + is inside to out \\ \hline - & \# End 1 termination model & - & Number of sources and resistances = number of conductors-1 \\ \hline - & 1.0 & V & End 1, conductor 1 voltage source amplitude \\ \hline - & 0.0 & V & End 1, conductor 2 voltage source amplitude \\ \hline - & 0.0 & V & End 1, reference conductor voltage source amplitude \\ \hline - & 50.0 & $\Omega$ & End 1, conductor 1 resistance \\ \hline - & 25.0 & $\Omega$ & End 1, conductor 2 resistance \\ \hline - & 0.0 & $\Omega$ & End 1, reference conductor resistance \\ \hline - & \# End 2 termination model & - & Number of sources and resistances = number of conductors-1 \\ \hline - & 1.0 & V & End 2, conductor 1 voltage source amplitude \\ \hline - & 0.0 & V & End 2, conductor 2 voltage source amplitude \\ \hline - & 0.0 & V & End 2, reference conductor voltage source amplitude \\ \hline - & 50.0 & $\Omega$ & End 2, conductor 1 resistance \\ \hline - & 25.0 & $\Omega$ & End 2, conductor 2 resistance \\ \hline - & 0.0 & $\Omega$ & End 2, reference conductor resistance \\ \hline - & \# Type of analysis & - & Comment line \\ \hline - & AC & - & AC or TRANS \\ \hline \\ \hline For AC analysis: & & & \\ \hline - & lin & - & logarithmic (log) or linear (lin) frequency scale \\ \hline - & 1e3 1e8 1000 & Hz Hz integer & min frequency, max frequency number of frequencies \\ \hline \\ \hline For TRANSIENT analysis & & & \\ \hline - & 0.01E-9 100E-9 & seconds seconds & \# timestep runtime \\ \hline - & 1e-9 50e-9 & seconds seconds & \# pulse risetime pulse width \\ \hline \\ \hline - & \# Output conductor number and end number & - & Comment line \\ \hline - & 1 1 & integer integer & Output conductor number and end number \\ \hline - & lin & - & For AC only: Output voltage scaling, linear or dB \\ \hline - & -10 & integer & \# order for transfer function fit model \\ \hline - & log & - & logarithmic (log) or linear (lin) frequency scale for transfer function fitting \\ \hline - & real real integer & 1e5 1e9 200 & \# fmin fmax number\_of\_frequencies for transfer function fitting \\ \hline \hline \end{tabular} \end{center} \vspace{5mm} \textbf{\underline{AC example for a frequency dependent coaxial cable with a transfer impedance model plus a single wire}} \begin{verbatim} #MOD_cable_lib_dir ./ #MOD_bundle_lib_dir ./ #MOD_spice_bundle_lib_dir ./ #spice_symbol_dir ./ # Specification for spice model of two wire transmission line, no loss zt_test # cable bundle length (m) 1.0 #Incident field specification 0.0 amplitude (V/m) 90.0 0.0 ktheta kphi (degrees) -1.0 0.0 Etheta Ephi #Transfer impedance terms 1 # number of transfer impedances to include in the model 3 +1 # conductor number and coupling direction for transfer impedance model 1 + is inside to out # End 1 termination model 0.02 End 1 voltage source list 0.5 0.0 300.0 End 1 impedance list 20.0 0.0 # End 2 termination model 0.03 End 2 voltage source list 1.0 0.0 1000.0 End 2 impedance list 150.0 0.0 # Type of analysis AC log # frequency scale (log or lin) 1e5 1e9 1000 # fmin fmax number_of_frequencies # Output conductor number and end number 1 2 lin # output type (lin or dB) -10 # order for transfer function fit model log # frequency scale for transfer function fit (log or lin) 1e5 1e9 200 # fmin fmax number_of_frequencies for transfer function fit \end{verbatim} In addition to the data required to specify a spice cable bundle model, additional flags may be specified to influence the operation of the software. These flags are as follows: \begin{enumerate} \item 'verbose' output detailed summary of the software operation and calculation results.\\ \item 'use\_xie' Include direct incident field to shielded domain coupling terms\\ \item 'no\_xie' Do not include direct incident field to shielded domain coupling terms\\ \item 'use\_high\_freq\_zt\_model' Use a distributed model for the transfer resistance - this may give improved transfer impedance coupling results at high frequency for cases when the shield termination impedance is very small at the expense of low frequency accuracy\\ \item 'no\_high\_freq\_zt\_model' (default) Use a lumped model for the transfer resistance - this may give poor transfer impedance coupling results at high frequency for cases when the shield termination impedance is very small however it will give good results at low frequency\\ \item 'no\_s\_xfer' Use a lumped component model to implement the frequency dependent transfer function used in the propagation correction and transfer impedance implementation. This is experimental and only available for 1st and 2nd order models at the moment.\\ \end{enumerate} \cleardoublepage