Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
Pedal load sensor/ power meter for auto shifter.
#5
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
Répondre


Messages dans ce sujet
RE: Pedal load sensor/ power meter for auto shifter. - par Oran - 2017-09-26, 11:03

Atteindre :


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