fixes auto adjustment for rowed distance

This commit is contained in:
Lars Berning 2021-05-13 10:11:00 +02:00
parent 103b77190e
commit c87e78b000
No known key found for this signature in database
GPG Key ID: 028E73C9E1D8A0B3
1 changed files with 2 additions and 3 deletions

View File

@ -51,9 +51,6 @@ function createRowingEngine (rowerSettings) {
// jMoment * ωdot = -kDamp * ω^2 during non-power part of stroke
let kDamp = jMoment * omegaDotDivOmegaSquare
// s = (k/c)^(1/3)*θ
const distancePerRevolution = 2.0 * Math.PI * Math.pow((kDamp / c), 1.0 / 3.0)
let workoutHandler
const kDampEstimatorAverager = createWeightedAverager(5)
const flankDetector = createMovingFlankDetector(rowerSettings)
@ -100,6 +97,8 @@ function createRowingEngine (rowerSettings) {
prevDt = currentDt
// each revolution of the flywheel adds distance of distancePerRevolution
// s = (k/c)^(1/3)*θ
const distancePerRevolution = 2.0 * Math.PI * Math.pow((kDamp / c), 1.0 / 3.0)
strokeDistance += distancePerRevolution / numOfImpulsesPerRevolution
omegaVector[1] = omegaVector[0]