cagnulein / qdomyos-zwift

Zwift bridge for smart treadmills and bike/cyclette
https://www.qzfitness.com/
GNU General Public License v3.0
435 stars 118 forks source link

[BUG] Can't reach target power with power pedals because the resistance keeps getting reduced automatically #1708

Closed dartzon closed 6 months ago

dartzon commented 1 year ago

Describe the bug I just started using my Assioma Uno power pedals with my Echelon EX-4s indoor bike to do TrainerRoad workouts and I noticed that the automatic resistance keeps going down whenever I am close to the target power and even when I try to compensate by increasing my cadence, the resistance gets reduced again, so I'm never able to reach it.

This problem doesn't occur if I use the power output from the Echelon bike instead.

PS: I enabled the option to double the power output of the Assiomas from the mobile app.

To Reproduce Steps to reproduce the behavior:

  1. Install the Assioma UNO power pedals on the indoor bike
  2. Go to 'Settings > Accessories > Power sensor options > Power sensor'
  3. Click on 'power sensor and pick the power pedals from the Bluetooth list'
  4. Click 'OK' and restart the app
  5. Add the virtual power trainer device created by qdomyos-zwift to TrainerRoad
  6. Pick any workout and try to reach the power output target

Expected behavior The resistance should stay the same if reaching the target power output is possible, otherwise it should go up (harder) not down.

Screenshots

Desktop:

Smartphone:

Indoor bike:

Append a debug log

debug logs + fit file in a zip archive

QZ-Assioma-EchelonEX4-TrainerRoad-logs.zip

Additional context

cagnulein commented 1 year ago

thanks i will check this tomorrow

Il giorno lun 16 ott 2023 alle 19:24 Othmane AIT EL CADI < @.***> ha scritto:

Assigned #1708 https://github.com/cagnulein/qdomyos-zwift/issues/1708 to @cagnulein https://github.com/cagnulein.

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/qdomyos-zwift/issues/1708#event-10668491658, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWCJQ4O3OSTY5OPPUZLX7VUURAVCNFSM6AAAAAA6CRKL72VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJQGY3DQNBZGE3DKOA . You are receiving this because you were assigned.Message ID: @.***>

cagnulein commented 1 year ago

hi @dartzon I got the issue. QZ is getting the wattage from the assioma, but when it tries to do the erg mode, it's using the standard wattage table of the echelon bike. So try to change the echelon profile to the mgarcea one. It should be better, let me know and in case it doesn't work we will think about a different solution

dartzon commented 1 year ago

That did it! Thank you very much.

Is there a plan to add a new option in the app for people with the same setup as mine or is switching to mgarcea good enough?

cagnulein commented 1 year ago

@dartzon i can simply switch to it automatically when i see a power sensor pedal, what do you think?

dartzon commented 1 year ago

Sorry for the late reply, I wanted to test the workaround a little bit more but didn't got time until yesterday. I started a TrainerRoad workout and noticed that the resistance is following my output power better than before but it's still not perfect as often when the target power is high the resistance would drop down by 1 unit, which still makes it hard for me to attain the target and forces me to pedal above 100 rpm. Furthermore, I noticed during my workout that the current power output was displayed in yellow or orange when there was still about ~50W to reach the target power which indicates to me that QZ is displaying the correct power target but internally has a much lower value for some reason. Unfortunately I was in the middle of a workout and didn't want to interrupt it to enable the debug mode when these issues started showing up, so I started a quick workout afterwards to collect some more logs and I hope they're enough:

QZ-Assioma-EchelonEX4-TrainerRoad-logs_20231024.zip

Thank you for your support!

cagnulein commented 1 year ago

Furthermore, I noticed during my workout that the current power output was displayed in yellow or orange

the current wattage color is not based to the target one, it's following the ftp zone. Am I misunderstood what you mean?

I started a TrainerRoad workout and noticed that the resistance is following my output power better than before but it's still not perfect as often when the target power is high the resistance would drop down by 1 unit, which still makes it hard for me to attain the target and forces me to pedal above 100 rpm.

Ok, got it. The only way to make it perfect is collecting the profile directly from your bike. I mean QZ is doing the ERG mode based on the resistance/wattage table that mgarcea collected, that probably is a slightly different one from yours.

So we have 2 possibilites: 1) the fastest one: you're providing me your personal table and I can add it as a new profile 2) the longest and hardest one: I can add an alghorithm that can collect in realtime the table while you're doing the workout. This will be very helpful because, if in the future, another user will have the same issue, he can just enable this and I will collect it automatically. This requires a significatively amount of time to be developed.

Thoughts?

cagnulein commented 1 year ago

for my reference, the idea 2) is the one implemented in the SS2K https://github.com/doudar/SmartSpin2k/blob/develop/src/ERG_Mode.cpp#L239

dartzon commented 1 year ago

the current wattage color is not based to the target one, it's following the ftp zone. Am I misunderstood what you mean?

Oh I see, I thought the color green is when your power output matches or is very close to the target and it goes yellow than red when you're above it. It's me who's misunderstood it.

As for the 2 potential solutions you described, I actually like both of them. I was thinking maybe you can have a static pre-populated table for most of the well known indoor bike brands then in case one doesn't exist your algorithm can kick in and start collecting the values for a new table, then cache it somewhere... And maybe even be submitted over the cloud to you so that it can be integrated as a static table in future releases?

I am not gonna lie 😁, I would like to go with the 1st option as soon as possible if it's gonna allow me to properly follow my winter workout, then the 2nd option can come later whenever you're able to develop it.

Thanks!

cagnulein commented 1 year ago

I already start the work for the 2nd but could be long. For the 1st fill this table with your values and I will add it https://github.com/cagnulein/qdomyos-zwift/blob/master/src/echelonconnectsport.cpp line 585 Let me know

Il giorno gio 26 ott 2023 alle 04:20 Othmane AIT EL CADI < @.***> ha scritto:

the current wattage color is not based to the target one, it's following the ftp zone. Am I misunderstood what you mean? Oh I see, I thought the color green is when your power output matches or is very close to the target and it goes yellow than red when you're above it. It's me who's misunderstood it.

As for the 2 potential solutions you described, I actually like both of them. I was thinking maybe you can have a static pre-populated table for most of the well known indoor bike brands then in case one doesn't exist your algorithm can kick in and start collecting the values for a new table, then cache it somewhere... And maybe even be submitted over the cloud to you so that it can be integrated as a static table in future releases?

I am not gonna lie, I would like to go with the 1st option as soon as possible if it's gonna allow me to properly follow my winter workout, then the 2nd option can come later whenever you're able to develop it.

Thanks!

— Reply to this email directly, view it on GitHub https://github.com/cagnulein/qdomyos-zwift/issues/1708#issuecomment-1780312106, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAALYWEP632HBSCD2NQX5YDYBHCF3AVCNFSM6AAAAAA6CRKL72VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBQGMYTEMJQGY . You are receiving this because you were mentioned.Message ID: @.***>

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

cagnulein commented 1 year ago

hi @dartzon are you still interested?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

cagnulein commented 8 months ago

@dartzon if you I have some news for you #2175 let me know!

dartzon commented 8 months ago

Hi @cagnulein sorry I haven't replied to this thread in months now, life got between me and the trainer for a while... I am definitely still interested as I am back to training again. How do I test your PR please?

cagnulein commented 8 months ago

welcome back @dartzon ! OK I will build it ASAP and I will send you it. send me an email to roberto.viola83 at gmail.com indicating this ticket and if you are on android or iOS. Thanks

cagnulein commented 8 months ago

@dartzon done!

https://github.com/cagnulein/qdomyos-zwift/actions/runs/8209064337

Google is very slow in these days, reviewing the app on the store, even the beta ones. For this reason, in order to check right now if the patch that I did is right, you can use the android build in the link (check at the bottom of the page in about 1 hour). In order to test it you need first to remove the current QZ version on your phone, install the one that you downloaded. This version is a 15 minutes trial (you can restart it as many times as you want). I already unlocked it using your email (add the email that you sent me in the email settings in qz).

What you have to do, set everything and do some spin with all the resistance in order to give the possibility to qz to collect some data: after this try an erg workout, QZ will collect in realtime data from your power sensor + echelon bike and will try to match the wattage!

Let me know if you have any questions

cagnulein commented 8 months ago

new link https://github.com/cagnulein/qdomyos-zwift/actions/runs/8209277216

cagnulein commented 8 months ago

@dartzon any news?

stale[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

dartzon commented 7 months ago

Sorry, I couldn't ride for the past month but I was able to try it briefly. After I installed the app you sent me, it wasn't able to load my configuration and when I started a ride the power was very low and didn't go up no matter how much power I was actually putting down on my pedals. Unfortunately I wasn't able to collect debug logs. I will do another ride today and will send you some logs.

dartzon commented 7 months ago

Is your PR merged yet? I am using the Beta version on Android to get the latest changes, I wonder if I could keep using it if it already has your fix?

cagnulein commented 7 months ago

nope @dartzon it's not merged. you have to use the apk in the link above.

cagnulein commented 7 months ago

also be sure to collect wattage doing some spins to all the resistance values, qz has to dinamically collect them. also a debug log is required to understand your issue

cagnulein commented 7 months ago

@dartzon any news?

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.