Engineering Skills: measurement and uncertainty analysis; signal processing; MATLAB; LabVIEW
My final project for Boston University's Instrumentation and Measurement course, ME310, was to construct a position measurement system for a mass-spring oscillator. The 2nd order system was driven by an electric motor of unknown speed and voltage; only the percent-power indicated by the dial marks on the motor controller could be used to construct the measurement system. The requested deliverables for this project were as follows:
derive the damping coefficient, spring constant, natural frequency, and damping ratio of the system (oscillating mass is given as a known value with no uncertainty)
plot magnitude ratio as a function of driving frequency
plot position against time for various driving frequencies
The linear potentiometer (LP) is constructed with a wire and a sliding contact attached to the oscillating mass. By inputting a small voltage across the wire, the LP creates a voltage divider with variable output that can be measured via a DAQ board. The working principle of this project is that the measured voltage output is linearly proportional to the displacement of the oscillating mass.
The wire's total resistance was measured as 5 Ohm, therefore, to prevent excessive current through the wire, the input voltage was set to 0.1 V. The resulting voltage output of the divider was passed through an inverting differential amplifier with a gain of 100, which was then collected by a DAQ set to a full-scale voltage of ±10 V.
In order to convert the amplified voltage output to displacement measurements, the amplifier and LP needed to be calibrated using LabVIEW. By producing calibration fits, the experimental setup could be used to measure displacement, which in turn provides a means of calculating the requested parameters.
By attaching weights of known masses to the oscillating mass, the spring will compress and move the sliding contact down. Hysteresis was accounted for by increasing the total weight to maximum, then removing weights by the same increments and measuring displacement again. Sampling was conducted to convert the LP output to a displacement, which was then processed in MATLAB to yield a plot of applied force versus displacement. Via Hooke's Law, the spring constant was calculated as the absolute value of slope of the line.
Analysis of the 2nd order system's response to various driving frequencies was conducted by incrementing the electric motor's power by 5% (starting from 10% power since the motor did not begin turning when supplied with less than 10% power) to 100% and sampling for 10 seconds at 1kHz. The resulting raw data was collected and processed in MATLAB. Because the sliding contact was simply a free end of a wire that was restricted to a small space, it was not always in contact with the potentiometer wire. The result of this is extremely noisy data due to open circuit creation. To extract clean sinusoidal signals, the dominant frequency in the data was identified with a Fourier transform. After performing a low-pass filter using this dominant frequency, a moving median filter was applied to remove spikes in the data due to the contact's disengagement from the LP.
The experimental derivation of the natural frequency involves approximating the period of each signal by finding the distance between sinusoidal peaks, which in turn allows for the calculation of the signal's damped natural frequency. Additionally, the resonance frequency was estimated by observing that the data had the largest amplitude at 45% motor power. Since the amplitude at resonance can be defined in terms of only the damping ratio, it can be computed and used to calculate the average natural frequency of the system.
In MATLAB, each signal's period was computed by plotting a midline through the data. A square wave was constructed to graphically represent where the data lay above and below the midline. By finding the time distance between respective corners of the square wave, the period can be estimated by averaging each of these intervals in the signal. Since the data has lingering noise that creates spikes around the midline crossing, a Fourier transform was applied to the square wave to produce clean square waves. With the period computed, the maximum data point in each period-interval with respect to the midline was extracted as the amplitude of the signal, and each interval's maximum was averaged to compute the average amplitude in each signal. During processing, invalid peaks were required to be omitted since they either inaccurately represented the behavior of the system or were misclassified by a first pass of MATLAB's "findPeaks" function.
Complete data processing script available on GitHub