Table of Contents

Class MillingTraining

Namespace
Hi.MillingForces.Training
Assembly
HiNc.dll

Provides utilities for milling force training and parameter identification.

public static class MillingTraining
Inheritance
MillingTraining
Inherited Members

Fields

DesignMatrixSvdRelativeTol

Relative singular-value cutoff (σ_i/σ_max on σ(M)) for the truncated pseudo-inverse of the lead-para fit when EnableDesignMatrixSolver is on. Replaces the legacy absolute gap (1e-7) applied to σ(MᵀM) = σ(M)², whose effective cut depends on the data scale.

public static double DesignMatrixSvdRelativeTol

Field Value

double

EnableCwePhasePairing

When enabled, GatherAndBuild(ICuttingPara, ConcurrentDictionary<int, List<ITimeShot>>, ClStrip, SampleFlag, bool, double, IProgress<IMessage>, CancellationToken, out double, out int) determines each step's rotation phase by the CWE block-pairing detector (Hi.MillingForces.Training.MillingPhasePairing) instead of the self-bootstrapped averaged-basis lead parameter, and replaces the averaged-basis outlier pre-filter by a residual-based pass. Applies to one-flute and symmetric two-flute cutters in light radial side cuts (contact arc smaller than the flute pitch); when its preconditions do not hold the training falls back to the legacy lead path with a warning.

public static bool EnableCwePhasePairing

Field Value

bool

EnableDesignMatrixSolver

When enabled, the least-squares fits are solved directly on the N-by-p design matrix M (thin QR, plus SVD of its R factor for the lead-para truncated pseudo-inverse) instead of forming the normal-equation matrix MᵀM first. Forming MᵀM squares the condition number (κ(MᵀM) = κ(M)²), which halves the usable precision and blurs the rank structure; the direct path keeps σ(M) intact at the same p-by-p solve size. Experimental flag for the QR-vs-MᵀM solver comparison.

public static bool EnableDesignMatrixSolver

Field Value

bool

EnableMzLeverWeighting

Gets or sets whether Mz lever weighting is enabled during training sample gathering.

public static bool EnableMzLeverWeighting

Field Value

bool

EnableSampleNormalization

[Obsolete]
public static bool EnableSampleNormalization

Field Value

bool

Remarks

The input normalization deminish the quantity effect. The R-value decrease from 99% to 70% in moment training case from NKUST\nkust2024-milling-para-training-plan\workingx.hincproj Don't apply this option.

ReTrainAnchorOutputScale

Weight scale of the virtual anchor samples that pull a GatherAndGetUpdate(ConcurrentDictionary<int, List<ITimeShot>>, ClStrip, ICuttingPara, SampleFlag, double, IProgress<IMessage>, CancellationToken) (ReTrain) result back toward its seed parameter. The anchors are generated at scale * Σoutput / ElementNum per coefficient, so their curvature grows as N² against the data's N — at large sample counts they dominate and the result reproduces the seed.

Set to 0 to make ReTrain purely data-driven: the seed then only supplies the phase alignment and the outlier scoring, which turns ReTrain into an external-lead identifiability instrument ("with a known-good lead but no prior, what do the data actually say?"). The default 0.1 keeps the historical seed-anchored ridge behaviour.

public static double ReTrainAnchorOutputScale

Field Value

double

Properties

CycleDivisionNum

Division number of a spindle cycle.

public static int CycleDivisionNum { get; }

Property Value

int

DefaultParaTemplate

Gets or sets the parameter template for cutting operations.

public static ICuttingPara DefaultParaTemplate { get; set; }

Property Value

ICuttingPara

StepQuantityNames

Gets the names of step quantities used in training.

public static string[] StepQuantityNames { get; }

Property Value

string[]

TextAngleOffset_deg

Gets the text key for angle offset in degrees.

public static string TextAngleOffset_deg { get; }

Property Value

string

TextTrainingErrRatio

Gets the text key for training error ratio.

public static string TextTrainingErrRatio { get; }

Property Value

string

Methods

Convert(ICuttingPara, ICuttingPara, GeneralApt, double, double, IProgress<IMessage>, CancellationToken)

Converts one cutting parameter model to another based on the provided parameters.

public static ICuttingPara Convert(ICuttingPara src, ICuttingPara resultParaTemplate, GeneralApt apt, double helixAngle_rad, double radialRakeAngle_rad, IProgress<IMessage> messageProgress, CancellationToken cancellationToken)

Parameters

src ICuttingPara

Source cutting parameter model

resultParaTemplate ICuttingPara

Destination template for the converted model

apt GeneralApt

General apt parameters

helixAngle_rad double

Helix angle in radians

radialRakeAngle_rad double

Radial rake angle in radians

messageProgress IProgress<IMessage>

Message host for logging

cancellationToken CancellationToken

Cancellation token

Returns

ICuttingPara

The converted cutting parameter model

Convert(LocalProfileMillingPara, double, double, IProgress<IMessage>, CancellationToken)

Converts a LocalProfileMillingPara to a RakeFaceCuttingPara.

public static RakeFaceCuttingPara2d Convert(LocalProfileMillingPara src, double helixAngle_rad, double radialRakeAngle_rad, IProgress<IMessage> messageProgress, CancellationToken cancellationToken)

Parameters

src LocalProfileMillingPara

Source LocalProfileMillingPara

helixAngle_rad double

Helix angle in radians

radialRakeAngle_rad double

Radial rake angle in radians

messageProgress IProgress<IMessage>

Message host for logging

cancellationToken CancellationToken

Cancellation token

Returns

RakeFaceCuttingPara2d

The converted RakeFaceCuttingPara

GatherAndGetUpdate(ConcurrentDictionary<int, List<ITimeShot>>, ClStrip, ICuttingPara, SampleFlag, double, IProgress<IMessage>, CancellationToken)

Gathers training samples and updates an existing cutting parameter model.

public static ICuttingPara GatherAndGetUpdate(ConcurrentDictionary<int, List<ITimeShot>> stepToTimeShotListDictionary, ClStrip clStrip, ICuttingPara anchorPara, SampleFlag sampleFlags, double outlierRatio, IProgress<IMessage> messageProgress, CancellationToken cancellationToken)

Parameters

stepToTimeShotListDictionary ConcurrentDictionary<int, List<ITimeShot>>

Dictionary mapping step indices to time shot lists

clStrip ClStrip

The cutter location strip

anchorPara ICuttingPara

The anchor cutting parameter model to update

sampleFlags SampleFlag

Sample flags indicating which forces to use

outlierRatio double

Ratio of outliers to exclude

messageProgress IProgress<IMessage>

Message host for logging

cancellationToken CancellationToken

Cancellation token

Returns

ICuttingPara

The updated cutting parameter model