Add differential signals Ngspice


#1

Hi everybody. This is my first thread so please be patient.
Right now I’m designing a single-ended to full-differential OPA filter.


But I don’t know how to measure or add the differential output from the filter in the spice simulator. I want to see the transfer function from the single-ended input to the differential output. You think you can help me? Thanks


#2

The eeschema-ngspice interface is still rather limited. You cannot simply plot the voltage difference between two nodes.

So you have to create (design) your own voltmeter that provides a differential to single ended conversion.

Place a three terminal symbol with nodes 1, 2, 3. Assign 1, 2, 3 to in+, in- and out nodes. place a resistor from out to ground (to not have an unconnected output).

Assign an ngspice subcircuit to your new device that uses a ngspice voltage controlled voltage source vcvs inside, which produces a voltage difference between its in+ and in- nodes and amplifies the difference by factor 1 and sends this to node out.

.subckt meas in+ in- out
Emeas out 0 in+ in- 1
.ends

Now measure (plot) the ac voltage at node ‘out’. This will be the ratio to V1 if you assign ‘DC 0 AC 1’ to V1, not just AC, and you will get the bode plot (gain and phase versus frequency), if you run an ac simulation.


#3

Hello Holger.
Thanks a lot for your help, you rock jaja. I think I get the gist of what you’re saying. Basically I need a unity gain differential amplifier, a buffer at the output. But I’m a beginner at this so I don’t know much about designing devices with ngspice, I’ve been trying to find some documentation in the topic with no success, do you think you could give me some?
Regarding your answer, this is what I came up with.
image
I believe I correctly followed up your instructions, but I obtained a bode which is different to what I expected. The circuit is supposed to be a second order low pass filter, with cut-off frequency at 700k, but the bode shows something different.


#4


#5

Hi again :stuck_out_tongue: So yes, I had a design error. Here I present you the final circuit with its theoretically expected bode. And the cut off was 70kHz not 700


#6