# Simulation plotting references?

I’m simulating a simple bridge rectifier, but I’m struggling with the plot. I’d like to show the input (red) and the output (yellow) in the same graph. I’m guessing I would need to use multiple references? How can I achieve this in KiCad?

FYI:
Vsource: sin(0 10 50 0)
Diode Node sequence: 2 1
Transient simulation: 10u 100m

With simulation you run into the same problem as in the touchable world.

The AC and the DC side do not share a common GND reference.

I do not do much with simulators myself, in the real world you can define “GND” as on one side of the bridge, and use a differential probe for the other side. Or with a 4 channel scope use the scope’s subtract option for a somplified differential probe.

Hey, there. Currently, Eeschema `<->` ngspice interface is somewhat limited so you can’t plot differential voltages directly in KiCad’s Simulator app. One workaround is to generate the difference voltage within the simulation itself and plot it. There are several ways to do this. Although E-source would probably be the most “correct” way, it requires a non-standard symbol with two extra control pins. Therefore, I opted to use a B-source in the attached example project (in ZIP file below) which uses the SPICE notation of `V(node_a,node_b)` to calculate the difference between node_a and node_b. You can also simply take the direct difference with `V(node_a)-V(node_b)`. Both results are equivalent. Notice how I used global labels for my nodes since that removes the forward-slash required to reference them in the B-source equation.

dbridge_test.zip (4.5 KB)

Let me know if you have any follow-up questions.

Thanks Ste! Spot on!

It took me a while to figure it out because I was intimidated by the B-source (since I couldn’t find it in my library).
However it took just a few steps to solve it. It might even be that some of them are not necessary, but this works for me.

1. Add global labels for Voutp, Voutn
2. Copy the VSource
3. Double click the new VSource to edit it.
-Reference: B?
-Value: V=V(Voutp,Voutn)
-Spice_Primitive: B
-Spice_Model: <Remove this field by clicking on it, then clicking the trashcan>
-Confirm changes by OK
4. Connect the 1G resistor, GND and Vout label to B-Source
5. Annotate and Simulate

Edit:
Here’s more information on B-sources from this forum: Voltage and current controlled source

1 Like