LSS-P - Communication Protocol
Page Contents
Serial Protocol
The Lynxmotion Smart Servo (LSS) serial protocol was created in order to be as simple and straightforward as possible from a user perspective ("human readable format"), while at the same time staying compact and robust yet highly versatile. The protocol was based on Lynxmotion's SSC-32 & SSC-32U RC servo controllers and almost everything one might expect to be able to configure for a smart servomotor is available.
In order to be able to control each servo individually with commands, the first step should be to assign a different ID number to each servo (see details on the Configure ID, or "CID" command here). Only the servo(s) which have been configured to a specific ID will act on a command sent to that ID. There is currently no CRC or checksum implemented as part of the protocol.
Action Commands
Action commands tell the servo, within that session, to do something (i.e. "take an action"). The types of action commands which can be sent are described below, and they cannot be combined with other commands such as queries or configurations. Only one action command can be sent at a time. Action commands are session-specific, therefore once a servo is power cycled, it will not have any "memory" of previous actions or virtual positions (described below). Action commands are sent serially to the servo's Rx pin and must be sent in the following format:
- Start with a number sign # (Unicode Character: U+0023)
- Servo ID number as an integer (assigning an ID described below)
- Action command (one or more letters, no whitespace, capital or lowercase from the list below)
- Action value in the correct units with no decimal
- End with a carriage return \r or <cr> Unicode Character (U+000D)
Ex: #5D18000<cr>
This sends a serial command to all servo's RX pins which are connected to the bus and only servo(s) with ID #5 will move to a position (1800 in tenths of degrees) of 180.0 degrees. Any servo on the bus which does not have ID 5 will take no action when receiving this command.
Modifiers
- Start with a number sign # (Unicode Character: U+0023)
- Servo ID number as an integer
- Action command (one to three letters, no spaces, capital or lowercase from a subset of action commands below)
- Action value in the correct units with no decimal
- Modifier command (one or two letters from the list of modifiers below)
- Modifier value in the correct units with no decimal
- End with a carriage return \r or <cr> Unicode Character (U+000D)
- Start with a number sign # (Unicode Character: U+0023)
- Servo ID number as an integer
- Query command (one to four letters, no spaces, capital or lower case)
- End with a carriage return \r or <cr> Unicode Character (U+000D)
- Start with an asterisk * (Unicode Character: U+0023)
- Servo ID number as an integer
- Query command (one to four letters, no spaces, capital letters)
- The reported value in the units described, no decimals.
- End with a carriage return \r or <cr> Unicode Character (U+000D)
- Start with a number sign # (Unicode Character: U+0023)
- Servo ID number as an integer
- Configuration command (two to four letters, no spaces, capital or lower case)
- Configuration value in the correct units with no decimal
- End with a carriage return \r or <cr> Unicode Character (U+000D)
In this example, the gyre direction (explained below, a.k.a. "rotation direction") is positive (clockwise), and origin offset has not been modified. Each square represents 30 degrees. The following command is sent:#1D-300<cr> This causes the servo to move to -30.0 degrees (green arrow)#1D2100<cr> This second position command is sent to the servo, which moves it to 210.0 degrees (orange arrow)#1D-4200<cr> This next command rotates the servo counterclockwise to a position of -420 degrees (red arrow), which means one full rotation of 360 degrees plus 60.0 degrees (420.0 - 360.0), with a virtual position of -420.0 degrees. Although the final physical position would be the same as if the servo were commanded to move to -60.0 degrees, the servo is in fact at -420.0 degrees. #1D4800<cr> This new command is sent which would then cause the servo to rotate from -420.0 degrees to 480.0 degrees (blue arrow), which would be a total of 900 degrees of clockwise rotation, or 2.5 complete rotations. #1D3300<cr> would cause the servo to rotate from 480.0 degrees to 330.0 degrees (yellow arrow).If the servo loses power or is power cycled, it also loses the virtual position associated with that session. For example, if the virtual position was 480.0 degrees before power is cycled, upon power up the servo's position will be read as +120.0 degrees from zero (assuming center position has not been modified). The virtual position range at power-up is [-180.0°, 180.0°].

