Machine state estimation and process supervision

Purpose

  • Combine sensor data into a coherent machine state

  • Supervise the machining process based on estimated state

  • Prevent tolerance loss, chatter, and spindle stall

  • Never perform motion planning or trajectory generation

Machine state estimation

  • State estimation performed in ECU

  • Inputs:

    • vibration:

      • piezo surface microphones

      • accelerometers

    • quasi-static tilt:

      • low-pass-filtered accelerometer data

    • structural load:

      • X-carriage strain gauge

    • spindle load:

      • motor current

  • Sensor fusion performed with explicit time-scale separation:

    • fast signals:

      • vibration

      • chatter indicators

    • slow signals:

      • tilt

      • strain

      • motor current envelope

Machine state classification

  • ECU classifies the current operating state as:

    • normal operation

    • static overload / excessive compliance

    • dynamic instability (chatter)

    • incipient spindle stall

Process supervision actions

  • ECU supervises process only

  • ECU does not:

    • control axis motion

    • modify trajectories

    • override safety systems

  • Actions requested via:

    • Duet macros

    • GPIO signals for low latency

Supervision logic

  • Static overload / excessive compliance:

    • detected by increased tilt and/or strain

    • action: reduce feed rate

  • Dynamic instability (chatter):

    • detected by elevated vibration energy

    • action: adaptive spindle speed adjustment

  • Incipient stall:

    • detected by rapid motor current increase

    • action: immediate feed reduction

State transitions and hysteresis

  • State transitions implemented using Schmitt-trigger logic

  • Upper threshold:

    • spindle motor current ≥ 100 % rated

    • transition to reduced-feed state

  • Lower threshold:

    • spindle motor current ≤ configurable value (e.g. 80 %)

    • maintained for configurable time

    • transition back to normal-feed state

  • Hysteresis prevents oscillation and hunting

Configuration and scope

  • All thresholds and timing parameters:

    • configurable via Raspberry Pi plugin

    • logged for analysis

  • Supervisory logic:

    • non-safety-critical

    • fully disable-able

    • degrades gracefully if unavailable

  • Safety functions remain hardware-only and independent

digraph CNC_Supervision { rankdir=TB; compound=true; fontsize=12; ranksep=1.2; splines=true; labelloc="t"; label="CNC State Estimation, Compliance Supervision and Chatter Control Architecture"; node [shape=box, style=rounded]; /* ======================= SENSOR LAYER ======================= */ subgraph cluster_sensors { label="Sensors"; style=dashed; subgraph cluster_slow { label="Slow Domain (Hz)"; style=dashed; accel_plate_slow [label="Accelerometer\n(Spindle Plate Angle)"]; accel_tower_slow [label="Accelerometer\n(Tower, reference)"]; motor_current [label="Motor Current\n(RS-485)"]; } subgraph cluster_fast { label="Fast Domain (kHz)"; style=dashed; piezo_housing [label="Piezo\n(Spindle Housing)"]; piezo_tower [label="Piezo\n(Tower)"]; accel_plate [label="Accelerometer\n(Spindle Plate)"]; accel_tower [label="Accelerometer\n(Tower)"]; strain_x [label="Strain Gauges\n(X Beams)"]; } } /* ======================= ECU ======================= */ subgraph cluster_ecu { label="ECU (Master PCB)"; style=bold; /* SLOW DOMAIN */ // tilt_est [label="Tilt Estimation\n(Low-pass Accel)"]; // strain_eval [label="Strain Evaluation"]; // { // rank=same; // tilt_est; // strain_eval; subgraph cluster_compliance { label="Compliance Model"; style=dashed; tilt_model[label="Tilt Estimate"]; compliance_model[label="Compliance Model\n(Deflection Estimate)"]; { rank=same; tilt_model; compliance_model; } } // compliance_model[label="Compliance Model\n(Deflection Estimate)"]; // tilt_model[label="Tilt Estimate"]; chatter_metric [label="Chatter Detection"]; stall_detect [label="Incipient Stall Detection"]; /* DECISION LAYER */ decision_layer [label="State Classification & Hysteresis\n\nStates:\n- Normal\n- Compliance Overload\n- Chatter\n- Stall"]; { rank=same; chatter_metric; decision_layer; } } /* ======================= EXTERNAL CONTROLLERS ======================= */ duet [label="Duet 3 6HC\n(Motion Control)"]; spindle [label="Spindle Servo Drive"]; /* ======================= CONNECTIONS ======================= */ /* Sensors to preprocessing */ piezo_housing -> chatter_metric; piezo_tower -> chatter_metric; accel_plate -> compliance_model [lhead=cluster_compliance]; accel_tower -> compliance_model [lhead=cluster_compliance]; // accel_tower -> chatter_metric; // accel_plate -> chatter_metric; strain_x -> compliance_model [lhead=cluster_compliance]; motor_current -> stall_detect; motor_current -> tilt_model [lhead=cluster_compliance]; /* Domains to decision */ chatter_metric -> decision_layer; tilt_model -> decision_layer; stall_detect -> decision_layer; compliance_model -> decision_layer; tilt_model -> compliance_model; accel_tower_slow -> tilt_model [lhead=cluster_compliance]; accel_plate_slow -> tilt_model [lhead=cluster_compliance]; /* Outputs */ decision_layer -> duet [label="GPIO:\nFeed Reduce\nFeed Restore"]; chatter_metric -> spindle [label="RS-485:\nRPM Shift"]; { rank=same; duet; spindle; } }