doudar / SmartSpin2k

Transform your spin bike into a Smart Trainer!
GNU General Public License v2.0
175 stars 33 forks source link

Not working with TrainerDay #515

Closed docholiday1234 closed 4 months ago

docholiday1234 commented 5 months ago

SS2K is not working with Trainer Day app iOS 17.0.3

Steps to reproduce

  1. Open App
  2. Connect SS2K
  3. Start workout
  4. App take control of SS2K and raises or lowers resistance until it bottoms out. I

Expected behavior It should raise or lower resistance consistent with ERG mode wattage setting

Actual behavior resistance seems to acting sporadically

Additional Information

Custom UDP Receiver (Port 10000).txt

doudar commented 5 months ago

Thank you for the logs!!

The issue appears to be that TrainerDay sends ERG targets at least once per second. Currently the SmartSpin2k ERG algorithm uses the lookup table for the first two seconds after it receives a ERG target and then after the two seconds elapses, it uses a normal positive feedback control loop. With these rapid fire ERG targets, the current scheme never gets a chance to go into a positive control mode and the rapid ERG targets keep it spiraling out of control.

It also appears that this fast ERG target sending is breaking the protections in place to keep the resistance in bounds on the Peloton (further complicating the issue as it starts to build a bad table due to skipped motor steps).

I have some possible fixes in mind.

doudar commented 5 months ago

New branch #516

doudar commented 5 months ago

firmware.zip @docholiday1234 , give this firmware a try.

Instructions: https://github.com/doudar/SmartSpin2k/wiki/Loading-Software Use the "Updating your existing software" section, except use the binary from the zip file attached to this message.

docholiday1234 commented 5 months ago

Hi, It shifted back and forth, immediately and constantly increasing and decreasing the resistance. Then I turned up the watts and it seems to increase resistance but then when I turned back down the watts it still increased resistance although it never 'bottomed out' and now that I'm not even pedaling it is still changing resistance.

Trainer Day Log 2.txt

doudar commented 5 months ago

firmware.zip This is the latest build. It should work for you.