This post will detail an experiment in which the wave sensor was attached to a rotating arm at three different diameters. These diameters were 40cm, 60cm and 80cm. For each diameter, measurements were taken at two speeds to get an idea of how rotation frequency affects measurement accuracy. This gives a total of 6 sets of data.
The speeds will be referred to as speed 1 and speed 2. With speed 2 being around 1.5 to 2 times faster than speed 1.
Two seperate methods of resetting the integration counter were used and compared. The first is detecting the peaks of the acceleration signal using this to reset the integration, the second method is using the zero crossings as the reset point.
Zero crossing method:
Speed 2 :
Peak detect method:
The results are very encouraging. In particular it was interesting that the zero crossing method provides results very similar to the peak detect method of integration reset. Zero crossing would be the preferred method for an embedded system because it takes much less processing power to detect zero crossings compared to peaks.
Post #5 outlined the steps used to go from vertical acceleration to vertical displacement and how the results were completely off. The reason why each of the displacement graphs at the end of the post look so totally different just by changing the integral reset points is because of a negative offset to the velocity signal. This causes huge problems when you go to integrate the signal. Lets take a look at the vertical acceleration signal again:
You may notice that there is a negative offset of somewhere around -0.15 in the acceleration signal. This offset was noticed and removed before the first integration to go from acceleration to velocity. The issue occurred at the second integration stage, going from velocity to displacement. It turns out the velocity signal also had a small offset present that went unnoticed and caused all of the issues outlined in post #5.
Lets take a look at an example graph with which does not offset correct the velocity signal before integrating to get displacement:
The blue vertical lines indicate the seperate chunks of data, with everything being split based on the minima of the acceleration signal. You may notice that the velocity signal has a slight positive bias. When this signal is integrated to get the bottom graph of displacement, the displacement starts at zero but does not return to zero as you would expect as the rotating arm is rotating in a circle.
Now lets take a look at the graphs when you do offset correct before each integration step:
This plot finally makes some sense, and to make things better, the average displacement for the 5 chunks of data is 41.7cm. This measurement has an error of 4.25 %. The results from offset correcting are very encouraging but more testing needs to be done to verify that this isn’t just a case of confirmation bias. A more comprehensive experiment is planned involving multiple wave heights. Extra mounting holes have been drilled into the rotating arm at a radius of 20cm, 40cm and 60cm. Measurements will be taken with the sensor at the three different radii and compared to the actual values in the next blog post.
This post will examine the steps currently being used to go from vertical acceleration data to vertical displacement and the issues involved.
Step 1: Getting acceleration data
The first step is to setup the rotating arm with the IMU attached, rotate it for a fixed amount of time, say 60 seconds and capture the raw linear acceleration data for the z-axis which is the vertical axis. See below video for an example of the rotating arm.
Note that this video is just an example of the arm rotating. All of the data used in this post was obtained with the arm set to a 40cm diameter and a rotation speed of approximately 0.2Hz. The recorded z-axis acceleration data looks something like this:
Step 2 : Filtering acceleration signal
As it is, this signal is too noisy to work with and so it is first filtered before any other signal processing steps occur. The low-pass filtered signal is shown in orange below:
Step 3 : Peak detection
Now that we have a relatively smooth signal to work with, peak detection is relatively simple. The orange x marks on the graph below mark the peaks and troughs of the signal.
Step 4: Break signal into chunks and double integrate each chunk
These peak detection points are used to break the signal into chunks where each chunk is separately integrated twice to go from acceleration chunks to displacement chunks. The displacement chunks can then be graphed which looks like this:
One issue is that changing the integral reset point has a drastic impact on the end displacement result. The above image was obtained by detecting the minima and maxima in the acceleration signal and breaking it into chunks at those points. If you break the signal at just the minima you get the following displacement graph:
By using the maxima to reset the integration you get this graph:
Remember that the actual arm diameter was 40cm so we should see a maximum displacement of 40cm. Take the above image for example. The first blue line on the left goes from approximately 0.2m down to -0.5m which is a total displacement of 0.7 meters. The rightmost blue line goes from 0.2 down to -0.2 which is exactly what the expected result would be. More testing is necessary to try and narrow down the cause of this issue.
Getting displacement data from an acceleration signal is possible by double integration. This double integration causes issues as any error present in the original acceleration signal will accumulate at an exponential rate in the displacement signal.
A python script is being used to perform analysis on the Z-axis (vertical axis) acceleration signal.
The script performs the following steps:
Analyse the Z-axis acceleration data and identify the local minima of the data.
Split the Z-axis acceleration data into seperate chunks of data using the local minima as breakpoints.
Double integrate each of these z-axis acceleration data chunks seperately and return an equal number of displacement data chunks.
Stitch the displacement data chunks back together to get a continuous time series of data .
Plot the stitched displacement data.
The stitched together displacement data looks like this:
The values of displacement in this graph to not match the diameter of the rotating arm. After researching other academic articles about inertial wave measurement devices, it is apparent that the accuracy of the measurement is inversely proportional to the frequency and the amount of acceleration involved. This is one possible explanation for the discrepancy. Experiments over the next few days will involve modifying the speed of rotation of the arm and the length to see how that affects the accuracy of the height measurements.
Some papers online mention using the zero crossings as integration reset points instead of local maxima or minima. The results from the zero crossing method is shown below:
This graph doesn’t look anywhere near as good as the first and the values are completely different compared to the minima detection method. The separate displacement chunks that have been stitched together do not match up perfectly meaning the last point of one chunk is quite far away from the first point of the next chuck. This artificially adds high frequency components into the data. As the frequency content of the data is really important , this method may not be viable without adding in more steps to stitch the displacement chunks together in a smoother way.
The current parameter of interest is maximum displacement. This should be equal to the diameter of the rotating arm which is currently 1.5 metres. This parameter is calculated by looking at each of the displacement chunks and finding the maximum displacement by subtracting the absolute value of the largest displacement from the absolute value of the smallest displacement value in a given chunk. I do this for all of the displacement chunks and average out the maximum displacement value from each.
When using the peak detection method this value of maximum displacement comes out as 1.81 meters.
With the zero crossing method this value of maximum displacement is 1.83 meters.
This represents roughly a 20% error for both methods of measurement. The exact cause of this issue is not known and will require further experiments to try and diagnose the problem.