Table of Contents

Interface IMachineKinematics

Namespace
Hi.Numerical.Xyzabc
Assembly
HiMech.dll

Device for UniNc controller.

public interface IMachineKinematics
Extension Methods

Methods

McAbcToMat(vec3d_t)

Converts machine ABC coordinates to a tilt matrix. the tilt matrix is the transformation matrix from table to attacher.

mat4d_t McAbcToMat(vec3d_t mcAbc_rad)

Parameters

mcAbc_rad vec3d_t

The machine ABC coordinates in radians

Returns

mat4d_t

The tilt matrix

McToMat(dvec3d_t)

Converts machine coordinates to an attacher matrix.

mat4d_t McToMat(dvec3d_t mcXyzabc)

Parameters

mcXyzabc dvec3d_t

The machine coordinates

Returns

mat4d_t

The attacher matrix

McToPn(dvec3d_t)

Machine coordinate to tool attacher Pn (Point and Normal). The Pn is from table mount to tool attacher.

dvec3d_t McToPn(dvec3d_t mcXyzabc)

Parameters

mcXyzabc dvec3d_t

machine coordinate. ABC is in radian.

Returns

dvec3d_t

tool attacher Pn (Point and Normal)

OrientationToMcAbc(mat4d_t, out vec3d_t)

Converts a tilt matrix to machine ABC coordinates. the tilt matrix is the transformation matrix from table to attacher. the solution only fit the orientation part of the tiltMat.

bool OrientationToMcAbc(mat4d_t tiltMat, out vec3d_t mcAbc_rad)

Parameters

tiltMat mat4d_t

The tilt matrix to convert

mcAbc_rad vec3d_t

Output parameter that will contain the machine ABC coordinates in radians

Returns

bool

Whether the conversion was successful: the orientation the answer realises meets the target within the solver's polish tolerance (about 1e-6 rad; see SetPn(dvec3d_t, out dvec3d_t)); on false the solver state is as it was on entry. A matrix with a NaN or an infinite element is refused (false, a NaN out value).

OrientationToMcAbc(mat4d_t, AbcTravel, out vec3d_t)

OrientationToMcAbc(mat4d_t, out vec3d_t) restricted to the rotary travel travel (the machine's A/B/C stroke limits, typically). A full orientation fixes the rotary positions up to axis periodicity, so a solution outside the travel is a posture this machine cannot take: the conversion then fails (false) and leaves the solver state as it was, so that the caller can fall back to OrientationToMcAbc(vec3d_t, AbcTravel, out vec3d_t), where the free rotation about the tool axis opens the other branch. A null travel, or one without any configured end (HasAnyLimit false), does not restrict: this is then the plain overload.

The travel is data, not a delegate: XyzabcSolver runs its inverse kinematics in core.dll and hands the record there. Build it from the runner's dependency list with RotaryTravel(IEnumerable<INcDependency>). The default implementation is the plain solve, refused when IsAdmissible(vec3d_t) refuses its result.

bool OrientationToMcAbc(mat4d_t tiltMat, AbcTravel travel, out vec3d_t mcAbc_rad)

Parameters

tiltMat mat4d_t

The tilt matrix to convert.

travel AbcTravel

The rotary travel to respect; null, or a record without any configured end, does not restrict.

mcAbc_rad vec3d_t

Output machine ABC coordinates in radians.

Returns

bool

Whether an admissible conversion was found.

OrientationToMcAbc(vec3d_t, out vec3d_t)

Converts a target tool axial direction (endpoint orientation) to machine ABC coordinates. Only the axial alignment is constrained; rotation about the tool axis is free.

Use this in place of OrientationToMcAbc(mat4d_t, out vec3d_t) when the rotation about the tool axis is irrelevant (e.g. G53.1 rotary positioning). The axial-only solve avoids the redundant 6-target full-matrix constraint and is more likely to converge for tilt configurations such as G68.2 I180 J90 K0.

bool OrientationToMcAbc(vec3d_t toolAxialNormal, out vec3d_t mcAbc_rad)

Parameters

toolAxialNormal vec3d_t

Target tool axial direction in table coordinates (the third row of the tilt matrix; e.g. AxialNormal).

mcAbc_rad vec3d_t

Output machine ABC coordinates in radians.

Returns

bool

Whether the conversion was successful: the tool axis the answer realises meets the target within the solver's polish tolerance (about 1e-6 rad; see SetPn(dvec3d_t, out dvec3d_t)); on false the solver state is as it was on entry. A normal with a NaN or an infinite component is refused (false, a NaN out value).

OrientationToMcAbc(vec3d_t, AbcTravel, out vec3d_t)

OrientationToMcAbc(vec3d_t, out vec3d_t) preferring the solution branch inside the rotary travel travel. The axial-only problem has two branches on a two-rotary-axis machine (on a table-table A/C: (A, C) and (−A, C+180°)); the plain overload returns the branch nearest the solver's seed, which from the rotary pole (A0 C0) is the one the tilt's azimuth happens to favour — half the time the branch a cradle table with an asymmetric tilt travel cannot reach (CHEM20180926 N100: G68.2 I210 J-90 + G53.1 solved to A=+90° on a −120°…+30° A axis). When the nearest branch is outside the travel, an implementation with a real solver searches the other branches and returns the admissible one nearest the seed; when none is admissible it returns the refused solution and true, and the stroke-limit check downstream reports it. A null travel, or one without any configured end (HasAnyLimit false), makes this the plain overload.

The travel is data, not a delegate: XyzabcSolver runs the solve and the branch search in core.dll and hands the record there. Build it from the runner's dependency list with RotaryTravel(IEnumerable<INcDependency>). The default implementation is the plain solve — the travel is advisory for an implementation without a solver, which searches no branch.

bool OrientationToMcAbc(vec3d_t toolAxialNormal, AbcTravel travel, out vec3d_t mcAbc_rad)

Parameters

toolAxialNormal vec3d_t

Target tool axial direction in table coordinates.

travel AbcTravel

The rotary travel to prefer; null, or a record without any configured end, does not restrict.

mcAbc_rad vec3d_t

Output machine ABC coordinates in radians.

Returns

bool

Whether the conversion was successful (admissible or not).

PnToMc(dvec3d_t, out dvec3d_t)

Tool attacher Pn (Point and Normal) to machine coordinate. The Pn is from table mount to tool attacher.

bool PnToMc(dvec3d_t pn, out dvec3d_t mcXyzabc_rad)

Parameters

pn dvec3d_t

tool attacher Pn (Point and Normal)

mcXyzabc_rad dvec3d_t

machine coordinate (ABC in radian)

Returns

bool

whether conversion succeeded; a pn with a NaN or an infinite component is refused (false, a NaN out value)