Hi
How do I create a current sink with increasing frequency over time. Please see image
Thanks
Santosh
Hi
How do I create a current sink with increasing frequency over time. Please see image
Thanks
Santosh
Hi Santosh,
There are several methods. The easiest one is to use 2 current sources in parallel, each with a PULSE function:
I1 0 N001 PULSE(0 2 0 10n 10n 6.99u 14u 5)
I2 0 N001 PULSE(0 2 63.5u 10n 10n 490n 1u)
Reiner
Hi Reiner
The image I attached here was just for example. Actually, I want to create a current sink that can sink current with frequency sweeping from 20KHz to 50kHz over a period. Initially, the pulse should start with 20KHz then gradually increase to 50KHz with a step of 1KHz
Please suggest
Thanks
Santosh
In this case, the easiest way is to make use of the current limitation capability of a voltage controlled switch.
You need:
- a voltage controlled switch with model SW
- model definition ".model SW SW(Ilimit=0.1)" e.g. for a 0.1A current sink
- a control voltage. E.g. with a B source (symbol BV). Define "V=sin(time*(fstart+(fend-fstart)*time/tspan/2)*2*PI)"
- at last, define your parameters with e.g. ".param fstart=20k fend=50k tspan=10m"
This example generates a 0A/0.1A current sink with continuously increasing frequency from 20kHz to 50kHz within 10ms.
Reiner
HI Reiner
I have attached my LTspice sim file here for your reference. I have created a sink model as you suggested.
But for the voltage-controlled switch if I try to change the current limit to 100A from 0.1A it does not work. Current limits at 1A only. How do I change it to 100A? ".model SW SW(Ilimit=100)"
also, what is tspan? can I adjust this to 100m or 1000m?
Can I adjust the rise time and fall time of the current pulse?
Thanks
Santosh
Hi Santosh,
The default on-resistance of the switch model is 1 Ohm. Therefore, you see max. 1A with your 1V source.
Just add a "ron" parameter to the model definition.
You can make use of the smooth transition parameter "negative vh" to influence rise and fall times. But this is not linear. Let me know f you need an exact linear rise and fall behavior, an other method has to be used then.
The extended model definition could look like this in your case:
.model MYSW SW(Ilimit=10 ron=1m vh=-1)
Reiner