Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

### Changed
- Fix Peloton serial homing to use resistance feedback instead of StallGuard sensorless detection.
StallGuard fired prematurely on Peloton's continuously-increasing magnetic resistance, causing
hMax to be set at ~50% of the actual physical travel range. pelotonConnected() now sets
resistance.setMin/setMax (the homing target bounds) so that _findFTMSHome() receives valid
targets, and goHome() now includes ss2k->pelotonIsConnected in its FTMS homing condition so
Peloton serial users take the resistance-feedback path rather than falling through to StallGuard.
- Replace hardcoded post-homing gear 8 with a calculated midpoint (hMax / (2 * shiftStep)).
The hardcoded value assumed a correctly-ranged hMax; for Peloton serial users whose hMax was
only ~50% of physical range, starting at gear 8 left no room to shift up. The calculated
value places the motor at the center of the actual calibrated travel range.

### Hardware

Expand Down
3 changes: 2 additions & 1 deletion src/BLE_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ void bleClientTask(void* pvParameters) {
ss2k->goHome(true);
} else { // Startup Homing
ss2k->goHome(false);
rtConfig->setShifterPosition(8); // Set to middle position after homing on startup
int startGear = (userConfig->getShiftStep() > 0) ? (userConfig->getHMax() / (2 * userConfig->getShiftStep())) : 4;
rtConfig->setShifterPosition(startGear > 0 ? startGear : 0); // Start at ~midpoint of calibrated travel range
}
spinBLEServer.spinDownFlag = 0;
}
Expand Down
6 changes: 4 additions & 2 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,8 @@ void SS2K::goHome(bool bothDirections) {
}
}

// if we're using real resistance from a FTMS bike, find those values for the reported min and max resistance instead of using hard stops.
if (!rtConfig->resistance.getSimulate() && userConfig->getConnectedPowerMeter() != NONE && rtConfig->resistance.getMax() > 0) {
// if we're using real resistance from a FTMS bike or Peloton serial, use resistance feedback for homing instead of hard stops.
if (!rtConfig->resistance.getSimulate() && (userConfig->getConnectedPowerMeter() != NONE || ss2k->pelotonIsConnected) && rtConfig->resistance.getMax() > 0) {
ss2k->_findFTMSHome(bothDirections);
if (rtConfig->getHomed()) {
fitnessMachineService.spinDown(FitnessMachineStatus::SpinDown_Success);
Expand Down Expand Up @@ -955,6 +955,8 @@ bool SS2K::pelotonConnected() {
if (millis() - rtConfig->resistance.getTimestamp() < 5000 && !rtConfig->resistance.getSimulate()) {
rtConfig->setMinResistance(MIN_PELOTON_RESISTANCE);
rtConfig->setMaxResistance(MAX_PELOTON_RESISTANCE);
rtConfig->resistance.setMin(MIN_PELOTON_RESISTANCE);
rtConfig->resistance.setMax(MAX_PELOTON_RESISTANCE);
return true;
} else {
rtConfig->setMinResistance(-DEFAULT_RESISTANCE_RANGE);
Expand Down