Last modified by Eric Nantel on 2024/09/06 14:52

From version < 11.1 >
edited by Coleman Benson
on 2023/06/26 15:03
To version < 12.1 >
edited by Coleman Benson
on 2023/06/27 13:07
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -3,6 +3,7 @@
3 3  
4 4  
5 5  
6 +
6 6  (% class="wikigeneratedid" id="HTableofContents" %)
7 7  **Page Contents**
8 8  
... ... @@ -31,7 +31,7 @@
31 31  
32 32  == Modifiers ==
33 33  
34 -{{html clean="false" wiki="true"}}
35 +{{html clean="false" wiki="true" __cke_selected_macro="true"}}
35 35  <div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt">
36 36  Modifiers can only be used with certain **action commands**. The format to include a modifier is:<div class="wikimodel-emptyline"></div>
37 37  
... ... @@ -47,5 +47,83 @@
47 47  
48 48  This results in the servo with ID #5 rotating to a position (1800 in tenths of degrees) of 180.0 degrees in a time ("T") of 1500 milliseconds (1.5 seconds).<div class="wikimodel-emptyline"></div>
49 49  <div class="wikimodel-emptyline"></div></div></div>
51 +
52 +<div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt">
53 +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>
54 +
55 +1. Start with a number sign **#** (Unicode Character: U+0023)
56 +1. Servo ID number as an integer
57 +1. Query command (one to four letters, no spaces, capital or lower case)
58 +1. End with a carriage return **&#92;r** or **&lt;cr&gt;** Unicode Character (U+000D)<div class="wikimodel-emptyline"></div>
59 +
60 +Ex: #5QD&lt;cr&gt; Query the position in (tenth of) degrees for servo with ID #5<div class="wikimodel-emptyline"></div>
61 +
62 +The query will return a serial string (almost instantaneously) via the servo's Tx pin with the following format:
63 +
64 +1. Start with an asterisk * (Unicode Character: U+0023)
65 +1. Servo ID number as an integer
66 +1. Query command (one to four letters, no spaces, capital letters)
67 +1. The reported value in the units described, no decimals.
68 +1. End with a carriage return **&#92;r** or **&lt;cr&gt;** Unicode Character (U+000D)<div class="wikimodel-emptyline"></div>
69 +
70 +There is currently no option to control how fast a servo replies after it has received a query command, therefore when sending a query command to the bus, the controller should be prepared to immediately "listen" for and parse the reply. Sending multiple queries to multiple servos on a bus in fast succession may result in replies overlapping and giving incorrect or corrupt data. As such, the controller should receive a reply before sending a new query command. A reply to the query sent above might be:<div class="wikimodel-emptyline"></div>
71 +
72 +Ex: *5QD1800&lt;cr&gt;<div class="wikimodel-emptyline"></div>
73 +
74 +This indicates that servo #5 is currently at 180.0 degrees (1800 tenths of degrees).
75 +<div class="wikimodel-emptyline"></div></div></div>
76 +
77 +<div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt">
78 +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>
79 +
80 +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 the same configuration commands are sent, one after the next, only the last configuration is used and stored.<div class="wikimodel-emptyline"></div>
81 +
82 +The format to send a configuration command is identical to that of an action command:<div class="wikimodel-emptyline"></div>
83 +
84 +1. Start with a number sign **#** (Unicode Character: U+0023)
85 +1. Servo ID number as an integer
86 +1. Configuration command (two to four letters, no spaces, capital or lower case)
87 +1. Configuration value in the correct units with no decimal
88 +1. End with a carriage return **&#92;r** or **&lt;cr&gt;** Unicode Character (U+000D)<div class="wikimodel-emptyline"></div>
89 +
90 +Ex: #5CO-50&lt;cr&gt;<div class="wikimodel-emptyline"></div>
91 +
92 +This configures an absolute origin offset ("CO") with respect to factory origin of servo with ID #5 and changes the offset for that session to -5.0 degrees (50 tenths of degrees). Once the servo is powered off and on, zeroing the servo will cause it to move to -5.0 degrees with respect to the factory origin and report its position as 0 degrees. Configuration commands can be undone / reset either by sending the servo's default value for that configuration, or by doing a factory reset that clears all configurations (through the button menu or with DEFAULT command described below).<div class="wikimodel-emptyline"></div>
93 +
94 +**Session vs Configuration Query**<div class="wikimodel-emptyline"></div>
95 +
96 +By default, the query command returns the session's value. Should no action commands have been sent to change the session value, it will return the value saved in EEPROM which will either be the servo's default, or modified with a configuration command. In order to query the value stored in EEPROM (configuration), add a '1' to the query command:<div class="wikimodel-emptyline"></div>
97 +
98 +Ex: #5CSR20&lt;cr&gt; immediately sets the maximum speed for servo #5 to 20rpm (explained below) and changes the value in memory.<div class="wikimodel-emptyline"></div>
99 +
100 +After RESET, a command of #5SR4&lt;cr&gt; sets the session's speed to 4rpm, but does not change the configuration value in memory. Therefore:<div class="wikimodel-emptyline"></div>
101 +
102 +#5QSR&lt;cr&gt; or #5QSR0&lt;cr&gt; would return *5QSR4&lt;cr&gt; which represents the value for that session, whereas<div class="wikimodel-emptyline"></div>
103 +
104 +#5QSR1&lt;cr&gt; would return *5QSR20&lt;cr&gt; which represents the value in EEPROM
105 +<div class="wikimodel-emptyline"></div></div></div>
106 +
107 +<div class="cmdcnt"><div class="cmdpad"></div><div class="cmdtxt">
108 +The ability to store a "virtual angular position" is a feature which allows for rotation beyond 360 degrees, permitting multiple rotations of the output horn, moving the center position and more. The "absolute position" would be the angle of the output shaft with respect to a 360.0 degree circle and can be obtained by taking the modulus (with respect to 360 degrees) of the value. For example if the virtual position is reported as 15335 (or 1533.5 degrees), taking the modulus would give 93.5 degrees (3600 * 4 + 935 = 15335) as the absolute position (assuming no origin offset).<div class="wikimodel-emptyline"></div>
109 +
110 +[[image:LSS-servo-positions.jpg]]<div class="wikimodel-emptyline"></div>
111 +
112 +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:<div class="wikimodel-emptyline"></div>
113 +
114 +#1D-300&lt;cr&gt; This causes the servo to move to -30.0 degrees (green arrow)<div class="wikimodel-emptyline"></div>
115 +
116 +#1D2100&lt;cr&gt; This second position command is sent to the servo, which moves it to 210.0 degrees (orange arrow)<div class="wikimodel-emptyline"></div>
117 +
118 +#1D-4200&lt;cr&gt; 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.<div class="wikimodel-emptyline"></div>
119 +
120 +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.<div class="wikimodel-emptyline"></div>
121 +
122 +#1D4800&lt;cr&gt; 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.<div class="wikimodel-emptyline"></div>
123 +
124 +#1D3300&lt;cr&gt; would cause the servo to rotate from 480.0 degrees to 330.0 degrees (yellow arrow).<div class="wikimodel-emptyline"></div>
125 +
126 +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°].
127 +<div class="wikimodel-emptyline"></div></div></div>
128 +
50 50  {{/html}}
51 51  )))
Copyright RobotShop 2018