Giter VIP home page Giter VIP logo

simcline's Introduction

SIMCLINE Icon   SIMCLINE for Smart TACX, Wahoo KICKR and FTMS enabled trainers

Simulation of Changing Road Inclination for Indoor Cycling

SIMCLINE 1

SIMCLINE 2

The SIMCLINE physically adjusts the bike position to mimic hilly roads, climbing and descending. This allows the rider to naturally change position on the bike, engage climbing muscles, and improve pedaling technique to become a more efficient and powerful climber.
Without user intervention the SIMCLINE will replicate inclines and declines depicted in (online & offline) training programs (like Zwift, Rouvy, VeloReality, myWhoosh and many others) that adjust accordingly the resistance of the indoor trainer.
The SIMCLINE auto connects at power up with a smart Wahoo KICKR trainer or a smart TACX trainer and let's relive the ascents and descents from favorite rides or routes while training indoors.
The physical reach is: 20% maximum incline and -10% maximum decline. However, the reach that the rider is comfortable with can be adjusted!
The SIMCLINE pairs directly to the smart trainer and with your PC/Laptop with (Zwift) training App for a connection that notifies the SIMCLINE to simulate autonomous the (change in) physical grade of the road during an indoor ride.
During operation an OLED display shows the road grade in digits and in graphics.
The SIMCLINE Companion App (for Android smartphones) can be paired, only when the training App is disconnected, for adjusting operational settings, like Ascent Grade Limit (between 0-20%), Descent Grade Limit (between 0-10%), Road Grade Change Factor (between 0-100%) and manual Up and Down control. Notice that the Companion App has a slightly different functionality depending of what brand of trainer (TACX or Wahoo) is connected, due to specific connectivity differences.

There are Instructables available with all the nitty gritty of how to create, construct and install the various parts and components of the different SIMCLINE versions.

The applied electronic components in the 2 projects are somewhat different but NOT in an essential way, as documented hereafter.
NOTICE that the SIMCLINE control code can be run with both (mechanically different) SIMCLINE versions! However, 3 different code versions are specially designed for operating with a TACX or Wahoo Kickr or FTMS enabled trainers! You will find in the arduino folder all the test programs and the common libraries. These will help you to test the electronic components separately and built together of both SIMCLINE versions.

Finally you have to select the SIMCLINE code that is appropriate for the trainer of your liking!

SIMCLINE 1.0

See: Instructables SIMCLINE 1.0 Instructables

Electronic Components and Circuitry used in version 1.0

Circuitry version 1.0

The original project has been elaborated with different electronic parts than the later version. I have then chosen for the following 4 active components:
Cytron Motor Driver MDD3A. Two channel motor driver for 12 V and 3 Amperes with buttons to test manually the working of the attached DC motor. This board enables the processor to set the Actuator motor in up or down movement. It transforms logical digital levels (Go Up, Go Down and Stop) from the Feather nRF52/ESP32 to switching of 12 Volt at 3 Amperes max., the levels at which the Actuator works.
Adafruit Feather nRF52840 Express
Is another easy-to-use all-in-one Bluetooth Low Energy board with a native-Bluetooth chip, the nRF52840! Notice that the Feather nRF52840 Express is to be prefered and has better value for money! It's Adafruits's take on an 'all-in-one' Arduino-compatible + Bluetooth Low Energy with built in USB and battery charging. It is a low power, handsome and fast processor board with lots of memory and I/O pins. Can easily be programmed over the USB connection.
Adafruit HUZZAH32 ESP32 Feather V2
Recently we have shared Simcline code that is targeted for another of the Adafruit star Feathers: the Adafruit HUZZAH32 ESP32 Feather V2 - with the fabulous ESP32 WROOM module. The ESP32 has both WiFi and Bluetooth Classic/LE support. The new HUZZAH32 V2 is Adafruit's redesigned ESP32-based Feather V2. Compared to the original Feather with only 4 MB Flash and no PSRAM, the V2 has 8 MB Flash and 2 MB PSRAM. Packed with everything people love about Feathers: built in USB-to-Serial converter, automatic bootloader reset, Lithium Ion/Polymer charger, and just about all of the GPIOs brought out.
The programmed Feather nRF52/ESP32 is communicating with (a) the trainer to collect power output information and (b) with the training App for resistance settings (like grade) or (c) with the Companion App on your mobile phone. The programmed Feather nRF52/ESP32 is in full control of the Simcline operation.

OLED display blue 128x64 pixels
Small display with screen of: 25 mm x 19 mm. Shows cycling data and diagnostic info that is gathered during operation by the programmed Feather nRF52/ESP32 to inform the Simcline user about relevant information. NOTICE: Install Straight Pin Through Hole Male PCB Header on the board; these will allow later flat mounting of the board on top of the frame!
Time-of-Flight-Distance sensor VL6180X
The sensor contains a very tiny laser source, and a matching sensor. The VL6180X can detect the "time of flight", or how long the laser light has taken to bounce back to the sensor. Since it uses a very narrow light source, it is perfect for determining distance of only the surface directly in front of it. The sensor registers quite accurately the (change in) position of the wheel axle during operation, by measuring the distance between the top of the inner frame and the reflection plate that is mounted on the carriage. The distance feedback of the sensor is crucial for determining how to set the position of the carriage and axle in accordance with the grade information that for example Zwift is using to set the resistance of the trainer. NOTICE: Install Right Angle Through Hole Male PCB Header Pins on the board.
In retrospect I do not regret the component choices made. All components are documented very well. There are lots of examples for use in an Arduino enviroment. They have turned out to be very reliable.

SIMCLINE 2.0

See: Instructables SIMCLINE 2.0 Instructables

Electronic Components and Circuitry used in version 2.0

Circuitry version 2.0

I have chosen for the following 5 compact active components that are slightly different from the earlier SIMCLINE project and that can finally all be mounted inside the components box:
Adafruit DRV8871 DC Motor Driver
A small one channel motor driver for 12 V (6.5 - 48 V) and 3,6 Amperes max. This board enables the processor to set the Actuator motor in up or down movement. It transforms logical digital levels (Go Up, Go Down and Stop) from the Feather nRF52/ESP32 to switching of 12 Volt at 3,6 Amperes max., the levels at which the Actuator works. Notice that default the board comes limited to 2,6 Amperes and you need to add a resistor to set for max current level. Install Vertical Through Hole Male PCB Header Pins on the board; this will allow correct mounting of the board inside the components box!
Adafruit Feather nRF52840 Express
Is another easy-to-use all-in-one Bluetooth Low Energy board with a native-Bluetooth chip, the nRF52840! Notice that the Feather nRF52840 Express is to be preferred and has better value for money! It's Adafruit's take on an 'all-in-one' Arduino-compatible + Bluetooth Low Energy with built in USB and battery charging. It is a low power, handsome and fast processor board with lots of memory and I/O pins. Can easily be programmed over the USB connection.
Adafruit HUZZAH32 ESP32 Feather V2
Recently we have shared Simcline code that is targeted for another of the Adafruit star Feathers: the Adafruit HUZZAH32 ESP32 Feather V2 - with the fabulous ESP32 WROOM module. The ESP32 has both WiFi and Bluetooth Classic/LE support. The new HUZZAH32 V2 is Adafruit's redesigned ESP32-based Feather V2. Compared to the original Feather with only 4 MB Flash and no PSRAM, the V2 has 8 MB Flash and 2 MB PSRAM. Packed with everything people love about Feathers: built in USB-to-Serial converter, automatic bootloader reset, Lithium Ion/Polymer charger, and just about all of the GPIOs brought out.
The programmed Feather nRF52/ESP32 is communicating with (a) the trainer to collect power output information and (b) with the training App for resistance settings (like grade) or (c) with the Companion App on your mobile phone. The programmed Feather nRF52/ESP32 is in full control of the Simcline operation.

OLED display blue/white 128x64 pixels (0,96 Inch, I2C)
Small display board has a critical overall board size of 25 mm * 27 mm (!); (See for example: Webshop). Display area itself is: 25 mm x 14 mm. Shows cycling data and diagnostic info that is gathered during operation by the Feather nRF52/ESP32 to inform the SIMCLINE user about relevant information. NOTICE: a) Many different formfactors are offered at webshops; b) Install Vertical Through Hole Male PCB Header Pins on the board; this will allow correct mounting of the board inside the components box!
Pololu Time-of-Flight-Distance sensor VL6180X
The sensor board (12.7 * 17.8 mm) contains a very tiny laser source, and a matching sensor. The VL6180X can detect the "time of flight", or how long the laser light has taken to bounce back to the sensor. Since it uses a very narrow light source, it is perfect for determining distance of only the surface directly in front of it. The sensor registers quite accurately the (change in) position of the wheel axle during operation, by measuring the distance between the top of the inner frame and the reflection plate that is mounted on the carriage. The distance feedback of the sensor is crucial for determining how to set the position of the carriage and axle in accordance with the grade information that for example Zwift is using to set the resistance of the trainer. NOTICE: a) VL6180X boards are also offered by different suppliers and have different formfactors; b) Install Straight Angle Through Hole Male PCB Header Pins on the board; this will allow later flat mounting of the sensor board in the components box!
Pololu D24V5F5
This is a small 5V, 500mA Step-Down Voltage Regulator that is responsible for voltage conversion from 12V to 5V, the power supply for all components boards. NOTICE: Install Straight Angle Through Hole Male PCB Header Pins on the board; this will allow later easy mounting of the sensor board in the components box!

All components are documented very well and are low cost. There are lots of examples for use in an Arduino environment. They have turned out to be very reliable. The exact wiring of the components can be followed in the figure above.

simcline's People

Contributors

berg0162 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

simcline's Issues

Elite Trainer code

Dear Jörgen!
I came back here, but today not for an issue regarding the my SimCline simulator (it works fine!).
Recentelly I bought a new Elite Direto XR-T trainer for my new SCOTT ADDICT RC bike and i saw that SimCline now is availble also Wahoo trainer and of couse TACX too.
So, I would like to contribute to the development of SimCline for ELITE if you plan to do it, so that SimCline can communicate with the best trainers on the market and to be a reference for us.

Let me know how I can be useful

Best Regards
Filippo (cherryphilip)

Test Zwift Hub FTMS

    Hello Jorghen,

Here is the first result with FTMS_Client_ v022

I don't know if it's good?

Next test when I receive the dongle for the Pc

Friendship,
Joel

[CFG ] SoftDevice's RAM requires: 0x20002C78
FTMS and Chars 'initialized'
CPS and Chars 'initialized'
CSCS and Chars 'initialized'
GA and Chars 'initialized'
DIS and Chars 'initialized'
Start Scanning for CPS, CSC and FTMS!
[BLE ] BLE_GAP_EVT_ADV_REPORT : Conn Handle = 65535
[BLE ] BLE_GAP_EVT_ADV_REPORT : Conn Handle = 65535
Found advertising Peripheral with FTMS service!, see the Raw Data packet:
Timestamp MAC Address Rssi Data
000000681 F8:9C:FC:53:5E:49 -60 09-02-16-18-26-18-18-18-0A-18
[BLE ] BLE_GAP_EVT_CONNECTED : Conn Handle = 0
[GAP ] MAC = F8:9C:FC:53:5E:49, Type = 1, Resolved = 0
[GAP ] Conn Interval = 20.00 ms, Latency = 0, Supervisor Timeout = 2000 ms
[BLE ] BLE_GAP_EVT_DISCONNECTED : Conn Handle = 0
[GAP ] Disconnect Reason: CONN_FAILED_TO_BE_ESTABLISHED
Feather nRF52 (Central) connected to Trainer (Peripheral) device: [] MAC Address: F8:9C:FC:53:5E:49
Now checking mandatory Client Services and Characteristics!
Discovering Client Cycling Power (CP) Service ... [DISC ] [SVC] Handle start = 1
bool BLEDiscovery::_discoverService(uint16_t, BLEClientService&, uint16_t): 79: verify failed, error = BLE_ERROR_INVALID_CONN_HANDLE
Not Found!
Disconnecting since Client Cyling Power Service is mandatory!
Client Disconnected, reason = 0x3E

Restart the Feather nRF52 Client for a new run! <<<
Couldn't enable notify for Client CP Measurement Characteristic.
Couldn't enable indicate for Client CP Control Point Characteristic.
Couldn't enable notify for Client CSC Measurement Characteristic.
Couldn't enable notify for Client FTM Training Status Characteristic.
FTMS (trainer) is controlled by another Client (Training App)!
Client (Central) is Up and Running!

BSP Library : 1.3.0
Bootloader : s140 6.1.1
Serial No : C2BA380FAD3CBBC2

--------- SoftDevice Config ---------
Max UUID128 : 10
ATTR Table Size : 4096
Service Changed : 1
Central Connect Setting

  • Max MTU : 23
  • Event Length : 3
  • HVN Queue Size : 1
  • WrCmd Queue Size: 1

--------- BLE Settings ---------
Name : ItsyBitsy nRF52840 Express
Max Connections : Peripheral = 0, Central = 1
Address : E2:AA:F7:E9:06:E0 (Static)
TX Power : 0 dBm
Conn Intervals : min = 20.00 ms, max = 30.00 ms
Conn Timeout : 2000 ms
Central Paired Devices:

Originally posted by @le-joebar in #5 (comment)

Testing Simcline with FTMS v01

New section for Tread testing Simcline with FTMS v01
For a fast feedback (if you want) I created a private group in telegram (here link https://t.me/+FBKaD3Kue2Q5MzM0).
I will delete the link once time you joined it.

Can I close the previous Trainer Elite code section?

correlation between actuator linear vs slope

Dear Jörgen!

I'm back again with a couple questions. First I tried to study the simcline flowchart just to adopt it on my chassis.
I understood the correlation between counts / slope % / VL6180 reads height to target /height of the fork wheel from gound.

I adopted these concepts also on my chassis (aluminum + 3d printed abs) just to create a simple solution without wood.
In general it works well, the flat position is correct but when slope value increases above 3.2% the equipment is not alligned with the software of the trainer.

Inside spreadsheet you can find all values related to VL6180 readings, slopes and wheel support to ground height.

Could you tell me what I'm doing wrong?

Thanks angan for your answers

Best Regards
Filippo

SimCline.xlsx

20211222_130815
20211222_130828

20211222_125421
20211222_125426

20211222_130547
20211222_130554

20211222_130536
20211222_130838
20211222_130843
20211222_130902
20211222_130909

Fail message in Arduino IDE

hi.
im very new at this and this project got me into arduino so here i am struggeling and im getting this messege when compilling the code:

Arduino: 1.8.16 (Windows 7), Board: "Adafruit Feather nRF52832, S132 6.1.1, Level 0 (Release)"

try_one:56:10: fatal error: Lifter.h: No such file or directory

56 | #include <Lifter.h>

  |          ^~~~~~~~~~

compilation terminated.

exit status 1

Lifter.h: No such file or directory

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

FTMS_client code with Jetblack volt trainer using ESP-wroom-32

Hi berg0162,
I get "Client Reads HR Location Sensor:Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled." error when I try to run the ftms_client code. I have pasted the serial monitor output below of the full cycle everytime the board reboots. I also tried the FTMS_server code and it works just fine. Let me know if you need more information to find out why it is not working with my particular set up. Thank you in advance.

-> Client Reads Device Name: [Volt]
-> Client Reads Appearance: [1152]
Client Device Information Service: Found!
-> Client Reads Manufacturer Name: [JetBlack]
-> Client Reads Model Number: [05]
-> Client Reads Serial Number: [828]
Client_CyclingPower_Service: Found!
Client_CP_Measurement_Chr: Found!
Client_CP_Feature_Chr: Found!
-> Client Reads Raw CP Feature bytes: [4] [ 0C 00 00 00 ]
Wheel revolution data supported
Crank revolution data supported
Client_CP_Location_Chr: Found!
-> Client Reads HR Location Sensor:Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x4009140c PS : 0x00060c30 A0 : 0x8011ae48 A1 : 0x3ffc85d0
A2 : 0xff00ffff A3 : 0xff00fffb A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x3ffc8a06
A10 : 0x3ffc8a03 A11 : 0x3ffc87d1 A12 : 0x00000003 A13 : 0x00000001
A14 : 0x00060e20 A15 : 0x00000001 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0xff00ffff LBEG : 0x4009142d LEND : 0x4009143d LCOUNT : 0xffffffff

Backtrace: 0x40091409:0x3ffc85d0 0x4011ae45:0x3ffc85e0 0x40121e7a:0x3ffc88f0 0x40121eb6:0x3ffc8980 0x400e6e46:0x3ffc89c0 0x400d25fa:0x3ffc8a60 0x400d34fc:0x3ffc8ab0 0x400d3552:0x3ffc8ad0 0x400e7ab9:0x3ffc8b10

ELF file SHA256: 22369bb919dc67f3

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
ESP32 BLE Client/Central: CPS, CSC, HBM and FTMS
------------------- Version 01.0 --------------------
Client Starts Scanning for Server Device with CPS, CSC and FTMS!
BLE Advertised Device found: Name: , Address: 52:13:3e:f4:ba:09, manufacturer data: 4c001005231828fa3f, txPower: 7
BLE Advertised Device found: Name: , Address: 40:a0:23:a6:b2:78, manufacturer data: 4c001005171857574b, txPower: 11
BLE Advertised Device found: Name: Volt, Address: ed:84:37:e2:f5:e5, appearance: 1152, serviceUUID: 0x1826
Service Data:
UUID: 0x1826, Data: �
Client Connection Parameters -> Interval: [40] Latency: [0] Supervision Timeout: [256]
ESP32 Client connected to Server device with Name: [Volt] MAC Address: [ED:84:37:E2:F5:E5] MTU: [244]
Now checking all Client Services and Characteristics!
If Mandatory Services Fail --> the Client will disconnect!
Client Generic Access: Found!
-> Client Reads Device Name: [Volt]
-> Client Reads Appearance: [1152]

294 error line: **expected unqualified-id before '.' token**

I'm trying to load the file ino on nFR52 board.
After installing all libraries need the program is stopped at line 294: Lifter.Init(actuatorOutPin1, actuatorOutPin2, MINPOSITION, MAXPOSITION, BANDWIDTH);
for this msg:
exit status 1
expected unqualified-id before '.' token

I would like to verify the comunucation with my trainer (TACX Smart Genius) before to buy the other components.

Could you help me. I'm a beginner
.

Thansk a lot for your kindly feedback and contribution for this project.

Best Regards
cherryphilip@74

Simcline FTMS with Elite Direto

Please post here when you come across any erratic behavior of the Simcline FTMS when connected with an Elite Direto Trainer!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.