Upload
lee-simmons
View
218
Download
0
Tags:
Embed Size (px)
Citation preview
THE OPENFES PROJECT 2009EEE193A – Final Presentation
Matthew Blanford Team Lead / Kernel Drivers / Analog TENS Circuit
Kevin Stone Digital Logic / FES Algorithm
Dennis Dahlquist Course Instructor
Dr. Nils A. Hakansson Project Mentor (Support)
Dr. Warren D. Smith Faculty Advisor (Support)
Kris Moyer EEE Contractor (Support)
Kevin Herron GUI Form Design
Tony Rivas Mechanical Engineering
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 for upgradability 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
Task Schedual – Gantt Chart
Recumbent Bike Modifications
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 OpenSVN and 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
BeagleBoard
SDATA
SCLOCK
TENSUNIT(x0)
TENSUNIT(x1)
TENSUNIT(xF)…
TENS Unit Block Diagram (Digital Side)
TENS MODULE
SDA
SCL
Buscontroller Module address
decoder
a[3:0]
State machinecontroller
enable
p[5:0]
Digital to Analog
Binary SearchAlgorithm
ANALOG
GPIO (1)
GPIO (2)
CurrentFeedback
c[7:0]
Microcontroller to TENS Unit Block Diagram 2.0
Am
plit
ude
Time450μs
33ms
Pulse Waveform (2 consecutive pulses)
Am
plit
ude
Time200-250ms
1 bike rotation
Pulse Train Waveform (cont. next page)
Pulse duration
Pulse frequency (30Hz)
Pulse train duration
I (m
A)
I (m
A)
Pulse Train Waveform
pedal
0°
crank
pulse train start angle
pulse train stop angle
θstart
θstop
Am
plit
ude
Crank Angle
θstart θstop θstart θstop
I (m
A)
Multiple channel stimulation (right side)
0°θgstart=4°
Am
plit
udes
Crank angles
θqstart=308°
θqstop=323°
0°
θhstart=111°
θhstop=170°
θgstart=4° θgstop=72°
Gluteus
Hamstrings
Quadriceps
0°
0°
θgstop=72°
θhstart=111°
θhstop=170°
clockwiserotation
θqstart=308°
θqstop=323°
Design Calculations
Time vs. (Current and RPM)
I (mA
)
Time (s)
RPM
tstart tmaintain thold tend
Imin
startt=
tbd
Imax=
14
0m
A
RPM
min
start=
tbd
RPM
min
en
d=3
5rp
mR
PM
max=
55
rpm
RPM
targ
et
dt
dI
dI/d
t=m
ax c
harg
e ra
te =
tbd
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 Packet Contents
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)
START | A A A A P P P P P P C C C C C C C C | STOP3 2 1 0 5 4 3 2 1 0 7 6 5 4 3 2 1 0
SCL
SDA
S B1 B2 Bn… P
…
…
I2C Bus: Microcontroller to Module Communication
Analog 1-Channel TENS 1.0
Analog 1-Channel TENS 2.0
TENS Analog Circuit PCB 3.0
TENS Analog Circuit PCB 4.0
TENS Analog Circuit PCB 4.0
TENS Analog Circuit Schematic 4.0
Atmel AT91Sam9261-ek Dev Kit
Texas Instruments “Beagle Board”
Å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!
OpenFES Controller
We have implemented a custom Linux driver that 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.
I2C Waveforms from BeagleBoard
Clock Pulsing @566Mhz
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.
THE OPENFES PROJECT 2009Solutions 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 2009Solutions 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 2009Current problems or concerns
•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 2009Questions from the class…
How did you get started with GPIO interrupts?
Why did we use multiple CPLDs?