SPID Rot1Prog and Rot2Prog Protocol

2011–01–30

This is an attempt at documenting the protocol of the Rot1Prog and Rot2Prog rotator controller from SPID Elektronik (spid@alpha.pl). Rot1Prog controls only azimuth, while Rot2Prog controls both azimuth and elevation.

General information

The SPID protocol supports 3 commands: stop, status and set. The stop command stops the rotator in its current position. The status command returns the current position of the rotator, and the set command tells the rotator to rotate to a given position.

The rotator controller communicates with the PC using a serial port. Communication parameters are 1200 bps (Rot1Prog) or 600 bps (Rot2Prog), 8 bits, no parity and 1 stop bit.

All commands are issued as 13 byte packets, and responses are received as 5 byte packets (Rot1Prog) or 12 byte packets (Rot2Prog).

Command Packets

Command packets are 13 byte long.

Byte:0123456789101112
Field:SH1H2H3H4PHV1V2V3V4PVKEND
Value:0x570x3?0x3?0x3?0x3?0x0?0x3?0x3?0x3?0x3?0x0?0x?F0x20
S
Start byte. This is always 0x57 ('W')
H1-H4
Azimuth as ASCII characters 0-9
PH
Azimuth resolution in pulses per degree (ignored!)
V1-V4
Elevation as ASCII characters 0-9
PV
Elevation resolution in pulses per degree (ignored!)
K
Command (0x0F=stop, 0x1F=status, 0x2F=set)
END
End byte. This is always 0x20 (space)

Positions are encoded as number of pulses in ASCII numbers '0000'-'9999' (see set command for formula).

Rot1Prog does not control elevation and does not support different resolutions, so V1-V4, PH and PV are set to 0x00. Also, since only whole degrees are supported, H4 is always set to 0x30 (0 tenths of degrees).

Response Packets

Rot1Prog response packets are 5 bytes long.

Byte:01234
Field:SH1H2H3END
Value:0x570x0?0x0?0x0?0x20
S
Start byte. This is always 0x57 ('W')
H1-H3
Azimuth as byte values
END
End byte. This is always 0x20 (space)

Positions are decoded using the following formula:

az = H1 * 100 + H2 * 10 + H3 - 360

Rot2Prog response packets are 12 bytes long.

Byte:01234567891011
Field:SH1H2H3H4PHV1V2V3V4PVEND
Value:0x570x0?0x0?0x0?0x0?0x0?0x0?0x0?0x0?0x0?0x0?0x20
S
Start byte. This is always 0x57 ('W')
H1-H4
Azimuth as byte values
PH
Azimuth resolution in pulses per degree (controller setting)
V1-V4
Elevation as byte values
PV
Elevation resolution in pulses per degree (controller setting)
END
End byte. This is always 0x20 (space)

Positions are decoded using the following formulas:

az = H1 * 100 + H2 * 10 + H3 + H4 / 10 - 360
el = V1 * 100 + V2 * 10 + V3 + V4 / 10 - 360

The PH and PV values in the response packet reflect the settings of the rotator controller. The Rot2Prog supports the following resolutions (always the same for azimuth and elevation):

Deg/pulsePHPV
10x010x01
0.50x020x02
0.250x040x04

Stop Command

The stop command stops the rotator immediately in the current position and returns the current position. (The position returned does not seem to be entirely correct, often off by a degree or two.)

The H1-H4, PH, V1-V4 and PV fields are ignored, so only the S, K and END fields are used. E.g.:

Command:

SH1H2H3H4PHV1V2V3V4PVKEND
0x570x000x000x000x000x000x000x000x000x000x000x0F0x20

Rotator stops.

Rot1Prog response:

SH1H2H3END
0x570x030x070x020x20

az = 372 - 360 = 12

Rot2Prog response:

SH1H2H3H4PHV1V2V3V4PVEND
0x570x030x070x020x050x020x030x090x040x000x020x20

az = 372.5 - 360 = 12.5, el = 394.0 - 360 = 34.0
PH = PV = 0x02 (pulse for each 0.5 deg)

Status Command

The status command returns the current position of the antenna.

The H1-H4, PH, V1-V4 and PV fields are ignored, so only the S, K and END fields are used. E.g.:

SH1H2H3H4PHV1V2V3V4PVKEND
0x570x000x000x000x000x000x000x000x000x000x000x1F0x20

Rot1Prog response:

SH1H2H3END
0x570x030x070x020x20

az = 372 - 360 = 12

Rot2Prog response:

SH1H2H3H4PHV1V2V3V4PVEND
0x570x030x070x020x050x020x030x090x040x000x020x20

az = 372.5 - 360 = 12.5, el = 394.0 - 360 = 34.0
PH = PV = 0x02 (pulse for each 0.5 deg)

Status commands can be issued while the rotator is moving and will always return the current position.

Set Command

The set command tells the rotator to turn to a specific position. The controller does not send a response to this command.

Azimuth and elevation is calculated as number of pulses, with a +360 degree offset (so that negative position can be encoded with positive numbers).

Rot1Prog supports only whole degree positions:

H = 360 + az

Rot2Prog supports different resolutions:

H = PH * (360 + az)
V = PV * (360 + el)

H1-H4 and V1-V4 are these numbers encoded as ASCII (0x30-0x39, i.e., '0'-'9').

E.g., when pointing a Rot1Prog to azimuth 123:

H = 360 + 123 = 483

SH1H2H3H4PHV1V2V3V4PVKEND
0x570x340x380x330x300x000x000x000x000x000x000x2F0x20

Note that H4 is not used and always set to 0x30.

E.g., when pointing a Rot2Prog to azimuth 123.5, elevation 77.0 when the rotator sends one pulse per 0.5 degree (PH=PV=2):

H = 2 * (360 + 123.5) = 967
V = 2 * (360 + 77.0) = 874

SH1H2H3H4PHV1V2V3V4PVKEND
0x570x300x390x360x370x020x300x380x370x340x020x2F0x20

The PH and PV values sent are ignored. The values used by the rotator control unit are set by choosing resolution in the setup menu. Luckily, these values can be read using the status command (Rot2Prog only).

Note that H1-H4 is interpreted differently by Rot1Prog and Rot2Prog in the set command:

FieldRot1ProgRot2Prog
H1*100*1000
H2*10*100
H3*1*10
H4*0*1

Rot1Prog does not use H4 and uses H1 for houndres, while Rot2Prog uses H4 for ones and H1 for thousands.

See Also

http://alfaradio.ca/downloads/program_info/