Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II...

17
Multidisciplinary Senior Design Conference Kate Gleason College of Engineering Rochester Institute of Technology Rochester, New York 14623 Project Number: P16214 Bicycle Power Meter Team: Luke Brophy Electrical Engineering Adam Dibble Electrical Engineering Connor Reardon Electrical Engineering Sean Langan Industrial Engineering Ian Gielar Mechanical Engineering Abstract People ride bicycles for an endless amount of reasons; competition, exercise, fun, etc. The purpose of this project is to inform the rider of their force that they are exerting as well as their calories burned throughout their ride. This is critical because to properly stay healthy and fit, one should know what their body is exerting in order to know what and when to intake calories to keep their body and mind at peak performance. The device will be located inside and on the crank arm and will be inclosed in a 3D printed housing unit. Lastly, the data will be transferred wirelessly to an app intended for Apple based products (iOS). Introduction A bicycle power meter is a device used by professional and amateur cyclists in order to show the cyclist their power output on the bicycle. The RIT Cycling Team approached this Multidisciplinary Senior Design (MSD) team to provide a power meter for their Imagine RIT bicycle blender exhibit. Their desire was to have this device take the input force from the cyclist and display their power output and calories burned. The current devices on the market that provides these features are not quite instantaneous. There is a lag associated with the time between the rider exerting force on the bike and when the rider receives feedback from the system. The goal of this project is to develop a functioning power meter for the bicycle blender exhibit. In order to achieve this task the MSD team aims to improve upon the communication speed between the power meter sensors and the display in existing devices. This will assist in achieving a more instantaneous system and closer to realtime display. 1

Transcript of Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II...

Page 1: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Multidisciplinary Senior Design Conference Kate Gleason College of Engineering

Rochester Institute of Technology Rochester, New York 14623

Project Number: P16214 Bicycle Power Meter

Team: Luke Brophy Electrical Engineering Adam Dibble Electrical Engineering Connor Reardon Electrical Engineering Sean Langan Industrial Engineering Ian Gielar Mechanical Engineering Abstract

People ride bicycles for an endless amount of reasons; competition, exercise, fun, etc. The purpose of this project is to inform the rider of their force that they are exerting as well as their calories burned throughout their ride. This is critical because to properly stay healthy and fit, one should know what their body is exerting in order to know what and when to intake calories to keep their body and mind at peak performance. The device will be located inside and on the crank arm and will be inclosed in a 3D printed housing unit. Lastly, the data will be transferred wirelessly to an app intended for Apple based products (iOS). Introduction

A bicycle power meter is a device used by professional and amateur cyclists in order to show the cyclist their power output on the bicycle. The RIT Cycling Team approached this Multidisciplinary Senior Design (MSD) team to provide a power meter for their Imagine RIT bicycle blender exhibit. Their desire was to have this device take the input force from the cyclist and display their power output and calories burned. The current devices on the market that provides these features are not quite instantaneous. There is a lag associated with the time between the rider exerting force on the bike and when the rider receives feedback from the system.

The goal of this project is to develop a functioning power meter for the bicycle blender exhibit. In order to achieve this task the MSD team aims to improve upon the communication speed between the power meter sensors and the display in existing devices. This will assist in achieving a more instantaneous system and closer to real­time display.

1

Page 2: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Design Process This device will need to be battery powered while lasting a minimum of 10 hours for the Imagine

RIT event. The calculation accuracy of the outputs must be within +/­ 5%. The required output should also be as instantaneously as possible and be displayed in an accessible fashion to the user. The system must be user friendly while being durable to withstand a drop test and ranging temperature from ­30 degrees Celcius to 50 degrees Celsius. The device will need to be able to reset after each rider to properly determine the individual's force and calories burned. The device may not interfere with the rideability of the bicycle so it must be contained down in size and weight. The total budget for the entire project was $1000, $500 supported by MSD and the other $500 funded by RIT Cycling Club. Figure 1 in the Appendix shows the flow of power and information throughout the entire system. Accelerometer

The accelerometer was chosen for this project to be able to measure rpm of the bicycle. The accelerometer was chosen for this project because it is a device that our team knew could provide multiple data points per revolution. The accelerometer was designed to be placed in the spindle of the crankset. This placement of the accelerometer was chosen because it is the center of rotation of the crankset and would be the location that would produce the most accurate results for the rpm. The accelerometer that was used for this project was placed on a breakout board. The breakout board was designed to allow for wires to be easily soldered to the board. The breakout board also contains components to allow the accelerometer to be used for its typical application.

In order for the accelerometer to be able to fit inside of the spindle of the crankset, a plug was machined to be able to hold the accelerometer breakout board in place. This plug contained a slot in it in which the accelerometer would sit snug and not move within the spindle. The plug design is explained in more detail in a later section. Battery

The 2032 coin cell battery was chosen due to its size, power, and cost. The device needs to be placed on the crank arm without interfering with the bike frame and the rider. The height of the battery is 0.13” which will passes these two requirements. The diameter of the battery is 0.79” which enables an easy fit onto the side of the crank arm. The voltage is rated at 3V, so a total of 3 batteries will be used throughout the use of the device to last for a minimum of 10 hours. The battery will power the Bluno Nano and the accelerometer. Figure 2 shows the entire system power consumption based on the battery. Battery Holder

Through testing the subsystems, it was found that three 2032 coin cell batteries were required to power the bicycle power meter. There were no battery holders that could be purchased that could hold three 2032 coin cell batteries. The team designed a battery holder that met our requirements by stacking two of the batteries together and keeping the other separate. This battery holder will be capable of powering several subsystems with three or six volts. The battery holder was 3D printed according to the drawing in Figure 3. Holes were drilled into the 3D case to fit wires and leads.

2

Page 3: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Bluno Nano Arduino BLE Microcontroller One of the main system­level design decisions regarding this project was to determine how the

acquired data would be transmitted to a user­friendly display. After performing Pugh analysis on several options, it was determined that the best design would be to use Bluetooth Low Energy (BLE) to transmit data from a microcontroller mounted on the crankset to a smartphone. The end display device was chosen to be a smartphone because of its availability and popularity. The iOS/Apple ecosystem was chosen because of the resources available to the team (a spare iPhone and a large amount of online resources) and the potential to be publicly published on the iPhone App Store for possibly consumer use. BLE was chosen as the method of transmission because of the availability of open­source resources as well as the fact that almost every smartphone on the market has BLE capability.

Once the communications protocol was chosen (BLE), a microcontroller needed to be selected that would meet the requirements defined by that portion of the design. The Bluno Nano by DFRobot was chosen as the microcontroller which would be used to acquire and send strain and cadence data. This microcontroller has a built­in BLE chip, runs Arduino software, and fits within the allotted space for mounted components on the RIT Cycling Bike Blender. The electrical engineers on the team had prior experience coding in the Arduino environment, so this along with the other listed reasons are why the Bluno Nano was chosen.

Several tests were run in order to verify the BLE functionality and range as well as the Bluno Nano’s capability to acquire and send data. The functionality of the BLE communications was tested by connecting the microcontroller to the phone using an online application called Evothings Workbench and its provided simple sketch. The test results were measured using a binary scale. If the microcontroller was able to connect to the phone the result of the test was pass; if the microcontroller was unable to connect to the phone the result of the test was fail. Communication was successfully achieved between the Bluno Nano and the mobile phone, thus this test passed. Communication was also tested between a Bluno Nano and a Bluno Development board in order to verify a backup solution should the mobile application prove to be unsuccessful; this test also passed.

The range of BLE communications was tested by establishing a connection between the Bluno Nano and the mobile phone, then increasing distance between the two devices until the connection was lost. Once lost, re­connection was attempted and the distance was decreased until re­connection was established. This final distance was taken as the range of BLE communications because it was a range at which the Bluno Nano and mobile phone could both hold a connection and establish a re­connection. The results of this test are depicted in Figure 4 of the Appendix.

Figure 4 shows the results of the aforementioned range test, indicating that the measured range was 49.68 meters. This result is well within the requirements for this project, as the maximum range needed for the bicycle power meter will be approximately one to two meters.

Finally, 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 Nano, 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

3

Page 4: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

measured by the smartphone (acquired from the Bluno Nano and sent via BLE), matched the values on the oscilloscope. Casing

A housing was designed to keep dust and moisture away from the electronic components. It also protects the fragile strain gauges and electronics from impact. The casing was custom designed and 3D printed to fit the crank arm and bike frame’s unique structure. This allowed to meet the customer requirement of being durable from the riders as well as weather. Crankset

The crankset used for this project was purchased because of a few key qualities. It is made of aluminum which will strain more than steel under load. This will make the torque a little easier to measure with the strain gauges. It uses a standard bottom bracket spindle called GXP. This is a very common spindle so the bike power meter will be versatile. The tops of the crank arms is very flat which allows for the strain gauges to be easily glued to the crank arms. The Figure 5 shows the layout of the power meter components on the crankset. Data Acquisition Software

In order to properly provide the bicycle blender user with accurate data, software had to be written to acquire data from the strain gauge sensors and the accelerometer. This software was written in the Arduino IDE (Integrated Development Environment) using a variation of the C coding language. Both of the sensors used to in the system output a voltage that varies from 0 to 1 volts. These voltage values are read in by the Bluno Nano through its analog pins. Using an internal reference voltage source, the ADC (Analog to Digital Converter) in the microcontroller compares the voltages of the sensors to the reference and assigns a digital value ranging from 0 to 1023 depending on the voltage seen at the input. For example, if 0.5 volts is seen at the input, the digital value 512 is assigned and if 1 volt is seen, the value 1023 is assigned.

To calculate the power produced by the user, strain measurements on both crank arms and angular velocity are used in the following calculation.

Equation 1: Torque (Nm) = .175m x force (N) Equation 2: Power (W) = Angular velocity (rad/sec) x Torque (Nm) Equation 3: nergy (kJ) Power dt (change in seconds)E = * Equation 4: Calories (kCal) = 1.1*Energy (kJ) The new data is then ready to be sent to the phone for further manipulation and displaying. The application created to display power produced to the user connects to the Bluno Nano via

Bluetooth Low Energy (BLE). This fairly new technology uses very low energy bluetooth radio hardware and software protocol to increase device battery life. The team specifically chose the Bluno Nano for its BLE capabilities.

The layout of the application was meant to be simple and straightforward so the rider can easily see how much power they are producing as well as how many calories they have burned over the course of their session on the bicycle blender. Along with its ability to display power and calorie data, the

4

Page 5: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

application can also request a calibration of the strain gauge sensors as well as an update of the current Bluno Nano battery life. These two customer requested functionalities improve the accuracy and user friendliness of the overall system.

PCB Layout/ Board

Due to the very small range of change in signal value for the strain gauges, it was determined that extra circuitry would be needed in order to amplify the strain gauge outputs before being measured by the microcontroller. A wheat­stone bridge was the method which was selected after discussing the issue with subject matter experts. The wheat­stone bridge was used in order to create a circuit which compares the varying strain gauge signal with a non­varying signal. The difference in voltage between these two signals was extremely small, in the range of 0V ­ .0005V, so the signals were passed to an instrumentation amplifier in order to achieve a range of approximately 0V ­ 1.1V. This would allow the microcontroller to measure varying strain with acceptable accuracy. The amplifier would need to yield a gain of approximately 2000V/V, or 33dB in order to achieve this.

The instrumentation amplifier used was the Texas Instruments INA2126. This component was selected for its ability to produce a gain of 2000 V/V, its availability, and low cost. In order to test the amplifier, the circuit in Appendix Figure 6 was simulated in OrCAD Capture CIS and constructed using a breadboard, the INA2126, and several resistors.

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

The circuit in Figure 6 was simulated using OrCAD PSPICE with results shown in Figure 7. 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. The same results were verified after constructing the circuit on a breadboard and connecting components in the lab. The circuit on the breadboard was constructed using high tolerance resistors for R3 and R4. The higher tolerance resistors were necessary for proper functionality of the wheat­stone bridge, since the strain gauges produce such a small signal. Figure 8 shows a picture of the breadboard­level test setup.

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. An updated schematic depicting the new circuit is shown in Figure 9 of the Appendix. 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. Upon testing this method with failing results, the next solution was to use a pre­fabricated proto­typing PCB, with many holes and no traces; the connections would be made by soldering components together on this board. This solution also failed to produce acceptable results, so the next option was to design a PCB using the software Eagle

5

Page 6: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

and have the boards professionally fabricated by OSH Park. Figures 10 and 11 in the Appendix are the schematic and layout for the strain gauge amplifier circuit as designed using this software.

Upon receiving these boards from the fabrication house, components were soldered to the designated locations and the boards were tested by connecting the strain gauges, battery, and Bluno Nano. Force was applied to the strain gauges and the Bluno Nano was connected to the output signal of the amplifier circuit so that the results could be observed over the serial monitor. The results taken during the strain gauge testing with the new professionally fabricated PCBs are shown in Figure 12, which shows output voltages from the strain gauge amplifier for various amounts of weight applied to the crankset. The results produced indicate a functional strain gauge amplifier, and thus, the professionally fabricated PCBs pass the functionality test. Plug

The accelerometer needed to be held in place at the axis of rotation of the crankset. A holder was designed that would hold the accelerometer at the center of the crank spindle while still allowing wires to pass through the spindle. The holder acts like a plug. It needed to be a friction fit to keep any water and dust away from the accelerometer. Gauge pins were used to find the dimensions of the taper inside of the crank spindle. The design shown in figure 13 was machined from delrin. Strain Gauges

Strain gauges are used to find the torque place on the bike crankset. Torque is a very important part of calculating power produced by the rider. The strain gauge has very small wires the are oriented in one direction. When the strain gauge is stretched due to a torque placed on the bike crank, the small wires stretch. This stretching causes the wires diameter to shrink due to the poison effect. As a wires diameter is reduced its resistance goes up. This change in resistance is what produces the signal that allows us to find the torque.

The first plan was to place two strain gauges on the top of the crank arm as shown in figure 14. One strain gauge would measure the strain due to the primary bending force in the x direction. The second gauge would be in the same location as the first, but it would measure the strain in the y direction due to the poison effect. Using two gauges would hopefully increase accuracy and sensitivity. During testing, it was found that the gauges were both in tension which was not the expected result. After review the calculations, that the force was being placed on the pedal not the center of the crank. The offset force causes a twist along the crank which creates the tension in the y direction.

A new strain gauge orientation was used to solve this problem. As shown in figure 15, two strain gauges were still used for each crank arm. One was placed on the top of the crank. The other was placed on the bottom. It was expected that they would act in opposite directions when the torque was applied.

During testing the amplifier/wheatstone bridge board was used to transmit an amplified analog signal to the bluno nano micro controller. This was connected via usb to arduino. The crankset was mounted to a table. Weight up to 170lbs was hung from the pedal. The 170lbs was chosen based on a max power of 1200watts assuming 80rpm. Figure 15 shows the test setup.Figure 16 shows the test with the crankset clamped to the table with plate weights hanging from the pedal. Figure 17 shows that the data is linear, and the system is able to measure up to the max expected torque.

6

Page 7: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Results and Discussionand Recommendations The completed project was evaluated by its success of informing the rider of their force that they

were exerting as well as their calories burned throughout their ride at the exhibit of Imagine RIT. The device was located inside and on the crank arm and was inclosed in a 3D printed housing unit. The data was also transferred wirelessly to an app intended for Apple based products (iOS). After comparing the bicycle power meter data to a retail power meter which has an accuracy of +/­ 1%, the average power and calories burned measured over 5 minutes of use was within 2.5% of the retail power meter. The app was also Air played to a television so that everyone around the exhibit could participate and understand the details of each rider.

After completion of this project, certain aspects could have been improved upon. If more time and money were available, the micro controller and wheat­stone bridge circuit boards could be combined to reduce their size. Also if time allowed, the housing could have been made more robust and weather resistant. The microcontroller used had several unused pins and was using more energy than necessary. The space available for electronics and sensors was extremely limited. Acknowledgements

Special thanks to the RIT Cycling Club, employees of the RIT Machine Shop, Multidisciplinary Senior Design, Professor George Slack, and Mr. Mike Zona (Chief), who made this project possible.

7

Page 8: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

APPENDIX

Figure 1: Power and Information flow

Figure 2: System Power Consumption

8

Page 9: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Figure 3: Battery Holder

Figure 4: Range Test

9

Page 10: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Figure 5: Complete Assembly of Crankset

10

Page 11: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Figure 6: Amplifier Circuit Schematic.

Figure 7: Simulation Results for Amplifier Circuit.

11

Page 12: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Figure 8: Breadboard Level SG Amplifier Circuit.

12

Page 13: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Figure 9: Updated Schematic for SG Amplifier.

Figure 10: Eagle schematic of SG amplifier circuit.

13

Page 14: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Figure 11: Eagle layout for SG amplifier circuit.

Figure 12: Results from strain gauge test.

14

Page 15: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Figure 13: CAD Drawing of 3D Printed Plug

Figure 14: Bending crank arm diagram (2 axis strain gauges)

15

Page 16: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Figure 15: Bending crank arm diagram (1 axis strain gauges)

Figure 16: Strain gauge test setup

16

Page 17: Project Number: P16214 Bicycle Power Meteredge.rit.edu/edge/P16214/public/MSD II Documents/MSDPaper.pdfIn order to properly provide the bicycle blender user with accurate data, software

Figure 17: Force plotted against voltage

Figure 18: Power output against time

17