CAN Bus is the primary interface for communicating with Tinymovr. The physical and data link interface adheres to the CAN 2.0 standard. Tinymovr exposes to CAN all communication endpoints defined in firmware.
By default, the CAN baud rate is set to 1Mbit/s. This is customizable both through CAN as well as through UART. See can_config. Possible values are 125kbit/s, 250kbit/s, 500kbit/s and 1Mbit/s.
The 11-bit identifier of the CAN frame is used for device and endpoint identification. The 5 least significant bits of the identifier are reserved for endpoints, and the 6 most significant bits for device identification. This suggests that the total number of addressable endpoints in a single device are 32, and the total number of addressable devices are 64.
For a detailed description, please see API Reference.
As an alternative to CAN Bus, Tinymovr offers UART-based (serial) communication. The protocol is much simpler than can and mainly designed for troubleshooting or testing in the absence of CAN hardware.
The UART port on Tinymovr is NOT 5V tolerant. Applying 5V voltage will immediately damage the onboard PAC5527 controller. Please use only 3.3V for UART communication.
The UART port is TTL at 115200 baud. A regular FTDI-style USB to UART adapter should be sufficient.
UART communication is based on a simple human-readable protocole dubbed the “dot protocol”, because the dot is the command starting character. The protocol is response-only, meaning that Tinymovr will only respond to commands initiated by the client, it will never initiate a transmission on it’s own.
The command template is as follows:
The command begins with a dot. The next single character identifies the command. The characters following the second one are optional values to pass to write commands. Read commands only include the dot and command character. The command is finalized with a newline character (n, not shown above).
For instance, to get the current position estimate:
command: .p response: 1000
To set the velocity estimate in encoder ticks:
command: .V10000 (no response)
The values passed or returned are always integers scaled by the appropriate factor (see command reference below).
Note that command characters are case-sensitive, i.e. capitals and small represent different commands. As a convention, capital letters are setters and small are getters, where applicable.
Transition to idle state.
Transition to calibration state.
Transition to close loop control state.
Get the error code.
Get position estimate (ticks).
Get velocity estimate (ticks/s).
Get current (Iq) estimate (mA).
Get/set position setpoint (ticks).
Get/set velocity setpoint (ticks/s).
Get/set current (Iq) setpoint (mA).
Get/set velocity integrator gain (x0.001).
Note that high values (e.g. above 10) may cause instability.
Get motor phase resistance (mOhm).
Get motor phase inductance (μH).
Reset the MCU.
Save board configuration.
Erase board configuration and reset.