Difference between revisions of "CanServo/ReadPosition/en"

From HITEC_HELP
Jump to navigation Jump to search
Line 1: Line 1:
* The current position of the servo is in [[CanServo/POSITION/en]].
* The current position of the servo is in [[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

Revision as of 01:07, 21 April 2022

  • The current position of the servo is in CanServo/POSITION/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
  • Using the Stream function