Pelco-D Protocol Requirements

In order for a Pelco-D camera to be compatible with TimeZero, it needs to follow the below requirements:

- The camera must support continuous 360-degree rotation (continuous Pan)

- The camera must support speed commands ("Relative" PTZ commands) and position commands ("Absolute" PTZ commands)

- The camera must be able to provide position feedback (Pan Position, Tilt Position, Zoom Position), either continuously (more than 5 times per second) or upon request (whenever TimeZero issue a request position command). By default TimeZero will request position feedback 10 times per second (every 100ms), but this can be changed from the Pelco-D configuration.

- The camera must use the standard Pelco-D coordinate system for Pan and Tilt (see below)

Pelco-D Sentence Protocol

Pelco-D consists of 7 hexadecimal bytes:

Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7
Synch Byte Address Command 1 Command 2 Data 1 Data 2 Checksum
  • Byte 1 - the synchronization byte, fixed to FF

  • Byte 2 - logical address of the camera being controlled (Default Address is 01, but this can be changed from the "Pelco Configuration" settings)

  • Byte - Command 1 and 2

  • Byte 5 (Data 1) - pan speed, range from 00 (stop) to 3F (high speed)

  • Byte 6 (Data 2) - tilt speed, range from 00 (stop) to 3F (maximum speed)

  • Byte 7 (Checksum) - sum of bytes (excluding the synchronization byte), then modulo 100 (Decimal code: 256)

In order for TimeZero to successfully control a Pelco-D camera, the following Pelco-D sentences must be supported by the camera. It is important to understand that TimeZero needs to be able to send command, but also receive status (position feedback) from the camera:

"Relative" PTZ Commands (Speed Control):

Pan Left xFF Address (x01 by default) x00 x04 Speed (x01-x3F) x00 Checksum
Pan Right xFF Address (x01 by default) x00 x02 Speed (x01-x3F) x00 Checksum
Tilt Up xFF Address (x01 by default) x00 x08 x00 Speed (x01-x3F) Checksum
Tilt Down xFF Address (x01 by default) x00 x10 x00 Speed (x01-x3F) Checksum
Zoom In xFF Address (x01 by default) x00 x20 x00 x00 Checksum
Zoom Out xFF Address (x01 by default) x00 x40 x00 x00 Checksum
Stop xFF Address (x01 by default) x00 x00 x00 x00 Checksum

"Absolute" PTZ Commands (Position Control):

Set Pan Position xFF Address (x01 by default) x00 x4B MSB of Pan Position LSB of Pan Position Checksum
Set Tilt Position xFF Address (x01 by default) x00 x4D MSB of Tilt Position LSB of Tilt Position Checksum
Set Zoom Position xFF Address (x01 by default) x00 x4F MSB of Zoom Position LSB of Zoom Position Checksum

"Request Position" Commands:

Query Pan Position xFF Address (x01 by default) x00 x51 x00 x01 Checksum
Query Tilt Position xFF Address (x01 by default) x00 x53 x00 x01 Checksum
Query Zoom Position xFF Address (x01 by default) x00 x55 x00 x01 Checksum

Response (from Camera to TimeZero):

Response Pan Position xFF Address (x01 by default) x00 x59 x00 x01 Checksum
Response Tilt Position xFF Address (x01 by default) x00 x5B x00 x01 Checksum
Response Zoom Position xFF Address (x01 by default) x00 x5D x00 x01 Checksum

Focus Commands:

Focus Far xFF Address (x01 by default) x00 x80 x00 x00 Checksum
Focus Near xFF Address (x01 by default) x01 x00 x00 x00 Checksum

 

Coordinate System and Angle Resolution

The Pelco-D camera must adopt the standard Pelco-D coordinate system below with an angle resolution of 0.01 degree.

Pan:

The camera must be able to pan continuously around the full 360 degrees. The Pan value (used to set and query position) must start at 0 and go up to 35999:

For example, to pan the camera 90 degrees, the Pelco-D value 9000 should be used.

Tilt:

The Tilt value (used to set and query position) must follow the coordinate system below:

The 0 value is used for the horizontal original angle. Sending positive value (with an angle resolution of 0.01 deg) should tilt the camera down. For example, if TimeZero sends the Pelco-D 4500 value, the camera should tilt down to 45 degrees. To tilt up, values should start at 35999 and go "down" to the (maximum tilt up angle * 100) - 36000. For example, to tilt up 45 degrees, the Pelco-D value 31500 should be used. Note that maximum tilt up angle and the maximum tilt down angle used in this example (respectively 31500 and 4500) are arbitrary. It is OK for the camera to support different tilt up/down angle.