Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
Pedal load sensor/ power meter for auto shifter.
I’ve started another thread for this one but its really part of the automatic shifter project. I’m hoping to make it capable of being a power meter but I think if I can use it as a pedal load sensor for the auto shifter I’ll be happy. It’s an experiment to see what’s possible with the cheapest parts I can get hold of. If something doesn’t work or isn’t accurate enough I’ll get a more expensive version.

It’s based on this design by stoppi71 I’ve focused to start with on a robust, metal to reduce interference and hopefully water resistant casing to house the electronics. It’s definitely going to be one of the heaviest power meters. Hopefully it will succeed where other homemade power meters are likely to fail in that they won’t last because everything is stuck on the outside of the crank.

I’m hoping to place to amplifier circuit close to the strain gauges on the crank itself in its own metal box. This will then need only 4 wires to link with the rest of the electronics in a housing attached like a third chainring.

Power will be provided, as l know it won’t be very efficient, by 2 well used Li-ion 1.5Ah cells from my old Windows phone. In one of the other compartments will be room for an Arduino Nano. The forth is a spare in case I need a larger amp circuit for example or a gyro module to measure cadence. The NRF24L01 wireless module will obviously have to be mounted externally probably just sealed in a plastic bag to start with.

[Image: MSx6iH.jpg]

The crank that I’m using has a well protected area in a corner where the strain should be quite high. To attach the strain gauges I have just used basic super glue, will probably turn out to be a bad idea. They are then sealed with a popular 2 part glue called Alaldite. On top if this I placed a layer of aluminium foil, might block interference from RF maybe, never seen anyone else do it.

[Image: TWZFer.jpg]

I choose to use 4 strain gauges in a full bridge and use 2 as temperature compensation. Partly due to limited space but also other people seemed to be doing it that way and having success. I’m wondering now if it would have been better to use all the gauges to measure strain, would get double the voltage change.

The next decision is how to wire up the wheatstone bridge. The first circuit diagram was one I found on the internet however I calculated that the voltage change across the bridge would be very small.
[Image: vewYLK.jpg]
I started with a temperature compensation strain gauge on each side of the bridge. Initial signs with a multimeter were very good, I could measure a +- 0.1mV difference just bending the crank by hand. Further investigation revealed as much drift from temperature changes as the voltage variation due to bending.

Next I rewired the bridge like this. [Image: TR7Cqb.jpg]
The no load voltage is more stable although not great but I still get the same voltage change under load. To get the correct no load voltage I have connected a resistor across one of the gauges. The amplifier circuit based on a LF353 has been set up with a gain of 3000. This is giving me a voltage output of between about  0.25V - 2.5V.
- Oran
With everything wired together temporarily and a Bluetooth module connected (also temporary while I get the NRF24L01s to work) I uploaded a basic code to the Arduino. It just sends the voltage reading via serial every 50 milliseconds. The Bluetooth graphics app on my phone means I can monitor live graphs and data log if needed.

[Image: pccy9h.jpg]

This is my basic way of checking the response to load. I just roll the bike backwards until the desired load is on the spring balance and then lock the wheel. I was able to get a nice linear graph of voltage against load which I’m happy with. To balance the Wheatstone bridge and get a positive voltage offset I’ve connected a high value resister across one of the strain gauges. Might change it to a potentiometer.

[Image: 1IYKCS.png]

This is a screenshot of a graph on my phone with me standing on the pedal.
[Image: 8MlCid.png]

[Image: rFYgYm.jpg]

All wired ready to be assembled unfortunately the amp circuit is not working since soldering new wires. I also think there is an intermittent fault with a strain gauge or a wire in the Wheatstone bridge. Sometimes the offset voltage increases by a few milliamps and so the amplifier gives it’s maximum output. So close to working but not quite there yet.
- Oran
The amp circuit fault turned out to be my mistake, cut the veroboard track in the wrong place.  With that working I assembled everything for a test ride. The results were a little disappointing as it only worked for a few minutes before the intermittent short came back. I did record a little data which I’m very impressed by, it’s so close to working. Once I get to the bottom of the short it will be mostly code writing.

 [Image: wfwVwr.png]

As I had some data I thought I’d have a go at creating a polar chart of my pedal stroke. I averaged 5 pedal rotations and estimated the angle. Will be interesting to compare my pedal stroke with a NuVinci hub and derailleur gears to see whether there is any difference.

[Image: Zrob1D.jpg]
- Oran
Wow... Missed this one!

Using load cells on the pedals... This bike is soooo connected!
You are about to be the least significant mass on this bike Tongue

I did not have the time to fully read all of the text up there, but I will tomorrow (going to sleep)

Keep up the good work!
Si ça a déjà été fait, je peux le faire
Si ça n'a jamais été fait, donnez-moi juste le temps de trouver comment !

Everything is now together and for the moment working.  I had to pick apart the wires to the strain gauges until the short disappeared so they are for the moment only covered with tape. I will need to do a better job of the wiring sometime, I also had to redo the connections to the Arduino. Challenging making the Arduino so thin and still have removable connections.

As I haven’t yet got a wireless link setup I wanted the power meter to be able to measure cadence by itself. This usually means using a gyroscope or reed switch. I decided to take on the challenge of writing code that would use only the output of the Wheatstone bridge. Seeing the raw data made it obvious that the output is just a waveform and so it should be possible to detect the same point on the wave for every revolution of the crank. By using interrupts set at the moment to 25hz a piece of code detects the point on each pedal stroke when I begin to apply force. At that moment it takes the total of all the forces sampled at 25hz during the previous revolution and divides by a counter value. This is followed by a reset of the values and it starts adding and counting up again.

I was a little surprised when I put the two different methods of measuring cadence together, worked far more reliably than I thought possible. A shame the reed switch is starting to play up. It is off the cheapest cycle computer that was second hand. In general the reed switches have been incredibly reliable and the important one for speed never misses a beat.
 [Image: 6ipMsI.png]
 The resolution is not amazing at about 4 - 5rpm but should be easy to improve this. It's simply due to the interrupts running so slowly at 25hz instead of 1khz I use for the reed switches. I will experiment with how much I can increase this. A potential issue with this code is that it needs a minimum value so that it can know when the force starts to rise. The code to find the min value is simply, if current value is less than min value it’s the new minimum. On every loop of the code I add a small amount to it, incase there is an upwards drift. This does mess a little with the totals and also the average but I try and compensate for it. I haven’t yet got my head around the importance of having an accurate zero point equating to zero force. Currently I’m concentrating only on the amplitude of the waveform and averaging using the boundaries of that. The benefit is that drift becomes irrelevant and only the slope of voltage against force is important. I need to investigate further the difference between the minimum value while pedaling and the zero load value. Difficult at the moment  as the minimum happens to be coinciding with approximately 0V output. Need to change the value of the resistor but for the moment I find it useful for seeing how consistently its holding this 0 value with temp changes.

A graph of my commute to work. Don’t have any idea at the moment how good the accuracy is and the power was calculated after on a spreadsheet but I’m so far pleased with it consisting the way cadence is calculated. I now only have to update the code and a power reading can be sent straight to my phone.  
 [Image: ThkeDg.png]
The idea for now is to see how simple can I make a power meter that will give approximate power info to the auto shifter. If I ever want it to be accurate I think a better cadence measuring method will be needed and a more thorough understanding of how tocalibrate the force measurements. I’m not yet sure what data I need for the auto shifter. Do I want it to shift so I can maintain a constant force on the pedals. Or do I want a more complicated relationship between power output and cadence.
- Oran
Made good progress with the code and measuring cadence from the strain gauges is working amazingly well.

[Image: W4CjtV.jpg]

First thing I did was lift the zero force value up off 0V. I then had to rethink how I measured the min value for everything to be calculated from. Constantly recalculating the min value from the dead spot on my pedal stroke just wasn’t going to work for accuracy as it doesn’t represent 0 force. In the end I moved the min value, or should now be called zero force value, code into the setup. It takes 3 reading 1 sec apart and obtains an average before the loop starts to run.
It seems to be capable of returning to this zero value with minimal drift over a decent length of time.  If it does start to drift I’ve added an external reset for the Arduino. Better than switching off and on as it maintains the Bluetooth connection.

The following data is recorded at 0.5 second intervals, the amount of data gets a bit much otherwise. Where the gauge value stays below 0 is when my foot is resting on the pedal while behind the bottom bracket. 

[Image: DtBZTF.jpg]

I’ve started to increase the speed at which the code is running from a very slow 25Hz to 100Hz. This gets the cadence resolution to about 1 rpm, will experiment with how much I can push the speed. The output of the amplifier is disappointing noisy which I find odd because it was very smooth when I had everything temporarily wired with 30cm lengths of wire. To improve this I have the other timer running a 1kHz interrupt with a running average of 50 values.

Next challenge is to do a proper job of wiring the strain gauges to the amp. Until I get that reliable I can’t go any further with the project.
- Oran
Successfully rewired the strain gauges this time with thin plastic insulated wire. Not the way to connect strain gauges as its far too thick and could pull them off but at least the chance of a short onto the crank is less. This time instead of applying Araldite directly to the gauges I’ve used a layer of wax first as a seal. On top to provide protection a layer of Araldite with foil on top. I felt that resin was too rigid and liable to crack allowing water to seep in. When I removed the resin it peeled away easily leaving the gauges in place fortunately.

Once I got rid of the dodgy connection to the Arduino it has settled down nicely during recent test rides. The zero force value at the end of a resent ride had remained the same as at the start. I can leave it running and there is almost no drift at all. I do get a slight variation in the value from day to day but its only equivalent to a kg or two of force. The Arduino’s startup code measures this value each time and stores it for use in the calculations so no affect on the forces measured unless it drifts during the ride. 

To give an idea of the amazing sensitivity of the strain gauges this graphs shows the difference between the crank being at 90o and 270o. And I was worried I had a lot of noise but its not that bad.
 [Image: jlZc4z.png]
Next is to get the NRF24L01 modules to communicate with each other and provide the power meter to auto shifter connection. It seems that wireless communication is challenging me again. Another challenge would be connecting to an ANT+ device, Arduino code is available that suggests can provide a link. 

After that is taking the project to the exciting and new territory in the world of cycling, mapping optimum cadence against power output. BioShift have made a start but there system will always be limited by the ratio steps of derailleur gears. They talk about a sophisticated algorithm that can tell your fatigue level and calculate FTP *on-the-fly*. That’s what l want to  start to learning about.
- Oran

Atteindre :

Utilisateur(s) parcourant ce sujet : 1 visiteur(s)