# Measuring Displacements Using Accelerometers: Part 3- Testing And Video

In the last post I showed the results from a test of a few millimeters but that was one of the last tests I conducted, first I tested the output of the gyroscope compared to the angle moved which I talked about before, then tested measuring a linear movement, then a movement made up of both linear and angular movements and then finally I tested the device for its initial purpose. As I already discussed testing the output of the gyroscope, I’m going to talk about the linear movement tests. I tested the device ability to measure a linear movement by mounting the sensor on a rack of a rack and pinion controlled by a servo and by controlling the angle of the servo I could repeatedly move the sensor a known distance. I don’t have a picture of the actual setup but for a visual of it, I created it on CAD.

So the sensor in black was laid flat on the rack and moved varying distance and the output of the accelerometer was compared to the calculated movement. The movement was calculated by using the equation for the length of an arc that the gear moved, this would be translated to linear movement to the rack.
$L(\Theta)=2*\pi*r (\frac{\Theta }{360})$

# Measuring Displacements Using Accelerometers: Part 2- Comparing Methods and Integration

In the last post I discussed the methods I looked into for cancelling the gravity vectors measured by the ACC, if you haven’t seen that I would recommend reading that first. The way I compared the two methods was by seeing how well they follow the raw acceleration signal from an angular movement, this was done by mounting the sensor on the side of a servo motor and moving between different angles with varying starting positions(in reference to gravity) and magnitudes of angle change. Below is the graph from a 5-degree movement.

The blue graph is the raw acceleration signal on the Z axis,red is the cos method and the yellow is the tan method, looking at the full graph(left picture) they seem to be overlapped and looks like they both follow the raw signal fairly well but in the zoomed in picture(right), both are slightly off the middle of the raw acceleration so neither seems better than the other, the Y axis showed the same result that neither stood out. I did another test where the angle change was 35 degrees and the result of the of the two axes is below: