Can the accelerometer give performance figures?

Discussion in 'Application Ideas' started by Campa, Mar 26, 2008.

  1. Campa

    Campa New Member

    Joined:
    Jan 15, 2008
    Messages:
    23
    Likes Received:
    0
    Forgive my noobiness but if the accelerometer measures accelerations could it therefore be used to calculate velocity (simple integration with respect to time)?

    If so could an application measure the time taken for this velocity to go from say 0 to 100 km/h and turn the ipot/iphone into a crude performance measuring device?
  2. Collateral

    Collateral Active Member

    Joined:
    Sep 23, 2007
    Messages:
    1,974
    Likes Received:
    6
    Device:
    iPhone 3GS (Black)
    Accelerometers can be used to measure vibration on cars, machines, buildings, process control systems and safety installations. They can also be used to measure seismic activity, inclination, machine vibration, dynamic distance and speed with or without the influence of gravity. Applications for accelerometers that measure gravity, wherein an accelerometer is specifically configured for use in gravimetry, are called gravimeters.
    Accelerometers are increasingly being incorporated into personal electronic devices such as media players, gaming devices, or step counters. Smartphones and personal digital assistants (such as Apple's iPhone and iPod Touch and the Nokia N95) contain accelerometers for user interface control, e.g., switching between portrait and landscape modes. Apple's laptops since 2005 feature an accelerometer known as Sudden Motion Sensor, which is used to protect against hard disk crashes in the event of shock. In game controllers such as the Wii Remote accelerometers may provide realistic game control.
  3. Campa

    Campa New Member

    Joined:
    Jan 15, 2008
    Messages:
    23
    Likes Received:
    0
    So what you're saying is that the accelerometer in the ipod touch & iphone is very basic and only capable of determining the orientation of the device as oposed to outputing relative displacements?
  4. StrictNon-Conformist

    StrictNon-Conformist New Member

    Joined:
    Mar 26, 2008
    Messages:
    31
    Likes Received:
    1
    The accelerometer SDK trivia gives surprisingly unhelpful details in terms of just how sensitive it is, so the method I took to find the information I wanted/needed for my nefarious deeds/plans was to search online to figure out:

    1. Exactly the chip used as the accelerometer
    2. Look it up for the manufacturer
    3. Evaluate all the data sheets and consider the relevant stuff in relation to the iPhone/iPod Touch
    4. Think about what that means in practical terms

    The accelerometer as Apple is using it can be updated and sampled as fast as 100 Hz: this isn't the fastest the hardware can be used according to the data sheet, and is 1/4 the top speed, but keep in mind, there's a power cost to higher speed operation.

    The accelerometer is a full 3 axis accelerometer, so it's far more useful than merely figuring out the orientation of the device: you can definitely measure the acceleration in all 3 axis at once, if applicable, and by extracting the downward 1G force acting on it, as long as you have enough historical information, you can know the orientation of it as well as the current speed in any given direction, and if you have a known reference point that you started from, you can know the current location relative to that reference point.

    Now, how accurately can it measure? If the Apple usage is like I think, it's good to about +/- 2G, and according to the data sheets, that gives it a resolution of about .018g, +/- 1% for accuracy overall.

    I have a background in writing software for many things, with an electronics background in automation and programming it: if you don't have that sort of background, interpreting the data sheets may be just a bit hard to grok and make good sense of

    Please Register or Log in to view images

    What's important to remember is that because there's no absolute start you can reference from with the accelerometer, and there's some accuracy limitations for repeatability, along with cumulative rounding errors (regardless of how fine you measure things and compute them) over time, if you're trying to measure distances and velocities, you'll see the location diverge. Since I've not had access (yet: just got the iPod Touch a couple nights ago, haven't jailbroken it yet and put any code on it for testing purposes, and I don't want to kill my iPhone, as I need that for a phone) to a real-life test, I can't quantify how soon that will diverge. I can assure you, though, from my CAD/CAM CNC machine and 3D CAD software development experience, that unless you happen to have something that's supposed to be as precise as GPS as a reference you can check up on every so often that doesn't move, there will be a certain amount of float, and you'll need to somehow take a reference position: this is done in CNC programming, and even the most precise machines have some small amount of slop that creeps in.

    Another reason to expect slop to creep into the computations: sooner or later, there'll be a hiccup in getting CPU time that's sufficient for processing the incoming accelerometer data (perhaps Apple buffers enough of it?) and you may lose some samples. If there's a heavy I/O demand that goes for a relatively long period of time (it'd have to exceed 10 ms, clearly) and interrupts are turned off too long (though that'd be a crappy hardware driver to disable them that long) the device could lose some data.


Share This Page