SYSTEMS AND METHODS FOR AUTOMATED CHARGE BALANCING OF MULTIPLE ELECTRODES FOR UNINTERRUPTED THERAPY AND EVOKED RESPONSE SENSING

20170259065 · 2017-09-14

    Inventors

    Cpc classification

    International classification

    Abstract

    Electrical stimulation of a target (e.g., nervous tissue) is performed, wherein balance phases are automatically determined, and at least one of the electrodes is indirectly monitored during therapy delivery. The stimulation system is further configured to generate correction currents when a voltage accumulated at associated double layer capacitances crosses pre-defined thresholds so as to reduce or cancel the accumulated voltages without therapy interruption. A finer automatic determination of balance phases permits minimizing the stimulus artifact for evoked response sensing. Closed-loop neurostimulation may be performed based on such evoked responses.

    Claims

    1. A method for automatic charge balancing during delivery of electrical stimulation to tissue using a pulse generator (700), the pulse generator (700) having: I. a stimulating electrode (W, X), II. a return electrode (Y), and III. a forced return electrode (Z), wherein: A. the stimulating electrode (W, X), the return electrode (Y), and the forced return electrode (Z) are configured to deliver the electrical stimulation, B. each electrode (W, X, Y, Z) is coupled by a respective DC-blocking capacitor (C.sub.i) to a current source (S), a current sink (S′), or a voltage, and C. each electrode (W, X, Y, Z) defines a capacitance (C.sub.dli) when forming a double layer with adjacent tissue, the method including the steps of: a. in a determination stage, programming stimulation current pulses (I.sub.Ni) and determining balancing current pulses (I.sub.Pi) for each electrode (i=W, X, Y, Z) wherein: (1) for each stimulating electrode (W, X), the difference between the stimulation current pulse (I.sub.Ni) and balancing current pulse (I.sub.Pi) is a positive value; (2) for each of the return electrode (Y) and the forced return electrode (Z), the difference between the stimulation current pulse (I.sub.Ni) and the balancing current pulse (I.sub.Pi) is: (a) positive, and (b) less than or equal to the difference between the stimulation current pulse (I.sub.Ni) and balancing current pulse (I.sub.Pi) for the stimulating electrode (W, X); b. in a stimulation stage following the determination stage: (1) repeatedly applying stimulation cycles via the stimulating electrode (i=W, X) and the return electrode, each stimulation cycle including: (a) the stimulation current pulse (I.sub.Ni); (b) the balancing current pulse (I.sub.Pi) following the stimulation current pulse (I.sub.Ni); (c) an open circuit phase (OCP) following the balancing current pulse (I.sub.Pi), wherein no current is applied via the stimulating electrode (W, X); (2) monitoring at least one of the electrodes (W, X, Y, Z); and (3) generating correction currents (I.sub.CORRstim, I.sub.CORRRet) when an accumulated voltage (ΔV.sub.dli) at the double layer of any of the monitored electrodes crosses pre-defined thresholds (−ΔV.sub.AddOCP, ΔV.sub.SubOCP), wherein the correction currents (I.sub.CORRstim, I.sub.CORRRet) reduce the accumulated voltage (ΔV.sub.dli).

    2. The method of claim 1 wherein any crossing of the pre-defined thresholds (−ΔV.sub.AddOCP, ΔV.sub.SubOCP) by the accumulated voltage (ΔV.sub.dli) of one of the monitored electrodes is detected by comparing: a. a voltage on a terminal of the DC-blocking capacitor (C.sub.i) opposite the monitored electrode, and b. the difference between: (1) a voltage reference, and (2) an estimated accumulated voltage (P*ΔV.sub.CStim|.sup.Per Pulse, P*ΔV.sub.CRet|.sup.Per Pulse, or P*ΔV.sub.CFor|.sup.Per Pulse) at the DC blocking capacitor (C.sub.i) of the monitored electrode.

    3. The method of claim 2 wherein the stimulation current pulse (I.sub.Ni) and/or the balancing current pulse (I.sub.Pi) are determined in dependence on: a. patient posture, and/or b. stimulation cycle frequency.

    5. The method of claim 3 wherein the determination stage includes providing stimulation current pulses (I.sub.Ni) from each electrode (i=W, X, Y, Z) to a reference electrode (201).

    6. The method of claim 5 wherein the reference electrode (201) is defined by a casing (201) of the pulse generator (700).

    7. The method of claim 1 wherein the stimulation current pulse (I.sub.Ni) and/or the balancing current pulse (I.sub.Pi) are determined such that any stimulus artifact (SA) resulting from a stimulation cycle is minimized.

    8. The method of claim 7 further including the step of sensing evoked compound action potentials (ECAPs), each evoked compound action potential resulting from one of the stimulation cycles.

    9. The method of claim 8 wherein evoked compound action potentials (ECAPs) are sensed using at least one of: a. adaptive frequencies, and/or b. equivalent-time sampling techniques.

    10. The method of claim 8 wherein evoked compound action potentials (ECAPs) are sensed using three recording electrodes (B6, B7, B8).

    11. The method of claim 10 wherein: a. the recording electrodes (B6, B7, B8) are provided on at least one implantable lead connected to the pulse generator (700), and b. the recording electrodes (B6, B7, B8) are provided in: (1) a tripolar arrangement, or (2) a quasi-tripolar arrangement.

    12. The method of claim 10 wherein: a. the pulse generator (700) includes first and second leads (701.a, 701.b); b. one of the leads (701.a, 701.b) has the stimulating electrode (A3, B2) and return electrode (A2, A4, B1, B3) thereon, with the stimulating electrode being guarded by the return electrode; and c. one of the leads (701.a, 701.b) has the recording electrodes (B6, B7, B8) thereon.

    13. The method of claim 12 wherein: a. one of the stimulating electrode (A3, B2) and the recording electrodes (B6, B7, B8) is situated closer to a proximal end of one of the leads; b. the other of the stimulating electrode (A3, B2) and the recording electrodes (B6, B7, B8) is situated closer to a distal end of one of the leads.

    14. The method of claim 12 further including the step of detecting changes in relative positioning of the leads (701.a, 701.b), the step including determining latency value changes of ECAPs.

    15. The method of claim 1 wherein each electrode (W, X, Y, Z) is coupled to its respective current source (S), current sink (S′), or voltage solely via its respective DC-blocking capacitor (C.sub.i).

    16. The method of claim 1 wherein in the determination stage, the stimulation current pulses (I.sub.Ni) are programmed, and the balancing current pulses (I.sub.Pi) are determined, such that: a. the DC-blocking capacitor (C.sub.i) and defined capacitance (C.sub.dli) of each electrode (W, X, Y, Z) charge in the same direction; and b. the DC-blocking capacitor (C.sub.i) and defined capacitance (C.sub.dli) of the stimulating electrode (W, X) charge in directions opposite the charging of the DC-blocking capacitor (C.sub.i) and defined capacitance (C.sub.dli) of the return and forced return electrode (Y, Z).

    17. A method for automatic charge balancing during delivery of electrical stimulation to tissue using a pulse generator (700), the pulse generator (700) having: I. a stimulating electrode (W, X), II. a return electrode (Y), and III. a forced return electrode (Z), wherein: A. the stimulating electrode (W, X), the return electrode (Y), and the forced return electrode (Z) are configured to deliver the electrical stimulation, B. each electrode (W, X, Y, Z) is coupled by a respective DC-blocking capacitor (C.sub.i) to a current source (S), a current sink (S′), or a voltage, and C. each electrode (W, X, Y, Z) defines a capacitance (C.sub.dli) when forming a double layer with adjacent tissue, the method including the steps of: a. in a determination stage, programming stimulation current pulses (I.sub.Ni) and determining balancing current pulses (I.sub.Pi) for each electrode (i=W, X, Y, Z) wherein: (1) the DC-blocking capacitor (C.sub.i) and defined capacitance (C.sub.dli) of each electrode (W, X, Y, Z) charge in the same direction; (2) the DC-blocking capacitor (C.sub.i) and defined capacitance (C.sub.dli) of the stimulating electrode (W, X) charge in directions opposite the charging of the DC-blocking capacitor (C.sub.i) and defined capacitance (C.sub.dli) of the return and forced return electrode (Y, Z); b. in a stimulation stage following the determination stage: (1) repeatedly applying stimulation cycles via the stimulating electrode (i=W, X) and the return electrode, each stimulation cycle including: (a) the stimulation current pulse (I.sub.Ni); (b) the balancing current pulse (I.sub.Pi) following the stimulation current pulse (′N.sub.i); (c) an open circuit phase (OCP) following the balancing current pulse (I.sub.Pi), wherein no current is applied via the stimulating electrode (W, X); (2) monitoring at least one of the electrodes (W, X, Y, Z); and (3) generating correction currents (I.sub.CORRstim, I.sub.CORRRet) when an accumulated voltage (ΔV.sub.dli) at the double layer of any of the monitored electrodes crosses pre-defined thresholds (−ΔV.sub.AddOCP, ΔV.sub.SubOCP), wherein the correction currents (I.sub.CORRstim, I.sub.CORRRet) reduce the accumulated voltage (ΔV.sub.dli).

    18. The method of claim 17 wherein in the determination stage, the stimulation current pulses (I.sub.Ni) are programmed, and the balancing current pulses (I.sub.Pi) are determined, such that: a. for each stimulating electrode (W, X), the difference between the stimulation current pulse (I.sub.Ni) and balancing current pulse (I.sub.Pi) is a positive value; b. for each of the return electrode (Y) and the forced return electrode (Z), the difference between the stimulation current pulse (I.sub.Ni) and balancing current pulse (I.sub.Pi) is: (1) positive, and (2) less than or equal to the difference between the stimulation current pulse (I.sub.Ni) and balancing current pulse (I.sub.Pi) for the stimulating electrode (W, X).

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    [0035] Further versions, features, and advantages of the invention are described below with reference to the accompanying drawings, wherein:

    [0036] FIG. 1 shows an example of the potential of a stimulating electrode when an active charge-balanced stimulation protocol is used in a high rate pulsing application.

    [0037] FIG. 2 schematically depicts an exemplary front-end of an implantable pulse generator in accordance with the invention.

    [0038] FIG. 3 shows an exemplary stimulation phase and balance phase of the pulse generator of FIG. 2.

    [0039] FIG. 4 shows an exemplary circuit for determining the open circuit potential (OCP).

    [0040] FIG. 5 shows the use of the circuit of FIG. 4 to measure accumulated voltage in a cycled electrode “i” during the determination stage.

    [0041] FIG. 6a shows an N to 3 multiplexer (MUX) block for measuring voltages, and FIG. 6b shows the MUX block's use for monitoring electrodes.

    [0042] FIG. 7 shows a stimulation and balance phase following the determination stage described below.

    [0043] FIGS. 8 and 9 show comparators for indirectly monitoring the accumulated double layer voltages.

    [0044] FIG. 10 shows a correction phase for cancelling accumulated double layer voltages.

    [0045] FIG. 11 shows a compare phase preceding a correction phase.

    [0046] FIG. 12 shows a comparator for stopping the injection of a correction phase.

    [0047] FIG. 13 shows an exemplary version of the invention having a pulse generator (e.g., an implantable pulse generator) and dual percutaneous leads, with three recording electrodes in a quasi-tripolar configuration.

    [0048] FIG. 14 shows a first order impedance model for three recording electrodes for recording ECAPs.

    [0049] FIG. 15 shows a true tripolar configuration of recording electrodes.

    [0050] FIG. 16 shows an arrangement for detecting migration of the leads.

    [0051] FIG. 17 illustrates principles for determining lead migration using latency of ECAPs.

    DETAILED DESCRIPTION OF EXEMPLARY VERSIONS OF THE INVENTION

    [0052] In the field of electrical stimulation, it is widely accepted that pulses having fully balanced charge are required for therapy delivery. FIG. 1 shows an example of the potential of a stimulating electrode when an active charge-balanced stimulation protocol is used in a high rate pulsing application. The stimulation pulse consists of a stimulation phase 101 (cathodic pulse) and a balance phase 102 (anodic pulse), followed by an open circuit phase 103 where no current is imposed by the pulse generator. The electrode potential begins from its open circuit potential (OCP), which is measured against a suitable voltage reference electrode. During delivery of the first cathodic pulse 104, the electrode-tissue double layer reversibly charges and the electrode may begin to transfer charge into Faradaic reactions 105 as its potential moves negatively. Since it is likely some irreversible charge transfer will occur during the stimulation phase 101, not all of the injected charge may go into charging the double layer. Hence, only a fraction of the cathodic charge of pulse 104 would be required during the anodic phase 102 to bring the potential back to OCP. If the anodic pulse 102 is balanced with the cathodic one 101 instead, as classically implemented in implantable pulse generators (IPGs), the pre-pulse potential 106 of successive pulses moves in the positive direction until the same amount of charge is lost during the cathodic and anodic phases shaded areas 107.a and 107.b. If this occurs, the anodic Faradaic reaction 107.b may cause electrode corrosion. In the case of a platinum (Pt) electrode, for example, Pt oxide (PtO) may be formed, and soluble Pt compounds—including toxic products such as cisplatin [PtCl.sub.2(NH.sub.3).sub.2]—may be generated when such PtO reacts in the chloride medium.

    [0053] FIG. 2 then illustrates an exemplary multi-electrode, multi-current front-end system 1 of a pulse generator in accordance with the invention. The pulse generator is preferably an IPG, but the invention also encompasses non-implantable pulse generators. The system 1 is configured to deliver stimulation with a scheme that automatically adjusts the injected charges to maintain safe operation, particularly to prevent voltage runaway in the DC blocking capacitors C.sub.i (where i denotes the electrode; blocking capacitors C.sub.W, C.sub.X, C.sub.Y, C.sub.Z for electrodes i=W, X, Y, Z are shown, though more or fewer electrodes and blocking capacitors may be used).

    [0054] During charge-imbalanced stimulation, the shift in pre-pulse potential may be either positive or negative with respect to the open circuit potential OCP depending on the amount of imbalance. Hence, to be able to monitor electrode voltage drift and compensate for it during therapy (without interruption, e.g., without the need to pause to drain charge), the system 1 delivers the minimum charge imbalance to ensure that at each active electrode, both its associated DC blocking capacitor C.sub.i and double layer (which are in series) charge in the same direction. The stimulating electrodes will charge in one direction, whereas the return electrodes will charge in the opposite direction to allow compensating when certain voltage limits are reached.

    [0055] Determination of the necessary imbalance may be performed prior to therapeutic electrical stimulation of the target (e.g., tissue of a patient), for different patient postures, and depending on the stimulation frequency, by first independently cycling through each programmed stimulating electrode to be used for electrical stimulation, and stimulating (as programmed for electrical stimulation) against a pseudo reference electrode instead. Such pseudo reference may preferably be the IPG case 201. Thereafter, the system 1 cycles through all return electrodes except one, whereby this return electrode is forced to handle the current mismatches. During this “determination stage,” parameters that measure the final programmed “unbalance” for each active electrode are saved, and the stimulation and return electrodes with the largest voltage drift, as well as the forced return electrode, are selected for indirect monitoring during the actual therapeutic electrical stimulation.

    [0056] Once the determination stage is completed, electrical stimulation of the target is delivered as programmed. During the open circuit phases, the accumulated electrode-tissue double-layer voltages (of the electrodes selected for monitoring) are indirectly compared against variable reference voltages internally generated in the IPG 700. These comparators (exemplified by those in FIGS. 8 and 9) preferably allow monitoring the stimulation and return electrode voltages with the largest excursions, and the forced return electrode voltage, between programmable limits without directly accessing such electrode voltages. Unlike prior arrangements, there are no measurements during therapy (electrical stimulation of the target), only comparison of voltages that indirectly assess the double-layer voltages accumulated (e.g., a minimum of three voltages on the other side of the DC blocking capacitors for the selected electrodes). Advantageously, this approach reduces power consumption, as no amplifiers are used during the actual electrical stimulation of the target; minimizes time to decide on the status of the electrodes; and requires no DC path from an electrode.

    [0057] Preferably, once a comparator triggers, correction phases take place to start moving the accumulated charges in the opposite direction. These correction phases can either be performed by having a separate active phase during part of the open circuit phases, or by adjusting successive balance phases.

    [0058] Preferred arrangements for carrying out the invention will now be described in detail. FIG. 2 shows a schematic representation of a front-end of a classical multi-electrode (N electrodes) implantable pulse generator (IPG) 700, which may be configured as an IPG of a spinal cord stimulator (SCS), or as a neurostimulator designed for another application where current steering is desired, such as in nerve cuff stimulation of peripheral nerves. Each electrode-tissue interface is modelled by an impedance Z.sub.i (modelled at the top right of FIG. 2) composed of the parallel of the electrode-tissue double-layer capacitance C.sub.dli with a variable resistor R.sub.i (representative of Faradaic reactions that may occur during stimulation/balancing), in series with R.sub.Ω (which represents the ohmic drop of the tissue electrolyte in the vicinity of an electrode).

    [0059] Particularly, the IPG case 201 is made of a material that approximates a pseudo reference electrode (e.g. fractal Ir or TiN) and may have an effective area that makes its double-layer capacitance C.sub.Case (not shown) much larger than C.sub.dli (i=1 . . . N). The electrodes can be made, for example, of Pt, Pt/Ir, or fractal Ir. The open circuit potential (OCP) V.sub.OCP shown in FIG. 2 is against the IPG case 201 when the latter is connected to an internally-generated voltage reference V.sub.REF via switch 202. Since all electrodes are of the same material and have similar areas, it can be considered they all have the same V.sub.OCP, as reflected in FIG. 2.

    [0060] A similar R′.sub.Ω represents the ohmic drop in the vicinity of the IPG case 201. The R.sub.Ω and R′.sub.Ω actual values are irrelevant, as voltage monitoring for safe operation occurs during the open circuit phases 103 when no current is imposed by the IPG 700 (or it can otherwise be neglected for the purpose of the analysis). The voltage V.sub.STIM in FIG. 2 is programmed with the required minimum overhead for steady-state stimulation.

    [0061] C.sub.i represents the DC blocking capacitor associated with each electrode (i=1 . . . N, only C.sub.W to C.sub.Z shown in FIG. 2), which are nominally all equal. It can also be guaranteed by design that C.sub.case is much larger than C.sub.i. Typically, the C.sub.i value used in IPGs is in the order of 10 μF. C.sub.dli, on the other hand, can have a value on the order of (for example) 12.5 μF for an SCS Pt electrode. Fractal Ir coated electrodes will present a higher C.sub.dli. In the case of nerve cuff electrodes, C.sub.dli may be lower. However, no particular relative values between C.sub.dli and C.sub.i are assumed for the purpose of implementing safe electrical stimulation.

    [0062] Components R in FIG. 2 are bleeding resistors (preferably rated in the hundreds of kΩ), placed in star configuration, as typically utilized in IPG front-ends for passive charge neutrality. The invention preferably re-utilizes this network for the purpose of implementing safe stimulation, as described below. The IPG case 201 may also have a bleeding resistor connected to it, which would slightly alter the calculations shown below.

    [0063] Assume that electrodes W, X, Y, Z are active during delivery of electrical stimulation to the target and that (for example) W, X are the stimulating electrodes and Y, Z the return electrodes of the stimulation phases, as shown in FIG. 3. During the stimulation phase, sinking currents I.sub.NW and I.sub.NX (will flow through electrodes W and X respectively, whereas sourcing currents I.sub.PY and I.sub.PZ flow through electrodes Y and Z. Currents are programmed so the total cathodic current equals the total anodic current, i.e. in this case


    I.sub.NW+I.sub.NX=I.sub.PY+I.sub.PZ  (1)

    [0064] Assuming the sourcing currents (those from V.sub.STIM) present larger output impedance than the sinking ones (those to ground or another voltage reference), the sinking currents will accommodate their real values to satisfy eq. (1). The system adjusts the output impedance of the current source associated with at least one of the return electrodes in the stimulation phase (e.g., contact Z) to implement tissue and electrode safe operation, as further described below.

    [0065] An active balance phase has the reverse arrangement, as shown in FIG. 3, i.e., currents I.sub.PW and I.sub.PX flow instead through electrodes W and X respectively, whereas currents I.sub.NY and I.sub.NZ will flow through electrodes Y and Z.

    [0066] For the actual electrical stimulation of the target (therapy), currents I.sub.NW, I.sub.NX, I.sub.PY, and I.sub.PZ, the stimulation phase pulse width (PW.sub.Stim, common to all), the balance phase pulse width (PW.sub.Bal, common to all), the interphase delay (i.e., the time between the end of a stimulation pulse and the start of the associated balancing pulse), and the stimulation frequency are typically selectable and programmable in an IPG 700. For high pulsing rates, and for closed-loop neurostimulation based on neural response, PW.sub.Bal is preferably selected equal to PW.sub.Stim and programmed as a single parameter pulse width (PW). The balance phase currents I.sub.PW, I.sub.PX, I.sub.NY, and I.sub.NZ can be the unknowns the system may adjust to implement safe stimulation without therapy interruption, and to minimize the stimulation artifact (SA) for evoked response sensing. Thus, preferred versions of the invention automatically determine the balance phase currents for safe operation.

    [0067] For safe tissue and electrode stimulation, the accumulated voltage of the equivalent double-layer capacitances (ΔV.sub.dli, where i=W, X, Y, Z in the example) should remain within a safe window. With the sign shown in FIG. 2 (bottom right), this translates into


    −ΔV.sub.AddOCP≦Δ.sub.Vdli≦ΔV.sub.SubOCP  (2)

    [0068] where ΔV.sub.SubOCP and ΔV.sub.AddOCP respectively limit the excursion of the electrode voltage in the negative and positive directions with respect to its open circuit potential (OCP). The limit values may be determined via in-vitro experiments using a suitable electrolyte, confirmed in-vivo, and programmed in the IPG 700. Preferably, the window is symmetrical and a few hundred mV wide (e.g. ±100 mV).

    [0069] A preferred embodiment for safe stimulation is the following: prior to delivery of the actual electrical stimulation to the target and particularly for different patient postures, the IPG 700 first estimates V.sub.OCP. To do so, it is configured to measure the common point V.sub.CM of the bleeding resistor network R (see FIG. 2), preferably via the circuit of FIG. 4 (switches 401 and 402 are closed) when the digital-to-analog converter block (DAC) outputs a reference voltage V.sub.REF and the IPG case 201 is connected to such voltage. In this case, the output put Vo of the amplifier AMP equals


    Vo=−NV.sub.OCP+V.sub.REF  (3)

    [0070] which is preferably digitized via the analog-to-digital converter block (ADC). The V.sub.OCP is then calculated and stored in the IPG 700; N is typically 2, 4, 8, 16, or 32 in a neurostimulator, so digital division is straightforward. Switches 401 and 402 are particularly designed with negligible charge injection and on-resistance compared to R. The amplifier AMP offset is also negligible for the purpose of determining V.sub.OCP. The resistor R in the feedback of amplifier AMP is preferably matched with the resistors R of FIG. 2 to reduce measurement error.

    [0071] As previously mentioned, to be able to monitor voltage drift and compensate for it, the system 1 is preferably configured to deliver the minimum charge imbalance that guarantees (at each electrode) that both C.sub.i and C.sub.dli charge in the same direction. The stimulating electrodes (W and X in the example) and the return electrodes (Y and Z in the example) of the stimulation phase will charge in opposite directions to allow compensating once a limit given by condition (2) is reached.

    [0072] Prior to the stimulation stage (where the actual electrical stimulation of the target takes place), the determination stage may proceed as follows. The system 1 preferably first cycles through each stimulating electrode independently (W and X in the example), and injects M (M=1, 2, 4, 8, . . . ) “balanced as-programmed pulses” (i.e. I.sub.Pi is automatically programmed by the IPG 700 equal to I.sub.Ni) against the IPG case 201 (the return electrode in the determination stage). The balance will then only be limited by the current matching between the real I.sub.Ni and real I.sub.Pi, which is typically calibrated for and a few percent apart. Parameter M may be selected to improve accuracy of the calculations detailed below. In between the cycling of electrodes W and X (in the example), a complete passive balance phase for electrode W and IPG case 201 (with hardware not shown in FIG. 2) is preferably performed to guarantee an electrical-neutral system before cycling the next electrode (X in the example). The same procedure applies when two or more stimulating electrodes are utilized instead for therapy.

    [0073] For the determination stage, V.sub.STIM may be re-programmed with different values to mimic the actual varying voltage that will appear across each current source/sink during therapy. For electrode W, for example, V.sub.STIM may be temporarily re-programmed during the determination stage with a value equal to


    V.sub.DSn+R.sub.W2casemax*I.sub.NWmax+(I.sub.NWmax*PW)/C.sub.WdlWmin

    [0074] where V.sub.DSn is a “safe” compliance voltage required for the current sinks to operate, R.sub.w2casemax is the measured impedance between electrode W and the IPG case 201 increased by the measurement error, I.sub.NWmax is the stimulation current through electrode W increased by the allowable error, PW is the stimulation pulse width, and C.sub.WdlWmin is the measured series capacitor C.sub.W, C.sub.dlW decreased by the measurement error. It is assumed that V.sub.DSn has enough overhead to accommodate the maximum steady-state accumulated voltage on C.sub.W and C.sub.dlW for the determination stage to properly operate under such reduced V.sub.STIM. Given each electrode is much smaller than the IPG case 201, this setup emulates what each electrode will see under a multi-current therapy setup.

    [0075] After the M determination pulses in the stimulating electrode “i” (i=W or X in the example), connecting again the circuit of FIG. 4 and the IPG case 201 results in the circuit of FIG. 5. All electrodes, except the cycled “i” (which was active), still present a voltage equal to (V.sub.REF+V.sub.OCP). Programming now the DAC block reference to a voltage V.sub.REFFIG5 equal to such (V.sub.REF+V.sub.OCP) results in


    Vo=ΔV.sub.dli+V.sub.REFFIG5  (4)


    V.sub.i=−ΔV.sub.dli+V.sub.REF+V.sub.OCP=ΔV.sub.dli+V.sub.REFFIG5  (5)

    [0076] (see FIG. 2 for the defined sign of ΔV.sub.dli).

    [0077] At the same time, the system 1 particularly also measures V*.sub.I, which is the voltage at the other terminal of the DC blocking capacitor C.sub.i of active electrode “i” cycled (see FIG. 2 bottom right). This is measured via the N to 3 multiplexer (MUX) block, switch 601 and buffer (AMP) shown in FIG. 6a (V*.sub.iBUF is the output signal).

    [0078] From V.sub.i determined above (see eq. (5)) and V*.sub.iBUF, the accumulated voltage ΔV.sub.Ci (from current mismatches) on the blocking capacitor C.sub.i can be calculated as (Vi−V*.sub.iBUF) (see FIG. 2 for the sign of ΔVC.sub.i as measured).

    [0079] If both ΔV.sub.dli and ΔV.sub.Ci are positive, the balance phase for the cycled electrode “i” can be left as programmed for the determination stage. No adjustments are necessary as the positive voltages indicate the mismatch in the real I.sub.Ni and real I.sub.Pi is causing the balancing charge to be less than the stimulation charge. The misbalance current I.sub.Diffi, i.e. real I.sub.Ni−real I.sub.Pi, can be estimated to be at least


    I.sub.Diffi=[C.sub.imin*(ΔV.sub.Ci)]/(MPW)(i=W or X in the example)  (6)

    [0080] where C.sub.imin is the minimum value of the DC blocking capacitor C.sub.i, ΔV.sub.Ci is the aforementioned measured accumulated voltage, and PW is the programmed pulse width as defined before.

    [0081] On the other hand, if ΔV.sub.dli is negative, this implies the electrode “i” potential would be moving positively pulse after pulse, so less balancing charge is required to avoid this situation. Preferably, the balancing charge reduction is determined as follows.

    [0082] A prior impedance measurement allows estimating C.sub.dli for the electrode “i” under consideration (either W or X in the example), with a certain error. Thus, the current I.sub.Lessi to be subtracted from the automatically selected I.sub.Pi can be calculated as:


    I.sub.Lessi=[C.sub.dlimax*(−ΔV.sub.dli)](MPW) (i=W or X or none in the example)  (7)

    where C.sub.dlimax is the measured C.sub.dli with the maximum added error, ΔV.sub.dli is the accumulated double-layer voltage (see FIG. 2), and PW is the programmed pulse width as defined before.

    [0083] A lookup table can be implemented in the IPG 700 to determine each I.sub.Diffi, I.sub.Lessi based on the corresponding C, ΔV, and (M PW).

    [0084] For those electrodes with negative ΔV.sub.dli, I.sub.Pi will then be automatically re-programmed equal to


    new I.sub.Pi=old I.sub.Pi−I.sub.Lessi (i=W or X or none in the example)  (8)

    where I.sub.Lessi is the current estimated above.

    [0085] Having a positive ΔV.sub.dli and a negative ΔV.sub.Ci is not possible, as the latter implies the automatically programmed I.sub.Pi was larger than the selected I.sub.Ni (by mismatch), which will always result in a negative ΔV.sub.dli regardless of whether Faradaic reactions were present or not during the stimulation phase.

    [0086] After initially cycling through all stimulating electrodes, a new set of M pulses, with the modified balance phase, is preferably injected for the stimulating electrodes that required I.sub.Pi adjustment. Their new I.sub.Diffi is then estimated and stored, and it is confirmed that both C.sub.i and C.sub.dli accumulated charge in the same direction.

    [0087] At the end of this process, all stimulating electrodes “i” (W and X in the example) will in theory satisfy


    real I.sub.Pi=real I.sub.Ni−I.sub.Diffi  (9)

    [0088] The lowest value among the estimated I.sub.Diffi from all stimulating electrodes (W and X in the example) is stored in the IPG 700 as I.sub.MinDiff. An alternative measure, such as the ΣI.sub.Diffi divided by the number of return electrodes in the stimulation phase, can instead be stored as I.sub.MinDiff.

    [0089] In this manner, ΔV.sub.Ci for the stimulating electrodes (W and X in the example) will have the same positive sign as ΔV.sub.dli, as the real I.sub.Pi for therapy is guaranteed to be less than I.sub.Ni.

    [0090] However, I.sub.Pi was determined with only one electrode active. For the same I.sub.Pi to flow during therapy where all programmed electrodes are active simultaneously, at least a return electrode in the stimulation phase (e.g., Z, assuming that I.sub.PZ is the smallest return current amplitude of the stimulation phase) needs to be forced to present lower impedance than the sinking currents so that the I.sub.Ni currents get properly established.

    [0091] On the other hand, in the case of the return electrodes of the stimulation phase, except for the one forced to have lower impedance (Z in the example), the balance phase currents are preferably automatically programmed equal to


    I.sub.Ni=I.sub.Pi−I.sub.MinDiff (i=Y in the example)  (10)

    [0092] where I.sub.MinDiff was stored in the IPG 700 as described before.

    [0093] The system 1 can then cycle independently through each return electrode of the stimulation phase except the forced one (only Y in the example), injecting again M (M=1, 2, 4, 8, . . . ) pulses with the selected I.sub.Pi and the automatically-programmed I.sub.Ni (see eq. (10)) against the IPG case 201a (the return electrode in this stage).

    [0094] After the M pulses, the difference between the real I.sub.Pi and real I.sub.Ni can be estimated as follows


    (real I.sub.Pi−real I.sub.Ni)=[C.sub.imax*(−ΔV.sub.Ci)]/(MPW)  (11)

    [0095] The system 1 then verifies


    0<(real I.sub.Pi−real I.sub.Ni).Math.I.sub.MinDiff  (12)

    [0096] and (real I.sub.Pi−real I.sub.Ni) is defined as ΔI.sub.i.

    [0097] If condition (12) is not satisfied, the system 1 can automatically adjust I.sub.Ni until condition (12) is satisfied, as I.sub.Pi is the programmable parameter of the stimulation phase.

    [0098] The remaining sourcing/sinking currents of the stimulation/balance phase will circulate through the forced electrode (Z in the example).

    [0099] In this way, the stimulating and return electrodes charge in opposite directions, allowing for compensation when one of the conditions (2) is reached.

    [0100] To summarize, FIG. 7 shows the stimulation and balance phases (post determination stage) for the foregoing example. Programmable resistors, instead of a current source or sink, can be used to force electrode Z (which forms the forced return electrode in the example) to present lower impedance in both the stimulation and balance phases. Considering the stimulation phase, for example, such a resistor can be programmed equal to


    {V.sub.SDp/I.sub.pZmin+[(I.sub.PYmax/I.sub.PZmin)/C.sub.YdlYmin−1/C.sub.ZdlZmax]*PW+[(I.sub.PYmax/I.sub.PZmin)*R.sub.Y2allEmax−R.sub.Z2allEmin]}

    [0101] where V.sub.SDp is a “safe” compliance voltage required for the current sources to operate, min and max subscripts represent the respective parameters with added or subtracted errors, and R.sub.i2allE Y, Z in the example) is the impedance of electrode “i” against all other electrodes tied together. The selected resistance's appropriateness can be confirmed by compliance voltage monitoring across active sink and sourcing currents during the actual electrical stimulation of the target. If two or more return electrodes are programmed, electrode Z represents the electrode with the smallest programmed current.

    [0102] As a final step of the determination stage, a new set of M pulses, with the determined balance phase, is preferably injected next for all active electrodes (i.e., both the stimulating and return electrodes), except for the forced one (Z in the example). The parameters ΔV.sub.dli and ΔV.sub.Ci|.sup.Per Pulse for each electrode are now determined, the latter as the measured ΔV.sub.Ci/M for the selected stimulating and return electrodes, and particularly as


    [(ΣI.sub.Diffi−ΣΔI.sub.i)*PW]/C.sub.imin

    [0103] for the forced electrode (Z in the example). These values are digitized and stored in the IPG 700. For the forced electrode (Z in the example), a new lookup table can be implemented to determine ΔV.sub.CFor|.sup.Per Pulse (the accumulated per-stimulation pulse voltage in the DC blocking capacitor associated with the forced electrode, Z in the example).

    [0104] The system 1 will preferably select and monitor (during delivery of the electrical stimulation to the target) the stimulating and return electrodes that presented the largest |ΔV.sub.dli|. It will also monitor the forced electrode (Z in the example). The voltages V*.sub.Stim, V*.sub.Ret, and V*.sub.For (see FIG. 6b) of the selected stimulating, return, and forced electrodes will particularly be connected to V*.sub.MUXStim, V*.sub.MUXRet, and V*.sub.MUXFor respectively via the MUX. The circuitry of FIG. 4/FIG. 5, except for the DAC, and the AMP of FIG. 6a are not needed for the actual electrical stimulation of the target so they may be turned off/disconnected to reduce power consumption.

    [0105] In an alternative embodiment, all voltages of the participating active electrodes may be monitored instead.

    [0106] As mentioned before, during electrical stimulation of the target, the system guarantees:


    −ΔV.sub.AddOCP≦ΔV.sub.dli≦ΔV.sub.SubOCP (i=1 . . . N)  (13) (same as eq. (2))

    [0107] Now, during an open circuit phase (where no current is imposed by the IPG 700), if the IPG case 201 is connected to V.sub.REF, in particular one has for the monitored voltages:


    V.sub.REF+V.sub.OCP−ΔV.sub.dlOutput−ΔV.sub.COutput−V*.sub.MUXOutput=0  (14)

    (with the sign shown in FIG. 2) where Output is either Stim, Ret or For. Eq. (13) can be re-written as


    ΔV.sub.dlOutput=V.sub.REF+V.sub.OCP−ΔV.sub.COutput−V*.sub.MUXOutput  (15)

    [0108] At the same time, after P stimulation pulses,


    ΔV.sub.COutput=Σ.sub.1 to PΔV.sub.COutput|.sup.Per Pulse=P*ΔV.sub.COutput|.sup.Per Pulse  (16)

    where the parameter ΔV.sub.COutput|.sup.Per Pulse was previously digitized and internally stored in the IPG 700 in the final step of the determination stage.

    [0109] Hence from (13), (15) and (16), for the monitored voltages we have


    −ΔV.sub.AddOCP≦V.sub.REF+V.sub.OCP−P*ΔV.sub.COutput|.sup.Per Pulse−V*.sub.MUXOutput≦ΔV.sub.SubOCP  (17)

    [0110] Conditions (17) can be individually re-written as


    V*.sub.MUXStim≧V.sub.REF+V.sub.OCP−ΔV.sub.SubOCP−P*ΔV.sub.CStim|.sup.Per Pulse  (18.a)


    V*.sub.MUXRet≦V.sub.REF+V.sub.OCP+ΔV.sub.AddOCP−P*ΔV.sub.CRet|.sup.Per Pulse  (18.b)


    V*.sub.MUXFor≦V.sub.REF+V.sub.OCP+ΔV.sub.AddOCP−P*ΔV.sub.CFor|.sup.Per Pulse  (18.c)

    [0111] It is worth noting that ΔV.sub.CRet|.sup.Per Pulse and ΔV.sub.CFor|.sup.Per Pulse in conditions 18.b and 18.c are negative so they add to the value on the right of the foregoing inequalities.

    [0112] Conditions 18 can re-written as


    V*.sub.MUXStim≧V.sub.REFStim−P*ΔV.sub.CStim|.sup.Per Pulse  (19.a)


    V*.sub.MUXRet≦V.sub.REFRet−P*ΔV.sub.CRet|.sup.Per Pulse  (19.b)


    V*.sub.MUXFor≦V.sub.REFRet−P*ΔV.sub.CFor|.sup.Per Pulse  (19.c)

    where V.sub.REFStim and V.sub.REFRet are fixed voltages equal to (V.sub.REF+V.sub.OCP−ΔV.sub.SubOCP) and (V.sub.REF+V.sub.OCP+ΔV.sub.AddOCP) respectively.

    [0113] In a preferred version of the system 1, condition 19.a is implemented by the comparator of FIG. 8, where an extra DAC block generates a variable reference that subtracts the stored ΔV.sub.CStim|.sup.Per Pulse after each stimulation phase from the internally calculated fixed voltage V.sub.REFStim, for comparison following the end of the balance phase of pulse P and before the beginning of the next stimulation phase.

    [0114] Similarly, conditions (19.b) and (19.c) are implemented by the comparators of FIG. 9, where a third and fourth internal DAC generate the variable comparison voltages.

    [0115] If a comparator of FIG. 8 or FIG. 9 triggers (i.e., if outputs 801, 901, or 902 change logic value), after P pulses (a counter is kept in the IPG 700), the corresponding double-layer capacitance and blocking capacitor of the monitored electrode will be discharged.

    [0116] To do so, in a preferred version, a correction phase is implemented, with an example being shown in FIG. 10. A single correction current I.sub.CORR will be forced to circulate, which will result in real currents I.sub.CORRStim for the stimulating electrodes (W and X in the example) and I.sub.CORRRet for the return electrodes (only Y in the example). The forced electrode (Z in the example) will handle the difference between the correcting currents.

    [0117] Such correction phases particularly take place following the compare phases (where conditions 18 are evaluated) as shown in FIG. 11. It is also possible to stagger the compare and correction phases so they occur in subsequent pulses. In an alternative version, the correction phase is part of the balance phase (e.g., as shown) where the currents of the balance phase are adjusted accordingly, so as to reduce or cancel the respective accumulated double layer voltage.

    [0118] In a preferred version, current I.sub.CORR is programmed equal to two times I.sub.minDiff.

    [0119] Since it is unknown which capacitor has accumulated more charge, C.sub.Output or C.sub.dlOutput for the active electrode whose V*.sub.MUXOutput triggered a comparator, the system 1 needs to deliver up to P pulses and stop if ΔV.sub.dlOutput reaches zero voltage (ΔV.sub.COutput will still be positive or negative depending on the electrode). This avoids inverting the charging conditions of the stimulating and return electrodes. Hence, during the injection of the correction phases, the system will make sure the following conditions are satisfied:


    ΔV.sub.dlStim=V.sub.REF+V.sub.OCP−ΔV.sub.CStim−V*.sub.MUXStim≧0  (20.a)


    ΔV.sub.dlRet=V.sub.REF≦V.sub.OCF−ΔV.sub.CRet−V*.sub.MUXRet≦0  (20.b)


    ΔV.sub.dlFor=V.sub.REF≦V.sub.OCP−ΔV.sub.CFor−V*.sub.MUXFor≦0  (20.c)


    or re-written as


    V*.sub.MUXStim≦V.sub.REF≦V.sub.OCP−ΔV.sub.CStim  (21.a)


    V*.sub.MUXRet≧V.sub.REF+V.sub.OCP−ΔV.sub.CRet  (21.b)


    V*.sub.MUXFor≧V.sub.REF+V.sub.OCP−ΔV.sub.CFor  (21.c)


    or re-written as


    V*.sub.MUXStim≦V.sub.REFFIG5−ΔV.sub.CStim  (22.a)


    V*.sub.MUXRet≦V.sub.REFFIG5−ΔV.sub.CRet  (22.b)


    V*.sub.MUXFor≦V.sub.REFFIG5−ΔV.sub.CFor  (22.c)


    or re-written as


    V*.sub.MUXStim≦V.sub.REFFIG5−(P−R)*ΔV.sub.Cstim|.sup.Per Pulse  (23.a)


    V*.sub.MUXStim≧V.sub.REFFIG5−(P−R)*ΔV.sub.CRet|.sup.Per Pulse  (23.b)


    V*.sub.MUXStim≦V.sub.REFFIG5−(P−R)*ΔV.sub.CFor|.sup.Per Pulse  (23.c)

    [0120] After R correction phase pulses (R≦P), R*ΔV.sub.COutput|.sup.Per Pulse has been subtracted from the accumulated ΔV.sub.COutput (given I.sub.CORR equals 2*I.sub.MinDiff) so V*.sub.MUXOutput (of the triggered comparator) needs to be compared against a variable reference equal to V.sub.REFFIG5−(P−R)*ΔV.sub.COutput|.sup.Per Pulse, as shown in FIG. 12.

    [0121] If the comparator in FIG. 12 is triggered, or R equals P, the correction phase is stopped and actual electrical stimulation of the target as per FIG. 7 resumed.

    [0122] In summary, the invention automatically maintains safe electrode and tissue operation without altering the classical IPG 700 front-end, thereby complying with required safety standards. The use of comparators and not measurements during therapeutic electrical stimulation of the target advantageously minimizes overhead consumption for safe operation.

    [0123] When the system 1 is a spinal cord stimulator (SCS), the invention allows clinical testing of a multiple-electrode pattern at a tonic frequency (e.g., 40 Hz) that calms pain with associated paresthesia, running a determination stage, and increasing the stimulation frequency to the kHz range to avoid paresthesia. In contrast, conventional SCS products are limited to two electrodes at the kHz range.

    [0124] In an alternative version of the invention, a finer automatic determination of the balance phase permits evoked response sensing for closed-loop neurostimulation, and without the is need for post-balance phase compensation to minimize the stimulus artifact (SA). In this alternative version, if ΔV.sub.dli is positive and within ΔV.sub.biph (e.g., 5 mV) during the stimulation phase, the balance phase for the cycled electrode “i” can be left as programmed for the determination stage. No adjustments are necessary as the positive voltage indicates that the mismatch in the real I.sub.Ni and real I.sub.Pi is causing the balancing charge to be less than the stimulation charge, and the remnant voltage can be handled by the evoked compound action potential (ECAP) recording front-end. The parameter ΔV.sub.biph is preferably programmable.

    [0125] If ΔV.sub.dli is positive but larger than ΔV.sub.biph, the balancing phase current I.sub.Pi needs to be increased for better charge compensation. The required increase can be estimated as follows:

    [0126] A prior impedance measurement allows determination of C.sub.dli (with a certain error) for the electrode “i” under consideration (either W or X in the example). Thus, the current I.sub.Morei required to be added to the automatically selected I.sub.Pi in this case is estimated as


    I.sub.Morei=[C.sub.dli*(ΔV.sub.dli−ΔV.sub.biph1/2)]/(MPW)(i=W or X)  (24)

    [0127] where ΔV.sub.biph1/2 is the mid-range point of ΔV.sub.biph, and PW is the programmed pulse width as defined above.

    [0128] A lookup table can be implemented in the IPG 700 to determine each I.sub.Morei based on the corresponding C.sub.dli, (ΔV.sub.dli−ΔV.sub.biph1/2) and (M PW).

    [0129] On the other hand, if ΔV.sub.dli is negative, this implies the electrode potential moved positively pulse after pulse during the M pulses, and thus less balancing charge is required per pulse to avoid this situation. The required reduction may be estimated as follows:


    I.sub.Lessi=[C.sub.dli*(−ΔV.sub.dli+ΔV.sub.biph1/2)]/(MPW) (i=W or X in the example)  (25)

    [0130] The same lookup table for I.sub.Morei can be used for determining I.sub.Lessi.

    [0131] I.sub.pi will then be re-programmed equal to


    new I.sub.pi=old I.sub.Pi±(I.sub.Morei or I.sub.Lessi) (i=W or X in the example)  (26)

    [0132] After initially cycling through all stimulating electrodes, a new set of M pulses, with the modified balance phase, is injected for the stimulating electrodes that required I.sub.Pi adjustment. A new I.sub.Diffi then estimated and stored, confirming ΔV.sub.dli is positive and within ΔV.sub.biph.

    [0133] A similar procedure, as detailed above for the determination stage, is followed for the return electrodes and a forced electrode.

    [0134] Once the balance phase is automatically determined for the desired stimulation, in a version of the invention adapted for evoked response sensing, a quasi-tripolar arrangement of electrodes with a body drive is utilized for evoked compound action potential (ECAP) recording. FIG. 13 shows the system 1 of FIG. 2 in the form of an implantable SCS system including an IPG 700 and dual percutaneous leads 701.a and 701.b, each extending from a proximal end 701.c to a distal end 701.d. A typical guarded cathode configuration for stimulation is shown, i.e., A3 and B2 are stimulating electrodes which are surrounded by return electrodes A2, B1, A4 and B3. (This is merely an exemplary arrangement, and other electrodes could be chosen as stimulating and return electrodes.) These electrodes may have differently-valued sourcing and sinking currents to steer the electrical field as desired.

    [0135] Following a programmable blanking period following stimulus delivery, intermediate unused electrodes A5, A6, A7 and A8 and B4, B5 are connected to a voltage reference V.sub.REF (internally generated by the IPG 700) via switches 702 which “drive” the body common mode for recording. Blanking may be accomplished via disconnection of switches 702 and/or by other methods of placing the ECAP recording front-end 703 in a state so as to minimize the artifactual effect of the blanking termination.

    [0136] The end electrodes B6 and B8 are tied together and connected to the non-inverting input of the ECAP recording front-end 703, whereas the center electrode B7 is connected to the inverting input. The ECAP recording electrodes are preferably selected as far away as possible from the stimulating electrodes to minimize the stimulus artifact (SA). Alternatively, recording can occur using A6 tied to A8 as an electrode and A7 as the other electrode, and A5 and B4, B5, B6, B7, and B8 connected to V.sub.REF.

    [0137] The recording front-end 703 preferably has a programmable input range and band-pass characteristic, adjustable gain, high input impedance, low equivalent input noise level and power consumption, adequate settling time, high power supply rejection ratio (PSRR), and high common mode rejection ratio (CMRR), among other features.

    [0138] High CMRR allows rejection of electromyographic (EMG) signals of nearby muscles, as explained below. FIG. 14 shows a first-order impedance model considering the use of B6, B7, and B8 as recording electrodes.

    [0139] Elements Z.sub.B6, Z.sub.B7, and Z.sub.B8 model the impedance that exists between each electrode and the fiber bundle 800. Resistive elements R.sub.t model the resistance of the fiber bundle 800 where the ECAP 704 (see FIG. 13) is travelling, and elements R.sub.S model the shunting presented by the cerebrospinal fluid in the vicinity of the electrodes B6, B7, and B8. Assume an interfering voltage 801 (e.g. EMG and ECG) generates different voltages V.sub.A and V.sub.B in the vicinity of recording electrodes B6 and B8. This would create a voltage (V.sub.A+V.sub.B)/2 at electrode B7 given the voltage divider created by Rt//Rs, and assuming the recording front-end 703 presents high impedance (i.e., no current circulates through Z.sub.B7). Given the small distance between B6 and B8, and negligible differences between them (same area and metal), it can be expected Z.sub.B6 will be similar to Z.sub.B8. Hence, given they are shunted together, the non-inverting terminal of the recording front-end 703 will also see voltage (V.sub.A+V.sub.B)/2. In this way, the interfering signal 801 appears as a common mode voltage variation for the ECAP recording front-end 703, which can be suppressed with the appropriate high CMRR.

    [0140] The recorded ECAP 704 has a triphasic shape as shown in FIG. 13 since the quasi-tripolar configuration resolves the second derivative of the ECAP 704 with respect to time.

    [0141] In an alternative arrangement exemplified by FIG. 15, a true tripolar recording configuration is used. Two recording front-ends 900.a and 900.b are employed, with electrodes B6, B7, and B8 being recording electrodes, with their outputs 901.a and 901.b being summed is to create output 902. Block 903 may be included to compensate for misbalances in the recording impedances (see FIG. 14) to minimize pickup of potentially interfering signals (e.g. EMG, ECG). Block 903 preferably adjusts the gains of 900.a and 900.b, via control signals 904.a and 904.b respectively, by minimizing the energy of the difference between outputs 901.a and 901.b.

    [0142] As an additional or alternative arrangement, the ECAP recording front-end 703 may be switched to a bipolar recording configuration with body drive after a short period (e.g., several ms) following stimulation to observe non-propagating late responses. This late response may allow identifying whether unwanted activation of the nociceptive reflex arc, or muscle afferents in the dorsal roots, is caused by the programmed therapy.

    [0143] As another possible feature, adaptive sampling frequencies may be utilized to record ECAPs and late responses.

    [0144] As yet another possible feature, signal processing of ECAPs may utilize a morphological filter algorithm, given the reduced signal-to-noise ratio. U.S. Pat. No. 8,419,645 B2 describes how morphological operators can be utilized to determine respiration parameters from a transthoracic impedance signal. These operators can be applied in an analogous manner to process ECAPs 704. Additionally or alternatively, ECAPs signal processing may be based on discrete wavelet transforms.

    [0145] As yet another possible feature, the IPG 700 of the present invention senses ECG signals via electrodes on leads 701.a, 701.b, or via electrode(s) and the IPG case 201. Upon detection of an R-wave from such ECG signals, and following a programmable delay (e.g. 300-500 ms), ECAP recording may take place in the refractory period of the cardiac cycle to further reduce pickup of heart activity.

    [0146] As yet another possible feature, ECAP recording may be initiated in combination with a patient posture change automatically detected by circuitry in the IPG 700; and/or with a detected electrode-tissue impedance change; and/or may be manually initiated, or initiated in response to patient-triggered adjustments via a remote control.

    [0147] As yet another possible feature, the system 1 may provide automatic determination of the relative positions of inter-lead electrodes based on post-stimulus latency value changes of ECAPs 704. Since the IPG 700 controls both the timing of the stimulation pulse delivery and the sampling of ECAPs 704, it can stimulate at one end of lead 701.a and record at the other end of lead 701.b, thus maximizing the distance between stimulating and recording electrodes, as shown in FIG. 16 for a quasi-tripolar recording configuration. The same arrangement can be used with the true tripolar case shown in FIG. 15.

    [0148] Preferably, a suitable threshold is defined in an initial ECAP signature, and the latency to this threshold is calculated. This latency value directly corresponds to the physical distance between the stimulating and recording electrode sites following implantation, and is stored in the IPG 700 for future comparisons.

    [0149] During normal operation, the IPG 700 will occasionally initiate an ECAP 704 as described above. To determine the new ECAP 704 latency, the output of the ECAP recording front-end 703 is compared against the threshold defined using the initial ECAP. Since no subsequent ECAP measurements are required following the initial one, the power and memory required for the purpose of determining relative lead migration is minimized.

    [0150] If the initial and subsequent latency values are within some acceptable deviation, then it can be assumed leads 701.a and 701.b have not migrated relative to each other, or that they have migrated an acceptably small amount. An unacceptable deviation may, for example, be defined as an abrupt or significant short-term change from the initial latency value. It can be assumed latency changes due to factors that affect nerve conduction velocity (e.g., drugs) change relatively slowly, whereas relative migration is more likely to cause an abrupt change in latency values. Accordingly, latency comparisons may include non-trended calculations (where the initial value does not change over time) as well as trended calculations (where the initial latency value is adjusted so as to account for slow-varying nerve conduction velocity changes).

    [0151] A possible arrangement is to deliver a train of stimulation pulses following implantation, and average the corresponding initial ECAPs 704. In some applications, this may be required to improve the signal-to-noise ratio. A threshold for latency determination may be is defined from the averaged initial ECAP 704 signature, and an initial latency calculated. During normal operation, the IPG 700 will occasionally initiate a train of ECAPs 704 as described above. To determine the new ECAP 704 latency, all outputs of the ECAP recording front-end 703 may be averaged and compared against the threshold defined using the initial averaged ECAPs 704.

    [0152] Upon detection of an unacceptable latency deviation, the IPG 700 can dynamically alter the electrical stimulation of the target (e.g., the electrodes or current steering settings) until the effectiveness of the modified therapy is confirmed (e.g., by ECAPs 704 and/or by the patient). Additionally or alternatively, the IPG 700 might notify a physician of the migration via a remote reporting feature so that corrective action might be taken.

    [0153] The timing resolution required for detecting lead migration based on ECAP 704 latency changes can be estimated as follows. A large percentage of SCS patients implanted with dual parallel leads experience a mean relative micro-migration of approximately 2-3 mm of stagger between their leads, equivalent to one typical SCS electrode offset (cf. Heller “Lead Migration After SCS a ‘Universal Problem’”, Anesthesiology News, Pain Medicine, vol. 35:5, May 2009). The Aβ fibers recruited by SCS have typical conduction velocities in the range of 30 to 70 m/s. If the target is to detect 0.2 mm relative changes (for example), this implies a resolution better than 3.0 μs. This imposes a demanding requirement for sampling in the IPG 700, as most digitalization of biosignals (and other internal signals for operation, e.g., battery measurements) is usually done with 10 bits of resolution at a maximum sampling frequency of 100 kS/s.

    [0154] In a preferred arrangement, as shown in FIG. 17, a train of stimulation pulses 1100 is delivered following implantation, and each initial ECAP 704 for each pulse is sampled with a stimulus-to-start-of-sample timing 1101, or blanking-to-start-of sample timing, incremented by a small delta 1102 (less than the sample period). This equivalent-time-sampling (ETS) technique can then be applied to reconstruct the initial ECAP 704 signature with a high degree of temporal accuracy utilizing a reduced sampling frequency (period 1103). As an example, if twenty pulses are used to reconstruct the ECAP 704 and delta 1102 is selected equal to 2.0 μs, this requires a sampling frequency in the order of 25 kHz (a period 1103 of 40 μs), which is below the typical time-base of 32,768 Hz typically used in IPGs 700. ETS can be applied since ECAPs 704 can be considered a repetitive signal in the time period required to deliver the ECAP-generating stimulation train 1100. As in arrangements discussed above, a threshold for latency determination is defined from the reconstructed initial ECAP signature 704, and an initial latency is calculated.

    [0155] During normal operation, the IPG 700 will occasionally initiate a train of ECAPs 704 as described above. Using the ECAPs 704 generated by the train, a high-resolution ECAP 704 is reconstructed using ETS. To estimate the new latency between stimulating and recording sites, the time where the reconstructed ECAP 704 crosses the selected threshold is determined.

    [0156] As in arrangements discussed above, if the initial and subsequent latency values are within some acceptable deviation, then it can be assumed leads 701.a and 701.b have not migrated relative to each other, or that they have migrated an acceptably small amount. Latency comparisons may use non-trended calculations, where the initial value does not change over time, and trended calculations, where the initial latency value is adjusted so as to account for slow-varying nerve conduction velocity changes.

    [0157] Also as in previous arrangements, upon detection of an unacceptable deviation, the IPG 700 can dynamically alter the therapy (e.g., the electrodes or current steering settings) until the effectiveness of the modified therapy is confirmed (e.g., by ECAPs 704 and/or the patient. Additionally or alternatively, the IPG 700 can notify the physician of the migration, via a remote reporting feature, for further corrective action.

    [0158] In summary, the foregoing arrangements for ECAPs recording advantageously provide a balance phase for a given stimulation phase in a multi-electrode system that returns the electrodes within mV of their open circuit potentials (OCPs), thereby terminating Faradaic reactions caused by stimulation, and thus minimizing the stimulus artifact (SA) for evoked compound action potential (ECAP) recording. The invention further provides recording configurations for ECAPs, particularly in spinal cord stimulation (SCS) devices, that minimize the pick-up of interfering signals such as remnant SA, electromyographic (EMG) activity caused by nearby muscles, and heart activity (ECG). Finally, the invention further is provides a robust method for determining relative lead migration, particularly in neurostimulation systems with several implanted leads. The method can deliver high temporal resolution utilizing a reduced sampling rate.

    [0159] Exemplary versions of the invention have been described above in order to illustrate how to make and use the invention. The invention is not intended to be limited to these versions, but rather is intended to be limited only by the claims set out below. Thus, the invention encompasses all different versions that fall literally or equivalently within the scope of these claims.