C-Tool Acceleration Instrumentation

A lift tool was instrumented to measure the acceleration of the lower beam. A Nexus 6 android phone was used as the data acquisition device with the help of the Physics Toolbox app. Multiple lifts were performed. Acceleration in three axes and the total magnitude were recorded and uploaded to a cloud storage provider as a csv file.

We want to extract the spectral information from the acceleration time series. We use the discrete fast fourier transform (DFT or FFT) to compute the acceleration versus frequency.

In [82]:
import numpy as np
import pandas as pd
import datetime
import scipy
In [83]:
from pint import UnitRegistry
u = UnitRegistry()
In [84]:
import matplotlib
import matplotlib.pyplot as plt
import pylab
In [85]:
%matplotlib inline
%config InlineBackend.figure_format = 'svg'

Acceleration at mid-beam

In [86]:
acc = pd.read_csv('guardian_accelerometer_data_20160526.csv',
                  header=0,
                  names=['time',
                         'x',
                         'y',
                         'z',
                         'magnitude'],
                  dtype={'time':datetime.time, 
                         'x':np.float64, 
                         'y':np.float64, 
                         'z':np.float64, 
                         'magnitude':np.float64})

Fix time column

In [87]:
from dateutil.parser import parse
def munge_time(x):
    return parse(':'.join(x.split(':')[:-1]))
In [88]:
acc['time'] = acc['time'].map(munge_time)
In [89]:
print(acc)
                      time      x      y      z  magnitude
0      2016-05-30 09:45:11 -0.066  0.203  0.976      0.999
1      2016-05-30 09:45:11 -0.061  0.196  0.989      1.010
2      2016-05-30 09:45:11 -0.054  0.215  1.019      1.043
3      2016-05-30 09:45:11 -0.057  0.229  1.027      1.054
4      2016-05-30 09:45:11 -0.069  0.214  1.034      1.059
5      2016-05-30 09:45:11 -0.070  0.217  1.031      1.056
6      2016-05-30 09:45:11 -0.074  0.215  1.032      1.057
7      2016-05-30 09:45:11 -0.073  0.214  1.066      1.089
8      2016-05-30 09:45:11 -0.073  0.216  1.073      1.097
9      2016-05-30 09:45:11 -0.099  0.205  1.102      1.125
10     2016-05-30 09:45:11 -0.111  0.223  1.116      1.144
11     2016-05-30 09:45:11 -0.089  0.227  1.118      1.144
12     2016-05-30 09:45:11 -0.084  0.251  1.117      1.148
13     2016-05-30 09:45:11 -0.086  0.243  1.137      1.166
14     2016-05-30 09:45:11 -0.061  0.258  1.139      1.169
15     2016-05-30 09:45:11 -0.073  0.266  1.127      1.161
16     2016-05-30 09:45:11 -0.064  0.269  1.113      1.147
17     2016-05-30 09:45:11 -0.050  0.268  1.116      1.149
18     2016-05-30 09:45:11 -0.043  0.279  1.082      1.118
19     2016-05-30 09:45:11 -0.016  0.282  1.071      1.107
20     2016-05-30 09:45:11 -0.025  0.276  1.064      1.099
21     2016-05-30 09:45:11 -0.021  0.284  1.059      1.097
22     2016-05-30 09:45:11 -0.003  0.266  1.029      1.062
23     2016-05-30 09:45:11  0.005  0.296  1.020      1.062
24     2016-05-30 09:45:11  0.013  0.282  1.009      1.048
25     2016-05-30 09:45:11  0.033  0.303  0.977      1.023
26     2016-05-30 09:45:11  0.034  0.318  0.935      0.988
27     2016-05-30 09:45:11  0.041  0.330  0.926      0.984
28     2016-05-30 09:45:11  0.051  0.341  0.900      0.964
29     2016-05-30 09:45:11  0.059  0.343  0.866      0.933
...                    ...    ...    ...    ...        ...
508998 2016-05-30 10:22:51 -0.107  0.449  0.501      0.681
508999 2016-05-30 10:22:51 -0.146  0.461  0.496      0.693
509000 2016-05-30 10:22:51 -0.162  0.472  0.550      0.742
509001 2016-05-30 10:22:51 -0.113  0.464  0.671      0.824
509002 2016-05-30 10:22:51 -0.087  0.459  0.839      0.960
509003 2016-05-30 10:22:51 -0.060  0.462  0.975      1.080
509004 2016-05-30 10:22:51 -0.060  0.465  1.117      1.211
509005 2016-05-30 10:22:51 -0.061  0.477  1.198      1.291
509006 2016-05-30 10:22:51 -0.064  0.476  1.223      1.314
509007 2016-05-30 10:22:51 -0.056  0.462  1.218      1.304
509008 2016-05-30 10:22:51 -0.065  0.447  1.193      1.276
509009 2016-05-30 10:22:51 -0.055  0.436  1.157      1.238
509010 2016-05-30 10:22:51 -0.078  0.414  1.093      1.172
509011 2016-05-30 10:22:51 -0.084  0.411  1.022      1.105
509012 2016-05-30 10:22:51 -0.076  0.386  0.940      1.019
509013 2016-05-30 10:22:51 -0.043  0.354  0.845      0.917
509014 2016-05-30 10:22:51 -0.046  0.378  0.759      0.849
509015 2016-05-30 10:22:51 -0.070  0.404  0.672      0.787
509016 2016-05-30 10:22:51 -0.075  0.429  0.648      0.781
509017 2016-05-30 10:22:51 -0.084  0.452  0.633      0.782
509018 2016-05-30 10:22:51 -0.098  0.468  0.635      0.795
509019 2016-05-30 10:22:51 -0.108  0.456  0.688      0.833
509020 2016-05-30 10:22:51 -0.104  0.447  0.767      0.894
509021 2016-05-30 10:22:51 -0.085  0.444  0.810      0.928
509022 2016-05-30 10:22:51 -0.066  0.442  0.895      1.000
509023 2016-05-30 10:22:51 -0.053  0.422  0.984      1.072
509024 2016-05-30 10:22:51 -0.031  0.412  1.023      1.103
509025 2016-05-30 10:22:51 -0.008  0.401  1.093      1.165
509026 2016-05-30 10:22:51 -0.011  0.388  1.107      1.173
509027 2016-05-30 10:22:51  0.004  0.380  1.117      1.180

[509028 rows x 5 columns]
In [90]:
ax = acc.plot(x='time', 
              y='magnitude')
ax.set_ylabel("Acceleration (g)")
Out[90]:
<matplotlib.text.Text at 0x7f7fe56506a0>