01-28-2018, 04:13 PM

Turns out there was a problem with the calculations. Very useful to be able to transmit values to my phone via Bluetooth for live monitoring will riding. This equation for the multiplier ((sin(((Power+powerPrev)/2)/-560))*7)+17 wasn’t working correctly without being fed a float. The change in cadence was due to cadence correction as only the cadence setting equation was working.

With that fixed I then had to fine tune the cadence correction equation to work more smoothly with the ever changing cadence setting. This is where my experiments with PID came in useful. By reducing the amount of proportional and adding the right amount of integral I got rid if the oscillations. These graphs below show the difference between having cadence correction and not.

Example of some data recorded, the blue and purple stay pretty close together which makes for an amazing ride experience. Because I’ve become very sensitive to my cadence I can actually estimate my power out by the rpm of my legs.

I’ve also used what I’ve learnt from this to improve the cadence correction for the constant cadence, no power meter, mode. Always had problems with oscillations at high cadences and sometimes if I changed the cadence setting. Also because the relationship between cadence and multiplier isn’t linear it made sence to have the proportional part of the PID change depending on the multiplier. The result is much smoother operation and no more oscillations. How much better can I make the code. Of course if I get a new hub I’ll probably have to reconfigure everything.

With that fixed I then had to fine tune the cadence correction equation to work more smoothly with the ever changing cadence setting. This is where my experiments with PID came in useful. By reducing the amount of proportional and adding the right amount of integral I got rid if the oscillations. These graphs below show the difference between having cadence correction and not.

Example of some data recorded, the blue and purple stay pretty close together which makes for an amazing ride experience. Because I’ve become very sensitive to my cadence I can actually estimate my power out by the rpm of my legs.

I’ve also used what I’ve learnt from this to improve the cadence correction for the constant cadence, no power meter, mode. Always had problems with oscillations at high cadences and sometimes if I changed the cadence setting. Also because the relationship between cadence and multiplier isn’t linear it made sence to have the proportional part of the PID change depending on the multiplier. The result is much smoother operation and no more oscillations. How much better can I make the code. Of course if I get a new hub I’ll probably have to reconfigure everything.

- Oran