Go & Comeback To Original:
Position Based Mouse:
After signal processing for noise removal, we started giving some specific motion to observe instantaneous changes in input data along x-y plane. We found that static jerky movements are less than 300ms period. Figure shows results for square movement with clearly indicating direction & magnitude of movement (around peak value =50). This was primary focus as double integration would give absolute values as signal is well within error limits.
It was clear that we can differentiate between tilt & motion based acceleration. Tilt can be assumed to be either only slowly varying or if changing more quickly to change steadily to a new value without oscillation. Thus all oscillations occurring on short timescales (less than about 300ms) can be assumed to be caused by movements, i.e., accelerations followed by retardations. This separation is achieved by a least-square fit procedure with a window of 64 sample points. It is worth noting change in X- axis value when Y-axis is direction of motion.
Algorithm shows calculation of distance from acceleration profile. Calibration routine is essential as dynamic properties of sensor are not steady & keeps on changing which introduces drift errors in calculation. We calculated distance without any floating point calculation only with shift operations. Sampling time was considered to be constant say 10 ms with 100 samples per second.
Figure shows results of simple Go & Comeback to Original Position movement with velocity & distance results (Axis values are scaled) along x-y plane. The expected results & observed differs because of initial calibration value which is subtracted from 10 bit result of ADC to get relative magnitude of acceleration. This error keeps on increasing if accelerometer is not kept steady to settle down for some period after movement. Thus accuracy was main constraint in actual position based mouse with integration.
- Sampling Frequency= 62.5 KHz
- Sampling Time= 213µs
- Sampling Rate = 200 samples per second
- 10 bit ADC, 0g=512, +1g=800, -1g=380 count
- Steady state Drift Error= +/- 20 count
- Sensitivity = ((+1g) – (-1g))/2 = (740--360)/2 = 190 count per g (As per datasheet sensitivity= Vcc/5 = 660 mv/g =210 count)
- Zero g Offset = ((+1g)+ (-1g))/2 = (740+360)/2 = 550 count at 0g