Commit 31f7e00f authored by Mark Jessop's avatar Mark Jessop Committed by Alfredos-Panagiotis Damkalis

Resolve threshold issues with rotators that report azimuth overwind positions...

Resolve threshold issues with rotators that report azimuth overwind positions as values outside 0-360 degrees

Some rotators (for example Spid Rot2Prog rotators) report positions in an overwind region
(i.e. out of the usual 0-360 degree range) as either negative values, or positive values
outside the 0-360 range. With the current approach to rotator movement thresholding, a value
outside the 0-360 range will always cause the threshold comparison to fail, which means the
rotator is almost continuously being commanded. This can result in premature failure of motor
This change causes the reported azimuth value to be wrapped to 0-360, which allows the threshold
function to perform correctly.
Signed-off-by: Mark Jessop's avatarMark Jessop <>
parent 427724d1
Pipeline #85318011 passed with stages
in 5 minutes and 11 seconds
......@@ -197,8 +197,10 @@ class WorkerTrack(Worker):
# read current position of rotator, [0] az and [1] el
position = sock.send("p\n").split('\n')
# if the need to move exceeds threshold, then do it
# Take the 360 modulus of the azimuth position, to handle rotators that report
# positions in overwind regions as values outside the range 0-360.
if (position[0].startswith("RPRT")
or abs(azi - float(position[0])) > settings.SATNOGS_ROT_THRESHOLD
or abs(azi - float(position[0]) % 360.0) > settings.SATNOGS_ROT_THRESHOLD
or abs(alt - float(position[1])) > settings.SATNOGS_ROT_THRESHOLD):
msg = 'P {0} {1}\n'.format(azi, alt)
LOGGER.debug('Rotctld msg: %s', msg)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment