<Protocolname="Servo"prefix="Servo_"api="21"version="2.11"mapfile="Servo_SettingsMap"verifyfile="Servo_SettingsVerify"endian="big"supportSpecialFloat="false"supportInt64="false"supportFloat64="false"supportBool="true"comment="This is the ICD for the Currawong Engineering CAN Servo. This document details the Servo command and packet structure for communication with and configuration of the Servo"><Includename="string.h"comment="C string manipulation function header"global="true"/>
<Dataname="period"inMemoryType="unsigned8"comment="Servo telemetry period"units="50ms per bit"range="0 (Disabled) to 250 (12.5s)"initialValue="10"verifyMaxValue="250"/>
<Dataname="silence"inMemoryType="unsigned8"comment="Servo silence period (after boot)"units="50ms per bit"range="0 to 250 (12.5s)"initialValue="10"verifyMaxValue="250"/>
<Dataname="mapEnabled"inMemoryType="bitfield1"comment="1 = I/O map is enabled"initialValue="0"/>
<Dataname="piccoloCmd"inMemoryType="bitfield1"comment="1 = The servo will listen for Piccolo autopilot CAN messages"initialValue="1"/>
<Dataname="neutralPositionEnabled"inMemoryType="bitfield1"comment="1 = Servo neutral position is enabled, 0 = Neutral position disabled"initialValue="0"/>
<Dataname="piccoloChannel"inMemoryType="bitfield5"comment="Channel the servo will use to listen for Piccolo messages."range="1 to 16"notes="A value of zero indicates that the servo's CAN ID will be used to determine the Piccolo Channel. Values above 16 will be set to zero"verifyMaxValue="16"initialValue="0"/>
<Dataname="timeoutAction"inMemoryType="bitfield2"comment="Servo action at powerup"initialValue="0"/>
<Dataname="reservedB"inMemoryType="bitfield2"map="false"comment="reserved for future use"/>
<Dataname="reservedC"inMemoryType="bitfield4"map="false"comment="reserved for future use"/>
</Structure>
<Enumname="ServoMultiCommandPackets"lookup="true"prefix="PKT_SERVO_"comment="Command multiple servo positions with a single command"description="Using a single CAN frame, the position(s) of up to four servos can be commanded. The address IDs of these four servos must be sequential, and the CAN frame must be broadcast such that all servos on the CAN bus receive the frame.">
<Valuename="MULTI_COMMAND_1"value="0x00"comment="Send a position command to servos 1,2,3,4"/>
<Valuename="MULTI_COMMAND_2"comment="Send a position command to servos 5,6,7,8"/>
<Valuename="MULTI_COMMAND_3"comment="Send a position command to servos 9,10,11,12"/>
<Valuename="MULTI_COMMAND_4"comment="Send a position command to servos 13,14,15,16"/>
<Valuename="MULTI_COMMAND_5"comment="Send a position command to servos 17,18,19,20"/>
<Valuename="MULTI_COMMAND_6"comment="Send a position command to servos 21,22,23,24"/>
<Valuename="MULTI_COMMAND_7"comment="Send a position command to servos 25,26,27,28"/>
<Valuename="MULTI_COMMAND_8"comment="Send a position command to servos 29,30,31,32"/>
<Valuename="MULTI_COMMAND_9"comment="Send a position command to servos 33,34,35,36"/>
<Valuename="MULTI_COMMAND_10"comment="Send a position command to servos 37,38,39,40"/>
<Valuename="MULTI_COMMAND_11"comment="Send a position command to servos 41,42,43,44"/>
<Valuename="MULTI_COMMAND_12"comment="Send a position command to servos 45,46,47,48"/>
<Valuename="MULTI_COMMAND_13"comment="Send a position command to servos 49,50,51,52"/>
<Valuename="MULTI_COMMAND_14"comment="Send a position command to servos 53,54,55,56"/>
<Valuename="MULTI_COMMAND_15"comment="Send a position command to servos 57,58,59,60"/>
<Valuename="MULTI_COMMAND_16"comment="Send a position command to servos 61,62,63,64"/>
</Enum>
<Enumname="ServoPackets"comment="Servo CAN packet identifiers"prefix="PKT_SERVO_"lookup="true"description="Following are the enumerated identifiers for the various servo CAN packets available">
<Valuename="POSITION_COMMAND"value="0x10"comment="Send a position command to an individual servo"/>
<Valuename="NEUTRAL_COMMAND"value="0x15"comment="Move the servo to the neutral position"/>
<Valuename="DISABLE"value="0x20"comment="Disable a single servo, or all servos with a broadcast message"/>
<Valuename="ENABLE"comment="Enable a single servo, or all servos with a broadcast message"/>
<Valuename="SYSTEM_COMMAND"value="0x50"comment="Servo system command"/>
<Valuename="SET_TITLE"comment="Set the title of this servo"/>
<Valuename="STATUS_A"value="0x60"comment="Servo *STATUS_A* packet contains status and position information"/>
<Valuename="STATUS_B"comment="Servo *STATUS_B* packet contains current, temperature and other information"/>
<Valuename="STATUS_C"comment="Reserved for future use"/>
<Valuename="STATUS_D"comment="Reserved for future use"/>
<Enumname="ServoCommands"prefix="CMD_SERVO_"lookup="true"comment="These commands are sent to the servo using the SERVO_SYSTEM_COMMAND packet"description="Multiple commands can be sent to the servo using the SERVO_SYSTEM_COMMAND packet, where the first byte of the packet describes the command type. Below are the enumerated identifiers for the available servo commands. Each command is described at length further in this document.">
<Valuename="SET_LOOKUP_TABLE_ELEMENT"comment="Configure an individual I/O element"hidden="true"/>
<Valuename="SET_CONFIG"value="0x10"comment="Set the servo configuration bits"hidden="true"/>
<Valuename="SET_TEMPERATURE_LIMIT"hidden="true"comment="Set the over-temperature warning level"/>
<Valuename="SET_STRENGTH"hidden="true"comment="Set the servo 'strength' (maximum motor duty cycle)"/>
<Valuename="SET_ILIMIT_KI"hidden="true"comment="Set the servo current-limit integral gain value"/>
<Valuename="SET_MAX_PWM_LIMIT"hidden="true"comment="Set the maximum clipping value for the servo PWM signal"/>
<Valuename="SET_TELEMETRY_PERIOD"value="0x40"comment="Set the servo telemetry period"hidden="true"/>
<Packetname="MultiPositionCommand"ID="PKT_SERVO_MULTI_COMMAND_1 PKT_SERVO_MULTI_COMMAND_2 PKT_SERVO_MULTI_COMMAND_3 PKT_SERVO_MULTI_COMMAND_4 PKT_SERVO_MULTI_COMMAND_5 PKT_SERVO_MULTI_COMMAND_6 PKT_SERVO_MULTI_COMMAND_7 PKT_SERVO_MULTI_COMMAND_8 PKT_SERVO_MULTI_COMMAND_9 PKT_SERVO_MULTI_COMMAND_10 PKT_SERVO_MULTI_COMMAND_11 PKT_SERVO_MULTI_COMMAND_12 PKT_SERVO_MULTI_COMMAND_13 PKT_SERVO_MULTI_COMMAND_14 PKT_SERVO_MULTI_COMMAND_15 PKT_SERVO_MULTI_COMMAND_16"map="false"file="ServoPackets"parameterInterface="true"comment="This packet can be used to simultaneously command multiple servos which have sequential CAN ID values. This packet must be sent as a broadcast packet (address = 0xFF) such that all servos can receive it. These commands can be sent to groups of servos with ID values up to 64, using different PKT_SERVO_MULTI_COMMAND_x packet ID values.">
<Dataname="commandA"inMemoryType="signed16"comment="Servo command for servo with address offset 0"units="dimensionless"range="-20,000 to +20,000"notes="Input limits depend on servo I/O mapping"/>
<Dataname="commandB"inMemoryType="signed16"comment="Servo command for servo with address offset 1"units="dimensionless"range="-20,000 to +20,000"notes="Input limits depend on servo I/O mapping"/>
<Dataname="commandC"inMemoryType="signed16"comment="Servo command for servo with address offset 3"units="dimensionless"range="-20,000 to +20,000"notes="Input limits depend on servo I/O mapping"/>
<Dataname="commandD"inMemoryType="signed16"comment="Servo command for servo with address offset 3"units="dimensionless"range="-20,000 to +20,000"notes="Input limits depend on servo I/O mapping"/>
<Packetname="PositionCommand"ID="PKT_SERVO_POSITION_COMMAND"comment="Send this command to move the servo(s) to the commanded position. Position command units depend on the configuration of the servo. Send with the broadcast ID (0xFF) to send the position command to *all* servos."file="ServoPackets"parameterInterface="true">
<Dataname="command"inMemoryType="signed16"comment="Servo command"units="dimensionless"range="-20,000 to +20,000"notes="Input limits depend on servo I/O mapping"/>
</Packet>
<Packetname="NeutralPositionCommand"ID="PKT_SERVO_NEUTRAL_COMMAND"comment="Send this command (with zero data bytes) to move the servo(s) to the neutral position (if enabled). Send with the broadcast ID (0xFF) to move *all* servos to their neutral positions"file="ServoPackets"parameterInterface="true">
</Packet>
<Packetname="Disable"ID="PKT_SERVO_DISABLE"file="ServoPackets"parameterInterface="true"comment="Send this command (with zero data bytes) to disable the servo. Send with the broadcast ID (0xFF) to disable *all* servos.">
</Packet>
<Packetname="Enable"ID="PKT_SERVO_ENABLE"file="ServoPackets"parameterInterface="true"comment="Send this command (with zero data bytes) to enable the servo. Send with the broadcast ID (0xFF) to enable *all* servos.">
</Packet>
<Packetname="SetTitle"ID="PKT_SERVO_SET_TITLE"file="ServoPackets"parameterInterface="true"comment="Set the human-readable description of this servo">
<Packetname="StatusA"ID="PKT_SERVO_STATUS_A"file="ServoPackets"parameterInterface="true"structureInterface="true"comment="The *SERVO_STATUS_A* packet contains status, warning and error information, in addition to the servo position">
<Packetname="StatusC"ID="PKT_SERVO_STATUS_C"file="ServoPackets"parameterInterface="true"structureInterface="true"comment="The *SERVO_STATUS_C* packet contains servo position data. It is a cut-down packet to allow high-speed feedback on servo position">
<Dataname="position"inMemoryType="signed16"comment="Servo position, mapped to input units"/>
</Packet>
<Packetname="Accelerometer"ID="PKT_SERVO_ACCELEROMETER"file="ServoPackets"parameterInterface="true"comment="Raw accelerometer data. To convert these raw readings to 'real' units, use the formula acc = 0.5 * raw * fullscale / (2^resolution)">
<Dataname="xAcc"inMemoryType="signed16"comment="X axis acceleration value"range="-0x7FFF to +0x7FFF"notes="Multiply by (0.5 * fullscale / 2^resolution) to get acceleration value in 'g' units"/>
<Dataname="yAcc"inMemoryType="signed16"comment="Y axis acceleration value"range="-0x7FFF to +0x7FFF"notes="Multiply by (0.5 * fullscale / 2^resolution) to get acceleration value in 'g' units"/>
<Dataname="zAcc"inMemoryType="signed16"comment="Z axis acceleration value"range="-0x7FFF to +0x7FFF"notes="Multiply by (0.5 * fullscale / 2^resolution) to get acceleration value in 'g' units"/>
<Dataname="commandTimeout"inMemoryType="unsigned16"comment="Servo command timeout"units="1ms per bit"range="0 to 65535"notes="0 = Timeout disabled"initialValue="1000"verifyMaxValue="60000"/>
<Dataname="homePosition"inMemoryType="signed16"comment="Servo neutral position. Servo can be configured to return to this position at powerup, or after loss of communication"notes="Neutral position is specified in *input* units. i.e. if the I/O map is enabled, it will be applied to the neutral position"initialValue="1500"verifyMinValue="-20000"verifyMaxValue="20000"units="dimensionless"/>
<Dataname="reserved"inMemoryType="unsigned8"array="2"comment="Reserved for future use"map="false"/>
</Packet>
<Packetname="RequestHighFrequencyData"ID="PKT_SERVO_SYSTEM_COMMAND"file="ServoCommands"parameterInterface="true"comment="Select packets for high-frequency transmission. Selected packets will be transmitted at 500Hz for one second. Sending this command again resets the timer, allowing continuous data as long as this packet is received">
<Dataname="packets"struct="TelemetryPackets"comment="Select which telemetry packets are transmitted at high-speed by the servo"/>
</Packet>
<Packetname="SetNodeID"ID="PKT_SERVO_SYSTEM_COMMAND"file="ServoCommands"parameterInterface="true"comment="Set the Node ID (CAN Address) for the servo">
<Dataname="serialNumber"inMemoryType="unsigned32"comment="The serial number must match that of the servo for the command to be accepted"/>
<Dataname="nodeID"inMemoryType="unsigned8"comment="Set the CAN Node ID of the target servo"range="0 to 254"notes="A servo with a Node ID of zero (0) will be disabled"/>
</Packet>
<Packetname="SetUserIdA"ID="PKT_SERVO_SYSTEM_COMMAND"file="ServoCommands"parameterInterface="true"comment="Set user programmable ID value">
<Dataname="bootSeqA"inMemoryType="null"encodedType="unsigned8"checkConstant="true"constant="0xAA"comment="This byte is required for the command to be accepted"/>
<Dataname="bootSeqB"inMemoryType="null"encodedType="unsigned8"checkConstant="true"constant="0x55"comment="This byte is required for the command to be accepted"/>