After digging through old archives I found what may have prompted your question--a collection of models used to demonstrate features of the Linear Circuit Builder. Some of these date back to 2002. One of them was a circuit that compensated for electrode capacitance and series resistance, and sure enough its main file was called init_rc_comp3.hoc. Here is the source code for this particular model, updated slightly for better initialization, including explanatory nodes and a couple of figures
https://www.neuron.yale.edu/ftp/ted/neu ... 3_2017.zip and here is its equivalent circuit
The model cell it uses is a ball and stick approximation to the charging properties of the pyramidal cell that comes with NEURON's demo program; the specification of the model is
Code: Select all
soma { nseg=1 L=60.6576 Ra=160
diam=60.6576
cm=1
insert hh { gnabar_hh=0.12 gkbar_hh=0.036 gl_hh=0.0003 el_hh=-54.3}
}
dend { nseg=37 L=1632 Ra=160
diam = 4.3
soma connect dend (0), 1
insert pas { g_pas=0.001 e_pas=-65}
cm=1
}
The circuit uses an equivalent T approximation for the properties of the electrode. Adjust the gain of amplifier A2 to compensate for series resistance, and adjust the gain of Af to compensate for electrode capacitance. The time constant of the series combination of Cf and Rf must be the same as the electrode time constant (Ce Re / 4) to achieve good capacitance compensation.
The potentials at the ungrounded ends of Ce and Cf must be properly initialized, or spurious current will be injected at t = 0, causing large voltage transients and possibly a spike as well. The correct initializations are
Code: Select all
Vx v_init
Ve v_init
Vy 5*v_init (i.e. gain of A1 * gain of Af * Ve)
Vo v_init
Assuming that this is the circuit that you're asking about, here are the answers to your questions.
The current that compensates for electrode capacitance is produced by the output of Af driving the series combination of Cf and Rf. Notice that the gain of A1 is 1, so Af must have gain Gf > 1 in order for positive feedback to occur.
why does Af amplifier has a gain of 5?
For this circuit's parameters, higher gains result in ringing or oscillations, and lower gains result in delay and attenuation of Vo compared to Vs. Ringing and oscillations occur if open loop gain G1 Gf > Rf/(Re/2) (G1 and Gf are the gains of A1 and Af, respectively); in this circuit, Rf is 25 megohms and Re/2 is 5 megohms.