class

Kozai::Radio::Tuner

Inherits Reference < Object

Keeps a receiver on frequency across a pass.

Like Rotator::Tracker, this exists so that the corrections are rate limited and quantised. A radio retuned every few hertz produces an audible click on some models and a stream of serial traffic on all of them, for a correction far below the width of the signal.

Constructors

Instance methods

due?(frequency : Float64, now : Time = Time.utc) : Bool

Whether frequency is far enough from the last command to be worth sending.

Source
follow(angles : Frames::LookAngles, now : Time = Time.utc) : Float64 | Nil

Retunes the radio for angles, subject to the step size and rate limit.

Returns the frequency commanded, or nil if nothing was sent. A connection failure is logged rather than raised, for the same reason as in Rotator::Tracker: the station keeps predicting even when the radio is unplugged.

Source
last_command_at

When the last command was sent.

Source
last_frequency

The last frequency commanded.

Source
minimum_interval

Shortest interval between commands.

Source
mode

Radio mode to set when retuning, if the transponder named one.

Source
reset

Puts the radio back on the nominal downlink frequency.

Source
retarget(transponder : Transponders::Transponder) : Nil

Points the receiver at a different transponder.

NOTE: clearing @last_frequency is not tidiness, it is the point. #due? decides whether a retune is worth sending by comparing against the last one, and it holds anything inside minimum_interval. Switching from 436 MHz to 145 MHz would clear the step test on size alone, but could still be held back a second by the rate limit โ€” a second of the receiver sitting on the wrong band at the start of a pass, which is exactly when there is least to spare. Forgetting the last command makes the next #follow unconditional.

The mode is set here rather than on every retune: it does not change across a pass, and rigctld writes it to the radio each time it is asked.

Source
step_hz

Smallest retune worth making, in hertz.

Source
target(angles : Frames::LookAngles) : Float64

The frequency the radio should be on for angles.

Source
transponder

The transponder currently tuned, if it came from the table.

Source