Skip to content

Latest commit

 

History

History
77 lines (60 loc) · 4.38 KB

File metadata and controls

77 lines (60 loc) · 4.38 KB

Central configuration of Kickr-Virtual-Shifting

configNimBLE.h

Make configNimBLE.h settings to comply with your Legacy KICKR smart trainer.

  • Open file, edit and save(!): /documents/arduino/libraries/KickrVirtualShifting/src/config/configNimBLE.h

Kickr-Virtual-Shifting NimBLE-Arduino configuration options:

// ---------------------------------------------------------------------------------------
// Wahoo has realeased KICKR (firmware) versions that expose FTMS in addition to CPS
// Consult repository documentation to check in what rare cases this is usefull!
// Uncomment "#define FTMS_ENABLE" to activate, ONLY when this is applicable to your setup!
//#define FTMS_ENABLE

// ---------------------------------------------------------------------------------------
// Training Apps set MTU after connection from 23 to 255, this allows for max data throughput!
const uint8_t MAX_PAYLOAD = 20;  // Max 20 (23-3) byte size for array DATA and strings
// Preferred Connection Parameters for max data throughput: Client-side (!) AND Server-side !
const uint16_t ConnectionMinInterval = 6; 	// Min interval (7.5ms)  
const uint16_t ConnectionMaxInterval = 12;	// Max interval (15ms)  
const uint16_t ConnectionLatency = 0;   	// No slave latency (immediate response)
const uint16_t ConnectionTimeout = 200; 	// Supervision timeout (2 seconds before disconnect)
const uint16_t ScanInterval = 160;		    // Scan every 100ms (160 * 0.625ms)
const uint16_t ScanWindow = 160;		      // Active scanning for 100ms (160 * 0.625ms)
const uint16_t ConnectionMTU = 255;     	  // ATT (Attribute Protocol) Maximum Transmission Unit
const uint16_t AdvertiseMinInterval = 160;	// 100ms (160 * 0.625ms)
const uint16_t AdvertiseMaxInterval = 240;	// 150ms (240 * 0.625ms)

configDebug.h

Kickr-Virtual-Shifting has a fine-grained scheme for allowing debug-messages during operation. Every /src/<file name>.cpp has its own #define DEBUG at the beginning of the code that can be (un)commented (switched on or off) discretionary. However, when one reaches the state that debugging has no longer a purpose, you want to get rid of all the overhead (processor load) and optimise for speed. This configDebug.h allows you to switch OFF in one place all Kickr-Virtual-Shifting debugging messages with one master switch.

Make configDEBUG.h settings to comply with the status of your Kickr-Virtual-Shifting setup.

  • Open file, edit and save(!): /documents/arduino/libraries/KickrVirtualShifting/src/config/configDEBUG.h

Kickr-Virtual-Shifting Debug configuration options:

// ------------------------------------------------------------------------------------------------
// COMPILER DIRECTIVE to allow/suppress ALL DEBUG messages that help to debug code sections
// Uncomment general "#define GLOBAL_DEBUG" to activate the Kickr-Virtual-Shifting debug master switch...
#define GLOBAL_DEBUG

configKickr.h

Make configKickr.h settings to comply with your Legacy KICKR smart trainer.

  • Open file, edit and save(!): /documents/arduino/libraries/KickrVirtualShifting/src/config/configKickr.h

  • Set your KICKR-configuration for use with Kickr-Virtual-Shifting:

// To calculate the speed we assume a default wheel diameter of 0.7m and take the current 
// cadence from the trainer
#define WHEELDIAMETER 0.7  // Wheel diameter in m

// Internal "difficulty" setting used to modify some calculations
#define DIFFICULTY 100  // Difficulty in percentage (0-200%)

// As the Zwift Cog has 14 teeth and a standard chainring 34 teeth the default ratio is 
// defined at 2.4 which roughly matches Zwift Gear 12
// Calculated as Chainring/Sprocket --> 2.4 equals gear 12    
#define DEFAULTGEARRATIO 2.4  // Default gear ratio of the bike (chainring / sprocket)

// Perceptual scaling exponent ALPHA (tunable)
//  1.0	  Linear, harsh
//  0.9	  Sharp, race-oriented
//  0.8	  Natural, cassette-like (recommended)
//  0.7	  Softer, forgiving
//  0.6	  Very smooth, ERG-like
// Check repo documentation: /docs/Alpha_Explained.md
#define ALPHA 0.8

Warning: When a new version of Kickr-Virtual-Shifting is installed in Arduino IDE 2 it will override ALL files of a previous version! If you have made modifications in a file that is part of Kickr-Virtual-Shifting --> Make a copy of the file(s) in question BEFORE you install a new library version!