The purpose of this work was to allow me to study the temperature dependence of the Memsic unit.
The resulting code is based on the Memsic 2125 Demo by Jon Williams.
What I found was that nearly all accumulating error resulted from temperature dependent variability in the wave period.
The error is only significant if it is allowed to accumulate. So, for angular measurement the original code works fine. But in my previous attempts to use the device as an accelerometer, there was always an accumulating error that seemed to be temperature dependent in some complex and mystifying way. It now makes perfect sense to me[noparse]:)[/noparse]
By putting additional logic into Jon's object to ensure that I was getting the start of the high signal and the lengths of both the high and low periods... and then actually computing the ratio of high and low periods, the results were nothing short of spectacular:
accumulated error = .096 g... for 123,000 continuous measurements over a period of 2 hours... equivaltent to .006 g-sec During this time the wave period varied from 801072 to 803120 clocks, using an 80Mhz system clock and reflecting a substantial change in temperature.
The additional code reduces the maximum bandwidth to 50 Hz. This code is exclusively in Spin and takes a fair amount of time writing to the screeen. The effective measurement rate is almost exactly 16 Hz.
It appears that when you are zero-ing out the initial reading, it may be necessary to have a physical angle(in axis deviation of angle) that is not "in between" two reliable angles. That is, I think it might be necessary to add a small physical adjustment to get optimal results. I did this at my desk by placing a small weight on the leading edge of my board. This changed the axis deviation just enough to eliminate intermittent errors but not to change the offset value.
To see the effect of temperature on wave period, simply measure the voltage at the analog (temperature out) pin on the memsic unit. and observe the wave period range on the screen.
I tested the program logic by placing the unit in my car and driving a 3 mile course from and then back to my driveway.
In the car, no physical adjustment was needed. Everything was stable right out of the box.
The road trip was to test the hypothesis that if my logic was correct, then the acceleration errors caused by driving up and down steep hills and going around various bends and corners should all zero out... giving me a final calculated speed of 0 when I returned back to the starting point
... and it worked!!!
Somewhere in the info there is a statement by the manufacturer that the unit's sensitivity is temperature dependent.
This must mean that the range of ratios is affected in some way. I didn't see it, but I am going to look again after I get a gyro[noparse]:)[/noparse]
Rich
The best news is that I don't have to pontificate about floating point numbers...After I dug out Jon's code... it didn't use any!!!
Comments
The resulting code is based on the Memsic 2125 Demo by Jon Williams.
What I found was that nearly all accumulating error resulted from temperature dependent variability in the wave period.
The error is only significant if it is allowed to accumulate. So, for angular measurement the original code works fine. But in my previous attempts to use the device as an accelerometer, there was always an accumulating error that seemed to be temperature dependent in some complex and mystifying way. It now makes perfect sense to me[noparse]:)[/noparse]
By putting additional logic into Jon's object to ensure that I was getting the start of the high signal and the lengths of both the high and low periods... and then actually computing the ratio of high and low periods, the results were nothing short of spectacular:
accumulated error = .096 g... for 123,000 continuous measurements over a period of 2 hours... equivaltent to .006 g-sec During this time the wave period varied from 801072 to 803120 clocks, using an 80Mhz system clock and reflecting a substantial change in temperature.
The additional code reduces the maximum bandwidth to 50 Hz. This code is exclusively in Spin and takes a fair amount of time writing to the screeen. The effective measurement rate is almost exactly 16 Hz.
It appears that when you are zero-ing out the initial reading, it may be necessary to have a physical angle(in axis deviation of angle) that is not "in between" two reliable angles. That is, I think it might be necessary to add a small physical adjustment to get optimal results. I did this at my desk by placing a small weight on the leading edge of my board. This changed the axis deviation just enough to eliminate intermittent errors but not to change the offset value.
To see the effect of temperature on wave period, simply measure the voltage at the analog (temperature out) pin on the memsic unit. and observe the wave period range on the screen.
I tested the program logic by placing the unit in my car and driving a 3 mile course from and then back to my driveway.
In the car, no physical adjustment was needed. Everything was stable right out of the box.
The road trip was to test the hypothesis that if my logic was correct, then the acceleration errors caused by driving up and down steep hills and going around various bends and corners should all zero out... giving me a final calculated speed of 0 when I returned back to the starting point
... and it worked!!!
Somewhere in the info there is a statement by the manufacturer that the unit's sensitivity is temperature dependent.
This must mean that the range of ratios is affected in some way. I didn't see it, but I am going to look again after I get a gyro[noparse]:)[/noparse]
Rich
The best news is that I don't have to pontificate about floating point numbers...After I dug out Jon's code... it didn't use any!!!