Difference between revisions of "CanServo/ReadPosition/en"
Jump to navigation
Jump to search
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
* The current position of the servo is in [[CanServo/POSITION/en]]. | * The current position of the servo is in Register 0x0C [[CanServo/POSITION/en]]. | ||
** If the motion angle is likely to exceed 360 degrees, we recommend using [[CanServo/POSITION-32/LOW/en]] | |||
* There are two methods. | * There are two methods. | ||
* Read Command | * Read Command | ||
** Sends a message that reads the address 0x0C of the position value. | ** Sends a message that reads the address 0x0C of the position value. | ||
** The corresponding servo reports its own position value. | ** The corresponding servo reports its own position value. | ||
* | |||
* Outgoing/returning packet format | |||
<pre> | <pre> | ||
Host -> Servo: CAN ID = | Host -> Servo: CAN ID = <Target ID2>, DATA = 'r', <Target ID1>, <Address of Register>, DLC = 3 | ||
Servo -> Host: CAN ID = <Servo's ID2>, DATA = 'v', <Servo's ID1>, | Servo -> Host: CAN ID = <Servo's ID2>, DATA = 'v', <Servo's ID1>, <Address of Register>, <Low Byte>, <High Byte>, DLC=5 | ||
</pre> | </pre> | ||
* Specific servo: Servo ID=10, Servo CAN ID=0x123, Type=CAN 2.0B, current position value = 0x1122 | * Example: broadcast to all servos, servo1 (ID1=5, ID2=15, position value=0x1234, Type=CAN 2.0B), servo2 (ID1=6, ID2=15, position value=0x3344, Type=CAN 2.0B) | ||
<pre> | |||
Host -> Servo: CAN ID = 0, CAN=EXT, DATA = 'r', 0, 0x0C, DLC = 3 | |||
Servo1 -> Host: CAN ID = 15, CAN=EXT, DATA = 'v', 5, 0x0C, 0x34, 0x12, DLC=5 | |||
Servo2 -> Host: CAN ID = 15, CAN=EXT, DATA = 'v', 6, 0x0C, 0x44, 0x33, DLC=5 | |||
</pre> | |||
* Example: Specific servo: Servo ID=10, Servo CAN ID=0x123, Type=CAN 2.0B, current position value = 0x1122 | |||
<pre> | <pre> | ||
Host -> Servo: CAN ID = 0x123, CAN=EXT, DATA = 'r', 10, 0x0C, DLC=3 | Host -> Servo: CAN ID = 0x123, CAN=EXT, DATA = 'r', 10, 0x0C, DLC=3 | ||
Line 20: | Line 28: | ||
** When the [[CanServo/Stream/en]] function is turned on, the servo transmits information such as its own position value. | ** When the [[CanServo/Stream/en]] function is turned on, the servo transmits information such as its own position value. | ||
** If there is additional information you want, specify it in [[CanServo/Stream/Address/en]]. | ** If there is additional information you want, specify it in [[CanServo/Stream/Address/en]]. | ||
* For reference, the servo ID is set through [[CanServo/ID1/en]] and the servo CAN ID is set through [[CanServo/ID2/en]]. |
Latest revision as of 01:07, 21 April 2022
- The current position of the servo is in Register 0x0C CanServo/POSITION/en.
- If the motion angle is likely to exceed 360 degrees, we recommend using CanServo/POSITION-32/LOW/en
- There are two methods.
- Read Command
- Sends a message that reads the address 0x0C of the position value.
- The corresponding servo reports its own position value.
- Outgoing/returning packet format
Host -> Servo: CAN ID = <Target ID2>, DATA = 'r', <Target ID1>, <Address of Register>, DLC = 3 Servo -> Host: CAN ID = <Servo's ID2>, DATA = 'v', <Servo's ID1>, <Address of Register>, <Low Byte>, <High Byte>, DLC=5
- Example: broadcast to all servos, servo1 (ID1=5, ID2=15, position value=0x1234, Type=CAN 2.0B), servo2 (ID1=6, ID2=15, position value=0x3344, Type=CAN 2.0B)
Host -> Servo: CAN ID = 0, CAN=EXT, DATA = 'r', 0, 0x0C, DLC = 3 Servo1 -> Host: CAN ID = 15, CAN=EXT, DATA = 'v', 5, 0x0C, 0x34, 0x12, DLC=5 Servo2 -> Host: CAN ID = 15, CAN=EXT, DATA = 'v', 6, 0x0C, 0x44, 0x33, DLC=5
- Example: Specific servo: Servo ID=10, Servo CAN ID=0x123, Type=CAN 2.0B, current position value = 0x1122
Host -> Servo: CAN ID = 0x123, CAN=EXT, DATA = 'r', 10, 0x0C, DLC=3 Servo -> Host: CAN ID = 0x123, CAN=EXT, DATA = 'v', 10, 0x0C, 0x22, 0x11, DLC=5
- For the format of Read/Write Command and Return message, refer to SERVO/PROTOCOL/CAN/V1.0/ENG.
- Using the Stream function
- When the CanServo/Stream/en function is turned on, the servo transmits information such as its own position value.
- If there is additional information you want, specify it in CanServo/Stream/Address/en.
- For reference, the servo ID is set through CanServo/ID1/en and the servo CAN ID is set through CanServo/ID2/en.