Difference between revisions of "CanServo/Protocol/V1.1"

From HITEC_HELP
Jump to navigation Jump to search
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Under construction ==
== CAN Protocol Ver 1.1 ==
== CAN Protocol Ver 1.1 ==


* This protocol needs FW Ver 1.12+
* This protocol needs FW Ver 1.12+
* The purpose of this message is to set the servo's ID based on the servo's UID.


* CAN ID
* CAN ID
** 0x7FF : Servo -> Host
** 0x7FF : Servo -> Host
** 0x7FE : Host -> Servo
** 0x7FE : Host -> Servo
=== UID ===


* Message : Servo -> Host
* Message : Servo -> Host
** ZUID, <UID : 16 byte>, <ID2 : 4 byte>, <ID1 : 1 byte>, <CAN Mode : 1 byte>
** ZUID, <UID : 16 byte>, <ID2 : 4 byte>, <ID1 : 1 byte>, <CAN Mode : 1 byte>
** This message is sent periodically by the servo if either servo setting ID1 or ID2 is 0.


* Message: Host -> Servo
* Message: Host -> Servo
Line 18: Line 17:
** ZIDS, <UID : 16 byte>, <ID2 : 4 byte>, <ID1 : 1 byte>
** ZIDS, <UID : 16 byte>, <ID2 : 4 byte>, <ID1 : 1 byte>
** ZIDS, <UID : 16 byte>, <ID2 : 4 byte>, <ID1 : 1 byte>, <CAN Mode : 1 byte>
** ZIDS, <UID : 16 byte>, <ID2 : 4 byte>, <ID1 : 1 byte>, <CAN Mode : 1 byte>
** The servo with matching UID sets ID2, ID1, and CAN Mode depending on the length of the message.


* This message is delivered using the MultiPacket method below.
* This message is delivered using the MultiPacket method below.


== CAN Protocol Ver 1.2 ==
=== Write/Read Register's bits by ID or UID ===


* Message: Host -> Servo
* Message: Host -> Servo
** ZUW1, <UID : 16 byte>, <ADDR : 2 byte>, <DATA : 2 byte>
** ZGUu - Get UID
** ZUW2, <UID : 16 byte>, <ADDR1 : 2 byte>, <DATA1 : 2 byte>, <ADDR2 : 2 byte>, <DATA2 : 2 byte>
*** ID2 (4), ID1 (1)
** ZUX1, <UID : 16 byte>, <ADDR : 2 byte>, <DATA : 2 byte>
** ZSuu - Set Register by UID
** ZUX2, <UID : 16 byte>, <ADDR1 : 2 byte>, <DATA1 : 2 byte>, <ADDR2 : 2 byte>, <DATA2 : 2 byte>
*** UID (16), ADDR (1), bit 0.5, bits (0.5), Value (2)
** ZUR1, <UID : 16 byte>, <ADDR : 2 byte>
** ZGuu - Get Register by UID
** ZUR2, <UID : 16 byte>, <ADDR1 : 2 byte>, <ADDR2 : 2 byte>
*** UID (16), ADDR (1), bit 0.5, bits (0.5)
 
** ZXuu - Set/Get Register by UID
* Message : Servo -> Host
** ZSid - Set Register by ID
** ZUV1, <UID : 16 byte>, <ADDR : 2 byte>, <DATA : 2 byte>
*** ID2 (4), ID1 (1), ADDR (1), bit 0.5, bits (0.5), Value (2)
** ZUV2, <UID : 16 byte>, <ADDR1 : 2 byte>, <DATA1 : 2 byte>, <ADDR2 : 2 byte>, <DATA2 : 2 byte>
** ZXid - Set/Get Register by UID
 
** ZGid - Get Register by ID
== MultiPacket for Long Message ==
*** ID2 (4), ID1 (1), ADDR (1), bit 0.5, bits (0.5)
* Mesasge: Servo -> Host
** ZRuu - return register by UID
*** UID (16), ADDR (1), bit 0.5, bits (0.5), Value (2)
** ZRid - return register by ID
*** ID2 (4), ID1 (1), ADDR (1), bit 0.5, bits (0.5), Value (2)


* The first step is to calculate the CRC16 of the message and add it to the end to create the content to be sent.
=== File Access ===
* Send (maximum) 7 bytes extracted from the content to be sent and a Check Byte.
* ZGFL
* ZSDF
* ZFWU


* Multi Packet's Data Format
=== Message ===
** < Data : max 7 byte, cut from 'Message + CRC16' >, <Check Byte>
** Check Byte
*** bit 7 = 1, if first packet
*** bit 6 = 1, if last packet
*** bit 5 = Toggle, first packet = 1, toggle bit on each packet
*** bit 4:0 = Seq, 0 ~ 31, inc 1 on each message


* Note:
* ZMSG
** ID2, CRC16 : byte order : low byte first, little endian


* Reference:
=== History ===
** [[Code/CRC16]]
==== 2025_06_19 ====


== FD-CAN ==
* Replace message by bug in ZRUU, ZRID
** ZSUU -> ZSuu
** ZXUU -> ZXuu
** ZGUU -> ZGuu
** ZRUU -> ZRuu
** ZSID -> ZSid
** ZXID -> ZXid
** ZGID -> ZGid
** ZRID -> ZRid


* FD-CAN allows up to 64 bytes to be transmitted, so up to 63 bytes can be extracted at a time.
== Long Message ==


* This approach has not yet been implemented.
[[CanServo/Protocol/LongMessage]]

Latest revision as of 00:16, 20 June 2025

CAN Protocol Ver 1.1

  • This protocol needs FW Ver 1.12+
  • CAN ID
    • 0x7FF : Servo -> Host
    • 0x7FE : Host -> Servo

UID

  • Message : Servo -> Host
    • ZUID, <UID : 16 byte>, <ID2 : 4 byte>, <ID1 : 1 byte>, <CAN Mode : 1 byte>
    • This message is sent periodically by the servo if either servo setting ID1 or ID2 is 0.
  • Message: Host -> Servo
    • ZIDS, <UID : 16 byte>, <ID2 : 4 byte>
    • ZIDS, <UID : 16 byte>, <ID2 : 4 byte>, <ID1 : 1 byte>
    • ZIDS, <UID : 16 byte>, <ID2 : 4 byte>, <ID1 : 1 byte>, <CAN Mode : 1 byte>
    • The servo with matching UID sets ID2, ID1, and CAN Mode depending on the length of the message.
  • This message is delivered using the MultiPacket method below.

Write/Read Register's bits by ID or UID

  • Message: Host -> Servo
    • ZGUu - Get UID
      • ID2 (4), ID1 (1)
    • ZSuu - Set Register by UID
      • UID (16), ADDR (1), bit 0.5, bits (0.5), Value (2)
    • ZGuu - Get Register by UID
      • UID (16), ADDR (1), bit 0.5, bits (0.5)
    • ZXuu - Set/Get Register by UID
    • ZSid - Set Register by ID
      • ID2 (4), ID1 (1), ADDR (1), bit 0.5, bits (0.5), Value (2)
    • ZXid - Set/Get Register by UID
    • ZGid - Get Register by ID
      • ID2 (4), ID1 (1), ADDR (1), bit 0.5, bits (0.5)
  • Mesasge: Servo -> Host
    • ZRuu - return register by UID
      • UID (16), ADDR (1), bit 0.5, bits (0.5), Value (2)
    • ZRid - return register by ID
      • ID2 (4), ID1 (1), ADDR (1), bit 0.5, bits (0.5), Value (2)

File Access

  • ZGFL
  • ZSDF
  • ZFWU

Message

  • ZMSG

History

2025_06_19

  • Replace message by bug in ZRUU, ZRID
    • ZSUU -> ZSuu
    • ZXUU -> ZXuu
    • ZGUU -> ZGuu
    • ZRUU -> ZRuu
    • ZSID -> ZSid
    • ZXID -> ZXid
    • ZGID -> ZGid
    • ZRID -> ZRid

Long Message

CanServo/Protocol/LongMessage