Eightlines Creations

Experiments in Physical Computing

Calculating Δv to Maximize EEPROM Storage

After a round of clarity (read: beer), Noel thought up a good way of maximizing the EEPROM memory in the data logger. Unfortunately it didn’t quite work, I’ll demonstrate below.

To reiterate, the RPMs I was recording off of the Hall Sensor would increase to a rate of over 255 revolutions provided the speed was fast enough. This makes it difficult to save the data to a single address block in the EEPROM without bit-shifting the data to two addresses.

What Noel suggested was that you might only have to record the change in velocity, or Δv, to attain the same data. Recording the previous velocity in RPM minus the new velocity would give you a difference - which could in many cases be assured to be less than 255 revolutions at the wheel diameter I’m using.

For example, this is a fragment of the data I collected on one trip:
[ [ 0,0 ], [ 0,55 ], [ 255,45 ], [ 255,35 ] ]

This takes up eight address blocks. When bit-shifted back to its original values it looks like this:
[ 0, 55, 300, 290 ]

But by recording the change in velocity we can reduce this by a factor of two.
[ 0, 55, 245, -10 ]

You can achieve the same results by adding the values of the above array in a linear sequence. And therein lies the problem. The EEPROM address block can’t store a negative value (not without that extra byte), so we can’t reduce our reading.

Well, it was a pretty good idea, perhaps if we lived in a perpetual state of drunken stupor it would have worked out.

Search

The archives run deep. Feel free to search older content using topic keywords.