Table of Contents

Class RotaryReadoutUtil

Namespace
Hi.NcParsers.Dependencys
Assembly
HiMech.dll

Internal Use Only. The machine coordinate of a wrap-around rotary axis as the controller's position screen shows it. The engine moves a rotary axis by a continuous angle: the tail pass McAbcCyclicPathSyntax walks every modular axis round from the previous block the way the controller does — the shortest way, or the control's own rule for the word (a SINUMERIK plain word under the factory MD30455 setting, a HEIDENHAIN word under M127) — so a table that keeps turning the same way stands at -720° after two turns and at -2520° after seven, and every position the engine records carries that continuous value. A controller with the usual wrap-around setting (Fanuc parameter No.1006 ROTx=1 ROSx=0, SINUMERIK MD30320 DISPLAY_IS_MODULO, HEIDENHAIN modulo axes, Mitsubishi #8213) displays the same axis folded into 0–360°: -720° reads 0°, -2520° reads 0°, -90° reads 270°, -180° reads 180°. The position readouts fold the continuous angle through Displayed_deg(double) for the axes IsDisplayedModulo(IMachineAxisConfig, string) and DisplayedModuloAxes(IEnumerable<INcDependency>) name: the modular rotary axes of the IMachineAxisConfig on the dependency list, judged by IsModularRotary(string), the predicate the tail pass folds by, so a readout wraps exactly the axes the motion wraps. A rotary axis that does not wrap (a tilting head with a limited travel) and every linear axis keep the raw value. Only the readouts fold: the motion, the NC writeback, the stroke and collision checks and the exported step file keep the continuous angle.

public static class RotaryReadoutUtil
Inheritance
RotaryReadoutUtil
Inherited Members

Fields

SnapEps_deg

A readout that falls short of 0° or of 360° by less than this distance, in degrees, snaps to 0: the last-bit residue the degree-radian round trips and a long chain of turns leave (about 1e-13°) must not print as -0.000 or 360.000. A billionth of a degree is far below any control's display resolution (0.0001°) and far above that arithmetic noise; a residue just above 0° already prints 0.000 and is left as it is. A kinematic solve's residue is larger (up to about 1e-6 rad, a few 1e-5°): the display rounding of Displayed_deg(double, int), not this snap, absorbs it.

public const double SnapEps_deg = 1E-09

Field Value

double

Methods

DisplayedModuloAxes(IEnumerable<INcDependency>)

The names of the axes whose readout is folded: the modular rotary axes (IsModularRotary(string)) of the first IMachineAxisConfig on dependencies, the one the tail pass reads. An empty set when the list is null or carries no configuration: unlike the tail pass, which then falls back to A/B/C, the readout folds no axis it cannot name — a raw value is never wrong, a fold of an axis that does not wrap would be.

public static IReadOnlySet<string> DisplayedModuloAxes(IEnumerable<INcDependency> dependencies)

Parameters

dependencies IEnumerable<INcDependency>

The effective NC dependency list, or null.

Returns

IReadOnlySet<string>

The axis names, compared ordinally; never null.

Displayed_deg(double)

The continuous angle as a modulo axis' position display shows it: folded into [0°, 360°) — 180° and -180° both read 180°, -720° reads 0°, -90° reads 270°, 450° reads 90°. A value less than SnapEps_deg below 0° or below 360° — the fold lands it in (-SnapEps_deg, 0] — reads 0, as positive zero, so that a fixed-point format never prints -0.000 or 360.000 for such a residue; NaN and ±infinity pass through unchanged. Degrees in, degrees out. The readout at a display resolution, which also absorbs a solve's larger residue, is Displayed_deg(double, int).

public static double Displayed_deg(double continuous_deg)

Parameters

continuous_deg double

The continuous angle the engine moves by, in degrees.

Returns

double

The displayed angle in [0°, 360°); the input itself when it is not finite.

Displayed_deg(double, int)

The readout at a display resolution: the angle rounded to digits decimals — the position screen's least increment, the way a control counts its position in whole increments — then folded by Displayed_deg(double), so an angle that rounds to 360° or to -0° reads 0 (-0.00006° at three decimals reads 0, not 359.99994 printed as 360.000) and a fixed-point format of that many digits never prints 360.000 or -0.000; 359.9994° at three decimals still reads 359.999. NaN and ±infinity pass through unchanged.

public static double Displayed_deg(double continuous_deg, int digits)

Parameters

continuous_deg double

The continuous angle the engine moves by, in degrees.

digits int

The decimals the readout prints (3 for a 0.001° display).

Returns

double

The displayed angle in [0°, 360°) at that resolution; the input itself when it is not finite.

IsDisplayedModulo(IMachineAxisConfig, string)

Whether the readout of axisName is folded: the axis is a modular rotary axis of axisConfig (IsModularRotary(string), the same predicate McAbcCyclicPathSyntax uses — not IsRotaryAxis(string), which is also true of a rotary axis that does not wrap). False without a configuration or without a name.

public static bool IsDisplayedModulo(IMachineAxisConfig axisConfig, string axisName)

Parameters

axisConfig IMachineAxisConfig

The axis configuration on the dependency list, or null.

axisName string

Axis name (e.g., “B”), or null.

Returns

bool

True when the position readouts fold the axis into [0°, 360°).