400 likes | 516 Views
The Openfes project 200 9. EEE193A – Final Presentation. OpenFES Introduction FES (Functional Electrical Stimulation) bike Provides upper and lower body workout for SCI (Spinal Cord Injury) patients Provides natural (user powered) workout.
E N D
The Openfes project 2009 EEE193A – Final Presentation
OpenFES Introduction • FES (Functional Electrical Stimulation) bike • Provides upper and lower body workout for SCI (Spinal Cord Injury) patients • Provides natural (user powered) workout. • FES is a rehabilitation technique where controlled electrical current is used to stimulate nerves in order to evoke muscle contractions against resistance. • Specific waveforms produce maximum muscle efficiency
OpenFES Project Goals • Modular Design • Firmware based solution to allow forupgradability and testing • FES Algorithm that runs completely in kernel memory space • Complete fabrication of the digitally controllable TENS unit • Careful attention to muscle physiology to allow for maximum efficiency
Personal Goals - Matt Blanford • Learn DSP programming and PCB fabrication. • Get practical bus communication protocol experience • Hone my kernel driver development skills • Take a product from idea to reality.
Personal Goals – Kevin Stone • Further my software and hardware skills. • Work as team member to efficiently accomplish a common goal. • Learn how to take a circuit from concept to completed PCB. • Gain experience with embedded system programming and architecture. • Implement complex algorithms in a hardware description language
Software Everything produced by OPENFES is free and open source. Anyone is free to use, modify, and sell our designs. From day one, the OPENFES Project has had a strong web presence. Hosted both on OpenSVNand GoogleCode, the Trac Wiki and SVN repository encourage community involvement and eventually… Real-world user feedback!
TENS Unit TENS - Transcutaneous Electrical Nerve Stimulation Initial research and prototyping was done on an 1-channel analog TENS unit design from Silicon Chip Magazine. Once the concept was proven, we enlisted the help of a contractor to help with design of a 8-channel TENS unit with digitally controlled frequency, duration, and amplitude.
Microcontroller to TENS Unit Block Diagram 1.0 Beagle Board GPIO (1) SDATA GPIO (2) SCLOCK TENS UNIT(x0) TENS UNIT(x1) TENS UNIT(xF) … TENS Unit Block Diagram (Digital Side) TENS MODULE a[3:0] SDA Bus controller Module address decoder State machine controller enable SCL p[5:0] Digital to Analog ANALOG Current Feedback Binary Search Algorithm c[7:0]
Pulse Waveform (2 consecutive pulses) I (mA) Amplitude Pulse duration Time 450μs Pulse frequency (30Hz) 33ms Pulse Train Waveform (cont. next page) I (mA) Amplitude Pulse train duration Time 200-250ms 1 bike rotation
Pulse Train Waveform I (mA) Amplitude Crank Angle θstart θstop θstart θstop 0° pulse train start angle θstart pedal crank θstop pulse train stop angle
Multiple channel stimulation (right side) Gluteus 0° θgstart=4° θgstop=72° Crank angles Amplitudes Hamstrings 0° θhstart=111° θhstop=170° Quadriceps 0° θqstart=308° θqstop=323° 0° θgstart=4° θqstop=323° θqstart=308° clockwise rotation θgstop=72° θhstart=111° θhstop=170°
Time vs. (Current and RPM) Imax=140mA RPMmax=55rpm RPMtarget RPM I (mA) dt dI dI/dt=max charge rate = tbd RPMminend=35rpm RPMminstart=tbd Iminstartt=tbd Time (s) tstart tmaintain thold tend Tstart – Current increases at maximum rate (max charge rate) Tmaintain – Current is increased (or decreased) in order to maintain target RPM Thold – Muscle fatigue becomes dominant factor, decreasing RPM Tend – Minimum stable RPM reached, stimulation should cease
I2C Bus: Microcontroller to Module Communication … SDA SCL … … S B1 B2 Bn P I2C Packet Contents START | A A A A P P P P P P C C C C C C C C | STOP 3 2 1 0 5 4 3 2 1 0 7 6 5 4 3 2 1 0 18 bit length packet A[3:0] = Address of desired module P[5:0] = Pulse count (000000 => 0 pulses, 111111 => 31 pulses) C[7:0] = Current amplitude (00000000 => 0mA), 11111111 => 254mA)
Ångström 2009 Ångström was started by a small group of people who worked on the OpenEmbedded, OpenZaurus and OpenSimpad projects to unify their effort to make a stable and userfriendly distribution for embedded devices like handhelds, set top boxes …and now FES Equipment!
OpenFESController We have implemented a custom Linuxdriverthat acts as referee between our Quadrature encoder, Touchscreen UI and our custom hardware TENS Unit. The driver contains three main components: Interrupt logic, character device for UI communication, and I2C interface for sending data to and from the TENS unit across an external bus.
Data Acquision Use General Purpose Input Output to receive, process, and transmit data. Use a Rotary Encoder to feed the position of the bike crank to the Microcontroller. Use Microcontroller to send signals to the TENS unit.
Rotary Encoder AMT102-V Shaft Size 8 mm to 2 mm Programmable Resolution • Uses Capacitors. 2.5 x 1
Programmable Resolution Resolution 48 – 2048 48, 96, 100, 125, 192, 200, 250, 256, 384, 400, 500, 512, 800, 1000, 1024, 2048 Pulses Per Revolution.
Encoder Type Incremental - Channel A and B 90 degrees out of phase Better Resolution – More accurate position and speed Simple Grey Code Reference bit (Z-signal) for positioning.
Problem: How should we maintain data coherency while trying to calculate crank angle in a heavily multi processed kernel? • Solution: Atomic Operations. • Problem: How can we communicate with a Java UI from the Linux kernel when the JVM is completely abstracted from our memory map? • Solution: Character devices • Problem: Time-variant characteristics of analog circuitry cause unwanted fluctuations in electrode output current • Solution: Digital feedback algorithm (Binary Search Tree). The Openfes project 2009 Solutions to Problems encountered
Problem: How should we maintain data coherency while trying to calculate crank angle in a heavily multi processed kernel? • Solution: Atomic Operations. • Problem: How can we communicate with a Java UI from the Linux kernel when the JVM is completely abstracted from our memory map? • Solution: Character devices • Problem: Time-variant characteristics of analog circuitry cause unwanted fluctuations in electrode output current • Solution: Digital feedback algorithm (Binary Search Tree). The Openfes project 2009 Solutions to Problems encountered
Problem: How can we develop functionally relevant performance benchmarks. • Problem: Reliable QE Decoding • Problem: How should we secure the character device that governs the operation of our TENS unit? The Openfes project 2009 Current problems or concerns
The Openfes project 2009 Questions from the class… How did you get started with GPIO interrupts? Why did we use multiple CPLDs?