module

Kozai::Rotator

Pointing an antenna rotator at a satellite.

Two protocols are supported, both plain text over TCP and neither requiring a C library: hamlib's rotctld, which is what most stations already run, and Easycomm II, which several controllers speak directly.

Constants

Log = ::Log.for("kozai.rotator")

Class methods

crosses_north?(azimuths : Enumerable(Float64)) : Bool

Whether a run of azimuths crosses due north.

Used to warn before a pass rather than discovering it mid-pass.

Source
flip(azimuth : Float64, elevation : Float64) : Target

The flipped representation of a direction: turn 180 degrees and lean back over the top.

Only usable on a rotator whose elevation goes past 90 degrees. It is worth it for a near-overhead pass, where the azimuth swings through almost 180 degrees in seconds and no azimuth motor can keep up.

Source
resolve_azimuth(desired : Float64, current : Float64, limits : Limits) : Float64

Chooses which representation of desired to command.

An azimuth of 10 degrees can be commanded as 10, as 370 on a rotator that overlaps past north, or as -350 on one centred on south. All three point the same way; they differ in how far the rotator has to travel to get there from where it is now. This picks whichever is reachable and nearest to current.

This is the whole of the "crossing zero" problem: get it wrong and a pass through north makes the antenna unwind 350 degrees in the middle of the pass, which at a typical six degrees per second takes a minute — most of a low pass, spent pointing at the ground.

Source

Nested types