Cerebrospinal Fluid Pump

The goal of the project is to design, test and refine a compact, low-cost, oscillatory-flow pump that will reproduce realistic cerebrospinal fluid (CSF) flow conditions within a given range of human/animal cerebrospinal models. Flow rates mimic cardiac and respiratory frequencies and have an adjustable frequency and flow volume.
=Problem Definition=
==Background==
CSF
Central nervous system (CNS) diseases can be difficult to treat because many potential drugs cannot reach the brain due to the blood brain barrier. A potential new route to get drugs to the brain is to inject them into the cerebrospinal fluid (CSF). One way to bypass the blood brain barrier is by direct injection of drugs to the CSF. Drugs can then spread/mix in the CSF and be distributed directly to the brain and spinal cord tissue surface. 
The CSF is a clear water-like fluid located around the entire brain and spinal cord and pulses each time the heart beats thereby making it a good medium to transport drugs to the CNS. One problem with delivering drugs to the CNS by the CSF is that it requires extremely expensive (and ethically nebulous) animal studies to understand and optimize the delivery device and protocol. Thus, the NIML is designing the world's first laboratory bench-top simulator of the complete CSF system for brain therapeutic development. They have an ongoing project to make a detailed in vitro model that accurately represents the CSF anatomy and flow that would accommodate testing with medical devices. 
The Cerebrospinal Fluid Pump project is designed to pair with the NIML's existing human spinal model to make a complete CSF system simulation.
Oscillatory Flow
By definition flow of fluid, gas, or electricity moves along or out steadily and continuously in a current or stream and oscillation is the repetitive variation, typically in time, of some measure about an equilibrium. Together, oscillatory flow is the variation of a wave frequency in time. 
The oscillatory waveform chosen to mimic the same frequency of a heat beat takes the form of a sinusoidal wave. Typically, a resting healthy human heat beat can range anywhere from 60 to 100 beats per minute (bpm). The use of fluid dynamics can assist in predicting the behaviors of flow in a pump in multiple ways. With a known frequency or speed of a fluid, displacement or stroke volume, and the area of the cylinder that the fluid is passing though, then the continuity equation can be used as a way to model fluid flow. Another basic equation that can be used to predict other aspects of fluid flow such as pressure is Bernoulli’s Equation.
Syringe travel force
Time and force required for a manual injection (or time required for an injection using an autoinjector) are important and may impact the usability of the product by the end-user and thus compliance. The force required for the injection of a solution at a given injection rate via a needle of predetermined gauge and length is referred to as ‘syringeability’ [2]. The Hagen-Poiseuille equation can be utilized to estimate the travel (or glide) force (Equation 1).
	
Q = Volumetric flow rate
μ = Fluid viscosity
L = Needle length
R = Needle inner diameter
A = Cross sectional area of syringe plunger
F = Frictionless travel force
	
==Deliverables==
The cerebrospinal-fluid pump must produce an oscillating flow within spinal cord models ranging from the size of a human to a small vertebrate. This flow must be adjustable in volume and frequency. Ideally the design should be low-cost and easy to operate, as it is intended to be widely distributed for laboratory testing. The design must also include a 5V, square wave-form trigger that simulates the human heartbeat in MRI testing.
==Specifications==
=Previous Design Considerations=
Belt Design	Flywheel Design	Linear Actuator
;Features:
*Belt driven by 2 stepper motors.
*Dowel rod slider connected to belt and syringe to guide linear motion.
;Pros:
*Highly programmable.
*Could be compact.
*Pre built parts can be found online.
;Cons:
*Code the motor to produce a sinusoidal motion.	
;Features:
*Single stepper motor drive
*Adjustable flow volume 
**Lead screw adjustment for eccentricity offset
**Interchangeable syringe mount
*Light weight and Compact
**single motor
**Total length ≈ 2inches more than syringe length
*Frequency adjustable through computer Control
; Pros
*Frequency computer controlled
*Robust/Repeat-ability
*Easily convertable to non-ferrous materials
*Simple integration for a pneumatic motor control 
;Cons
*Manual volume control	
;Features:
*Servo-motor linear actuator with relay.
*programmable linear motion.
;Pros:
*Simple
*Compact
;Cons:
*Coding ability 
*Finding the right one that meet the specs
=Project Learning - Types of Actuators=
Linear Motion: creates motion in a straight line, often made by harnessing circular motion and transforming it into linear. 
Electro-Mechanical Actuator: 
1.Screw :by rotating a machine’s nut or screw, its counterpart is moved in a line. 
2.Wheel & axle:a rotating wheel moves a cable or belt. 
3.Cam: a sliding pin connection converts rotation to linear motion. 
Piezoelectric Actuator: 
Properties of its material (usually ceramic) cause it to expand when voltage is applied. Works well for precise positioning, uses little power, generates no magnetic field, and has the fastest acceleration rate. However its range of motion is limited and the material is susceptible to hysteresis. 
A good option for future development with MRI testing. 
Hydraulic Actuator: 
Made of a hollow cylinder with piston surrounded with fluid. Since liquids are incompressible (nearly), can give precise linear displacement. Useful for heavy loads. Disadvantages are noise, heat, and leakage trouble. 
Pneumatic Actuator: 
Like the hydraulic actuator, but uses compressed gas to generate force. Not suitable for heavy loads; typically used in applications requiring less than 100 PSI, or for high force and small displacements. 
A good option for future development with MRI testing.
=Final Product Design - Linear Actuator=
==Pump Parts/Assembly==
Figure 1. Exploded View of Full Assembly	1. Fan 
Haitronic DC 5V cooling fan
Dimensions: 30mm x 30mm x 10mm
2. LCD Display
a 2.1" x 3.2" LCD display. It comes with a 16x2 blue and white backlight LCD. Complatible with any Arduino 'classic; - UNO, duemilanive,diecimilla, as well as Arduino Mega R3. It used only the I2C pins - Analog 4 & 5 on classic Arduinos, Digital 20 and 21 on Arduino Mega R3
3. Push Button
Color: Black
Size:17.5 X 18mm
Mounting Hole Diameter: 12mm
4. Blue LED Power Button 
Button Cap Diameter: 10mm 
Button Body: 6mm x 6mm 
Momentary type: push it- on, release it - off
Figure 2. Exploded View of Internal System	5. Internal System
5a. Guide rail
250 mm guide rail, 17 mm width. Raw material : Anodized Aluminum. Mounting Hole diameter : 3.5 mm
5b. Linear actuator
50 mm stroke length linear actuator with an analog position deedback signal that can be input to an external controller. Required voltage : 12 v
5c. Syringe
Maximum Fluid Displacement:
Minimum Fluid Displacement:
Figure 3. Front View of Arduino DUE and Bread Board	6. Arduino DUE
The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU. It is the first Arduino board based on a 32-bit ARM core microcontroller. It has 54 digital input/output pins (of which 12 can be used as PWM outputs), 12 analog inputs, 4 UARTs (hardware serial ports), a 84 MHz clock, an USB OTG capable connection, 2 DAC (digital to analog), 2 TWI, a power jack, an SPI header, a JTAG header, a reset button and an erase button.
7. TB6612FNG Dual Motor Driver Carrier
The TB6612FNG (308k pdf) is a great dual motor driverfor interfacing two small DC motors such as our micro metal gearmotors to a microcontroller, and it can also be used to control a single bipolar stepper motor. The MOSFET-based H-bridges are much more efficient than the BJT-based H-bridges used in older drivers such as the L298N and Sanyo’s LB1836M, which allows more current to be delivered to the motors and less to be drawn from the logic supply (the LB1836 still has the TB6612 beat for really low-voltage applications). The breakout board gives direct access to all of the features of the TB6612FNG and adds power supply capacitors and reverse battery protection on the motor supply (note: there is no reverse protection on the Vcc connection).
8. Solder-able Breadboard
dimension: 3.29 x 2.15 x 0.33" (83.5 x 54.5 x 8.5mm)
==LCD Menu==
LCD Technical Details
	
;Specs
*Dimensions: 2.1" x 3.2"
*Comes with a 16x2 Blue & White backlight LCD
*Plug and play with any Arduino 'classic' - UNO, duemilanove, diecimilla, etc as well as Arduino Mega R3.
*Uses only the I2C pins - Analog 4 & 5 on classic Arduinos, Digital 20 and 21 on Arduino Mega R3
*This board/chip uses I2C 7-bit address 0x20
*Mounting hole size is 2.5mm	
400px|thumb|left|LCD Shield to Arduino DUE Wire Diagram Source:https://learn.adafruit.com/rgb-lcd-shield/using-the-rgb-lcd-shield
Menu Selection
The interface design of the Cerebrospinal Fluid Pump includes a push button menu system and a LCD with a 16 x 2 character display screen. The purpose of this component in the interface design is to be able to display the different options available to the user in a menu styled format so that they can easily select their desired input variables at any given test run. The user input variable are the type of wave form the pump will mimic, the frequency at which the pump preforms, and the oscillating displacement of fluid in the syringe during the test run. With in each of these variables, there are multiple options that can be chosen by the user depending on the needed performance parameters per experiment. 
==Coding/PWM==
 N = 1;
 // Extension_______________________________________________________
 // Extension until the actuator reaches the end of its stroke.
 // The value is then read and set as the high voltage level for 50mm''
 while (N == 1) {
 Pos1 = analogRead(PosSense);
 digitalWrite(AIN1, LOW);
 digitalWrite(AIN2, HIGH);
 analogWrite(PWMA, 180);
 delay(250);
 Pos2 = analogRead(PosSense);
 if (Pos1 == Pos2) {
 Top = Pos1;
 N = 2;
 Pos1 = 0; //Values are reset for 
 Pos2 = 1000; //the retraction calibration 
 }
 }
 
The above coding sets the reference voltage that is used to set the gain for the actuator control loop.
The above section is repeated in the opposite fashion to set the reference ground voltage.
 // Calibration_____________________________________________________
 Gain = 50.00 / (Top - Bottom); //Gain, length per voltage (mm/volt)
 Dis = Gain * (analogRead(PosSense)); //Displacement in mm__________
 while (Dis < Start) { //Actuator extended to initial value
 digitalWrite(AIN1, LOW);
 digitalWrite(AIN2, HIGH);
 analogWrite(PWMA, 120);
 Dis = Gain * float(analogRead(PosSense));
 }
This calibration uses the set stroke displacement of 50mm and linearly correlates the voltage references of the potentiometer to the actuator displacement.
'''
 X = float(analogRead(PosSense)) * Gain; //Reads Current actuator Position_____
 Control = (K_i * (Position - X)); //Power to be supplied to actuator____
 if (Control <= 0) {
 Direction1 = HIGH; //Retraction when Control value is negative___________________
 Direction2 = LOW;
 }
 if (Control > 0) {
 Direction1 = LOW; //Extension when Control value is positive____________________
 Direction2 = HIGH;
 }
 // Power set to the actuator from 0 to 255, 255 is max________________________________
 if (abs(Control) >= 255) {
 Control = 255;
 }
 else {
 Control = 5 + abs(Control);
 }
 //Output Values to Actuator Controller__________________________________________________
 digitalWrite(AIN1, Direction1);
 digitalWrite(AIN2, Direction2);
 analogWrite(PWMA, Control);
This final portion of the code controls the actuator itself in the main program loop. The variable Position is the desired actuator position at a given time t, this value is dependent on the function input. From the desired position and the measured position, a control value is output that controls direction and power to the actuator.
==Arduino==
Wiring Diagram
	The wiring diagram (left) shows all electrical wiring connections needed for the control system. This includes, buttons, actuator, actuator feedback, motor driver, 12v supply and LCD interface.
==FFT==
	The big-picture of the pump project was to simulate the pulsation of the brain and its effect on the cerebrospinal fluid (CSF). These pulsations originate in the heart, meaning that as the heart beats, blood is pulsed to the brain, causing it to expand and contract, causing the CSF fluid to pulse in a similar manner. 
	The University of Idaho’s Neurophysiological Imaging and Modeling Laboratory (NIML) provided averaged flow rate data points, taken from a cross-section of the cervical spine, showing CSF flow over time. The raw data proved to be a complicated waveform, so to convert it into a manageable function for the actuator, we decided to perform an FFT analysis on the data, to extract the frequencies most significant in driving the waveform. 
In Matlab, the Fast Fourier Transform (FFT, the quick-fix version of the DFT), converts discrete, equally-sized samples of a function into a function of frequency. In simple terms, it breaks down a set of time-dependent data points into its building-blocks, a series of sine (or cos) waves which are stacked to create a complex waveform.
=Validation=
==System Load Test & Response==
The team ran some preliminary tests with the spinal fluid system filled with water to ensure that the actuator could handle the syringe load. We also made rough flow measurements at end opposite the actuator, to confirm that the flow rates were similar. The actuator performed well, although precise measurements of any kind were not possible since the waveform code was still in progress. 
==Future Testing==
With fully assembled system, the flow rate can be verified by inserting a vertical tube at the end with known diameter and measuring displacement over time. Additional testing can be done with pressure sensors and NIML's current model, as time allows.
=Team Members=
	Brian Aldrimk:
Major: Mechanical Engineering/Pre-med
Hometown: Eagle,ID
Graduation Date: May 2018 
Hobbies: Traveling, Volunteer work, Hiking, Tennis 
Skills/Team Responsibilities: Project management, 3D design, programming, prototyping and testing 
Future Goals: Medical Doctor
Email: aldr1383@vandals.uidaho.edu
	Krissy Buckler:
Major: BS in Mechanical Engineering
Minor: Mathematics
Hometown: Tumwater, WA
Graduation Date: December 2017
Hobbies: Culinary Arts, Upcycle Crafting, Graphic Design 
Skills/Team Responsibilities: Organization, Design, 3D Modeling/Machining
Future Goals: Work in prosthetics design or rehabilitative robotics. 
Email: buck8903@vandals.uidaho.edu
	Claire Majors:
Major: Mechanical Engineering
Hometown: Kamiah, ID
Graduation Date: December 2017
Hobbies: Backpacking, Spanish, Skiing, Bicycle Repair, Motorcycling, Literature and History
Skills/Team Responsibilities: 3-D Modeling & Printing, Arduino Programming, Project Budget, Design
Future Goals: Aircraft design and manufacturing
Email: lucy8500@vandals.uidaho.edu
	Nick Shaber:
Major: Mechanical Engineering
Minor: Mathematics
Hometown: Spokane Valley, WA
Graduation Date: December 2017
Hobbies: Fishing, Hunting, Backpacking, Skiing, Automotive Work
Skills/Team Responsibilities: Modeling, Concept Design, Machining and GUE Programming
Future Goals: Design and Manufacturing work with Mechanics and Materials Emphasis
Email: shab4213@vandals.uidaho.edu
=Additional Documentation=
Project Schedule
Meeting Minutes
Presentations
Client Interview