I am trying to build the CCCV (voltage limited current source in LTspice, having following characteristics:
- Sources defined current until voltage at the terminals reaches defined voltage, then keep that voltage at the terminals
- Disconnect the source after keeping it at constant voltage for predefined amount of time (e.g. "charge with 100 mA to 3.6 V, then continue holding 3.6 V for 30 minutes")
I managed to resolve (1). Circuit bellow combines ideal current source, defined to source 200 mA for 110 s, with ideal diode having forward voltage set to the desired voltage limit (in this case 2.7 V):
When the source reach the voltage limit, excessive current will flow through the diode, passing just the current needed to maintain the voltage to the rest of the circuit, as shown in circuit response:
I don't know how to resolve requirement (2), i.e. how to modify current source to after reaching the voltage limit continue to supply current for e.g. 30 seconds and then switch off. I was thinking of using comparator that triggers a timer, which after the time elapses turns off the switch in series with the source, but it seems too complicated. I would prefer a solution that use SPICE command to record time when the voltage is reached and use it to turn the source off after additional interval passes.