Real time closed loop optogenetic control (CLOC) using RTXI

I worked on this project during my final semester (Spring 2016) as a Masters student at Georgia Tech under the guidance of Professor Garett Stanley and in support of Michael Bolus and Adam Willats’ research. The project’s broad objective is to control the activity (firing rate trajectories) of light sensitive (ChR2) neurons in a mouse brain’s whisker region (barrel cortex) with optical stimulation (i.e. shining a light onto the exposed mouse brain) in real time using math (control theoretic techniques). For laypersons, normal mammals do not have light sensitive neurons/brains and the mice in question are genetically engineered for scientific research. My contribution to the project was engineering oriented. Click below for a couple of paragraphs explaining the scientific relevance of this work, what I did and how it fit into the bigger picture.

CLOC is a scientifically relevant experimental paradigm. Brain activity tends to be highly variable, even in response to repetitions of the same stimulus. Once fully developed, the CLOC paradigm can allow experimenters to better understand how such variability arises in the brain. For example, by holding neural activity (of many neurons) in one brain area steady, experimentalists can explore the variability inherent in the activity of a downstream brain region, which receives its input from the CLOC controlled region.

I assembled and integrated a programmable real time experimental platform using RTXI that could facilitate Michael’s experiments. Originally (left figure below), the experiments ran on TDT equipment that is common in electrophysiology labs, but the TDT graphical programming interface (think of LabView) turns out to be quirky and made it difficult to realize Michael and Adam’s goals of programming control algorithms beyond the simplest ones (e.g. PID controller). The RTXI platform offers hard real time control (via a Xenomai patched linux kernel) for code written in C that can run on a PC. My work (right figure below) involved setting up an RTXI rig, interfacing it with the TDT recording equipment, programming a PID controller and interfacing the output to the LED/Fiber optic cable that applied optogenetic stimulation to the rodent in experiments and validating that the entire system works in real time in a live experiment with Michael. Simply put, I did the engineering work to move from the experimental setup shown on the left to the one shown on the right to make it easier to program and deploy more complicated control theoretic approaches in CLOC experiments.