+ All Categories
Home > Documents > edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will...

edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will...

Date post: 04-Mar-2020
Category:
Upload: others
View: 7 times
Download: 0 times
Share this document with a friend
18
Team P16214: Bicycle Power Meter Team members: Luke Brophy, Adam Dibble, Ian Gielar, Sean Langan, Connor Reardon Test Plan Section 1: Battery The battery selected for our power meter is rated at a capacity of 950mAh. This rating will be tested by using a simple circuit to draw more than the maximum amount of current our microcontroller can draw (500mA) at any one time. An ammeter and a voltage meter will be used to measure the current and voltage of the battery and these values will be logged every 5 minutes until the test is complete. The data points will then be plotted to show the lifetime characteristics of the battery. Section 2: Mobile App Section 3: Strain Gauges The strain gauge used for this test is an vishay 90 degree rosette. The strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped, and force will be applied to the pedal via hanging calibrated weights. The objective of this test is to be able to predict the force that is being applied to the pedal from the strain gauge signal. Since the crank arm length is constant, the force can be found by dividing the torque by the moment arm. The amplifying circuit will be used to create a more readable signal from the strain gauge. The amplified signal will be imported to labview using a NI Daq device for data analysis. The test procedure is outlined below: 1. Install Strain Gauge 2. Clamp crankset 3. Connect strain gauge to amp 4. Connect amp to NI Daq device 5. Apply calibrated weights to pedal 6. Import data, and create force vs. strain signal curve
Transcript
Page 1: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

Team P16214: Bicycle Power MeterTeam members: Luke Brophy, Adam Dibble, Ian Gielar, Sean Langan, Connor Reardon

Test Plan

Section 1: BatteryThe battery selected for our power meter is rated at a capacity of 950mAh. This rating

will be tested by using a simple circuit to draw more than the maximum amount of current our microcontroller can draw (500mA) at any one time. An ammeter and a voltage meter will be used to measure the current and voltage of the battery and these values will be logged every 5 minutes until the test is complete. The data points will then be plotted to show the lifetime characteristics of the battery.

Section 2: Mobile App

Section 3: Strain GaugesThe strain gauge used for this test is an vishay 90 degree rosette. The strain gauge will

be mounted to the crank arm to measure bending strain. The crankset will be clamped, and force will be applied to the pedal via hanging calibrated weights. The objective of this test is to be able to predict the force that is being applied to the pedal from the strain gauge signal. Since the crank arm length is constant, the force can be found by dividing the torque by the moment arm. The amplifying circuit will be used to create a more readable signal from the strain gauge. The amplified signal will be imported to labview using a NI Daq device for data analysis. The test procedure is outlined below:

1. Install Strain Gauge2. Clamp crankset3. Connect strain gauge to amp4. Connect amp to NI Daq device5. Apply calibrated weights to pedal6. Import data, and create force vs. strain signal curve

Results:

Page 2: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

Notes:● The plot is linear. This is what is expected with strain in the elastic region● The voltage when the crank is unweighted changes depending on the conditions● The calibration of the offset voltage will need to be built into the app● The slope of this line should stay constant in all conditions

Section 4: Microcontroller

The microcontroller to be used for this project is the DFRobot Bluno Nano Arduino BLE Microcontroller. A Bluno Nano will be mounted on the crank arm of the RIT Cycling Bike Blender for the final product and a development board version, the DFRobot Bluno Arduino BLE Microcontroller, will be used for testing.

Section 4.1: BLE

The first tests to be run for the microcontroller subsystem will involve the BLE communications. Items to be tested include the functionality of the BLE communication, the BLE range between the Bluno (development board) and the mobile phone, the BLE range between the Bluno Nano and the mobile phone, and the BLE range between the Bluno Nano and the Bluno.

Page 3: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

Figure 4.1: BLE Range Test Depiction.Section 4.1.1: BLE Functionality Test:

The functionality of the BLE communications will be tested for each of the cases listed above by following the procedure below:

1. Connect the microcontroller to the phone using Evothings Workbench and its provided simple sketch.

2. Verify that a connection is made.

The test results will be measured using a binary scale. If the microcontroller is able to connect to the phone (or other microcontroller), the result of the test is pass; if the microcontroller is unable to connect to the phone (or other microcontroller), the result of the test is fail. It is expected that each item will pass this test.

Results:

Table 4.1 BLE Functionality Test Results

Page 4: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

Table 4.1 shows the results of the functionality tests which were performed for the BLE chip on the microcontroller system. Communication was successfully done between the Bluno and the mobile phone, the Bluno Nano and the mobile phone, and the Bluno and the Bluno Nano.

Section 4.1.2: BLE Range Test:

The range of BLE communications will be tested for each of the three cases/items listed above. This will be done by the following procedure:

1. Connect the microcontroller to the phone using Evothings Workbench and the provided Arduino sketch

2. Once the BLE is connected, begin to increase the distance between the devices3. Continue to increase the distance until the connection is lost4. Find the maximum distance by decreasing the distance between the devices until

the connection is re-established5. Measure the distance between devices6. Repeat steps 2 - 5 three times and take the smallest recorded distance as the

maximum BLE range

It is expected that the BLE range will be greater than or equal to 20 meters.

Results:

Table 4.2 BLE Range Test Results.

Table 4.2 shows the results for the BLE range testing. Full testing was performed for the Bluno Nano communication with the mobile phone, and it was found that the maximum distance before the connection is lost is approximately 65 meters. The range for this link, determined by observing the maximum distance before a connection was reestablished after being lost, was approximately 50 meters. The required range for this BLE link will be approximately 2 - 3 meters, so the measured range is well within the acceptable range. The link between the Bluno

Page 5: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

Nano and the Bluno was also tested. This link was tested at a range of 34.5 meters, where the connection was still active; thus, the range test for the Bluno Nano to the Bluno also passed.

4.2 Data Acquisition and BLE Transmission

Firmware code was developed using Arduino for the Bluno Nano in order to acquire data from the strain gauges and transmit via BLE. Once the code was written and loaded onto the Bluno, the output signal of the strain gauge amplifier was connected to an analog input of the Bluno Nano. This output signal was also probed using an oscilloscope to verify values. The EvoThings application was modified in order to display the strain gauge values. To test the data acquisition and BLE transmission of strain gauge data, force was applied to the strain gauges, and the values measured on the smartphone application were compared to the oscilloscope capture. This test was successful because the values measured by the smartphone (acquired from the Bluno Nano and sent via BLE), matched the values on the oscilloscope.

Section 5: Crankset Layout

This test focuses on the Component layout as a mock up. Cardboard cutouts of each components were made and placed on the crankset. The test is used to confirm that each component will fit on the crankset

Figure 5.1: Image shows the proposed locations for the microcontroller, amp circuit and accelerometer.

Page 6: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

Figure 5.2: Image shows the proposed location for the battery and drive side amp circuit.Results:

Spatial test

Expected Result

Measured Result

strain gauges Pass Pass

Amp Circuit Pass Pass

Battery Pass Pass

Micro Controller Pass Pass

Table 5.1: The results of the spatial test are tabulated above

Results: All the components fit on the crankset. The proposed layout will be used to make the cad

drawings for the full assembly.

Section 6: Accelerometer

The reason for having the accelerometer is to allow for the cadence (revolutions per minute) to be measured. The accelerometer will be placed in the center of the spindle of the crank set for the Power Meter. The reasoning for having the accelerometer in the spindle is to protect it from any damage that may occur when riders are getting on and off of the bicycle or from riders whose feet slip off of the pedals and accidentally kick the accelerometer.

Section 6.1: Verifying Accelerometer Functionality

Page 7: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

Another reason for placing the accelerometer in the spindle is to allow for the accelerometer to be at the center of the axis of rotation so that the only acceleration that it will feel is that which is due to gravity. This will allow for the readings from the accelerometer to be most accurate. To ensure that the accelerometer is giving accurate results it must first be tested to show that it is producing the expected results due to strictly the acceleration due to gravity.

The following are the steps to test the accelerometer accuracy:1. Place the accelerometer, and microcontroller onto a breadboard2. Connect the output from each axis of the accelerometer to an input pin on the

microcontroller3. After powering the devices, choose one axis (x, y, or z) to isolate.4. Rotate the breadboard with the devices on it to known angles (0 deg, 90 deg,

and -90 deg) and record the output voltage of the isolated axis.a. Also record the number of bits used for each angle (using Arduino code

for the Blunob. Make sure that each angle matches up with a particular orientation of the

axis with respect to gravity (-1g, 0g, 1g)5. Repeat Step 4. for the other 2 axes

After performing this testing this will then allow the microcontroller to be coded to connect a particular angle with each different voltage that is produced. This test will be verified using the calculations that were done previously to determine the level of degree sensitivity of the accelerometer.

Results:

After conducting the accelerometer testing it was seen that the x-axis and the y-axis produced values for the voltage that were close to the expected values as taken from the data sheet for the accelerometer. However, the z-axis did not produce the expected results taken from the data sheet. The recorded voltages for each axis are shown in the table below:

Due to the values of the z-axis not being the correct values, calculations were performed to verify that these incorrect values would be good enough to perform the task at hand. After the calculations it was determined that the z-axis could still detect the angle up to a 0.5 degree accuracy which is more than sufficient for the bicycle power meter application.

Section 6.2: Testing Algorithms for Accelerometer

After verifying that the accelerometer does in fact give the correct values as expected in each axis direction, code could then be developed to calculate the angular velocity that will be seen by the accelerometer. This test was conducted once again by placing the accelerometer

Page 8: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

on a breadboard and using the microcontroller to power it as well as to read the output values coming from the accelerometer. Due to the positioning of the accelerometer into the spindle of the crankset we will only see the values of the y-axis and z-axis change. These are the only two axis that will see a change in the acceleration due to gravity whereas the x-axis is placed in the spindle so that it will not see any changes due to gravity while the spindle is spinning.

Results:

Upon running this test there was an issue that arose. It was noticed that the accelerometer kept shutting off and not producing the correct values. Initially the accelerometer was being powered by a digital I/O pin from the microcontroller. The reasoning for powering the accelerometer with a digital I/O was so that we could program the microcontroller to turn off the accelerometer while it wasn’t being used to limit the power consumption of the system. Since the digital output pin can only be 0V when low and 5V when turned high we had to pulse width modulate (PWM) the output signal to get it to a value of 3.3V so as not to damage our accelerometer. It was noticed that with the PWM signal coming from the accelerometer the switching frequency was very quick but the accelerometer was able to detect this very quick switching frequency and it was turning on and off at the same rate as the PWM digital output signal.

Next it was decided to run the enable pin of the accelerometer off of a steady 3.3V pin coming from the microcontroller. It was decided that the accelerometer used such little power that it would not hinder our power consumption that much by leaving it on all the time. When this change was made testing continued however, the accelerometer would still shut off after an allotted amount of time. It was decided to investigate this case further to discover the reasoning behind the accelerometer shutting off. We decided to monitor the 3.3V signal to see if there were times when it would go below the shutoff voltage of the accelerometer. This was not the case because the signal never wavered when the accelerometer shut down. Next we decided to try a voltage divider to run from the digital I/O pin.

After running the accelerometer from the voltage divider of the I/O pin it was noticed that we were having the same issues as seen when running the accelerometer from the 3.3V pin. This anomaly could not be explained however, we were able to put a precaution in the code for when the accelerometer does start to shut down. When this happens we will turn the enable pin off and then on again. By doing this the accelerometer will turn back on so quickly that it will show no effects in the accuracy of our accelerometer measuring the angular velocity of the spindle.

Section 7: Strain Gauge Amplifier Circuit

Section 7.1: Breadboard Level Tests

Due to the very small range of change in signal value for the strain gauges, extra circuitry will be needed in order to amplify the strain gauge outputs before being measured by the microcontroller. A wheat-stone bridge will be used in order to create a circuit which compares the varying strain gauge signal with a non-varying signal. The difference in voltage

Page 9: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

between these two signals will be extremely small, in the range of 0V - .0005V, so the signals will be passed to an instrumentation amplifier in order to achieve a range of approximately 0V - 1.1V. This will allow the microcontroller to measure varying strain with acceptable accuracy. The amplifier will need to yield a gain of approximately 2000V/V, or 33dB.

The instrumentation amplifier to be used is the Texas Instruments INA2126. In order to test the amplifier, the circuit below will be constructed using a breadboard, the INA2126, and several resistors:

Figure 7.1: Amplifier Circuit Schematic.

R5 will be chosen to be approximately 40.1Ω, which will set the instrumentation amplifier to 2000V/V gain. R1 and R2 will represent the strain gauges, and will be chosen to be 349.65Ω and 350.35Ω in order to represent a maximum strain. R3 and R4 will be fixed to the nominal value of the strain gauges, 350Ω. A sinusoidal voltage will be supplied to the wheat-stone bridge, then the input and output of the amplifier will be measured in order to verify the gain. The node between R1 and R2 (green probe) is the input measured and the output at the top op-amp (purple probe) is the output. It is expected that a gain of 2000V/V will be measured.

Results:

The circuit in Figure 7.1 was simulated using OrCAD PSPICE with the following results:

Page 10: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

Figure 7.2: Simulation Results for Amplifier Circuit.

The output peak voltage in the simulation was 0.9974V and the input peak voltage was 499.815uV, corresponding to a gain of 1995.54V/V. This is very close to the expected value of 2000V/V. Next, the circuit was constructed in the lab and tested. Input signals were sent directly to the amplifier bypassing the wheat-stone bridge for the purposes of this test:

Figure 7.3: Scope capture of amplifier gain.

Figure 7.4: Amplifier Test Results.

The results show that a 2V p-p signal was produced by applying a 1mV p-p signal at the amplifier input. This yields the expected 2000V/V gain for the chosen 40.1Ω resistor.

Page 11: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

Next, the circuit was constructed using higher tolerance resistors for R3 and R4 as well as one resistor for the gain selector of the amplifier. The output voltage was measured in order to determine what the nominal “no-strain” value is for the output voltage from the circuit:

Figure 7.5 Breadboard Level SG Amplifier Circuit.

Figure 7.6 Full Wheat-Stone Test Results.

Page 12: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

Using the strain gauges, measured at SG1 = 350.67Ω and SG2 = 350.80Ω, as well as R3 = 349.94Ω and R4 = 350.15Ω, and a gain resistor of 40.845Ω, the output voltage when no strain was applied was measured to be 60mV with an input signal of 1V and an amplifier supply of +3V and -3V. It was expected that the output voltage at “no-strain” would be approximately 0V because this would mean that the strain gauges would have the same resistance (no strain) and the difference between the two input voltages would be 0V. The measured value for Vo was 60mV, so this result is relatively consistent with the expected result.

Upon further testing, it was decided that the 1V supply for the strain gauges and wheat-stone bridge would not come from the Bluno microcontroller. Instead, a voltage divider was set up by connecting a 1KΩ and a 5.6KΩ resistor to one of the 3V batteries in order to produce 1V. This was done because the pulse-width modulated (PWM) 1V signal from the Bluno was not functioning in a desired manner and was switching the wheat-stone bridge on and off. By using a supply voltage generated from the battery, this issue was avoided. Below is an updated schematic depicting the new circuit:

Figure 7.7. Updated Schematic for SG Amplifier.

Page 13: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

Figure 7.8. Updated System Schematic.

Figures 7.7 and 7.8 show updated schematics which incorporate the change in the 1V supply for the strain gauge wheat-stone. In each case, the 1V is now supplied by a voltage divider from the batteries, depicted by the 1K and 5.6K resistors in each schematic.

Section 7.2: PCB Level Tests

The original plan for a final version of the strain gauge amplifier circuit was to make a home-etched PCB board and solder through-hole components to this board. This was done in the lab by designing a layout for the circuit in Fritzing and printing a mirror image of this layout onto lazer-printed photo-paper. Next, the mirror image of the circuit was ironed onto a sheet of copper-plated PCB. Ferric chloride and fingernail polish remover/rubbing alcohol were used to erode away the unwanted copper so that the finished product was a PCB with copper traces resembling the circuit. Next, the amplifier chip, resistors, and strain gauge leads were soldered onto the board. The board was connected to a power supply with +/- 3V to power the amplifier and +1V for the wheat-stone bridge. The board was tested by connecting the amplifier to an oscilloscope and measuring the output voltage.

It was expected that this PCB version of the circuit would work correctly and yield the same results as the breadboard version/test. This however, was not the case. Upon making all of the connections and powering the board, the output voltage level was incorrect. With no force applied to the strain gauges, the voltage at the output was approximately 2.3V; the expected no-strain value is between 0V and 500mV, and 2.3V is too large of a value for the microcontroller to detect. After further investigation, the reason for a very high output voltage

Page 14: edge.rit.eduedge.rit.edu/content/P16214/public/MSD II Documents... · Web viewThe strain gauge will be mounted to the crank arm to measure bending strain. The crankset will be clamped,

was that the wheat-stone bridge was not functioning properly; once the board was powered on, the difference between the two reference resistors was not zero, thus the voltage divider was dividing the 1V signal unevenly. The difference between the two strain gauges was near zero, so the two input signals to the amplifier, V+ and V-, were at a difference of approximately 1.15mV at the zero-strain state. Once amplified, this difference was 2.3V.

It is unclear why the circuit was behaving incorrectly on the PCB when it was performing well on the breadboard. The layout and connections were checked several times, and all voltages on the PCB were at the correct levels, with the exception of the voltage between the two reference resistors of the wheat-stone bridge. In order to rule out the fact that it could have been a bad board, another PCB was created using the same process as above. This board was then tested and found to have the same results. Due to the failure of this test, the next step will be to create the circuit board using a through-hole proto-typing PCB.

The new proto-typing PCB was created and tested using the updated schematic with a voltage divider to supply the 1V source to the wheat-stone bridge. First, the PCB was connected to a power supply for +/- 3V and the Vout pin was connected to an oscilloscope to observe the final output signal. Below is a screen capture of the scope when applying varying strain to the strain gauges:

Figure 7.9. Output Signal from Strain Gauge Amplifier.

Figure 7.9 shows the expected result for the output signal - with varying strain applied, there is a corresponding change in output voltage. It can also be noted that the expected “no-strain” value was approximately 80mV, measured with a multimeter. This is close to the theoretically expected value of zero volts.

Section 8: Overall System Accuracy


Recommended