The RobotHead has 6 servos from Hitec. These servos have only reverse engineered documentation which is linked below.
Reverse engineered documentation: hsr8498hb_servo.pdfhsr_serial_communication.pdf

An interface board with a LPC1769 was designed to provide a high-level interface for the servos.
It communicates with a PC through UART at a 1 Mbps with 8 bits words, no parity and one stop bit with hardware flow control through RTS/CTS.

All the material produced is in the shared folder at Projects/RobotHead6DOF.

(One Time) Preparation of Servos:

All servos are connected in parallel on a data bus. Each servo is identified by an (internal) ID number. Factory default ID number for all servos is “0”. You need to change the default ID to a unique number (1..255) to avoid bus conflicts.

To change an individual Servo's ID, connect only that one servo to the board, and use the command “!I=b\n” to set the servo ID to <b>.

By convention we assign the “outmost” servo the smallest number; i.e. servos that turn other servos when moving have lower IDs. For the robot head we suggest:

  • neck-pan-ID 0
  • neck-tilt-ID 1
  • left-eye-pan-ID 2
  • left-eye-tilt-ID 3
  • right-eye-pan-ID 4
  • right-eye-tilt-ID 5

Supported Commands:

All commands need to be terminated by ‘\n’; i.e. <return> and are case insensitive.
These servos are connected on the same bus and they stop to process new commands so the frequency of new commands should be rather small (maybe 50 to 60Hz).

?I - get servo id and version
!I=b - set servo id to b

?C - display checksums(the current and correct)

!D+b,p - enable sensors streaming, ??D to show options
!D-[b] - disable sensors streaming, ??D to show options
?Db - get sensor readouts according to bitfield b
??D - bitfield b options

?Ex - print verbose explanation of the error x
??E - print error table

?Maddress - read address from servo memory
!Maddress=data - write to servo memory address
?MEaddress - read address from servo EEPROM memory
!MEaddress=data - write to servo EEPROM memory address

!P[0-8],p - set servo position
!PA[0-8],p[|] - set multiple servos position, | as separator of id,p
!PR - reset servo position to safe value
?P[0-8] - get servo position
?PA - get all servos positions

!R - release servos

!S[0-8],s - set servo velocity
!SA[0-8],s[|] - set multiple servos velocity, | as separator of id,s
?S[0-8] - get servo velocity
?SA - get all servos velocities

?V - get servos voltage

!U=x - set baud rate to x
!U[0,1] - UART echo mode (none, all)

?? - display (this) help

Position and Speed Arguments

The positions for each servo varies between 500 and 2500 where 1500 is the center position of the servo rotation.

The speed for servos can be set to a number between 1 and 255 although according to the available documentation, the actual velocity saturates much earlier.

Example for settings multiple motors' position with a single command

PA0,1500|1,1500|2,1900\n

This command sets the motors with id 0 and 1 to position 1500 and motor with id 2 to position 1900.

Enabling / Disabling Data Streaming

Use the !D command to enable or disable data streaming.
Format: !D[+/-]b,p 
where p is the period (in milliseconds and ignored when disabling) and b is a bitfield (see below). 
Example: !d+1545,8 will stream the position 0, position 3, all positions and the voltage level at 125 Hz.

Reply:
-P0 1250\n
-P3 550\n
-PA 1250 0 0 550 0 0 0 0 0\n
-V7250\n

If any value is negative, it means an error occurred while attempting to read the value.

 

BitDecimal ValuesName# ValuesDescriptionFormat per Valuesince Version
01POSITION01servo0 positionup to 4 digits1.0
12POSITION11servo1 positionup to 4 digits1.0
24POSITION21servo2 positionup to 4 digits1.0
38POSITION31servo3 positionup to 4 digits1.0
416POSITION41servo4 positionup to 4 digits1.0
532POSITION51servo5 positionup to 4 digits1.0
664POSITION61servo6 positionup to 4 digits1.0
7128POSITION71servo7 positionup to 4 digits1.0
8256POSITION81servo8 positionup to 4 digits1.0
9512ALL POSITIONS9all servos' positionsup to 4 digits0.1
101024VOLTAGE1servos' voltagesup to 4 digits0.1
  • Keine Stichwörter