Closed marklogan17 closed 3 years ago
@kadaan is there a way with the current firmware to have access to the current inclination/resistance of SS2K? Or maybe for now i can set my homing point to the current resistance and put it as an offset. What do you think @marklogan17 ?
Of course having the raw control of the motor will be the perfect solution
@cagnulein No way ATM to get access to current inclination/resistance Don't think that will work because QZ and SS2K don't know what the resistance of the bike is.
@kadaan with the offset, SS2K will become just an actuators so it should work. I'm only worried about negative inclines value. It will work for sure with positive ones
If by "set my homing point to the current resistance" you mean the user indicates in the app what resistance the bike is set to before starting a ride, then yes, that could work.
@kadaan yeah but without the user intervention: you know, i know already which is the current resistance. The bike told me it :) So SS2K will work also with the negative incline?
@cagnulein Yes, negative incline is fine. But, not all bikes tell you the current resistance (ie. Schwinn IC4/IC8)
@kadaan not true :D we have an algorithm to calculate the resistance for the schwinn :) it will works with your bike too :)
@cagnulein Cool. I want to see how accurate it is. Seems unlikely to match the display, but if it does, that's great!!!
@cagnulein Gave it a very quick try. Seems close when the resistance is at the higher end, 70+. On my bike it is very inaccurate at lower resistances < 50. When the bike is at 0, the resistance display in QZ is 28.
@marklogan17 i added the startup offset to the smartspin2k module. could you please try? if something doesn't work, as always, send me the debug log
OK you guys are smarter than me - plus you seem to solve things while I'm sleeping. I know the long term solution is likely to disable the shifters and have the request pass through to QZ. However until that's done I'm not sure how best to handle this. I tried a bunch of things to get this consistently changing 1 resistance level every time a + or - button is hit on QZ however I seemed to run into various edge cases.
What would be ideal is for a simple way of QZ replicating the shifters rather than dealing with the relative nature of the incline. So it would send the number of 'shifter presses' that it needs to replicate. That way the step config in SmartSpin still applies nicely. Sending a 'number' of shifter presses matters because for Schwinn or Peleton or something like that you may need to increase by 10 or 20 resistance levels and you don't want to make 20 calls, waiting for the resistance change between each.
@marklogan17 The issue is that "api" for controlling the stepper is not in terms of shifter steps, but in incline. Incline is scaled by Incline Multiplier, so you will want to adjust that to try to get one shift per incline submitted by QZ.
@marklogan17 The issue is that "api" for controlling the stepper is not in terms of shifter steps, but in incline. Incline is scaled by Incline Multiplier, so you will want to adjust that to try to get one shift per incline submitted by QZ.
OK, I was not reading the code right where it was taking current position and adding incline*incline multiplier. You caused me to re-read it and now I think we're good.
I've settled on 800 as the shift steps that I need for each level. So @cagnulein what we need is the inclination change you send times the configured multiplier equal 800. So the easiest way is where you are multiplying by 100 and sending, multiply by 200 and then I set the incline multiplier to 4. So 1 resistance level will cause you to send an incline change of 200 (or -200) which SmartSpin multiplies by 4, getting us to the +/-800 that seems to be good for changing one resistance level. Even better, if this is applied to the Peleton usage, you can easily request changes greater than 1 resistance level and it should still work.
I modified QZ to multiply by 200 and did a quick test and it worked really well. We'll still get potentially messed up in cases where the shifters are used and then +/- but I'll figure all those edge cases out so I can tell people what to do/avoid - and more importantly, how to get back in sync.
Longer term we probably need a way to reset inclination to zero so we can resync between apps.
Now to pull the hardware apart and replace the small gear to hopefully get rid of my last binding issue :)
@kadaan any update on the changes in SmartSpin?
@marklogan17 No, I've been crazy busy on my farm. :(
@marklogan17 No, I've been crazy busy on my farm. :(
Totally understandable! Life comes first :)
i'm closing this one. in case we will open a new one for future requests!
Looking to integrate the two so we can remotely control resistance on bikes with no motorized resistance control. NRF screenshots attached. I have started a discussion on the SmartSpin2K github page asking for suggestions/thoughts.