Measurements and Signal
processing (part 1) MCE 493/593 & ECE 492/592 Prosthesis Design and Control
September 25, 2014
Antonie J. (Ton) van den Bogert
Mechanical Engineering Cleveland State University
1
Today
• Body-mounted measurement systems – for human movement field studies
• real-time or off-line data processing
– for prosthetic control systems • real-time data processing
• Next week – laboratory techniques for human motion studies
Kinematic measurement
• Potentiometer for joint rotation – “electrogoniometer” – simple, analog signal – must be aligned with joint or allow translation
• Or resistive “bend sensors”
from Winter book Cyberglove
flexible goniometer
Kinematic measurement
• Encoders on joints or motors – standard robotics technology – incremental encoders
• (requires “homing”) • not desirable in prosthetics
– absolute encoders
absolute encoder with 3 bit precision (optical)
10 bits $110
Electromagnetic receiver-transmitter
• Original application: virtual reality • Measures position and orientation
of receiver relative to transmitter – multiple receivers, one on each body
segment of interest • Can be body mounted for research
– e.g. skiing with transmitter in backpack • Not suitable for prosthesis
– transmitter is large – inaccurate near metal
Polhemus system
Application of joint angle sensing
• “Echo control” for powered prosthetic knee – Donald Grimes, MIT, PhD Thesis 1979 – joint angles measured on intact leg – “played back” on prosthetic leg, some time later
• Advantages – user has full control over cadence and amplitude
• Disadvantages – movement must always start with intact leg – only suitable for symmetrical movements – requires instrumentation on intact leg – mistakes get copied also
From Grimes 1979
transition from level walking to uphill ramp walking
Processing of position data
• For dynamic analysis (F = m a) we need acceleration • Position signals have noise
– from the sensor and electronics – from the analog-to digital conversion – these types of noise have high bandwidth
• Differentiation amplifies high frequencies – noise can become larger than the signal – solution: low pass filtering – this works because human motion has low bandwidth (<10 Hz)
Vertical position of the heel
heelY = mocap_077(4000:4400,112); % 4 seconds of data heelYd = diff(heelY)/0.01; % numerical derivative heelYdd = diff(heelYd)/0.01; subplot(3,1,1);plot(heelY);ylabel('position (m)'); subplot(3,1,2);plot(heelYd);ylabel('velocity (m/s) '); subplot(3,1,3);plot(heelYdd);ylabel('acceleration (m/s^2)'); xlabel('frame number');
Digital low pass filter
• Butterworth filter
– matlab functions: butter, filter, filtfilt – Winter’s book has a table with filter coefficients
• careful: a and b & signs are defined differently than in Matlab
– This can be done in real time also (Simulink, Labview, etc.)
• Consider Kalman filter – especially if something is known about dynamics of the process that
generated the signal
FILTER x(t) y(t)
231223121 −−−− −−++= iiiiii yayaxbxbxby
Matlab code for 10 Hz low pass filter a = [1 -1.01905 .25962]; % a coefficients from Winter book, for ratio % fs/fc = 100 Hz / 10 Hz = 10 b = [.06014 .12028 .06014]; % b coefficients from Winter book heelYdd_filtered = filter(b,a,heelYdd); >> plot(heelYdd); >> hold on; >> plot(heelYdd_filtered,'r','LineWidth',2);
real-time filtering always introduces a time lag (phase response of filter) lower cutoff frequency larger time lag
Force measurement
• Force transducer (load cell) – 1-axis, 3-axis, 6-axis (3D force and torque)
www.ichida.com For 1-axis, specifications will say how much off-axis load is allowed
Designing a load cell
• 1-axis: strain gauges on a piece of metal tube – four strain gauges for bridge circuit for temperature
compensation
• 6-axis: at least six strain gauges needed – when randomly placed: no temperature compensation – calibration with known forces and moments – linear model – C is a 6xN calibration matrix – s can be a raw voltage signal rather than strain
=
N
z
y
x
z
y
x
s
sC
MMMFFF
1
Calibration
• Apply known loads F,M, record the strains s – do this many times (T times) with different loads
• Or: apply random loads and record F,M (with already calibrated load cell) and record s
• Solve calibration matrix C from:
[ ] [ ]MF, loads knowndata =
NC
Cs
6
1
=
zT
yT
xT
zT
yT
xT
z
y
x
z
y
x
N
NTT
NTT
NTT
NTT
NTT
NTT
N
N
N
N
N
N
MMMFFF
MMMFFF
C
CC
ssss
ssss
ssss
ssss
ssss
ssss
1
1
1
1
1
1
6
12
11
1
1
1
1
1
1
111
111
111
111
111
111
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
161666 TxNxNTx bCA =Matlab solve: C = A\b (linear least squares) all six load variables are calibrated simultaneously
Using a bone as a 6-axis load cell
(and you can do this with aluminum tube also) – glue strain gauges on bone – post-mortem calibration required to get calibration matrix
Weinans & Blankevoort J Biomech 1995
Transformation of force/moment data
• Load cell is between ankle and knee • What are force and moment at ankle and knee?
– assume m*a between load cell and joint can be neglected
( )( )TzPyPxPP
TzPyPxPP
MMM
FFF
=
=
M
Fforce and moment measured at point P
is equivalent to another force and moment measured at point Q:
PPQ
PQ
FQPMMFF
×−+=
=
)(• derived from free body diagram and statics • distinguish action and reaction loads • (internal vs. external moment)
Example (instrumented prosthesis)
• 6-axis load cell between ankle and knee – distance to knee is 20 cm – assume load cell is outside the joint actuation system – measures load on the upper half of the lower leg – X = anterior, Y points towards knee (load cell coordinate system)
• P is load cell, Q is knee joint center
( )( ) m N
N T
P
TP
0,0,0
0,0,200
=
−=
M
F( )
m N
N
−=
−×
−+
=
−=
4000
00200
02.0
0
000
0,0,200
Q
TQ
M
F
This is a clockwise external moment acting at the knee. Assuming static equilibrium, the knee motor must have generated a 10 N counterclockwise moment that acts on the lower leg (extension moment).
Homework assignment (due Oct 2)
• We have the same load cell as in the example – same placement, same assumptions, same coordinate system – length of thigh is 60 cm, length of lower leg is 45 cm
• Measurements (in middle of stance phase) – from encoder: knee is 15 degrees flexed – from load cell:
– what are the joint moments (torques) at hip, knee, ankle? – which of the following hip muscles might be active?
• hamstrings, gluteals, iliacus, psoas, rectus femoris • explain your reasoning
( )( ) m N
N T
P
TP
50,0,0
0,800,50
−=
−=
M
F
Accelerometer
• Contains a small mass (test mass) sitting on a load cell – 1 axis, 2 axis or 3 axis – MEMS accelerometers are cheap (<$10)
• Accelerometer signal depends on – acceleration and gravitational force – in accelerometer XYZ reference frame:
– with a and g in world XYZ reference frame (Z=up)
from Winter book
gaFs
agF
−==
=+
m
mm
loadcellteraccelerome
loadcell
( )
−−=−=
81.900
aRgaRs TTteraccelerome
R: attitude matrix (orientation matrix, rotation matrix) of the accelerometer with respect to the world. Columns of R are the world XYZ coordinates of unit vectors along the accelerometer’s coordinate axes
measurement model:
Three examples • No acceleration, accelerometer XYZ aligned with world XYZ
– R = identity matrix, a = 0 – accelerometer signals are (0,0,g)
• Upward acceleration az, accelerometer XYZ still aligned with world XYZ – R = identity matrix, a = (0,0,az)T
– accelerometer signals are (0,0,g+az) • No acceleration (a = 0), accelerometer is rotated about (horizontal) X axis
−=
−=
θθθθ
θθθθ
cossin0sincos0
001
cossin0sincos0001
TR
Raccelerometer signals:
=
−−=
θθ
cos81.9sin81.90
81.900
T
z
y
x
sss
R
yworld
zworld
θ
Accelerometer
• Can not distinguish between acceleration and gravity – sometimes you can assume a<<g (tilt sensor) – or assume g<<a ( pure acceleration sensor) – or use additional sensors: IMU (inertial measurement unit)
• 3D magnetic field sensor • 3D MEMS gyro (angular velocity sensor)
– or do an analysis where they don’t need to be distinguished
• load estimation (two slides from here)
www.sparkfun.com, $49.95
www.xsens.com, $3290
Inertial Measurement Units
• Kalman filter or equivalent for state estimation and sensor fusion – state variables: 3D position, velocity,
orientation, angular velocity – nine measurements: 3D
accelerometer, magnetometer, gyro
• Can provide good 3D orientation • Unavoidable drift in 3D position
Accelerometers for force/moment measurement • Multiple accelerometers on a rigid body
– can provide information about angular velocity and angular acceleration
• Measurement model – 3-axis accelerometer mounted at position r
orientation
acceleration at body origin gravitational field
angular acceleration angular velocity
sensor mounting position
Rigid body dynamics
If we know motion of a rigid body (mass m, inertia I), the total force and moment acting on the body are:
Gravity and acceleration can’t be separated
−≡
αω
g)(aRsx
T0
But we don’t need to, for this purpose. Given enough accelerometers (12 channels is a good number), nine kinematic variables of the rigid body can be measured:
We have nonlinear measurement model: )( 91121 xhy =
Solve x by nonlinear least squares: find x for which is minimized (Numerical Recipes book, Chapter 15, Levenberg-Marquardt method) Kalman filtering would have been better
( )∑=
−=−12
1
22 )()(i
ii hy xxhy
van den Bogert, Read, & Nigg, J Biomech 1996
Clinical question
• Is skiing a safe activity after total hip replacement?
• Goals: 1. quantify forces in the hip joint during various skiing activities 2. compare skiing to walking and running 3. discussion of possible effects on prosthesis
Instrumentation
• analysis of upper body movement
• 4 triaxial accelerometers – 12 channels
• data logger
Alipne skiing, left hip joint upper body reference frame
lateral posterior superior
flexor abductor int.rotator
Estimation of joint contact force
muscles
contact
dM
FFFF
FFFd
F
+=+=
⇓
=−
=
muscles contact
musclescontact
musclesM
d
Summary of results
9 subjects
2 subjects
van den Bogert, Read, & Nigg, Med Sci Sports Exerc 1999
Foot switches
• To detect heelstrike and (sometimes) toe off • Mechanical switch • Force-sensitive resistor • Heelstrike impact detection
– Accelerometer – Cheap microphone
Electromyography
• Electrodes – surface electrodes – indwelling electrodes
• Dipole or quadrupole • Differential amplifiers
– to cancel the noise
16-channel wireless system (Delsys Trigno) $20,000
to iPad stereo microphone input
EMG amplifier with footswitch for $5
Winter book
EMG signal processing steps
1. Bandpass filter (30-600 Hz) to remove high frequency noise and movement artifacts
2. Full-wave rectification (take absolute value) to make the signal positive
3. Low-pass filter to obtain “EMG envelope”
arm muscles in gymnasts during giant swing
EMG during running recorded on iPad imported in Matlab with “wavread”, processed by software
0 2 4 6 8 10 12 14 16 18-0.5
0
0.5Raw EMG signal
0 2 4 6 8 10 12 14 16 18-0.5
0
0.5EMG after bandpass filter
0 2 4 6 8 10 12 14 16 18-0.5
0
0.5EMG envelope
0 2 4 6 8 10 12 14 16 18-0.5
0
0.5
1Motion sensor
Time (s)
Average of many strides
0 100 200 300 400 5000
0.02
0.04
0.06
0.08Mean and standard deviation (N=97)
0 100 200 300 400 5000
0.1
0.2
0.3
Mean and standard deviation (N=127)
Vastus Lateralis
Vastus Medialis
heelstrike
no evidence of a stretch reflex quadriceps is activated before impact feedforward control time (ms)
Application in prosthetics: myoelectric control
Kuiken et al., JAMA 2009
• Nerves from amputated arm (green) are surgically connected to the Pectoral muscles
• EMG electrodes placed on Pectoral muscles • User activates muscles in amputed arm, causes electrical
activity in Pectorals • EMG signals are decoded and used as command input for
robotic arm