8 ‐ Technical Information - xdream-biking/trixter-xdream-bike GitHub Wiki

Serial Communications

Telemetry from Bike

The data comes in from the serial port at baud rate 115200 as 32-character text strings of characters 0-9 and a-f (lower case), i.e. hexadecimal text for 16 bytes. The bike this was measured on delivers packets at a rate of about 1 every 13ms (although this timing could be an artifact of the way of measuring).

Many thanks to the author of this repo for a helpful start.

                                     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
          (00) Header (0x6a) --------+  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
          (01) Steering ----------------+  |  |  |  |  |  |  |  |  |  |  |  |  |  |
          (02) Unknown (0x80)--------------+  |  |  |  |  |  |  |  |  |  |  |  |  |
          (03) Crank position ----------------+  |  |  |  |  |  |  |  |  |  |  |  |
          (04) Right brake ----------------------+  |  |  |  |  |  |  |  |  |  |  |
          (05) Left brake --------------------------+  |  |  |  |  |  |  |  |  |  |
          (06) Unknown (0xff)--------------------------+  |  |  |  |  |  |  |  |  |
          (07) Unknown (0xff)-----------------------------+  |  |  |  |  |  |  |  |
          (08) Button flags ---------------------------------+  |  |  |  |  |  |  |
          (09) Button flags ------------------------------------+  |  |  |  |  |  |
          (0A) Crank revolution time (high byte) ------------------+  |  |  |  |  |
          (0B) Crank revolution time (low byte) ----------------------+  |  |  |  |
          (0C) Flywheel Revolution Time (high byte) ---------------------+  |  |  |
          (0D) Flywheel Revolution Time (low byte) -------------------------+  |  |
          (0E) Heart rate (BPM) -----------------------------------------------+  |
          (0F) XOR of 00 to 0E----------------------------------------------------+
  • Header is always 0x6a
  • Steering [0, 255]
  • Crank Position [1,60]
  • Left Brake [135, 250] (250 when released)
  • Right Brake [135, 250] (250 when released)
  • Button Flags are a bitmapped field. See XDreamControllerButtons.cs
  • Flywheel revolution time F: RPM = 600000/F approximately.
  • Crank revolution time C: RPM = 1/(C * 0.000006) approximately.
  • Heart rate is in beats per minute.
  • Unknowns 02, 06, 07 are always 128, 255 and 255.
  • 0F is the XOR of the first 15 bytes.

Button flags combined into 1 16-bit unsigned integer and subtracted from 65535 form a bitmapped field:

None = 0
Seated = 8

BackGearUp = 32
BackGearDown = 64
FrontGearUp = 32768
FrontGearDown = 128

LeftArrow = 4096
RightArrow = 16384
UpArrow = 256
DownArrow = 1024

Blue = 8192
Red = 512
Green = 2048

Resistance Request to Bike

Resistance is sent to the bike in a 6-byte block of data, not rendered to text like the incoming data.

X-Dream has been measured to produce these at 60-64 per second when the required resistance level is non-zero. If the information is not sent to the bike, it drops its resistance back to 0.

There are 251 resistance levels: 0 to 250. Each resistance packet is as follows:

                    6a 00 00 00 00 00
00 Header (0x6a) ----+  |  |  |  |  |
01 Level (0..0xFA)------+  |  |  |  |
02 (Level+0x3C)%0xFF ------+  |  |  |
03 (Level+0x5A)%0xFF ---------+  |  |
04 (Level+0x78)%0xFF ------------+  |
05 XOR of 00..04 -------------------+

Diagnostic Utilities

There are 2 diagnostic applications supplied with the original X-Dream software:

  • The X-Dream Test console application
  • The Trixter Diagnostics application

The X-Dream Test Console Application

This is a console application that reads the COM2 port and interprets the signal coming from the bike, displaying the numbers in a simple text display:

image

You can also use the up and down buttons to adjust the flywheel resistance.

Aside from installing the PL-2303 driver, this console application has no special requirements for installation.

The Trixter Diagnostics Application

This application shows animated icons and graphs depicting the state of the bike. Unlike the console application, it lacks the numeric value for the steering.

image

This application can be found in the “Trixter Additional Apps\Diagnostics” folder. The executable is TrixterDiagnostics.exe. You may need to install the Visual Studio 2005 C++ Runtime

This application requires a registry key in the current user’s hive (local machine hive doesn’t work). Create a text file called trixter.reg with the following content:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Trixter]
[HKEY_CURRENT_USER\Software\Trixter\X Dream Biking]
"Trixter Install Path"="C:\\Program Files\\Trixter"

Replace the “C:\Program Files\Trixter” with the actual path to the Trixter folder, being careful to use double-backslashes. Save the file. Right click the file and select “Merge” and click yes to the dialog boxes asking you to confirm.