4. Harmonic Balance simulators
The second simulator we consider is called Harmonic Balance (HB). In a HB simulation, the linear parts of the circuit are solved in the frequency domain. In the HB implementation of ADS, the response of the non-linear parts is obtained by simulation in the time-domain. The simulator then balances the responses of the linear and non-linear parts of the circuit such that the Kirchoff laws are satisfied at the interface between both the linear and non-linear parts [4]. For the HB simulation, it is assumed that all signals in the circuit are represented as a set of base frequencies with their harmonics and mixing frequencies:
The different base frequencies () have to be set by the user. In ADS, the amount of harmonics for each frequency is limited by its order, indicated here with . The amount of mixing is limited by a parameter called maximum mixing order. This way of limiting the frequency grid is called diamond truncation [7].
The HB simulator returns the steady-state response of the circuit in the frequency domain by retuning the different phasors. No post-processing step is needed to calculate the spectra.
Setting the frequency grid
For a lowpass multisine, setting the HB frequency grid is easy: A single-frequency grid () is used with frequency and .
In a simulation with a bandpass multisine, the spectrum of the signals in the circuit is limited to bands around of the multisine. When the spectral regrowth around the different harmonics of starts overlapping a single-frequency grid with and should be used. When there is no overlap between the spectral regrowth around each harmonic of , a two-frequency grid with base frequencies and is used to create a band of frequencies around each harmonic of .
is set to to generate every harmonic band of the multisine. When the maximum mixing order is not limited, the bandwidth around the harmonic of is due to the properties of the diamond truncation. When the order for is set to , a frequency grid is obtained that represents all the needed frequency lines around the harmonics of .
The final thing to take into consideration while setting the HB settings is the sequence in which the frequencies and orders are passed to the simulator: either is passed first and then or the other way round. The sequence of base frequencies doesn’t make any difference for the obtained frequency grid, but changes how the signals are processed internally. During the HB simulation, the non-linear elements in the circuit are evaluated in the time domain. To go to the time-domain and back some form of multi-dimensional Discrete Fourier Transform (DFT) is used. One of the methods is to first map the different frequencies present in the HB simulation on a single frequency axis and transformed to a time-domain signal using a one-dimensional DFT. The obtained time-domain signal is then passed through the non-linearities in the circuit and then transformed back into the frequency domain. The combination of the mapping and the evaluation of the non-linearities in the time-domain can introduce spectral components in places that are not expected.
As an example for this effect, consider a static non-linear element excited by a single-tone excitation at . This circuit is simulated with a HB frequency grid that contains two base frequencies: and with and . In a first simulation, was provided first to the simulator and second. In a second simulation run, the order of the frequencies was changed. Both obtained spectra are shown in Figure 4.1.
Figure 4.1 The order in which the frequencies are passed to the HB simulator influences the way tones alias from one frequency band to another.
The first few harmonics of both simulations coincide. Once the harmonic becomes too high in frequency to be captured by the baseband frequency bins, they appear in another band. The frequency band in which these extra harmonics end up eventually is determined by the order in which the frequencies are provided to the simulator. When is provided first, the harmonics end up in the frequency band around . When is provided first, the extra harmonics appear around the third harmonic of .
We should note that the aliasing here occurs due to a very poor choice of used in the simulation, so when a proper frequency grid is used, these strange aliased tones will not be present in the frequency grids. During the initial simulations, where the non-linear order is still being selected, it can however be very confusing to encounter such aliased tones.
It is a personal preference to set to order of the frequencies in the harmonic balance simulation such that the aliasing just jumps a single harmonic ( first), as it is easier to debug such a simulation as the one where the aliased harmonics appear is a frequency band far from the one where they are being created.
Possible convergence issues in HB simulations
Once the frequencies and the orders in the HB simulation are set, there is not much left to do for the user of the simulation in normal circumstances. Internally, the HB simulation will run a non-linear optimisation routine to obtain its solution and one hopes that is converges quickly to a result.
In ADS, the user can choose the type of non-linear solver and influence the way the derivatives of the circuit equations are calculated to speed up the convergence at the risk of introducing errors in the simulation results. For all multisine simulations in this thesis, the solver settings in HB simulations were set to the default values.
It can happen that the non-linear optimisation does not find the correct result, although this is quite rare in forced circuit simulations like the ones considered here. In simulations of autonomous circuits like oscillators, it happens more often that the wrong orbit is obtained. When convergence issues are encountered, the initial values for a HB simulation can be obtained from a transient simulation or from another HB simulation which is run on a simpler frequency grid. Additionally, if HB detects that it cannot find a solution due to very strongly non-linear behaviour of the circuit, the simulator will start a procedure called source stepping. Source stepping is a continuation technique [6]: The amplitude of all generators in the circuit is scaled down to decrease the non-linear behaviour of the circuit. When a HB solution is found for the tuned-down generators, it is used as initial value for the original HB simulation where the generators are running full-force. If the initial values obtained with the scaled generators is not good, more scaled-generator HB simulations are run until a good solution is found for the original problem.
If HB is source stepping for some phase realisations of the multisine, a little bit of Crest Factor (CF) optimisation usually solves the problem. CF optimisation should be done with great care though, as it changes the Probability Density Function of the multisines involved and influences the obtained Best Linear Approximation.
HB under switching and strongly non-linear behaviour
The HB simulator usually encounters problems when simulating circuits with very strongly non-linear behaviour, like clipping, switching or dead-zones. Another common source of convergence issues are models that are constructed by “glueing” functions together in a piecewise manner which creates discontinuities in the derivatives. These problems are mostly encountered in simulations of low-frequency circuits. For high-frequency circuits, usually the models are constructed with the HB simulator in mind and discontinuities in the models or its derivatives are avoided. Also, very abrupt clipping at these high frequencies is rare as the components used are not capable of generating the amount of harmonics required.
Many of the low-frequency transistor models on the other hand still contain discontinuities, as they are constructed only with time-domain simulations in mind. Discontinuities in the models usually introduce convergence issues in the HB simulations which are impossible to overcome without changing the transistor model.
Also, due to the very high gain in some of the low-frequency circuits, strongly non-linear behaviour can be encountered. When an operational amplifier, placed in feedback, reaches one of its supply rails abrupt clipping occurs, which is hard to capture in the frequency grids used in HB. As an example, we simulated a clipping non-linear element both with transient and HB. The result is shown in Figure 4.2.
It is clear that the HB simulation struggles to represent the sudden discontinuity in the signal, while the transient simulation doesn’t encounter any problem on the same circuit. The strong oscillations seen in the HB solution close to the discontinuity are due to the Gibbs phenomenon, which is encountered when a discontinuous signal is approximated by a Fourier series.
Figure 4.2 The Gibbs phenomenon is encountered when HB is used to simulate strongly non-linear behaviour, like a clipping non-linearity.