Changes for page LSS Communication Protocol
Last modified by Eric Nantel on 2025/06/06 07:47
Change comment: There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -7,7 +7,7 @@ 7 7 8 8 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. 9 9 10 -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 theConfigureID,or "CID" command[[here>>doc:||anchor="HIdentificationNumber28ID29"]]). Only the servo(s) which have beenconfigured toaspecificIDwillact onacommandsentto thatID. There is currently no CRC or checksum implemented as part of the protocol.10 +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 CID [[here>>doc:||anchor="HIdentificationNumber28ID29"]]). Once this has been done, only the servo(s) which have been assigned to the ID sent as part of the command will follow that command. There is currently no CRC or checksum implemented as part of the protocol. 11 11 12 12 == Session == 13 13 ... ... @@ -15,21 +15,21 @@ 15 15 <div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt"> 16 16 A "session" is defined as the time between when the servo is powered ON to when it is powered OFF or reset.<div class="wikimodel-emptyline"></div> 17 17 18 -**Note 1:** For a given session, the action related to a specific command overrides the stored value in EEPROM.<div class="wikimodel-emptyline"></div> 19 -**Note 2:** During the power-on / reset process the LSS cannot accept commands for a small amount of time ( ~1.25 s).<div class="wikimodel-emptyline"></div>20 - **Note 3:**You can ensure the LSS is ready by using a query command to check for response (ex: #[id]Q\r or #[id]QID\rdescribed below). If the LSS is ready for commands (initialized) it will respond to the query. A timeout between 50-100 ms is recommended to compensate for drivers, OS and buffering delays.18 +**Note #1:** For a given session, the action related to a specific command overrides the stored value in EEPROM.<div class="wikimodel-emptyline"></div> 19 +**Note #2:** During the power-on / reset process the LSS cannot accept commands for a small amount of time (1.25 s).<div class="wikimodel-emptyline"></div> 20 +You can ensure the LSS is ready by using a query command to check for response (ex: #[id]Q\r or #[id]QID\r). If the LSS is ready for commands (initialized) it will respond to the query. A timeout between 50-100 ms is recommended to compensate for drivers, OS and buffering delays. 21 21 <div class="wikimodel-emptyline"></div></div></div> 22 22 {{/html}} 23 23 24 24 == Action Commands == 25 25 26 -{{html clean="false" wiki="true"}}26 +{{html wiki="true" clean="false"}} 27 27 <div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt"> 28 -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>>||anchor="HVirtualAngularPosition"]] (described below). Action commands are sent serially to the servo's Rx pin and must be sent in the following format:<div class="wikimodel-emptyline"></div>28 +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>>||anchor="HVirtualAngularPosition"]]. Action commands are sent serially to the servo's Rx pin and must be sent in the following format:<div class="wikimodel-emptyline"></div> 29 29 30 30 1. Start with a number sign **#** (Unicode Character: U+0023) 31 -1. Servo ID number as an integer (assigning an ID described below)32 -1. Action command (one or more letters, no whitespace, capital or lowercase from the list below)31 +1. Servo ID number as an integer 32 +1. Action command (one or more letters, no whitespace, capital or lower case) 33 33 1. Action value in the correct units with no decimal 34 34 1. End with a carriage return **\r** or **<cr>** Unicode Character (U+000D) 35 35 ... ... @@ -42,15 +42,15 @@ 42 42 43 43 == Modifiers == 44 44 45 -{{html clean="false" wiki="true"}}45 +{{html wiki="true" clean="false"}} 46 46 <div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt"> 47 47 Modifiers can only be used with certain **action commands**. The format to include a modifier is:<div class="wikimodel-emptyline"></div> 48 48 49 49 1. Start with a number sign **#** (Unicode Character: U+0023) 50 50 1. Servo ID number as an integer 51 -1. Action command (one to three letters, no spaces, capital or lower casefrom a subset of action commandsbelow)51 +1. Action command (one to three letters, no spaces, capital or lower case) 52 52 1. Action value in the correct units with no decimal 53 -1. Modifier command (one or twolettersfromhelistof modifiersbelow)53 +1. Modifier command (one letter to too letters) 54 54 1. Modifier value in the correct units with no decimal 55 55 1. End with a carriage return **\r** or **<cr>** Unicode Character (U+000D) 56 56 ... ... @@ -62,7 +62,7 @@ 62 62 63 63 == Query Commands == 64 64 65 -{{html clean="false" wiki="true"}}65 +{{html wiki="true" clean="false"}} 66 66 <div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt"> 67 67 Query commands request information from the servo. They are received via the Rx pin of the servo, and the servo's reply is sent via the servo's Tx pin. Using separate lines for Tx and Rx is called "full duplex". Query commands are also similar to action and configuration commands and must use the following format:<div class="wikimodel-emptyline"></div> 68 68 ... ... @@ -71,7 +71,7 @@ 71 71 1. Query command (one to four letters, no spaces, capital or lower case) 72 72 1. End with a carriage return **\r** or **<cr>** Unicode Character (U+000D)<div class="wikimodel-emptyline"></div> 73 73 74 -Ex: #5QD<cr> Query theposition in (tenth of) degrees for servowith ID#5<div class="wikimodel-emptyline"></div>74 +Ex: #5QD<cr> Query position in (tenth of) degrees for servo #5<div class="wikimodel-emptyline"></div> 75 75 76 76 The query will return a serial string (almost instantaneously) via the servo's Tx pin with the following format: 77 77 ... ... @@ -91,11 +91,11 @@ 91 91 92 92 == Configuration Commands == 93 93 94 -{{html clean="false" wiki="true"}}94 +{{html wiki="true" clean="false"}} 95 95 <div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt"> 96 96 Configuration commands and corresponding values affect a servo's defaults which are written to and read from the servo's EEPROM.<div class="wikimodel-emptyline"></div> 97 97 98 -These configurations are retained in memory after the servo is reset or power is cut / lost. Some configuration commands affect the session, while others do not. In the Command table below, the column "Session" denotes if the configuration command affects the session. Not all action commands have a corresponding configuration command and vice versa. More information about which configuration commands are retained when in RC mode can be found on the [[LSS - RC PWM page>>doc:lynxmotion-smart-servo.lss-radio-control-pwm.WebHome]]. Configuration commands are not cumulative. This means that if two of thesame configuration commands are sent, one after the next, only the last configuration is used and stored.<div class="wikimodel-emptyline"></div>98 +These configurations are retained in memory after the servo is reset or power is cut / lost. Some configuration commands affect the session, while others do not. In the Command table below, the column "Session" denotes if the configuration command affects the session. Not all action commands have a corresponding configuration command and vice versa. More information about which configuration commands are retained when in RC mode can be found on the [[LSS - RC PWM page>>doc:lynxmotion-smart-servo.lss-radio-control-pwm.WebHome]]. Configuration commands are not cumulative. This means that if two same configuration commands are sent, one after the next, only the last configuration is used and stored.<div class="wikimodel-emptyline"></div> 99 99 100 100 The format to send a configuration command is identical to that of an action command:<div class="wikimodel-emptyline"></div> 101 101 ... ... @@ -189,13 +189,13 @@ 189 189 | |[[**G**yre Direction>>||anchor="HGyreDirection28G29"]]|(% style="text-align:center" %)G|(% style="text-align:center" %)QG|(% style="text-align:center" %)CG|(% style="text-align:center" %)✓|(% style="text-align:center" %)✓|1| |Gyre / rotation direction: 1= CW (clockwise) -1 = CCW (counter-clockwise) 190 190 | |[[**F**irst Position (**D**eg)>>||anchor="HFirstPosition"]]|(% style="text-align:center" %) |(% style="text-align:center" %)QFD|(% style="text-align:center" %)CFD|(% style="text-align:center" %)✓|(% style="text-align:center" %)✓|No value|1/10°|Reset required after change. 191 191 | |[[**M**aximum **M**otor **D**uty>>||anchor="HMaximumMotorDuty28MMD29"]]|(% style="text-align:center" %)MMD|(% style="text-align:center" %)QMMD|(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %)✓|1023|255 to 1023 integer| 192 -| |[[Maximum **S**peed in **D**egrees>>||anchor="HMaximumSpeedinDegrees28SD29"]]|(% style="text-align:center" %)SD|(% style="text-align:center" %)QSD|(% style="text-align:center" %)CSD|(% style="text-align:center" %)✓|(% style="text-align:center" %)✓|Max| 0.1°/s|SD overwrites SR / CSD overwrites CSR and vice-versa192 +| |[[Maximum **S**peed in **D**egrees>>||anchor="HMaximumSpeedinDegrees28SD29"]]|(% style="text-align:center" %)SD|(% style="text-align:center" %)QSD|(% style="text-align:center" %)CSD|(% style="text-align:center" %)✓|(% style="text-align:center" %)✓|Max|°/s|SD overwrites SR / CSD overwrites CSR and vice-versa 193 193 | |[[Maximum **S**peed in **R**PM>>||anchor="HMaximumSpeedinRPM28SR29"]]|(% style="text-align:center" %)SR|(% style="text-align:center" %)QSR|(% style="text-align:center" %)CSR|(% style="text-align:center" %)✓|(% style="text-align:center" %)✓|Max|RPM|SD overwrites SR / CSD overwrites CSR and vice-versa 194 194 195 195 |(% colspan="10" style="color:orange; font-size:18px" %)[[**Modifiers**>>||anchor="HModifiers"]] 196 196 |(% style="width:25px" %) |(% style="width:200px" %)**Description**|(% style="text-align:center; width:100px" %)**Modifier**|(% style="text-align:center; width:75px" %)**Query**|(% style="text-align:center; width:75px" %)**Config**|(% style="text-align:center; width:75px" %)**RC**|(% style="text-align:center; width:75px" %)**Serial**|(% style="width:100px" %)**Default**|(% style="width:170px" %)**Unit**|**Notes** 197 197 | |[[**S**peed>>||anchor="HSpeed28S2CSD29modifier"]]|(% style="text-align:center" %)S|(% style="text-align:center" %)QS|(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %)✓| |uS/s |For P action command 198 -| |[[**S**peed in **D**egrees>>||anchor="HSpeed28S2CSD29modifier"]]|(% style="text-align:center" %)SD|(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %)✓| | 0.1°/s|For D and MD action commands198 +| |[[**S**peed in **D**egrees>>||anchor="HSpeed28S2CSD29modifier"]]|(% style="text-align:center" %)SD|(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %)✓| |°/s|For D and MD action commands 199 199 | |[[**T**imed move>>||anchor="HTimedmove28T29modifier"]]|(% style="text-align:center" %)T|(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %)✓| |ms|Modifier only for P, D and MD. Time can change based on load 200 200 | |[[**C**urrent **H**old>>||anchor="HCurrentHalt26Hold28CH29modifier"]]|(% style="text-align:center" %)CH|(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %)✓| |mA|Modifier for D, MD, WD and WR 201 201 | |[[**C**urrent **L**imp>>||anchor="HCurrentLimp28CL29modifier"]]|(% style="text-align:center" %)CL|(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %) |(% style="text-align:center" %)✓| |mA|Modifier for D, MD, WD and WR ... ... @@ -212,7 +212,7 @@ 212 212 |(% colspan="10" style="color:orange; font-size:18px" %)[[**RGB LED**>>||anchor="HRGBLED"]] 213 213 |(% style="width:25px" %) |(% style="width:200px" %)**Description**|(% style="text-align:center; width:100px" %)**Action**|(% style="text-align:center; width:75px" %)**Query**|(% style="text-align:center; width:75px" %)**Config**|(% style="text-align:center; width:75px" %)**RC**|(% style="text-align:center; width:75px" %)**Serial**|(% style="width:100px" %)**Default**|(% style="width:170px" %)**Unit**|**Notes** 214 214 | |[[**LED** Color>>||anchor="HLEDColor28LED29"]]|(% style="text-align:center" %)LED|(% style="text-align:center" %)QLED|(% style="text-align:center" %)CLED|(% style="text-align:center" %)✓|(% style="text-align:center" %)✓| |0 to 7 integer|0=Off; 1=Red; 2=Green; 3=Blue; 4=Yellow; 5=Cyan; 6=Magenta; 7=White 215 -| |[[**C**onfigure **L**ED **B**linking>>||anchor="HConfigureLEDBlinking28CLB29"]]|(% style="text-align:center" %) |(% style="text-align:center" %) 215 +| |[[**C**onfigure **L**ED **B**linking>>||anchor="HConfigureLEDBlinking28CLB29"]]|(% style="text-align:center" %) |(% style="text-align:center" %)QLB|(% style="text-align:center" %)CLB|(% style="text-align:center" %)✓|(% style="text-align:center" %)✓| |0 to 63 integer|Reset required after change. See command for details. 216 216 217 217 = (% style="color:inherit; font-family:inherit" %)Details(%%) = 218 218 ... ... @@ -313,9 +313,9 @@ 313 313 314 314 ====== __Baud Rate__ ====== 315 315 316 -{{html clean="false" wiki="true"}}316 +{{html wiki="true" clean="false"}} 317 317 <div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt"> 318 -A servo's baud rate cannot be set "on the fly" and must be configured via the CB command described below. The factory default baud rate for all servos is 115200. Since smart servos are intended to be daisy chained, in order to respond to the same serial command, all servos in a project should be set to the same baud rate. Setting different baud rates will have the servos respond differently and may create issues. Available baud rates are: 9600 bps, 19200 bps, 38400 bps, 57600 bps, 115.2 kbps, 230.4 kbps, 250.0 kbps, 460.8 kbps, 500.0 kbps , 750.0kbps, 921.6 kbps.Servos are shipped with a baud rate set to 115200.<div class="wikimodel-emptyline"></div>318 +A servo's baud rate cannot be set "on the fly" and must be configured via the CB command described below. The factory default baud rate for all servos is 115200. Since smart servos are intended to be daisy chained, in order to respond to the same serial command, all servos in a project should be set to the same baud rate. Setting different baud rates will have the servos respond differently and may create issues. Available baud rates are: 9600 bps, 19200 bps, 38400 bps, 57600 bps, 115.2 kbps, 230.4 kbps, 250.0 kbps, 460.8 kbps, 500.0 kbps. Servos are shipped with a baud rate set to 115200.<div class="wikimodel-emptyline"></div> 319 319 320 320 Query Baud Rate (**QB**)<div class="wikimodel-emptyline"></div> 321 321 ... ... @@ -333,14 +333,6 @@ 333 333 </div></div> 334 334 {{/html}} 335 335 336 -====== __Automatic Baud Rate__ ====== 337 - 338 -{{html clean="false" wiki="true"}} 339 -<div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt"> 340 -A servo's baud rate cannot be set "on the fly" and must be configured via the CB command described below. The factory default baud rate for all servos is 115200. Since smart servos are intended to be daisy chained, in order to respond to the same serial command, all servos in a project should be set to the same baud rate. Setting different baud rates will have the servos respond differently and may create issues. Available baud rates are: 9600 bps, 19200 bps, 38400 bps, 57600 bps, 115.2 kbps, 230.4 kbps, 250.0 kbps, 460.8 kbps, 500.0 kbps, 750.0 kbps, 921.6 kbps. Servos are shipped with a baud rate set to 115200.<div class="wikimodel-emptyline"></div> 341 -</div></div> 342 -{{/html} 343 - 344 344 == Motion == 345 345 346 346 ====== __Position in Degrees (**D**)__ ====== ... ... @@ -472,7 +472,7 @@ 472 472 | |ex: *5Q3<cr>|3: Accelerating|Increasing speed from rest (or previous speed) towards travel speed 473 473 | |ex: *5Q4<cr>|4: Traveling|Moving at a stable speed 474 474 | |ex: *5Q5<cr>|5: Decelerating|Decreasing from travel speed towards final position. 475 -| |ex: *5Q6<cr>|6: Holding|Keeping current position (in EM0 mode, return will nornally be holding)467 +| |ex: *5Q6<cr>|6: Holding|Keeping current position 476 476 | |ex: *5Q7<cr>|7: Outside limits|{More details coming soon} 477 477 | |ex: *5Q8<cr>|8: Stuck|Motor cannot perform request movement at current speed setting 478 478 | |ex: *5Q9<cr>|9: Blocked|Similar to stuck, but the motor is at maximum duty and still cannot move (i.e.: stalled) ... ... @@ -518,20 +518,16 @@ 518 518 519 519 ====== __Enable Motion Profile (**EM**)__ ====== 520 520 521 -{{html clean="false" wiki="true"}}513 +{{html wiki="true" clean="false"}} 522 522 <div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt"> 523 -EM1 (Enable Motion Profile #1) is the default mode of the LSS and is an easy way to control the servo's position with a single (serial) position command. This mode uses a trapezoidal motion profile which takes care of acceleration, constant speed travel and deceleration. Once the actual position is within a certain value of the target, it switches to a holding algorithm. The LSS commands for Angular Acceleration and Deceleration (AA/CAA/AD/CAD) Angular Stiffness (AS/CAS) and Angular holding stiffness (AH/CAH) affect this motion profile. Modifiers like SD/S and T can be used in EM1.<div class="wikimodel-emptyline"></div> 524 - 525 525 Ex: #5EM1<cr><div class="wikimodel-emptyline"></div> 526 526 527 -This command enables a trapezoidal motion profile for servo #5<div class="wikimodel-emptyline"></div>517 +This command enables a trapezoidal motion profile. By default, the trapezoidal motion profile is enabled. If the motion profile is enabled, angular acceleration (AA) and angular deceleration(AD) will have an effect on the motion. Also, SD/S and T modifiers can be used.<div class="wikimodel-emptyline"></div> 528 528 529 529 Ex: #5EM0<cr><div class="wikimodel-emptyline"></div> 530 530 531 -This command will disable the built-in trapezoidal motion profile. As such, the servo will move at full speedtothe targetposition using theD/MD action commands.Modifierslike SD/S orT cannot beused in EM0 mode. By default theFilterPositionCounter,or "FPC" isactive inEM0 modeto smooth out its operation. EM0 is suggested for applications wherean external controller will bedetermining all incrementalintermediate positionsoftheservo's motion,effectivelyreplacing a trajectory manager.Topreventhaving tosendpositioncommands continuouslytoreachthedesiredpositionin EM0/FPCactive(FPC>= 2),aninternal positionengine(IPE) repeatsthe last position command. Note that in EM0 mode, the servo willeffectivelyalways beinstatus: Holding (if using thequery status command).521 +This command will disable the trapezoidal motion profile. As such, the servo will move at full speed for D/MD action commands. Angular acceleration (AA) and angular deceleration(AD) won't have an effect on motion in this mode and modifiers SD/S or T cannot be used.<div class="wikimodel-emptyline"></div> 532 532 533 -<div class="wikimodel-emptyline"></div> 534 - 535 535 Query Motion Profile (**QEM**)<div class="wikimodel-emptyline"></div> 536 536 537 537 Ex: #5QEM<cr> might return *5QEM1<cr><div class="wikimodel-emptyline"></div> ... ... @@ -548,10 +548,8 @@ 548 548 549 549 ====== __Filter Position Count (**FPC**)__ ====== 550 550 551 -{{html clean="false" wiki="true"}}539 +{{html wiki="true" clean="false"}} 552 552 <div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt"> 553 -The FPC value relates to the depth of a first order filter (exponential weighted average) over the position change. This has the effect of slowing down both acceleration and deceleration while still allowing the LSS to try to reach the desired position at maximum power at all times. A smaller FPC value will reduce the smoothing effect and a larger value will increase it. To prevent having to send position commands continuously to reach the desired position in EM0/FPC active (FPC >= 2), an internal position engine (IPE) has been put in place, which is also active by default. 554 -<div class="wikimodel-emptyline"></div> 555 555 Ex: #5FPC10<cr><div class="wikimodel-emptyline"></div> 556 556 This command allows the user to change the Filter Position Count value for that session. <div class="wikimodel-emptyline"></div> 557 557 ... ... @@ -787,7 +787,7 @@ 787 787 788 788 Ex: #5QMMDD<cr> might return *5QMMD512<cr> <div class="wikimodel-emptyline"></div> 789 789 790 -This command returns theconfigured limit ofthedutycyclevaluesentfrom theservo'sMCUtotheMotorController.Thedefault valueis1023.776 +This configuration command means the servo, when set to smart mode, will immediately move to 90.0 degrees upon power up. Sending a CFD command without a number (Ex. #5CFD<cr>) results in the servo remaining limp upon power up. In order to remove the first position, send no value, ex: #5CFD<cr> 791 791 <div class="wikimodel-emptyline"></div></div></div> 792 792 {{/html}} 793 793 ... ... @@ -847,12 +847,12 @@ 847 847 848 848 ====== __Speed (**S**, **SD**) modifier__ ====== 849 849 850 -{{html clean="false" wiki="true"}}836 +{{html wiki="true" clean="false"}} 851 851 <div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt"> 852 852 Example: #5P1500S750<cr><div class="wikimodel-emptyline"></div> 853 853 Modifier (S) is only for a position (P) action and determines the speed of the move in microseconds per second. A speed of 750 microseconds would cause the servo to rotate from its current position to the desired position at a speed of 750 microseconds per second. This command is in place to ensure backwards compatibility with the SSC-32 / 32U protocol.<div class="wikimodel-emptyline"></div> 854 854 Example: #5D0SD180<cr><div class="wikimodel-emptyline"></div> 855 -Modifier (SD) is only for a position (D) or relative position (MD) action and determines the speed of the move in tenths ofdegrees per second. A speed modifier (SD) of 180 would cause the servo to rotate from its current position to the desired absolute or relative position at a speed of 18 degrees per second.<div class="wikimodel-emptyline"></div>841 +Modifier (SD) is only for a position (D) or relative position (MD) action and determines the speed of the move in degrees per second. A speed modifier (SD) of 180 would cause the servo to rotate from its current position to the desired absolute or relative position at a speed of 180 degrees per second.<div class="wikimodel-emptyline"></div> 856 856 Query Speed (**QS**)<div class="wikimodel-emptyline"></div> 857 857 Example: #5QS<cr> might return *5QS300<cr><div class="wikimodel-emptyline"></div> 858 858 This command queries the current speed in microseconds per second.<div class="wikimodel-emptyline"></div>