Namespace Hi.MillingForces.Training
Classes
- FirstContactWindow
Selects “the first x seconds of contact” of one tool from a step stream: from FromStepIndex on, the tool's touched steps in step order until their
StepDurationsum reaches Target. The window is what the online setup-angle estimate samples — early in the mounting's life, long enough to average the transients out — and it is a property of the step stream alone, so the same tracker serves the armed (step-built event) and the post-hoc (walk the finished strip) paths.Contact time counts touched steps only; untouched steps between them do not count but do lie inside the resulting step range (they carry no sample anyway). Steps of other tools are ignored, so a window survives a tool change in the middle and continues when the tool comes back — the setup angle is a property of the mounting, which the simulation keeps across tool changes. Steps before FromStepIndex are ignored, so an arm issued mid-play samples what is cut after it.
- MillingParaTrainResult
Snapshot of the most recent milling-parameter training call (
LocalProjectService.TrainMillingPara/ReTrainMillingPara) — the queryable training outcome that otherwise only lands in the output.mpfile'sNote. Held byLocalProjectService.LastMillingParaTrainResult(service lifetime, last-wins) so callers such as the webservice can read it after a run without touching the file system.
- MillingTraining
Provides utilities for milling force training and parameter identification.
- SetupAngleEstimate
Result of Estimate(IEnumerable<KeyValuePair<int, List<List<TrainingSample>>>>, double[], SampleFlag, int, double, double, IProgress<IMessage>, CancellationToken): the rotation of the measured spindle-rotation-frame transverse moment (Mx, My, or one of them) relative to the model built from a known cutting parameter, i.e. the cutter setup angle the model is missing, plus the diagnostics that say how much to trust it.
- SetupAngleEstimation
Estimates the cutter setup angle from smart-holder moment samples and a known cutting parameter.
Physics: for a cutter whose flutes are all alike, mounting it turned by φ inside the holder changes the spindle-rotation-frame transverse moment series in two ways only — every (Mx, My) vector rotates by φ and the series shifts by φ along the rotation angle. The per-step begin-angle alignment the training pipeline already performs absorbs the shift, so φ survives solely as a constant planar rotation of the model's (Mx, My) against the measured (Mx, My); Mz, Fz and the workpiece-frame forces carry no information about it. The estimate is therefore a rotation-plus-scale (complex gain) Procrustes fit shared by all steps, with the begin-angle hypothesis chosen per step by brute force.
Channels: Mx, My or both are the transverse channels the angle is read from. With both, the fit is the complex-gain fit above; with one, the gain's two unknowns are solved from that channel alone, which suits a cutter with three or more flutes (over a turn one channel sees the transverse moment from N directions). A one- or two-flute cutter's holder-frame moment swings along one line, so on one channel a turned cutter and a lower gain read the same; there the scale is pinned — to 1, the magnitude being known: the holder delivers calibrated N·m and the coefficients have fixed units (the owner, 2026-10-12); or, with Mz selected and usable (its correlation with the model torque at or above MzCorrelationFloor), to the ratio the torque measures, since Mz = R·Ft reads the tangential force's size whatever the setup angle (the owner, the same day: Mx and Mz together; and 2026-10-16: the torque's zero read from the samples between the flutes' pulses, MzZeroGuard_deg) — and the fit reports the two angles mirrored about that line (ScaleFixed), never applied automatically while two fit. Mz, when selected, enters the per-step begin-angle choice, the shared scale and the energy diagnostics (contrast, residual ratio, the energy cap), not the angle itself. Which channels exist and which are used is the user's selection: the estimator never drops a selected channel, at most it warns.
Identifiability: the angle is determined only modulo the flute pitch (360/N for N uniform flutes) and only when the transverse envelope is modulated within a revolution — light side cuts or intermittent contact; a full slot with several flutes engaged at once leaves the objective flat, which Contrast exposes.
- SetupAngleReport
One tool's entry of the setup-angle report file that
LocalProjectService.EstimateSetupAnglewrites to itsdstRelFile: the SetupAngleEstimate flattened for transport, plus the inputs of the call that made it. The file is a JSON array of these, one per estimated tool, in the estimates' order; ToJson(IEnumerable<SetupAngleReport>) and FromJson(string) are its two ends.A public named type on purpose, never an anonymous one: the shipped assembly is obfuscated with only its public API kept, and an anonymous type there is renamed and loses its constructor parameter names, on which
System.Text.JsonthrowsNotSupportedExceptionbefore a byte is written (the rule of IToPresentDto). The property names are the JSON keys verbatim. NaN is a value here (a failed or degenerate estimate) and is written as the literalNaN.
- SetupAngleReportCurvePoint
One grid sample of a SetupAngleReport's objective curve: the angle hypothesis and the objective value there.
- SetupAngleStepEstimate
Per-step diagnostics of a SetupAngleEstimate.