VClamp

class VClamp

Voltage clamp object for holding neuronal compartments at a specific voltage. This implementation uses a builtin RC circuit to filter the command input and then use a PID to bring the sensed voltage (Vm from compartment) to the filtered command potential. Usage: Connect the currentOut source of VClamp to injectMsg dest of Compartment. Connect the VmOut source of Compartment to set_sensed dest of VClamp. Either set command field to a fixed value, or connect an appropriate source of command potential (like the outputOut message of an appropriately configured PulseGen) to set_command dest. The default settings for the RC filter and PID controller should be fine. For step change in command voltage, good defaults withintegration time step dt are as follows:

time constant of RC filter, tau = 5 * dt proportional gain of PID, gain = Cm/dt where Cm is the membrane capacitance of the compartment integration time of PID, ti = dt derivative time of PID, td = 0
proc

void (shared message field) Shared message to receive Process messages from the scheduler

getCommand()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

getCurrent()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

getSensed()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

setMode()

(destination message field) Assigns field value.

getMode()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

setTi()

(destination message field) Assigns field value.

getTi()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

setTd()

(destination message field) Assigns field value.

getTd()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

setTau()

(destination message field) Assigns field value.

getTau()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

setGain()

(destination message field) Assigns field value.

getGain()

(destination message field) Requests field value. The requesting Element must provide a handler for the returned value.

sensedIn()

(destination message field) The VmOut message of the Compartment object should be connected here.

commandIn()

(destination message field) The command voltage source should be connected to this.

process()

(destination message field) Handles 'process' call on each time step.

reinit()

(destination message field) Handles 'reinit' call

currentOut

double (source message field) Sends out current output of the clamping circuit. This should be connected to the injectMsg field of a compartment to voltage clamp it.

command

double (value field) Command input received by the clamp circuit.

current

double (value field) The amount of current injected by the clamp into the membrane.

sensed

double (value field) Membrane potential read from compartment.

mode

unsigned int (value field) Working mode of the PID controller.

mode = 0, standard PID with proportional, integral and derivative all acting on the error.

mode = 1, derivative action based on command input

mode = 2, proportional action and derivative action are based on command input.

ti

double (value field) Integration time of the PID controller. Defaults to 1e9, i.e. integral action is negligibly small.

td

double (value field) Derivative time of the PID controller. This defaults to 0,i.e. derivative action is unused.

tau

double (value field) Time constant of the lowpass filter at input of the PID controller. This smooths out abrupt changes in the input. Set it to 5 * dt or more to avoid overshoots.

gain

double (value field) Proportional gain of the PID controller.