How to Log Cycle Analyst USB Data on the Cheap
One of the nice Cycle Analyst features is data logging via the serial TTL port at either a 1Hz or 5Hz rate. This capability is expanded in V3 which offers additional data columns. Although Grin Technologies offers the Cycle Analogger to log this serial data, many find it a bit of a challenge to justify financially - particularly for limited use for tuning or curiosity. Fortunately, there is nothing special about the data stream and other inexpensive logging options are readily available. Here's a quick rundown of the data and how to capture it for no more than $5...
The Data
The CA V3 outputs the following data in <tab> separated format - ready for import into spreadsheet apps for manipulation and plotting (Excel, free Open Office, etc). The V2 log is similar - just fewer columns and flags...
View attachment UsbTerminal_2015_12_09.txt
The Interface Specification
The CA uses a serial port at TTL levels (0-5V) that runs at 9600 baud, 1 start bit, 8 data bits, 1 stop bit, no parity, and no handshake. Logging the data requires no program intelligence for flow control and is simply a matter of picking off the data bytes as they arrive. This same serial interface is used to download firmware and update Setup configuration by means of a USB-to-TTL serial cable.
The Cheapest Hardware Interface
Although there are posts that pursue use of Bluetooth connection to the CA as a means of accessing the data stream, the least expensive approach is to simply use the existing Grin Tech USB-to-TTL serial cable and driver to get data out instead of putting firmware in. This requires no special configuration of the CA and provides the log data stream in a convenient format via a standard USB connection to any device that has an FTDI USB driver.
PC Data Logging
On Windows, the USB cable driver installed with the Setup Uitility for firmware updates makes the CA data appear on a conventional (virtual) COM port. There are many free applications available that can capture and analyze serial port data. However, for simple data logging it's really only necessary to capture the stream - not analyze it - which makes a 'serial terminal emulator' a pretty good choice since these typically provide session logging as a feature - exactly what is needed.
The Unix utility 'putty' is an easy choice if you are running Linux. It is also available for Windows as 'PuTTy' (link). PuTTY lets you setup and store session/port configuration so you can open the CA connection and begin logging with a single click.
Although a PC is certainly handy for bench testing, a laptop stuffed in a backpack is perfectly workable for a few data collections on a frequently used commute or to test some controller or motor changes. Many investigations are one-time affairs and the inconvenience of a laptop is inconsequential compared to obtaining the data.
Android Phone/Tablet Logging
Android phones can be hooked up using the same strategy as the PC technique: plug in the USB cable and run a serial terminal emulator. Rooting the device is not required.
The tiny mini or micro USB connector on the phone or tablet simply needs a straight-through adapter to allow connection of the standard CA programming cable. These are readily available as 'USB OTG (On the Go) cables for about $5 - (search Amazon, etc). They have no electronics and just change the connector sex:
Plug the standard CA programming cable from the CA to the USB OTG cable and the 'electronics' part is done ( Whew! ).
Next choose a USB terminal emulator - one free example is 'USB Terminal' from the Play Store (link) which supports FTDI cables. Load up the app, configure the logging and data protocol options mentioned above then turn on the CA. Log data will begin scrolling down the screen and to the log file. Unfortunately (for this particular app), the CA <tab> column separator is not displayed on the screen, but importantly, it is passed through to the data log file. Log data can be retrieved in the same fashion as photos, etc. Either transfer the files to a cloud drive, pull the SD card, or use a conventional USB cable to connect to a PC and extract the files device-to-device.
While this direct-connect approach doesn't offer the flash and convenience of a bluetooth connection, the price is right. The standard CA programming cable is very long and easily allows the phone/tablet to be placed in a pocket, backpack, or in a trunk bag on the rack. This is a nice solution for occasional use to evaluate/compare tuning and cooling experiments where ongoing daily convenience is really not a determining consideration.
So - no more excuses - put your CA and programming cable to work and get logging!!!
One of the nice Cycle Analyst features is data logging via the serial TTL port at either a 1Hz or 5Hz rate. This capability is expanded in V3 which offers additional data columns. Although Grin Technologies offers the Cycle Analogger to log this serial data, many find it a bit of a challenge to justify financially - particularly for limited use for tuning or curiosity. Fortunately, there is nothing special about the data stream and other inexpensive logging options are readily available. Here's a quick rundown of the data and how to capture it for no more than $5...
The Data
The CA V3 outputs the following data in <tab> separated format - ready for import into spreadsheet apps for manipulation and plotting (Excel, free Open Office, etc). The V2 log is similar - just fewer columns and flags...
- Ah
- Volts
- Amps
- Speed
- Distance
- DegC
- RPM (cadence)
- Human Watts
- Nm (rider torque)
- ThrIn Volts
- ThrOut Volts
- Acceleration
- Flags (preset #, Thr Fault, Ebrake, LVC, Limit flags)
View attachment UsbTerminal_2015_12_09.txt
The Interface Specification
The CA uses a serial port at TTL levels (0-5V) that runs at 9600 baud, 1 start bit, 8 data bits, 1 stop bit, no parity, and no handshake. Logging the data requires no program intelligence for flow control and is simply a matter of picking off the data bytes as they arrive. This same serial interface is used to download firmware and update Setup configuration by means of a USB-to-TTL serial cable.
The Cheapest Hardware Interface
Although there are posts that pursue use of Bluetooth connection to the CA as a means of accessing the data stream, the least expensive approach is to simply use the existing Grin Tech USB-to-TTL serial cable and driver to get data out instead of putting firmware in. This requires no special configuration of the CA and provides the log data stream in a convenient format via a standard USB connection to any device that has an FTDI USB driver.
PC Data Logging
On Windows, the USB cable driver installed with the Setup Uitility for firmware updates makes the CA data appear on a conventional (virtual) COM port. There are many free applications available that can capture and analyze serial port data. However, for simple data logging it's really only necessary to capture the stream - not analyze it - which makes a 'serial terminal emulator' a pretty good choice since these typically provide session logging as a feature - exactly what is needed.
The Unix utility 'putty' is an easy choice if you are running Linux. It is also available for Windows as 'PuTTy' (link). PuTTY lets you setup and store session/port configuration so you can open the CA connection and begin logging with a single click.
Although a PC is certainly handy for bench testing, a laptop stuffed in a backpack is perfectly workable for a few data collections on a frequently used commute or to test some controller or motor changes. Many investigations are one-time affairs and the inconvenience of a laptop is inconsequential compared to obtaining the data.
Android Phone/Tablet Logging
Android phones can be hooked up using the same strategy as the PC technique: plug in the USB cable and run a serial terminal emulator. Rooting the device is not required.
The tiny mini or micro USB connector on the phone or tablet simply needs a straight-through adapter to allow connection of the standard CA programming cable. These are readily available as 'USB OTG (On the Go) cables for about $5 - (search Amazon, etc). They have no electronics and just change the connector sex:
Plug the standard CA programming cable from the CA to the USB OTG cable and the 'electronics' part is done ( Whew! ).
Next choose a USB terminal emulator - one free example is 'USB Terminal' from the Play Store (link) which supports FTDI cables. Load up the app, configure the logging and data protocol options mentioned above then turn on the CA. Log data will begin scrolling down the screen and to the log file. Unfortunately (for this particular app), the CA <tab> column separator is not displayed on the screen, but importantly, it is passed through to the data log file. Log data can be retrieved in the same fashion as photos, etc. Either transfer the files to a cloud drive, pull the SD card, or use a conventional USB cable to connect to a PC and extract the files device-to-device.
While this direct-connect approach doesn't offer the flash and convenience of a bluetooth connection, the price is right. The standard CA programming cable is very long and easily allows the phone/tablet to be placed in a pocket, backpack, or in a trunk bag on the rack. This is a nice solution for occasional use to evaluate/compare tuning and cooling experiments where ongoing daily convenience is really not a determining consideration.
So - no more excuses - put your CA and programming cable to work and get logging!!!