-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shifters in Stand-alone ERG mode #390
Comments
Awesome! Glad to have you here!!!
Holding down the shifters - I like it! That's a pretty cool idea. I'll definitely put it on my todo list. Changing target watts in ERG mode is interesting as well. I think it's something that could be done.
This one might be a little bit harder to implement correctly, but I'll think about it and look into it. In the meantime with Zwift, you could work around this by only connecting SS2k as a power meter and not a controllable trainer. |
I made a simple version a few years ago with a stepper motor and an A4988 and it works like Smartspin2k when not connected to Zwift, so only changing the resistance by pressing the shifters. I quickly got tired of pushing multiple times to get a large increase or decrease and so I implemented big steps when holding down the button for 1,5s. It also has a hardware switch and let the stepper "zero" itself when powering on.
That is a possibility offcourse. I mostly start a course in sim mode and when I'm done I tend to keep riding on the same course to do my cooling down. During the cooldown I don't like the automatic resistance change and would rather stay at a (manually) set power level. |
If you’re using a new version of SS2K and have some type of power meter attached, it will generate travel limits as you’re pedaling. These are base off min brake watts and max brake watts (settings) and SS2K won’t let you go above or below those respectively. |
It does that only in ERG mode right? Not in simulation mode? Also I think that MIN_WATTS needs to be replaced by userConfig.getMinwatts() in ERG_Mode.cpp? |
Good catch! Yes, it should be. Right now, the power table isn't persistent so it takes a few minutes of pedaling at various watt levels before the min and max positions are calculated. Prior to that, the limits are very large and the knob could crash. What I'd like to do is have the offsets for the table saved and then the table regenerated once a known position is found. That should give you protection after just a few seconds of pedaling. The only time in sim mode that shifting is blocked is if you are up against a calculated limit. |
Current changes (you suggested) are going into the FTMS_Resistance branch, as that is currently undergoing testing for merging into develop. If you're interested in working on a persistent power table, I'd absolutely love the help. No pressure of course. |
I implemented a simple 'solution' to this one. This way you can "Override" the simulation mode using the webinterface and ride with a fixed Powersetting. I use this when cooling down, because then I don't like the shifting up and down anymore.
I also made changes to the Interrupt Functions of Main.cpp to get this working.
I posted this, so perhaps anyone can also benefit from this. |
Implemented in #420 |
That was quick! :) There is a bug with the above solution for the ERG mode when switched off again. (I never use it, but it should work offcourse). In settings.h I added three lines: In smartSpin_parameters.h I changed line 44 & 45 to: And the void in line 75 to: |
Here's how I've done it in #420 I don't like adding much to ISR's so I instead created a new function that is run in the maintenance loop which checks for shifts in the ISR and then applies them depending on what the current FTMS mode is. That way, customized shifting can be easily implemented in every FTMS mode. Also, if you read this code, I started a refactor on the rtConfig class which you might notice. Watts, Resistance, Cadence and Heartrate were added to "Measurements". Lines 236 to 283 in fbc9ef9
|
Nice :)
Still, when switching from ERG to simulation mode the min and max stepperpositions needs to be set wide again (because ERG mode limited these points). This is also the case when you turn off ERG mode in RGT. I like the webinterface (SimTargetWatts) to overrule the incline data when connected to RGT so I made some changes to BLE_Server.cpp to get that working again. Because of the use of FTMSMode a little more lines were needed than my solution above. I also added the else back in the scanIfShiftersHeld to switch to '0' if the left shifter is held. |
Did you increase SmartSpin2k/include/settings.h Line 234 in 84eaafb
|
I tried that first, but made no difference. |
I also noticed that the BLE tries to reconnect from Main while I have a pm connected and hr set to "none" |
yes, they need to be cast to string type. It's been fixed in FTMS-resistance. I hope to merge this branch into develop soon Lines 560 to 577 in eaa165a
|
What would really help here (freeing up file space) is getting rid of hosting jquery, which we're only using for OTA firmware updates. I see there's this library/example without jQuery which I might try to adapt after FTMS-resistance is merged. |
I see now you already fixed this 2 days ago :) |
On the other hand maybe we can't close it yet. Lines 273 to 279 in eaa165a
|
Whoa! Resistance numbers? That's experimental in this branch - what bike are you using that you're getting resistance feedback? I could really use another tester if you have a bike with resistance feedback! (Especially an Echelon) |
No sorry, I don't have an Echelon bike. I like the ERG mode you implemented, that's why I ported your software to my setup and since it now has resistance too, I thought I'll give it a go. |
Awesome! That sounds pretty cool! The delay is why we have the Peloton resistance limits at 5&98. The actual bike is 0 and 100 but there needs to be a buffer for overshoot. |
Here's a new binary (with @Flo100 's oscillation fix) for anyone else that might be watching this thread. Unzip and make sure it's named exactly firmware.bin then use the web interface admin/admin. |
Before I had BLE working I wanted some sort of reproducable resistance level with each workout and that's why I mounted the FSR. After that I used to find the zero point at startup, reset the stepper to zero and use this as stepper minimum. My FSR gets saturated over time because there is more force on the felt pad than expected and I actually need another type. But I counted the steps to maxResistance once and used that as upper limit. You could probably do something like that too. Find the zero point at startup and after that use minStep() as boundary. |
Merged into develop for testing. |
Fixed |
I just found your SmartSpin2k project, build it, adapted it to my already made (and older) hardware setup and I really like it. :)
Is your feature request related to a problem? Please describe.
There's not really a problem, it;'s more inconvenience.
Sometimes I use my spinning bike stand-alone and choose the ERG mode from the webserver and set ERG target Watts. But during my excercise I would like to change this target using the shifters, because using the webinterface is annoying during a workout.
Describe the solution you'd like
Let the shifters increase and decrease the ERG target Watts in ERG mode. For example in 10Watt steps or so.
Also it would be great that the Watts go to minimum Watts when the shift down button is held for 1,5s. That way you don't have to push the button that many times to release the resistance. (Could also work for gears in SIM mode to switch back faster).
Describe alternatives you've considered
Using my phone on the handlebar to change the slider in de webinterface.
I noticed that I can't switch on ERG mode when connected to RGT or Zwift. Would it be possible that the webinterface ERG setting overrides the incline data from RGT so I can ride any event on targeted Watts instead of incline (but still sending all cadence, hr and powerdata to RGT)?
The text was updated successfully, but these errors were encountered: