Getting Started with the Accelerometer

Ok, so I understand how it is connected to the DSC but what is the cable that everyone is using?

Also, would the accelerometer be good for measuring speed and therefor distance?

And also is there a default program for the accelerometer somewhere in C++? Or is there a tutorial somewhere?


We built our own cable, using a four-conductor-wide ribbon cable (colors blue, violet, grey, white) with female pins and four-wide housings from Hansen Hobbies.

Accelerometers aren’t very good at giving speed data, and they’re really bad at giving distance data, especially in a mechanically noisy environment like FRC robots.

I’m afraid the only examples and tutorials I’m familiar with are for LabVIEW.

Accelerometer gives you accelerations. In order to obtain speed or distance data, you need to integrate the data against time to obtain speed (and double integration to obtain distance). Because of the fact that the accelerometer will pick up a lot of noise especially when the robot is moving, it means you will have major cumulative error in your integration. The error is especially bad for double integration. So beware if you decided to do this. We tried this a couple of years ago because we couldn’t mount encoders on the wheels. We ended up using a lot of tricks to minimize the error. For example, disable the accelerometer until we need it, reset the accumulators right before we need to enable it, only use it for short runs, disable the accelerometer right after we reach target etc. Also, mount the accelerometer on shock absorbing material to minimize vibrations.