acceleration based pedometer

25
Acceleration Based Pedometer CSE 237B Project by Vladimir Ermakov

Upload: noma

Post on 07-Jan-2016

29 views

Category:

Documents


0 download

DESCRIPTION

CSE 237B Project by Vladimir Ermakov. Acceleration Based Pedometer. Agenda. High Level Problem description Hardware Used/Resources Available Design Implementation Conclusion. Problem Description. Accelerometers today do not measure distance accurately. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Acceleration Based Pedometer

Acceleration Based Pedometer

CSE 237B Projectby Vladimir Ermakov

Page 2: Acceleration Based Pedometer

Agenda

● High Level Problem description● Hardware Used/Resources Available● Design● Implementation● Conclusion

Page 3: Acceleration Based Pedometer

Problem Description

● Accelerometers today do not measure distance accurately.

● They measure the number of steps traveled, and multiply it by some constant step length.

● This approach is not good for complex exercise sets, and hiking trips where step length varies.

Page 4: Acceleration Based Pedometer

Goal of The Project

Come up with a pedometer that does a better distance approximation.

Page 5: Acceleration Based Pedometer

Two Approaches

● Use instantaneous acceleration of the foot to get instantaneous velocity and calculate exact distance traveled.

● Use the acceleration of the foot to figure out the mode/style of walking and provide different step lengths for different modes.

Page 6: Acceleration Based Pedometer

Why Approach 1 Failed

● The accelerometer I had available is too coarse.

● Error gets multiplied by t(10ms) added up 100 times a second and multiplied by t again.

● This makes the error multiplied 10000 times for each second

● With a regular pedometer the error is only a couple of centimeters a step.

Page 7: Acceleration Based Pedometer

Can We Do Better?

● Yes, use modes approximation approach.● Have different modes (My implementation

has 2 modes) to measure different step lengths.

● Mode1 can be Walking● Mode2 can be Running● Use foot acceleration to decide which mode

to use.

Page 8: Acceleration Based Pedometer

What is the Hardware Available

● MMA3201D Accelerometer (+-40g)● Two Micro-controllers:

– Atiny26L performs A2D on the accelerometer– AT89C5131(32 KB programmable flash) user

interface and algorithms.– Connected through a serial interface(UART)

● ES13BA0FR LCD display

Page 9: Acceleration Based Pedometer

Design

● Two parts: – Sensor

● Gets mounted on shoe● Atiny26L performs A2D conversion on Accelerometer

output● Sends it to the processing unit upon request

– Processing Unit● User interface: LCD, Keypad● Step counting/distance calculation algorithms● Sends requests to the Sensor via UART

Page 10: Acceleration Based Pedometer

More Details

● Pressing GO turns on the processing unit.● After displaying the Splash Screen the

system enters MAIN state.● From here one can enter the menu by

pressing SELECT or start counting steps by pressing GO.

● The menu exposes multiple parameters that control the sensitivity of the pedometer.

Page 11: Acceleration Based Pedometer

Parameters

● Step Length – distance traveled in a step● Threshold – minimum acceleration to register

as a step● Step Time – minimum number of

measurements to be above threshold before a step is registered

● Recoil – duration of a step. A new step will not be registered during this time.

Page 12: Acceleration Based Pedometer

Illustration of Parameters

Page 13: Acceleration Based Pedometer

States of the System

● Stopped● Counting● Paused● Auto-configure

Page 14: Acceleration Based Pedometer

What is Auto-configure

● Asks the user to walk 10 steps and uses that as a sample of the mode of walking.

● Finds average maximum acceleration of the ten steps, and uses that as a guide when deciding what mode of walking one is in.

Page 15: Acceleration Based Pedometer

Implementation

● No OS, just compiler supported interrupt handling

● main() with a while(1) loop.● Scheduling is of tasks is performed using

timers.● No preemption except for interrupt handling.

Page 16: Acceleration Based Pedometer

Timing

● An interrupt handler timer0_irq() gets called every 10 milli-seconds.

● Its job is to decrement counters and to read in the current state of the keyboard register.

● Several important counters:– power_off_timer– sensor_timer

Page 17: Acceleration Based Pedometer

Serial Communication

● The protocol is simple, byte based.● First byte is a start of packet indicator.● Its followed by 6 bytes of data – X, Y, Z● Actually each data parameter is only 10 bits,

so 6 bits are wasted per parameter.● Not a bottle neck.

Page 18: Acceleration Based Pedometer

pkt_processSensor()

● Responsible for data processing.● Sensor data has to be centered and

normalized● Filter out the noise using the threshold

specified by the user (High noise to data ratio)

● Check step counter● After step gets registered set the recoil timer.

Page 19: Acceleration Based Pedometer

The Menu

● Menu is implemented as a key driven state machine

● Special cases are the Auto-configure, and Counting states where a special key(KEY_NONE) had to be generated in order to fit the model.

Page 20: Acceleration Based Pedometer

Real Time Issues

● LCD updating is done synchronously and is very slow.

● First I tried updating the screen every half a second – problems over/under counting steps. (Diagram on next slide)

● Solution – to only update the display when a step occurs.

Page 21: Acceleration Based Pedometer

Timing Problems

Page 22: Acceleration Based Pedometer

Testing

● Testing was performed by running/walking around the house and block

● Did very well counting steps.● Problems with determining modes, actually it

barely works.

Page 23: Acceleration Based Pedometer

Reasons for Error

● Acceleration does not differ that much between walking and running, so a more accurate accelerometer is needed to perform the job.

● Possibly the approach with taking the maximum acceleration can be replaced with taking the average acceleration instead.

Page 24: Acceleration Based Pedometer

Conclusion

● Instantaneous acceleration approach is not a feasible option.

● Modes of walking approach has good potential, and could be made more reliable if more time and hardware resources were available

Page 25: Acceleration Based Pedometer

The End

Questions?