Content uploaded by Lijuan Xia
Author content
All content in this area was uploaded by Lijuan Xia on Apr 14, 2019
Content may be subject to copyright.
A Low Power Flash-FPGA based Brain Implant Micro-System of PID
Control
Lijuan Xia, Nabeel Fattah, Ahmed Soltan, Andrew Jackson, Graeme Chester and Patrick Degenaar
Abstract— In this paper, we demonstrate that a low power
flash FPGA based micro-system can provide a low power
programmable interface for closed-loop brain implant inter-
faces. The proposed micro-system receives recording local field
potential (LFP) signals from an implanted probe, performs
closed-loop control using a first order control system, then
converts the signal into an optogenetic control stimulus pattern.
Stimulus can be implemented through optoelectronic probes.
The long term target is for both fundamental neuroscience
applications and for clinical use in treating epilepsy. Utilizing
our device, closed-loop processing consumes only 14nJ of
power per PID cycle compared to 1.52µJ per cycle for a
micro-controller implementation. Compared to an application
specific digital integrated circuit, flash FPGA’s are inherently
programmable.
I. INTRODUCTION
Closed-loop control is a promising strategy for suppressing
abnormal neuron disorders, such as epilepsy and Parkinson’s
diseases [1-3]. One of the core issues for closed-loop in-
terfaces is that there are a number of potential linear [4-5]
or non-linear [6] methods, which could be applied. These
could most efficiently be implemented onto an ASIC [7]
but at the cost of re-programmability [8]. Alternatively mi-
croprocessor platforms such as micro-controllers and digital
signal processors provide excellent programmability. But it
may cost much more in terms of energy consumed per pro-
cessing cycle. Field Programmable Gated Arrays (FPGAs)
can provide re-programmability at the circuit level but have
been traditionally power hungry [9].
Flash FPGAs utilize flash memory elements rather than
SRAM in their architecture, and thus consume minimal static
power (as low as 2uW) and can be reliably reprogrammed
up to 500 times, which is more than sufficient for most
tuning requirements. There are additional SRAM registers
which can store data which can be written indefinitely. So
the key question we hope to answer in this effort is whether
or not it is a trustworthy platform for reprogrammable
closed-loop neural control. We therefore implement an ex-
emplar Proportional-Integral-Derivative (PID) control algo-
rithm. PID control theory has been employed theoretically
in the neuroscience research field [10]. There are only a
few examples of it being implemented onto low power
Lijuan Xia is with School of Electrical & Electronics Engineering,
Newcastle University, United Kingdom, e-mail: (l.xia@ncl.ac.uk).
Nabeel Fattah, Ahmed Soltan, Graeme Chester, Patrick Degenaar are
with School of Electrical & Electronics Engineering, Newcastle University,
United Kingdom
Andrew Jackson is with Institute of Neuroscience, Newcastle University,
Newcastle upon Tyne, UK
implantable hardware of different re-programmability [11-
12].
Our target application is for closed-loop optogenetic con-
trol of epileptic brain activity. Our brain probe unit consists
of an intelligent probe with on-board micro-LEDs, recording
electrodes, and signal acquisition circuitry. The power con-
sumption of this probe is 1mW at a 10% optical duty cycle.
As such, a desirable power consumption for the control unit
is to be in the same range. Fig. 1 describes exploratory flash
FPGA-based closed-loop brain implant interface. We have
implemented our control unit into a 50m x 25mm form factor.
And it will be miniaturized further for use in small rodent
research.
(a) Optrode
(b) Controller
PID
Control
Optical
control
ADC
ASIC Optrode FPGA controller
Electrode
LED
Neural Amplifier
Neural Stimulator
DAC
Fig. 1: A high level schematic of proposed low power Flash-
FPGA based micro-system of closed-loop PID Control operation
for delivering further optogenetic stimulus.
II. CLOSED-LOOP OPTICAL CONVERTER
ALGORITHM
A. PID Algorithm
This closed-loop microsystem is aimed at intervening neu-
ral network via generating closed-loop optogenetic feedback
to control epilepsy. The intervention philosophy is akin
to noise cancelling via destructive interference of signals
deemed outside a normal range. To achieve this approach
we are exploring a linear control methodology incorporating
proportional-integral-derivative (PID) components.
PID algorithm falls within the scheme of linear, time in-
variant (LTI) filters. In Fig. 2, we design our LTI Filter kernel
in the time domain for performing proportion, differentiation
and integration operation. The optrode sampling rate is 100
samples/second which represents every sample data costs
0.01 second, and the local field potential frequency band
of interest is 1Hz to 100Hz. Accordingly, we set the filter
window taps as 100.
Table I theoretically describes the math methodology of
PID Filter kernel design. If a signal is convolved with Dirac
978-1-5090-2809-2/17/$31.00 ©2017 IEEE 173
Linear Time Invariant
Digital Kernel
h(n)
Input
x(n)
Output
y(n)
Taps
(b)
Proportion Kernel Integral Kernel Derivative Kernel
Taps 𝑓/Hz Taps 𝑓/Hz Taps 𝑓/Hz
Taps
(c)
Taps
(d)
(a)
(b1) (b2) (c1) (c2) (d1) (d2)
FFT FFT FFT
Fig. 2: Linear time invariant digital design of The PID filter. (a)
Linear time invariant system. (b) Dirac delta kernel for bandpass
proportion. (c) Unit step kernel for integration. (d) Gaussian kernel
for derivative.
TABLE I: Proportion, Integral and Derivative Filter Kernel Design
P Ker nel y(t) = x(t)∗δ(t) = x(t)
IK ernel y(t) = x(t)∗Rδ(t)dt =Rx(t)dt ∗δ(t) = Rx(t)dt
DKernel y(t) = x(t)∗
dδ(t)
dt =dx(t)
dt ∗δ(t) = dx(t)
dt
delta function δ(t), the result is identical to the original
signal. The proportion filter kernel is shown in Fig. 2 (b1),
the fast Fourier transform (FFT) of proportion kernel is
displayed in Fig. 2 (b2). In terms of integral filter design, if
an x(t) signal is convolved with integral δ(t), output signal
will be a time integral of the original signal. The integral
filter kernel is shown in Fig. 2 (c1), the FFT of integral
kernel is displayed in Fig. 2 (c2). Finally, If an x(t) signal
is convolved with differentiated δ(t), output signal will be
a time derivative of original signal. The derivative filter
kernel is shown in Fig. 2 (d1), and FFT of integral kernel is
displayed in Fig. 2 (d2).
The proportional, integral, and derivative kernel demon-
strated in Fig. 2 (b), (c) and (d) will be stored as lookup tables
in the flash FPGA hardware implementation. Physically, they
are stored as three 100*1 column buffer banks consisting of
an 8-bit column registers implementing on novel flash-based
logic arrays. These three kernels will be employed to do
multiplication with incoming digitalized local field potential
for convolution operation.
B. Optical Stimulus
An optical optogenetic stimulus converter has been created
for converting output of PID module to optogenetic Pulse
Width Modulation (PWM) stimulus on the probe for mod-
ulating optogenetic infected neurons. Fig. 3 describes two
stages in the optical converter process, stage 1 is to adapt
output of PID controller to total optical stimulus following on
the non-linear inverse sigmoid transfer function shown in Fig.
3 (b), stage 2 employs a reciprocal counter for modulating
duty ratio of fixed period pulses (10ms) for optogenetic
neural stimulation [13].
𝒌𝒈∗ 𝑷𝑰𝑫 − 𝒌𝑻
+𝒌𝒈𝒆𝒆
𝑷𝑰𝑫 𝑲𝒆
Inverse sigmoid function
inherently thresholds
(implemented as a look
up table)
Stage1: nonlinear adaptation Stage2: PWM output.
of PID output to total optical flux.
PWM
Clock
> 0?
+
-
Photons
Buffer
PWM
Output
(a) Optical Converter Schematic (b) Inverse Sigmoid
PID output intensity
PID Output
Stimulus intensity
Fig. 3: Intensity dependent optical stimulus mechanism: (a)
Schematic for converting output of PID controller to width modu-
lated pulse for delivering optogenetic stimulus (Kg =0.4, Kr = 128,
Kge=0.1, Ke=34). (b) Plot of non-linear inverse sigmoid function.
III. HARDWARE ARCHITECTURE
IMPLEMENTATION
Flash FPGA implementation architecture of PID control
design is shown in Fig. 4 which consists of the following
components:
1: A 100*1 row buffer bank of 8-bit row register is
receiving local field potential from optrode for further PID
control.
2: Three 8-bit column registers (Kp, Ki and Kd) are
employed to store the gain parameters of proportion modules,
integral modules and derivative modules.
3: A 1*1 MUX is used for row buffer bank to select
corresponding row register for multiplication.
4: Three 100*1 column buffer banks of 8-bit column
registers are used to hold proportional Dirac Delta kernel,
integral unit step kernel, derivative Gaussian kernel (shown
in Fig. 2 (b), (c) and (d) respectively) as convolution kernels
to do further multiplication.
5: A 1*1 MUX is used for column buffer bank to select
corresponding column buffer bank for multiplication.
6: An accumulator adds all results of multiplication which
has been send to output buffer bank for generating further
closed-loop neural stimulation.
7: A 255*1 buffer bank of 8-bit register is sigmoid function
truth table for modulating further pulse width feedback to
optrode for closed-loop optogenetic stimulation.
8: A 1*1 MUX is applied for selecting corresponding
sigmoid look up table buffer to modulate pulse duty ratio.
9: A counter and a comparator are created to compare with
sigmoid look up table to decide PWM output (high or low).
Actel
IGLOO
AGLN250
VQG100
LT3080
LT3080
Voltage Regulator
(5V 1.5V)
External Clock
25.9 mm
50 mm
Flash FPGA
(PID Algorithm)
Fig. 5: mini-PCB design of Flash-FPGA based brain implant
controller with PID control implementation in comparison with the
British decimal two pence coin.
174
ADC: 8-bit
ADCDAT[0]
ADCDAT[1]
ADCDAT[2]
ADCDAT[3]
…….
…….
ADCDAT[99]
8-bit
Buffer Bank
Sigmoid
LUT
+
Optical
Converter
Coeff
[0]
Coeff
[1]
Coeff
[2]
Coeff
[3]
…….
…….
…….
Coeff
[99]
X
D Q
ADCDAT
[0]
…………
ADCDAT
[99]
MUX
PID Output
MUX
Sigmoid[1]
Sigmoid
[2]
Sigmoid
[3]
Sigmoid
[4]
…….
…….
Sigmoid
[255]
Counter
Reference
LFP Input
Comp
PWM
Output
PWM
LFP
X
Kp/Ki/Kd
-
MUX
D Q D Q D Q
D Q
Fig. 4: FPGA architecture design of Proportion, Integration and Derivative (PID) Controller: Input buffer bank is for storing local field
potential sampled by analogue-to-digital converter (ADC) of optrode , PID module is designed by linear time invariant filter , Output
buffer bank is for storing PID output for modulating further stimulus .
Proportion Output Integration Output
Derivative Output PID Output
(a) Proportion FPGA testing (b) Integral FPGA testing
Kp = 1 , Ki = 0 , Kd = 0 Kp = 0 , Ki =1, Kd = 0
(c) Derivative FPGA testing (d) PID FPGA testing
Kp = 0 , Ki = 0 , Kd = 1 Kp = 1 , Ki =1, Kd = 1
Input
Input Input
Input
Fig. 6: The measured input and output test signal for verifying PID
flash FPGA hardware implementation. (a) Proportion testing (b)
Integral testing: sawtooth wave of 10Hz, output of PID controller
is smooth and round integration signal which means contains a lot
of energy in low frequency band. (c) Derivative testing: input signal
is sawtooth wave of 10Hz, PID output is frequency modulated spiky
signal. (d) PID FPGA testing.
IV. RESULTS AND DISCUSSION
The whole design of PID algorithm has been implemented
in a flash FPGA chip, with peripheral voltage regulator
circuit together, which have been fabricated in a mini-PCB
system shown in Fig. 5. The whole mini PCB body features a
size of 50mm*25mm which size is as twice as the prototype
size of British two pence coin. This node integrates a flash
FPGA IGLOO nano (AGLN250V2-VQG100) device and a
voltage regulator peripheral circuit. Fig. 6 displays the mea-
Time/s Time/s
Amplitude /mV
Amplitude /mV
Raw neuron data
(a) (b)
(c)
PID output: FPGA
Measurement
Frequency /Hz
Time/s
Fig. 7: (a) In-Vivo neural LFP recording (left). (b) PID control
FPGA output (right) (Kp=1, Ki=50, Kd=0.1). (c) Power spectrum
of PID control FPGA output.
surement of analogue input signal for testing the performance
of flash FPGA-based PID control implementation which
exactly match Matlab simulation results. Fig. 7 describes
flash FPGA-based PID control output for real neural local
field potential for 1 second. As shown in Fig. 8, when input
is 10Hz sin wave, the output is width-modulated pulses of
10ms, the width is modulated non-linearly by intensity levels
of sin waves which represent output of PID Controller.
Table II shows that the whole PID design and inverse
sigmoid optical converter utilize totally 27.2% of the avail-
able of the logic cells on the flash FPGA IGLOO nano
chip. The rest of logic cells can be employed for further
exploratory algorithm to perform better closed-loop neu-
ral stimulation algorithm. The power consumption of flash
175
Optical Optical Input
Stimulus PWM Threshold Analog Signal
Input Signal 10Hz
Threshold for delivering stimulus
Optical Stimulus 10ms …… 10ms
NO Stimulus NO Stimulus
①
②
③
Fig. 8: Measured optogentics stimulus modulation of which input
test analog signal is 10Hz of sin wave.
TABLE II: PID and Inverse Sigmoid Optical converter Design
Utilization of Resources on the Flash FPGA IGLOO Nano Device
Memory Resource Used Available Utilization
Number of Look Up Tables 816 3000 27.20%
Working Frequency 1MHz
Power Consumption 0.168mW
FPGA IGLOO nano chip with PID controller implementation
costs 0.168mW which has been tested by a multimeter (Volt-
age rail: 1.2V, current: 0.12mA , standby power consumption:
0.024mW).
Table III compares power consumption of the same PID
micro-controller (ARM Cortex M4) implementation with
flash FPGA (IGLOO Nano) implementation. In order to
provide a fair comparison, we operated both at a fixed clock
rate of 1MHz. Furthermore, this is the internal clock rate
of the optrode, though the incoming LFP data rate is typi-
cally only 100 bytes per second. A comparison with recent
reported designs of proportion integral derivative hardware
implementation for closed-loop brain machine interface has
been listed in Table IV.
TABLE III: measured power consumption comparison between
ARM cortex M4 and flash FPGA IGLOO nano
Hardware ARM Cortex M4 Flash FPGA nano
PID Execution time(clk cycles) 3300 100
Power(mW/MHz) 0.46 0.14
Energy(nJ/clk) 0.46 0.14
Energy per operation(nJ/PID) 1520 14.3
TABLE IV: Comparison With Bidirectional Neural Interface De-
sign
Reference Rhew[11] Xilin[12] This work
CMOS technology (nm) 180 180 130
Bandwidth (Hz) 0.64-6K 0.3-7K 0.1-10k
Feedback Control PI PID PID
Output Current (mA) 4.41 6 0.12
Voltage Rail (V) 1.8 0.9 1.2
Power Consumption (mW) 8 5.8 0.168
Reprogrammable Custom DSP ASIC flash FPGA
V. CONCLUSIONS
In this paper, we have demonstrated a low power flash
FPGA-based micro-system as closed-loop brain implant in-
terface. It sheds light on the potential possibility of applying
flash FPGA in the general purpose brain machine interface
for benefiting more neuroscience research. This PID control
flash FPGA implementation will also offer some inspirational
possibilities for closed-loop neural stimulus modulation in
neuroscience research and help neuroscientists to develop
better understanding of how to better perform closed-loop
stimulation.
ACKNOWLEDGMENT
The authors would like to thank the Wellcome
Trust and the EPSRC for funding the CANDO project
(www.cando.ac.uk). Lijuan Xia would also like to thank
Newcastle University SAGE Doctoral Training Awards
scheme and the Newcastle University Overseas Research
Scholarship for funding her PhD.
REFERENCES
[1] E. Krook-Magnuson, C.Armstrong, M. Oijala, and I. Soltesz, [On-
demand optogenetic control of spontaneous seizures in temporal lobe
epilepsy]. nature communications, DOI: 10.1038/ncomms2376
[2] S. Santaniello, G. Fiengo, L. Glielmo, and W. M. Grill, [closed-loop
control of deep brain stimulation: a simulation study]. IEEE. T. Neur.
Sys. Reh. 19, 15,24 (2011).
[3] C. Wu, A.Sharan, [Neurostimulation for the Treatment of Epilepsy:
A Review of Current Surgical Interventions] Neuromodulation 2012;
e-pub ahead of print. DOI: 10.1111/j.1525-1403.2012.00501.x
[4] M. T. Salam, M. Sawan, and D. K. Nguyen, [A low-power implantable
device for epileptic seizure detection and neurostimulation ] IEEE
Trans. Biomed. Circuits Syst., 2010.
[5] M. Azin, S. Member, D. J. Guggenmos, S. Barbay, and R. J. Nudo,
[A battery-powered activity-dependent intracortical microstimulation
IC for brain-machine-brain interface ] J. Solid-State Circuits, vol. 46,
no. 4, pp. 731-745, 2011.
[6] A. Vato, F. D. Szymanski, M. Semprini, F. A. Mussa-Ivaldi, and
S. Panzeri, [A bidirectional brain-machine interface algorithm that
approximates arbitrary force-fields] PLoS ONE, 9 (3), art. no.
e91677,2014.
[7] K. Limnuson, [A bidirectional neural interface SoC with an integrated
spike recorder, microstimulator, and low-power processor for real-time
stimulus artifact rejection]. IEEE Custom Integrated Circuits Conf.,
2014
[8] S.F.Liang, F.Z.Shaw,C.P.Young, D.W.Chang, and Y.C.Liao, [A closed-
loop brain computer interface for real time seizure detection and con-
trol]. IEEE Engineering in Medicine and Biology Soc, 2010,pp4950-
4953
[9] M.T.Salam,D.K.Nguyen, M.Sawan, [Low-Power Circuit Techniques
for Epileptic Seizures Detection and Subsequent Neurostimula-
tion].Journal of Low Power Electronics, Volume 8, Number 2, April
2012, pp. 133-145(13)
[10] J.Wang, E. Niebur, J. Hu and X. Li, [Suppressing epileptic activity
in a neural mass model using a closed-loop proportional-integral
controller ] Sci. Rep. 6, 27344; doi: 10.1038/srep27344 (2016).
[11] H.Rhew, J.Jeong, J.A.fredengburg ,S. Dodani, P. Pati; and M.Flynn,
[A fully self-contained logarithmic closed-loop deep brain stimulation
SoC with wireless telemetry and wireless power management ] IEEE
J.Solid-State Circuits, vol.49,pp.2213-2227, Oct.2014
[12] X. Liu, M. Zhang, A. G. Richardson, T. H. Lucas and J. Van
der Spiegel, [Design of a closed-Loop, Bidirectional Brain Machine
Interface System With Energy Efficient Neural Feature Extraction and
PID Control] IEEE Transactions on Biomedical Circuits and Systems,
vol.PP, no.99, pp.1-14, 2016
[13] N.Jonathan, M. Avery, A.H. Cetin, A.W.Roe, J.H. Reynolds, [Opto-
genetic Activation of Normalization in Alert Macaque Visual Cortex]
Neuron. 2015 Jun 17;86(6):1504-17. doi: 10.1016/j.neuron.2015
176