Languages

CommunityCategory: XMODELCan’t measure the current flowing through a capacitor driven directly by a voltage source

XMODEL

Can’t measure the current flowing through a capacitor driven directly by a voltage source

SA Support Team Staff 2022-02-22

I have a simple testbench that measures the current flowing through a capacitor. A 1uF capacitor is driven by a pwl_gen primitive, producing a 1V/us voltage ramp starting at 1us. The iprobe primitive inserted in series with the capacitor measures the current.

I expect the capacitor to conduct the current of 1A once the ramp starts. However, the simulated current level stays at 0.

What am I missing?

1 Answers
Best Answer
SA Support Team Staff 2022-02-22

It's not your fault -- it's the limitation of the simulator. Currently, XMODEL cannot properly simulate the current flowing through a loop formed only with voltage sources and capacitors. It has to do with the fact that the capacitor current is equal to the time-derivative of the driving voltage, which is a result that cannot be produced by a proper system (a system of which number of zeros does not exceed the number of poles). SPICE simulators also have the similar limitation.

An easy remedy is to add a very small resistance (say 0.0001-ohm) in series with the capacitor, so that the loop is not made of voltage sources and capacitors only (note that the iprobe primitive is basically equivalent to a 0V voltage source). Here is a revised testbench:

And the simulated waveforms show the expected 1A current level when the ramp starts at 1us.

The future releases of XMODEL may insert this dummy resistance automatically. Until then, please insert the series resistance manually when you have to measure the current of a capacitor directly driven by a voltage source.

Attachment: capacitor_20220221.tar.gz

XMODEL

전압원으로 직접 구동되는 커패시터의 전류가 측정되지 않습니다

SA Support Team Staff 2022-02-22

커패시터에 흐르는 전류를 확인해보기 위해서 간단한 테스트벤치를 구성해보았습니다. 아래의 테스트벤치는 pwl_gen primitive를 사용해 1us 시점부터 1V/us의 일정한 기울기를 가지고 증가하는 전압을 생성하고, 이 전압을 1uF의 커패시터에 직접 인가하고 있습니다. 이때 커패시터에 흐르는 전류를 측정하기 위해 iprobe primitive를 커패시터와 직렬로 삽입하였습니다.

제가 예상한 바는 전압이 증가하기 시작하는 1us 시점부터 흐르는 전류가 1A가 되는 것입니다. 하지만, 시뮬레이션한 결과로는 전류가 항상 0에 머물러 있습니다.

제가 무엇을 잘못한 것일까요?

1 Answers
Best Answer
SA Support Team Staff 2022-02-22

It's not your fault -- it's the limitation of the simulator. Currently, XMODEL cannot properly simulate the current flowing through a loop formed only with voltage sources and capacitors. It has to do with the fact that the capacitor current is equal to the time-derivative of the driving voltage, which is a result that cannot be produced by a proper system (a system of which number of zeros does not exceed the number of poles). SPICE simulators also have the similar limitation.

An easy remedy is to add a very small resistance (say 0.0001-ohm) in series with the capacitor, so that the loop is not made of voltage sources and capacitors only (note that the iprobe primitive is basically equivalent to a 0V voltage source). Here is a revised testbench:

And the simulated waveforms show the expected 1A current level when the ramp starts at 1us.

The future releases of XMODEL may insert this dummy resistance automatically. Until then, please insert the series resistance manually when you have to measure the current of a capacitor directly driven by a voltage source.

Attachment: capacitor_20220221.tar.gz