Skip to content
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

Adjust virtual flywheel according to virtual gearbox #118

Closed
switchabl opened this issue Oct 28, 2020 · 3 comments
Closed

Adjust virtual flywheel according to virtual gearbox #118

switchabl opened this issue Oct 28, 2020 · 3 comments
Labels
enhancement New feature or request implemented

Comments

@switchabl
Copy link
Contributor

When using the virtual gearbox, the virtual speed does not match the speed seen by the trainer. The acceleration differs by the same factor, so the flywheel force calculation will be off. I propose to adjust the flywheel mass accordingly to compensate:

Weight = max(0x0a, int(self.PowercurveFactor * self.UserAndBikeWeight))

This seems to work well for me and should give physically correct inertia depending on the virtual gear. The dynamic behaviour directly after a gear shift is probably not simulated correctly (depending on how the virtual flywheel is implemented internally, probably just F = m * a), i.e. in reality you would need to put in some additional power to accelerate as you shift up. But this is a more complicated topic.

@WouterJD
Copy link
Owner

Seems quite logical and I feel OK to implement.
It's amazing how detailed you studied the code to get here; great work!

@mattipee, I appreciate your view.

@WouterJD WouterJD added the enhancement New feature or request label Oct 28, 2020
@mattipee
Copy link
Contributor

Without looking into the details, if the Fortius unit is calculating inertia for a given rider+bike mass, then it does so based upon the wheel speed, not the virtual speed. So unless I'm missing something else, this suggestion seems sound.

As for the maths, linear is probably correct but I haven't looked into it just now.

Good spot, @switchabl !

@WouterJD
Copy link
Owner

WouterJD commented Nov 3, 2020

Implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request implemented
Projects
None yet
Development

No branches or pull requests

3 participants