again with the constant current generator

Thread Starter

electronicsenjoyer089

Joined Feb 24, 2025
182
Hello all,

I have made modifications u suggested me to do, now i got on the non inverting input a lower voltage as VREF and i put a resistor of 1k to set the 150uA that has to flow on the capacitor, but what i see is this: across the cap i got is 53mA, i want to have 150uA for 100us, the time there is the positive cycle of the square wave , how and why i could achieve that?
 

Attachments

ronsimpson

Joined Oct 7, 2019
4,645
Many comments.
1) I think C1 was not connected on the bottom end.
2) C1 (at time zero) has 3.3V across it. (in my case 5V) There is a way to tell spice to start with 0V across C1. I put a 1,000,000 resistor across C1 to make spice think the cap is discharged at the start.
3) The op-amp you chose is very slow. Its output moves at 0.3V/us typical and maybe as slow at 0.1V/us. Also it takes some time to get started when powered up at time zero. I put it on a separate 5V supply to get rid of the start up time problems.
4) This op-amp does not work if the inputs are near the supply(s) voltage. It does not work at 160mV. It needs more than 1V and more like 2V to work. I put the Vee supply at -3.3V to solve that.
5) I made C1 1000x bigger because the amp could not respond to a small cap charging.
6) I was not certain what Gate voltage was needed so I increased the Vcc supply to 5V. (I see it needs 2.5V) It probably should be a couple of volts above that 2.5V.
1757602709917.png
 

Attachments

Thread Starter

electronicsenjoyer089

Joined Feb 24, 2025
182
Many comments.
1) I think C1 was not connected on the bottom end.
2) C1 (at time zero) has 3.3V across it. (in my case 5V) There is a way to tell spice to start with 0V across C1. I put a 1,000,000 resistor across C1 to make spice think the cap is discharged at the start.
3) The op-amp you chose is very slow. Its output moves at 0.3V/us typical and maybe as slow at 0.1V/us. Also it takes some time to get started when powered up at time zero. I put it on a separate 5V supply to get rid of the start up time problems.
4) This op-amp does not work if the inputs are near the supply(s) voltage. It does not work at 160mV. It needs more than 1V and more like 2V to work. I put the Vee supply at -3.3V to solve that.
5) I made C1 1000x bigger because the amp could not respond to a small cap charging.
6) I was not certain what Gate voltage was needed so I increased the Vcc supply to 5V. (I see it needs 2.5V) It probably should be a couple of volts above that 2.5V.
View attachment 355762
I got a bit of questions, sorry if It may be really basic things for u

5) what do u mean the Op amp couldnt respond to a small charging cap? what i need to look into the Op amp as specification? What happens when i put bigger cap? What changes?
 

Thread Starter

electronicsenjoyer089

Joined Feb 24, 2025
182
Many comments.
1) I think C1 was not connected on the bottom end.
2) C1 (at time zero) has 3.3V across it. (in my case 5V) There is a way to tell spice to start with 0V across C1. I put a 1,000,000 resistor across C1 to make spice think the cap is discharged at the start.
3) The op-amp you chose is very slow. Its output moves at 0.3V/us typical and maybe as slow at 0.1V/us. Also it takes some time to get started when powered up at time zero. I put it on a separate 5V supply to get rid of the start up time problems.
4) This op-amp does not work if the inputs are near the supply(s) voltage. It does not work at 160mV. It needs more than 1V and more like 2V to work. I put the Vee supply at -3.3V to solve that.
5) I made C1 1000x bigger because the amp could not respond to a small cap charging.
6) I was not certain what Gate voltage was needed so I increased the Vcc supply to 5V. (I see it needs 2.5V) It probably should be a couple of volts above that 2.5V.
View attachment 355762
but at the end i dont achieve 100uA flowing thought the capacitor for 100us, so i cant know by calculus how much voltage there will be across It, cus there are these spikes etc, consider that im making a f-v converter, so It needs to be precise, the voltage on the cap that i will read with the ADC represents the frequency
 

ronsimpson

Joined Oct 7, 2019
4,645
what do u mean the Op amp couldnt respond to a small charging cap?
The 1uF cap seemed to charge up before the op-amp could respond. This is a very slow amp.

these spikes etc
That MOSFET has 0.0024m ohms of resistance. It is a monster. Pick a much smaller 1 ohm part. That big of a part has large amounts of capacitance. You need a part with low capacitance. I just tried the "RHU003N03" MOSFET which has very little cap. and the spikes are now gone.
 

Thread Starter

electronicsenjoyer089

Joined Feb 24, 2025
182
The 1uF cap seemed to charge up before the op-amp could respond. This is a very slow amp.


That MOSFET has 0.0024m ohms of resistance. It is a monster. Pick a much smaller 1 ohm part. That big of a part has large amounts of capacitance. You need a part with low capacitance. I just tried the "RHU003N03" MOSFET which has very little cap. and the spikes are now gone.
oh i got it, a lower rds on in a mosfet means that most likely the mosfet will have a big parasite capacitance, so i choose one with bigger rds on.
 

ronsimpson

Joined Oct 7, 2019
4,645
for choosing the op amp i need one that is quick enough to follow up right?
I would choose one that is much faster on the Volts/U second. But after the first pulse it seem to be OK.
Green trace is V1 signal. Red trace is the Gate drive.
1757693183534.png
Here I show the rise and fall time only.
1757693451691.png
Here is zoomed in showing rise time. At 400uS the signal goes high, Current starts up at 401uS and makes it by 402.5uS.
I think if you used a amp with 2 to 4 V/uS this delay will be 1/10 as much. (blue trace is current)
1757693500146.png
 

Thread Starter

electronicsenjoyer089

Joined Feb 24, 2025
182
I would choose one that is much faster on the Volts/U second. But after the first pulse it seem to be OK.
Green trace is V1 signal. Red trace is the Gate drive.
View attachment 355806
Here I show the rise and fall time only.
View attachment 355807
Here is zoomed in showing rise time. At 400uS the signal goes high, Current starts up at 401uS and makes it by 402.5uS.
I think if you used a amp with 2 to 4 V/uS this delay will be 1/10 as much. (blue trace is current)
View attachment 355808
Ok i understood thanks :D , i basically completed all the stages for my f-v converter
 
Top