* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download MEMS 1041 Report for Rocket Engine Measurement Project Use of
Analog-to-digital converter wikipedia , lookup
Atomic clock wikipedia , lookup
Phase-locked loop wikipedia , lookup
Superheterodyne receiver wikipedia , lookup
Josephson voltage standard wikipedia , lookup
Regenerative circuit wikipedia , lookup
Oscilloscope history wikipedia , lookup
Integrating ADC wikipedia , lookup
Oscilloscope types wikipedia , lookup
Power MOSFET wikipedia , lookup
Operational amplifier wikipedia , lookup
Surge protector wikipedia , lookup
Schmitt trigger wikipedia , lookup
Valve audio amplifier technical specification wikipedia , lookup
Beam-index tube wikipedia , lookup
Power electronics wikipedia , lookup
Voltage regulator wikipedia , lookup
Index of electronics articles wikipedia , lookup
RLC circuit wikipedia , lookup
Radio transmitter design wikipedia , lookup
Switched-mode power supply wikipedia , lookup
Current mirror wikipedia , lookup
Wien bridge oscillator wikipedia , lookup
Resistive opto-isolator wikipedia , lookup
Valve RF amplifier wikipedia , lookup
Battle of the Beams wikipedia , lookup
MEMS 1041 Report for Rocket Engine Measurement Project Use of Strain Gages, Amplifiers, and Filters to Determine the Thrust of an ESTES C6-5 Model Rocket Engine Date: April 22, 2016 Lab Instructor: Robert Carey Submitted by: Derek Nichols Objective: The objective of this experiment was to measure the thrust of an ESTES C6-5 model rocket engine with the use of a beam, strain gages, amplifiers, and filters. This measured thrust was then compared to the value of thrust provided by the manufacturer in order to determine the accuracy of the circuit and measurement system. Theory: When a cantilever beam is subjected to a point force at its free end, the free end is displaced from its equilibrium position. This vertical displacement causes the beam to extend, and the equation for this strain can be derived from knowledge of beams in bending. The experimental setup for the project can be seen in Figure 1 below. The beam is fixed in place with a point force acting on the end of the beam caused by the thrust of the rocket engine. Figure 1: The experimental setup of the beam defining variables (Reproduced from ME 1041 Lab #3 handout with permission of the ME Dept., University of Pittsburgh) This cantilever beam is simply a beam in bending. The stress and strain experienced on the top and bottom surfaces of a beam in bending can be expressed as: π = πΈπ = π= ππ πΌ ππ πΈπΌ 2 (1) (2) The strain at the surface is seen to be a function of the moment experienced at that portion of the beam. The moment at the strain gages is equal to the force at the end of the beam times the length of beam separating the strain gage and the end of the beam. π‘ (ππΏ1 ) ( ) 2 π= 1 πΈ (12 π€π‘ 3 ) π= 6ππΏ1 πΈπ€π‘ 2 (3) The beam must be designed in such a way to ensure that the predicted strain is over 1000 πstrain and that the natural frequency is that of an acceptable value. The natural frequency of the beam should be beyond that of the rocket and is defined as: 1 πΎππ β 2π πππ (4) 3πΈπΌ πΈπ€π‘ 3 = 3 = πΏ 4πΏ3 (5) ππ = πΎππ 1 1 πππ = ππ + πππππ = πππππππ‘ + π‘ππ΄π [0.00039687 + πΏπ€] 4 4 (6) Using these definitions, the natural frequency of the beam can be selected so that it is above the natural frequency of the rocket which is around 70 Hz. The value for the beam should ideally be in the range of 80-100 Hz. From equations 4, 5 and 6 it is seen that the frequency is dependent solely on the geometry of the beam. Going back to Equation 3, it is seen that the strain is also a function of only the geometry of the beam if the force is constant. This means that in order to satisfy the requirements for both strain and natural frequency simultaneously, only a certain combination of dimensions will work. This process will be further explained in the procedure section. Strain gages are long lengths of thin wire that are attached to a beam and have a current running through them. As the beam is subjected to a strain, the wire also strains which changes its resistance. When hooked up to a Wheatstone bridge, the changes in resistance are able to be used to produce voltage differences. Resistance of a wire is defined as: π = ππΏ π΄ (7) Volume of the wire is constant during the process; therefore, the relationship for the volume the wire can be used to solve for area, and this relationship can be put into Equation 7. 3 π = π΄πΏ (8) ππΏ2 π = π (9) The resistance is therefore seen to greatly increase as the length of the wire increases. This change in resistance can be measured if the strain gages are hooked up to a Wheatstone bridge. The two strain gages (one on the top of the beam and one on the bottom) have a resistance of 120 Ξ© when no strain is exerted upon them. Because of this, the other two resistors in the Wheatstone bridge are also 120 Ξ©. The bridge will become unbalanced when the resistors are not all the same resistance, and this occurs when the strain gages experience a strain which changes their resistances. This change in resistance unbalances the bridge which causes a voltage output for a given voltage input: πΈπ = πΈπ Ξπ 2π (10) This means that the output voltage is dependent on the change in resistance which is dependent on the change in length which is dependent on the applied force. This output voltage is very small, however, meaning that an amplifier must be used in addition to the Wheatstone bridge. Amplification employs the use of an op-amp and resistors. This amplifier takes in a voltage and multiplies this signal by a gain which is dependent on the values of the chosen resistors. A diagram of the amplifier is seen in Figure 2 below. Figure 2: Diagram of the amplifier of the circuit The gain of this amplifier is equal to: πΊπππ = π π π ππ (11) A filter is required to filter out the aliasing created by high frequency signals. This filter also acts as an amplifier. A diagram of the active low pass filter is seen in Figure 3 below. 4 Figure 3: Diagram of the low pass filter, LPF The gain of the amplification of the signal is equal to: πΊππππ‘ππ = π 2 π 1 (12) The filter is able to accept signals under a certain frequency. This frequency is called the cutoff frequency and is equal to: ππ = 1 2ππ 2 πΆ (13) Gains of circuits are multiplicative meaning that the total gain of the circuit is equal to the gain of the amplifier times the gain of the filter. The total gain of the circuit should be somewhere around 200 to allow for a significant increase in the signal of the output voltage of the Wheatstone bridge. The gain of the amplifier can be made to exhibit any value meaning that the gain of the filter is the one that requires the initial attention. The cutoff frequency from Equation 13 must first be satisfied. This frequency should be around 50 Hz. As it is a function of C and π 2 , different values can be chosen which satisfy this requirement. A value for π 1 can then be chosen which leads to a decent gain for the filter, and the resistors for the amplifier can be chosen to produce a gain of the amplifier large enough to produce a total gain of 200 for the entire circuit. This cutoff frequency will enable the natural frequencies from the rocket engine and the beam to be ignored during data collection enabling only the frequency from the measurement device to be collected. Procedure: In order to determine the forces that are at play during rocket testing, Figure 1 displays the point force at the end of the beam symbolizing the force caused by the thrust of the rocket engine. This force causes reaction forces to develop at the clamped end of the beam seen in Figure 4 below. 5 Figure 4: FBD showing reaction forces as the clamped end of the beam Other than these forces, the only other forces that develop are a result of the bending stress. This makes calculations relatively straight forward. Knowing these forces, a relationship for the deflection can be developed to find the deflection at any point at the beam; however, this is not necessary for the purposes of this report. The first hurdle of the project was to design the beam which acts as the design sensor. As stated in the theory section of the report, the two main concerns when designing the beam is to ensure that it attains a maximum deflection greater than 1000 πstrain under the force of the rocket and that the natural frequency of the beam is beyond that of the rocket and exists in the range of 80-100 Hz. Using Excel, different combinations of thickness, length, and width were tried, and the natural frequency and strain were calculated. In order to accomplish this, Equation 4 can be satisfied using Equations 5 and 6, and Equation 3 can be satisfied. For every combination of dimensions, if the natural frequency is between 80 and 100 Hz and if the strain is greater than 1000 πstrain, then the beam could be used for the analysis. Out of 3,888 different beam combinations, only 70 met these conditions. From here, the beam that was chosen out of these 70 did not matter. Refer to Section A1 of the Appendix for a detailed layout of the Excel spreadsheet. The dimensions that were chosen were: Table 1: Chosen dimensions for the beam which satisfy Equations 3, 4, 5, and 6 Parameter Thickness, t Length, L Width, b Value (in) 0.125 3 0.25 These values lead to maximum strain and a natural frequency of: 6 Table 2: Natural frequency and strain of the selected beam Natural Frequency, ππ 84.62 Hz Strain, π 1317.86 πstrain These dimensions were sent to the machine shop where a piece of aluminum was machined down to the necessary dimensions by one of the workers. Students were unfortunately unable to observe the machining of the part this semester, so the exact processes of the machining of the sensor is unknown. Perhaps the most intricate step of the entire procedure was the mounting of the strain gages. Once the beam was retrieved from the machine shop, the surface had to be prepared for strain gage mounting. First, the surface of the beam had to be degreased with CSM-1A degreaser. This was done to remove oils, greases, organic contaminants, and soluble chemical resides. Next, the surface of the beam was abraded with the use of M-PREP Conditioner A and 320-grit silicon-carbide paper. When the surface became bright, it was wiped clean with a gauze sponge and the steps were repeated with 400-grit silicon-carbide paper. This was done in order to remove any loosely bonded adherents which develops a surface texture capable of bonding. After these steps were performed, layout lines were added to the beam with a medium-hard drafting pencil symbolizing where the strain gages were to be located. Once the pencil marking was burnished into the surface, the surface was conditioned using Conditioner A once again. This was done until the cotton swab used to apply the conditioner was no longer discolored by the pencil. The beam was then dried with a piece of fresh gauze. The last step before the strain gage was installed was to neutralize the surface of the beam. Neutralizing was accomplished by applying M-PREP Neutralizer 5A liberally to the surface of the beam with a cotton swab. The beam was then wiped clean with one wipe of a piece of fresh gauze. After these steps, the beam was ready for the application of a strain gage. Because of the size of the beam, a half bridge was the design of the Wheatstone bridge being used. This means that only one strain gage was required for each side of the beam. It is very important that the strain gage is properly mounted to the surface of the beam as it must strain exactly the same at the surface of the beam in order to ensure an accurate strain measurement. Initially, the strain gage was removed from its package with a pair of tweezers and placed on a clean glass slide with the bonding side of the gage facing down. A piece of M-LINE PCT-2A cellophane tape was used to pick up the strain gage and this piece of tape was then placed on the beam by lining up the triangle alignment marks of the gage with the layout line. The end of the tape opposite the solder tabs was lifted up to expose the underside of the strain gage. A thin uniform coat of M-Bond 200 Catalyst was then wiped onto the entire gage surface and allowed to dry for one minute. One drop of M-Bond 200 Adhesive was placed at the junction of the tape and beam about 0.5 in from the gage installation area. Holding the tape slightly taught, a gauze sponge was slid over the gage/tape assembly and down over the beam. A thumb was firmly pressed onto the gage for one minute, and the assembly was left to sit for two minutes. The tape was then removed by peeling the tape back over itself leaving the gage permanently attached to the beam. 7 With the gage attached to the beam, wires had to be attached to the tabs. This was accomplished by soldering wires to the tabs. The tip of the soldering iron was first cleaned with a gauze sponge and was then tinned. The wire was then placed on the tab and solder was melted over top of it. This was repeated for both tabs. After the soldering was complete, a protective coating of M-Coat A was placed over top of both the wires and strain gage to protect the system. The resistance of the gage to ground was then measured to check if it lied somewhere between 10-20 πΊΞ©. This same process for mounting the strain gage was then repeated again for the underside of the beam resulting in a half bridge. The final result can be seen in Figure 5 below. Figure 5: Finalized design of the beam with the strain gages attached Once the strain gages were mounted, they had to be made into a Wheatstone bridge. As stated earlier, adding the gages into a Wheatstone bridge allows for a voltage output to develop as a result from the change in resistance between the two gages. The Wheatstone bridge can be constructed as follows with the squares representing the strain gages: Figure 6: Wheatstone bridge composed of the two strain gages - one in tension and one in compression Referring back to Equation 10, if left untouched, then no output voltage will develop. However, when a force is exerted on the end of the beam causing it to bend, the strain gages deform which leads to a change in resistance which leads to an output voltage from the circuit. This output voltage is very small; therefore, a gain must be applied to the circuit. This can be done with the use of an amplifier such as the one seen in Figure 2. High frequency signals also had to be filtered out, so an active low pass filter was added after the amplifier. The Final circuit without chosen resistor and capacitor values can be seen in Figure 7. 8 Figure 7: Full circuit without finalized values The values of the resistors and capacitors then needed to be determined in order to achieve a gain of around 200. As stated in the theory section, the low pass filter is the first to be analyzed. Once values were found which satisfy the cutoff frequency requirement, the gain of the filter was found. Then a gain for the amplifier was achieved which brought the total gain to nearly 200. Using the resistors and capacitors available in the lab, combinations were tried, and using Equation 13, the cutoff frequency was found. A 0.33 πF capacitor was used as well as a 10 kΞ© resistor which led to a cutoff frequency of 48.23 Hz. Given a wider range of resistor and capacitor values, this could have been closer to our goal of 50-70 Hz, but 48.23 was still acceptable as all necessary high frequencies would still be eliminated. A value for π 1 was then chosen to achieve a gain of 10 for the filter. The chosen values for the filter can be seen in Table 3 below. Table 3: Chosen values for the active low pass filter 0.33 πF 1 kΞ© 10 kΞ© C π 1 π 2 Next, the values for the amplifier had to be chosen in order to produce a gain of nearly 20 using Equation 11. With the options for the lab, the closest gain able to be achieved was 18 using the resistor values seen in Table 4. Table 4: Chosen values for the amplifier 100 Ξ© 1.8 kΞ© π ππ π π With the information in Tables 3 and 4, Figure 7 can be completed. The finalized values can be seen in Figure 8 which produce a circuit capable of measuring a voltage output from strain gages installed in a half bridge with a gain of 180 and a cutoff frequency of 48.23 Hz. 9 Figure 8: Full circuit with finalized values When installed on the breadboard, the actual circuit can be seen in Figures 9 and 10. Figure 9: Simplified breadboard schematic Figure 10: Physical breadboard In order to read the output voltage produced from straining the strain gages, the circuit had to be hooked up to a computer by means of a Data Acquisition Unit, and a MATLAB script which collects the output voltage from the circuit was run. Found in Section A2 of the Appendix is a copy of the MATLAB script which collects and plots the data. 10 This circuit will output an amplified voltage received from the strain gages; however, these voltages hold no significance it they cannot be interpreted. In order to interpret the output voltage, the circuit must be calibrated. By hanging a mass from the end of the beam, the output voltage was recorded. This was repeated multiple times in order to determine a relationship between the force exerted on the end of the beam and the output voltage. These points could then be plotted in Excel with the force at the end of the beam as the independent variable and the output voltage as the dependent variable. A line of best fit was added to the graph which found the relationship between the force and voltage. Equations 14 and 15 relate these variables with the slope, m, and y-intercept, b, found from the line of best fit. π(π) = ππ + π π= (14) 1 [π(π) β π] π (15) With the calibration in order, the MATLAB script could be run and the rocket could be fired. The beam was placed in a clamp, and the rocket engine was placed in the hole in the beam while being held in place by a set screw. The engine was pointed upwards allowing for the plume to be located at the top of the beam. The MATLAB script was run and shortly after the rocket was ignited with a voltage source. Points of data were collected a specified frequency chosen to be 1,000 Hz for a total of 15 seconds. Once the data for the voltage versus time was collected, it could be converted to thrust versus time by using the best fit equation from the calibration Excel spreadsheet. The data was then saved. Summary of Results: The calibration of the sensor was required before any form of rocket testing could be performed. As stated above, this was done by hanging specified weights from the beam. Voltage was measured with no weight attached, 0.5 kg, 1 kg, and 1.5 kg. The calibration was done right before testing. The following voltages were measured: Table 5: Calibration of the sensor Mass (kg) 0 0.5 1 1.5 Weight (N) 0 4.905 9.81 14.715 Voltage (V) 0.6332 1.3752 2.1806 2.7942 11 When these points were plotted, the relationship found below was observed. Figure 11: Plot resulting from the calibration of the sensor Adding the line of best fit, Excel interprets the relationship between weight and voltage as: π(π) = 0.1486 β π + 0.6525 (16) 1 [π(π) β 0.6525] 0.1486 (17) π= The frequency of the data could be measured in MATLAB using the voltage data. The code for this process can be found in Section A3 of the Appendix. This is done to check whether most of the frequencies were between 0 and 20 Hz. As can be seen in Figures 12 and 13 below, the test contains almost solely low frequencies which makes sense as all higher frequencies were filtered out by the low pass filter. Magnitude was calculated using the voltage data rather than thrust. 12 Figure 12: Natural frequency measurement for run 1 Figure 13: Natural frequency measurement for run 2 Once the rocket was launched, data was continuously collected in the form of voltage. This voltage could then be converted to thrust using Equation 17, and the important data encompassing thrust could be analyzed. Plots of voltage versus time and thrust versus time can be seen in Figures 14 and 15. 13 Figure 14: Voltage and thrust versus time for run 1 Figure 15: Voltage and thrust versus time for run 2 Discussion: Ideally, the line of best fit for the calibration (Equation 16) would result in a y-intercept of zero since there should be no strain in the strain gages. This would mean that there would be no resistance change in the gages making them 120 Ξ© resulting in a perfect bridge, and looking at Equation 10, this means that there would be no output voltage for the given input voltage. 14 This, however, is not the case. In order to validate whether the calibration is accurate, the strain can be found as a result from a known load using Equation 3. This strain can be used to find the change in resistance of the strain gages using Equation 18 below. This change in resistance can be used in Equation 10 to find the output voltage which can be multiplied by the total gain of 180 to find the theoretical voltage for a given force. The finalized relationship can be seen in Equation 19. Ξπ = πΊπΉ β π β π (18) 3πΈπ ππΏ1 πΊπΉ πΈπ€π‘ 2 (19) πΈπ = Using Equation 19, the theoretical output voltage can be compared to the measured values in order to determine the accuracy of the strain gages. Table 6: Measured voltages versus theoretical Mass (kg) Weight (N) 0 0.5 1 1.5 0 4.905 9.81 14.715 Measured Voltage (V) 0.6332 1.3752 2.1806 2.7942 Theoretical Voltage (V) 0 0.9504 1.901 2.8512 Percent Error (%) 44.70 14.71 2.00 It is seen that the percent difference is initially very high. As stated earlier, this is likely due to the fact that the gages were giving an initial reading which is seen in Figures 14 and 15 as the graph starts at a non-zero value. The percent error is also decreasing while the load increases. This means that the slope is steeper than predicted which could be a result of error in the experiment. This error will be further analyzed later. The natural frequency of the beam was equal to 84.62 Hz while the natural frequency of the rocket was around 70 Hz. Found using Equation 13, the cutoff frequency of the filter was 48.23 Hz meaning that all frequencies over this would be cut off. As seen in Figures 12 and 13, this holds true. Only the frequency from the measurements are recorded which occur at very low frequencies. Looking at the thrust data more closely, the data points from the rocket manufacturer can be overlaid in order to determine the accuracy of the measurements. These plots are seen in Figures 16 and 17. 15 Figure 16: Recorded rocket data with manufacturer data for run 1 Figure 17: Recorded rocket data with manufacturer data for run 2 As can be seen from these plots, they have very accurate shapes. They over measure the average thrust of the engine because of the initial offset caused by an initial voltage reading from the strain gages. The calibration allows for the measurements to still remain quite accurate, however. Peak thrusts, the time delay until ejection charge, and the total impulse of the two rockets can be seen in Table 7. All values were found using the recorded data and MATLAB. 16 Table 7: Comparison of values between testing and manufacturer Rocket 1 13.93 4.48 11.32 Peak Thrust (N) Time Delay Until Ejection Charge (s) Total Impulse (N*s) Rocket 2 13.69 4.04 10.09 Manufacturer Values 14.09 4.28 8.82 The peak thrust was found using the maximum value of the thrust. The time delay until ejection charge was found by taking the difference between the time of the ejection and the time of the end of the rocket thrust. Lastly, the total impulse was found by calculating the area under the thrust curve over the interval of the rocket thrust. As stated earlier, the thrust curves contain an offset. This offset can be factored into the above calculations to produce the values seen in Table 8. Table 8: Comparison of values between testing and manufacturer factoring in the initial offset Rocket 1 12.33 4.48 7.80 Peak Thrust (N) Time Delay Until Ejection Charge (s) Total Impulse (N*s) Rocket 2 12.57 4.04 7.62 Manufacturer Values 14.09 4.28 8.82 These values are fairly close with errors likely propagating from uncertainty. The element being measured is the total output voltage. This output voltage depends on many factors with its equation located below. πΈπ = 3πΈπ ππΏ1 πΊπΉ π π π 2 ( )( ) πΈπ€π‘ 2 π ππ π 1 (20) The uncertainty of a measurement depends on the uncertainty of each variable that it is dependent on. The uncertainties of each variable can be approximated as follows: Table 9: Variables with their approximate uncertainties Variable Uncertainty πΈπ 2% π 2% πΏπ 5% πΊπΉ 5% πΈ 2% π€ 5% π‘ 5% π 5% 17 With approximate uncertainties for each variable, the approximate uncertainty can be found for the output voltage reading which is exactly equal to the uncertainty of the thrust measurement. The total uncertainty is found using Equation 21. π’πΈ 2 π’πΈπ π’πΏ 2 π’π 2 π’πΊπΉ 2 π’πΈ 2 π’π€ 2 π’π‘ 2 π’π 2 = β( π ) + ( ) + ( 1 ) + ( ) + ( ) + ( ) + (2 ) + 4 ( ) (21) πΈπ πΈπ π πΏ1 πΊπΉ πΈ π€ π‘ π Using Equation 21, the total uncertainty of the output voltage is 16.94%. This means that the actual voltage measured is in the range of 0.831πΈπ β 1.169πΈπ . This corresponds directly to the thrust and impulse values since both depend on the measured output voltage. This means that the actual value for the thrust should be between 10.24 N and 14.70 N and that the actual value for the impulse should be between 6.33 π β π and 9.12 π β π . The manufacturerβs measured values fall inside of this range, so the accuracy of the strain gage thrust measurement system can be validated. Conclusion: While the complete accuracy of the strain gage thrust measurement system was verified, there is a lot of extra room for uncertainty in the experiment as seen from the fact that the manufacturerβs values lie near the outside of the acceptable range. In order for the system to be completely accurate, a few extra steps could have been taken. One step would be to figure out how to calibrate the sensor so that it was not reading a voltage while no force was applied. This was a major flaw in the experiment which would impact the results. A way to combat this would be to add a potentiometer in place of one of the resistors in order to achieve perfect balancing. More weights could also have been tested during the calibration to allow for a more accurate equation. Another step to enhance accuracy would be to find out the actual uncertainties of each of the variables in Equation 20. The only uncertainty that was known for sure was that of the resistors since it is part of the band code. One additional point for improvement would have been to use a full bridge instead of a half bridge. The width of the beam was too thin to allow for a full bridge, but this would have led to more accurate results. All of these areas for improvement would have likely lead to the manufacturerβs values lying closer to the center of the range produced from the uncertainty analysis. Regardless of the slight inaccuracy of the measurements, the goal of designing a circuit to measure the thrust of a rocket engine was met. With the use of a beam, some wire, a few resistors, a capacitor, some strain gages, and a couple of operational amplifiers, a couple of college students were able to measure how much force a ESTES C6-5 model rocket engine was able to produce with only slight error, and that in itself should be considered a success. 18 Appendix A1: 19 A2: clear, clc, close all daq.getDevices s=daq.createSession('ni') [ch,idx]=s.addAnalogInputChannel('dev1','ai0','Voltage'); %Specifying the sampling frequency fs=1000; t=15; N=fs*t; s.Rate=fs; s.NumberOfScans=N; s.DurationInSeconds=t; ch(1).Range=[-0.5 5] s.NotifyWhenDataAvailableExceeds=40; listen=s.addlistener('DataAvailable',@(s,event)plot(event.TimeStamps,event.Da ta)); %Collecting the data from the circuit and displaying [V,t]=s.startForeground(); title('Voltage vs. Time') xlabel('Time') ylabel('Voltage') %Converting the voltage to thrust thrust=zeros; for i=1:size(V) thrust(i,1)=(V(i,1)-0.6525)/.1486; end %Plotting the data subplot(2,1,1) plot(t,-V) title('Voltage vs. Time') xlabel('Time (s)') ylabel('Voltage (V)') subplot(2,1,2) plot(t,thrust) title('Thrust vs. Time') xlabel('Time (s)') ylabel('Thrust (N)') %Saving the data to variables save('Run.mat','fs','t','V','thrust') 20 A3: clear, clc, close all %Specifying the sampling frequency fs=1000; %Run 1 load('Run1.mat') V=V(2*fs:4.25*fs); %Performing FFT to the signal L=length(V); Y=fft(V); P2=abs(Y/L); P1=P2(1:floor(L/2+1)); %only choose one side P1(2:end-1)=2*P1(2:end-1); %choose one side, so t1=fs*(0:(L/2))/L; %determine the corresponding sampling rate %Plotting the frequency plot(t1,P1,'r') title('Magnitude vs. Frequency Run 1') xlabel('Frequency (Hz)') ylabel('Magnitude') xlim([0,100]) set(gca,'fontsize', 16) pause %Run 2 load('Run2.mat') V=V(2.4*fs:4.6*fs); %Performing FFT to the signal L=length(V); Y=fft(V); P2=abs(Y/L); P1=P2(1:floor(L/2+1)); %only choose one side P1(2:end-1)=2*P1(2:end-1); %choose one side, so t1=fs*(0:(L/2))/L; %determine the corresponding sampling rate %Plotting the frequency plot(t1,P1,'r') title('Magnitude vs. Frequency Run 2') xlabel('Frequency (Hz)') ylabel('Magnitude') xlim([0,100]) set(gca,'fontsize', 16) 21 amplitude doubled frequency with amplitude doubled frequency with