Combining ALICE Scope traces in LTSpice Simulations
The ADALM1000 and ALICE 1.2 Desktop is a multi-purpose and incredibly useful set of measurement tools for testing electronics projects and experiments. Circuit simulators like LTSpice, and others, are often used to test out electronic circuit experiments before constructing the actual circuit. In the previous Blog entry we showed an example of how to view simulation waveforms in ALICE. Now we will switch that around and show how to use measured waveforms from ALICE as PWL sources in LTSpice.
Sometimes we might need to use the output generated from an actual circuit as the input stimulus for part of the overall design that might not be built yet. In this Blog entry we are going to go over a simple example showing how to save the output waveforms from ALICE 1.2. We can then use them as PWL sources within a simulation in LTSpice so they can be either inputs to the simulated part of the circuit or compared to the simulated output voltage waveform you get. By comparing simulated and actual results you can get the most out of this powerful combination of software and hardware.
The first thing to do is build the following simple RC circuit to use for our example.
The resistor, R1, we are using is 10K ohms and the capacitor, C1, is 0.22 uF. Channel A will be used as a square wave source with a Min value of 0.5 V and a Max value of 4.5 V at 100Hz. The ADALM1000 2.5 V DC source is used as the reference node for the common side of the capacitor.
Now we can open ALICE and measure the actual circuit. We can setup CHA to output the 100 Hz square wave. In CHA, set the Min value to 0.5 and the Max value to 4.5 with the Mode set to SVMI and the shape to Square. We also need to set CHB mode to Hi-Z.
With the Horz time scale set to 2 mSec/Div we can run ALICE and see the measure results of the circuit. Something like this.
For the next step to save the waveform data in a form that LTSpice can read in as points for a PWL source we need to use the newest version of ALICE 1.2 Desktop dated 10 March 2018 or later. Earlier versions could not save just one trace's data with time points in a single file. Under the File drop down there is now an option to Save PWL Data. The program prompts for which channel's data you want to save. Each PWL data file can contain data for just one source.
For this example we will use this new function twice to save the channel A voltage trace data into a file named cha-out.txt and the channel B voltage trace data into a file named chb-out.txt.
Now we are all set to enter the example circuit in LTSpice. We have one PWL source, named CHA-Meas, that will be the input to the RC circuit. We need a second PWL source, named CHB-Meas, that will simply play back the measured CH-B voltage data for comparison to the simulated voltage waveform on node CHB. Note that all you have to do is specify the name of the file to use in each of the PWL sources.
Now we can run the simulation for 20 mSec and we should get a plot much like we got in ALICE of the actual circuit.
The green plot is the voltage on the CHA source. The blue trace is the simulated voltage on the capacitor, node CHB, which is mostly behind the red voltage plot of the CHB-Meas source. Of course we are getting a very close match between simulated and actual measurements as we would expect in the simple example.
For more info on how to use ALICE check out the User Guide.
Hopefully this overview is enough to get you familiar with using these useful tools. If you have any additional questions please head over to the Virtual Classroom section of the EngineerZone Forum.
As always I welcome comments and suggestions from the user community out there on how to improve ALICE.