Control and Telemetry
conventions percentage representations payload values in percentages are mapped to the range of int16 max to int16 max percentage representation in control and telemetry messages group cid a group cid can be used to send a message to a group of 4 sids the group cid is used in place of the device sid in broadcast messages basic can id structure for broadcast messages calculating group cid the group number, or group controller identifier (cid) for a device with a given sid (1 127) can be calculated as follows, please note the use of the floor division operator example a device with sid 8 will map to group 2 as demonstrated below group 2 will contain the following sids \[5, 6, 7, 8] or represented as the range \[5, 8] calculating index within group the index of a device with a given sid within it’s group can be calculated as follows, ‘mod 4’ indicates the use of the modulo operator (often represented by the % in many programming languages) example a device with sid 6 is in cid group 2 which contains the following range of \[5, 8] the index of sid 6 is calculated as, indexing is 1 based group cid diagram the below diagram demonstrates the group cid and group index relationship for sids 1 12, the pattern of groups and group indexes continues for higher sids arinc diagrams group cid explanaition drawio png throttle control throttle can be controlled with one of two methods, sending a throttle message to a singular esc or broadcasting throttle to groups of 4 escs at a time throttle commands should be sent to each esc at a minimum frequency of 1hz 100hz is typical, but the frequency should be adjusted according to system requirements can id cfc cid function name sender payload description 0x08581400 | (sid << 2) 10 sid direct throttle system signed 16bit throttle throttle for specific controller based on sid 0x08581600 | (sid << 2) 11 group cid broadcast throttle system 4x signed 16bit throttle throttle for a group of 4 controllers addressed by a group cid direct throttle a direct throttle command sends a singular throttle value to an individual motor controller on the bus can id 0x08581400 | (sid << 2) the direct throttle message can id is 0x08581400 | (sid << 2) where sid is the target device sid for sid 1 the can id is 0x08581404 advanced fid cfc cid device (default 11) 10 device sid can payload the can payload is structured as follows bytes datatype content 0 1 int16 throttle percentage value (mapped to +/ int16 max) direct throttle message payload broadcast throttle a broadcast throttle sends 4 throttle values in a singular can frame to a group of up to 4 motor controllers this can reduce bandwidth required for throttle commands compared to sending direct throttle commands to each esc can id 0x08581600 | (group cid << 2) the can id for the broadcast throttle uses the group cid instead of the sid as follows the direct throttle message can id is 0x08581600 | (group cid << 2) where group cid is the target group cid for group cid 2 the can id is 0x08581608 advanced fid cfc cid device (default 11) 11 group cid can payload the can payload is structured as follows bytes datatype content 0 1 int16 throttle percentage value for group index 1 (mapped to +/ int16 max) 2 3 int16 throttle percentage value for group index 2 (mapped to +/ int16 max) 4 5 int16 throttle percentage value for group index 3 (mapped to +/ int16 max) 6 7 int16 throttle percentage value for group index 4 (mapped to +/ int16 max) image png example the below diagram demonstrates how the broadcast throttle message operates with 4 escs with group cid 2 image png telemetry telemetry is broadcast over the following messages the rate at which each message type is sent is configurable in device settings can id cfc cid function name sender payload description 0x08586400 | (sid << 2) 50 sid esc status 1 esc 4x 16 bit statuses esc status broadcast 1 bus voltage bus current phase current mechanical rpm 0x08586600 | (sid << 2) 51 sid esc status 2 esc 4x 16 bit statuses esc status broadcast 2 bridge temperature motor temperature status flags ms since last command 0x08586800 | (sid << 2) 52 sid esc status 3 esc 4x 16 bit statuses esc status broadcast 3 output power percentage input duty cycle percentage output duty cycle percentage motor angle esc status 1 the esc status 1 telemetry broadcast is sent by each esc at a configurable frequency, default 10hz can id 0x08586400 | (sid << 2) the esc status 1 message can id is 0x08586400 | (sid << 2) where sid is the sid of the device sending the message for sid 1 the can id is 0x08586404 advanced fid cfc cid device (default 11) 50 device sid can payload the can payload is structured as follows bytes datatype content 0 1 int16 bus voltage (v) 100 2 3 int16 bus current (a) 10 4 5 int16 phase current (a) 10 6 7 uint16 mechanical rpm image png esc status 2 the esc status 2 telemetry broadcast is sent by each esc at a configurable frequency, default 10hz can id 0x08586600 | (sid << 2) the esc status 2 message can id is 0x08586600 | (sid << 2) where sid is the sid of the device sending the message for sid 1 the can id is 0x08586604 advanced fid cfc cid device (default 11) 51 device sid can payload the can payload is structured as follows bytes datatype content 0 1 int16 bridge temperature (°c) 2 3 int16 motor temperature (°c) 4 5 uint16 status flags 6 7 uint16 milliseconds (ms) since last throttle command image png status flags the status flags field of the esc status 2 message is a bitfield, where each bit corresponds to a flag indicating device state the flag mapping is below bit position flag 0 motor armed 1 motor running 2 over temperature error 3 bus over current error 4 phase over current error 5 bus over voltage error 6 bus under voltage error 7 voltage ripple error 8 signal loss error 9 motor saturated error 10 motor over temperature error 11 rpm limit reached error 12 device in error state 13 output shorted error 14 startup checks failed error esc status 3 the esc status 3 telemetry broadcast is sent by each esc at a configurable frequency, default 10hz can id 0x08586800 | (sid << 2) the esc status 3 message can id is 0x08586800 | (sid << 2) where sid is the sid of the device sending the message for sid 1 the can id is 0x08586804 advanced fid cfc cid device (default 11) 52 device sid can payload the can payload is structured as follows bytes datatype content 0 1 int16 output power percentage (relative to configured voltage and current limits) 2 3 int16 input duty cycle percentage 4 5 int16 output duty cycle percentage 6 7 int16 motor angle (degrees) image png