cagnulein / qdomyos-zwift

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

[BUG] Auto follow workout based on heart rate #2370

Open Rowdy opened 2 weeks ago

Rowdy commented 2 weeks ago

Description I've created a custom training program via Trainingroad, which uses their HR type workout. So I'd like the resistance to auto follow the workout based on my heart rate.

Steps to reproduce the behavior: If I load the custom training program there is no change on the resistance of the bike. I'm using a Schwinn IC4 and a SmartBike2k. Both are paired correctly. Resistance changes works with other programs like FTP workouts. I'm using my Apple watch with the qdomyos app as a heart rate monitor (which works fine).

Expected behavior The resistance should change based on my heart rate and based on the custom training program.

Screenshots CleanShot 2024-06-03 at 13 43 56@2x

Smartphone (please complete the following information):

Archive.zip Please find the debug.log and settings.qzs attached

cagnulein commented 2 weeks ago

hi @Rowdy are you able also to attach the TP program? I never saw anything like this. BUT you can already write your own program on QZ based on your HR Check this as a template https://github.com/cagnulein/qdomyos-zwift/blob/master/train-programs-examples/hrzones_1h_treadmill.xml

Rowdy commented 2 weeks ago

@cagnulein Sure. I've attached the zwo file from Trainingday. Zone 2 Workout.zwo.zip

Even better if I can do it directly on QZ @cagnulein 🤩 But I cannot add in specific bpm values right? only zones? What about the HR min / HR max settings in the Training mode settings / PID? Can I use specific bpm values there?

cagnulein commented 2 weeks ago

The attached file is not about hr

`

fr3nks
<name>Zone 2 Workout</name>
<description></description>
<sportType>bike</sportType>
<tags></tags>
<workout>
    <SteadyState Duration="3600" Power="0.65"/>
</workout>

`

Just power :)

I did on zones because HR has variability so putting a one value only will acts as continuously changing in the resistance, trust me :)

Rowdy commented 2 weeks ago

@cagnulein And what are these PID options about? IMG_6081

cagnulein commented 2 weeks ago

With the pid hr min and max you can specify a custom hr range. So qz will try to keep the resistance on a way that your hr is always matching it. Of course if it's too narrow it's changing a lot

Rowdy commented 2 weeks ago

@cagnulein that's actually what I need. So I don't need to set a PID zone but can work with the specific values. And I don't have to use a training program for that as well, right?

cagnulein commented 2 weeks ago

Correct. Let me know if you have any other questions

Il giorno lun 3 giu 2024 alle 21:36 Johns @.***> ha scritto:

@cagnulein https://github.com/cagnulein that's actually what I need. So I don't need to set a PID zone but can work with the specific values. And I don't have to use a training program for that as well, right?

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

Rowdy commented 1 week ago

I've no idea what the problem is but something is clearly not working here with my setup. The wattage thing looks fine. Haven't changed anything there. But I wanted to try the PID training and used the specific min/max bpm values and also zones but the SS2K cranks up the wattage way to high, so that I cannot tread anymore and as soon as the heart rate is in the target area the SS2K releases the magnetic brake and also goes below zero so that I have to loose it in order that there is no hardware damage happening.

Is there any solution to this problem? I've also uploaded the debug file. debug-Mi__Juni_5_17_29_17_2024.log

Thanks in advance.

cagnulein commented 1 week ago

Tomorrow I will check your case

cagnulein commented 1 week ago

@Rowdy i just did a patch for this. send me an email to roberto.viola83 at gmail.com indicating this ticket and I will send you it. Thanks

Rowdy commented 1 week ago

I haven't had these issues anymore with the patched version, but it still acts sometimes kind of weird. HR Zone is from 115-125 and I'm riding with 123bpm then it cranks up the watts from 110 to 170...

I've attached the log. It would be beneficial if the resistance acts more often and faster but more subtle. A lot of times there were big increases / decreases ~20 watts... debug-Mi__Juni_5_17_29_17_2024.log

It works way smoother in Zwift or Trainerroad.

cagnulein commented 1 week ago

you sent me the same file as yesterday, send me the new one. anyway i get your issue, you simply need to reduce the ss2k step setting in qz to have a more granular change. let me know! in case i can change also this using the wattage instead of the resistance to this feature (actually i'm using the resistance level).

Rowdy commented 1 week ago

Sorry mate. Here is the new debug.log. I guess it would make more sense to do it on wattage instead of resistance since resistance is way of on the Schwinn? debug-Do__Juni_6_17_36_22_2024.log

Rowdy commented 1 week ago

These screenshots are good examples. I was already on the upper end of the target HR zone and it still increased the resistance way too much IMG_6106 IMG_6107

Rowdy commented 1 week ago

Or here - it increases it from 161 to 193 watt within 10 seconds IMG_6110 IMG_6111

cagnulein commented 1 week ago

try to change the step

Author

in this log i don't see any connection, i guess you have more logs for today. anyway try to reduce the ss2k step and let's see if i'm right.

another option will be using the ss2k like a ftms bike directly and so we can use the FTMS command like zwift and trainer road to use the erg mode (wattage).

Anyway let's do first the test with the ss2k step setting, thanks

Rowdy commented 1 week ago

I don't understand the options here. Is there any wiki for that settings? image

cagnulein commented 1 week ago

reduce the shift step, for example put a 90 instead of a 900. this is the step motor for each resistance level, probably too much for your case