4.2.7 Custom Condition Wafer Position |
The C:\Program Files\RAYLASE\ProcessDataAnalyzer\API\SampleCode\SampleApplications\CustomCondition_WaferPositionDiff is an implementation of the ICondition interface that demonstrates sequence-based position logging for wafer processing applications. This example tracks the first and last marking positions within a sequence, capturing both commanded and measured positions to analyze positioning accuracy across entire marking operations.
This custom condition is particularly useful for:
Wafer marking validation: Verifying start and end positions of wafer marking sequences
Drift detection: Comparing first and last positions to identify positioning drift during processing
Sequence analysis: Understanding position accuracy at sequence boundaries
Quality control: Logging position data for wafer-level process validation
The CustomCondition_WaferPositionDiff example implements sophisticated sequence detection and position logging:
Detects marking sequences based on LM (laser mark) signal activity
Captures position at the first LM rising edge in a sequence
Captures position at the last LM rising edge before sequence end
Configurable timing offsets and inactivity detection
Logs commanded (Tx) and measured (Rx) positions for X and Y axes
The condition uses a JSON configuration file to specify timing parameters:
{
"LmOffsetUs": 0.0,
"ResetTimeWindowUs": 1000.0
}Configuration parameters:
LmOffsetUs: Timing offset (in microseconds) to apply when capturing position relative to LM signal edges. Use this to compensate for known signal delays.
ResetTimeWindowUs: Inactivity period (in microseconds) after which a new sequence is detected. When LM signal is off for longer than this period, the current sequence is considered complete and a new one will start on the next LM rising edge.
The condition implements state-machine-based sequence detection:
Sequence Start: When an LM rising edge is detected and no active sequence is running, a new sequence begins
First Position Capture: The position at the first LM rising edge (plus offset) is recorded and written to CSV
Sequence Tracking: Each subsequent LM rising edge updates the "last edge" position but doesn't write to CSV yet
Sequence End: When LM signal remains off for longer than ResetTimeWindowUs, the sequence ends
Last Position Capture: At sequence end, the position from the last LM rising edge is written to CSV
The Initialize method performs initialization:
Loads configuration from Configuration.json
Prepares output CSV file (deletes existing or creates backup)
Writes CSV header with tab-separated columns
During acquisition, the Check method maintains state and processes each timestamp:
Monitor the BuiltInSignal BisLm signal for rising and falling edges
Update current position values from BisField0TxX/Y and BisField0RxX/Y signals
Detect sequence boundaries based on LM activity and timing
Capture and log first position when sequence starts
Capture and log last position when sequence ends
Maintain internal state for sequence tracking
This condition always returns false, meaning it does not trigger trace file saves. Its purpose is purely to log sequence boundary positions to a CSV file for analysis. |
The condition writes a tab-separated CSV file named WaferPosition.csv in the same directory as the DLL. Each line represents either the first or last position in a sequence:
Timestamp: The timestamp (µs) of the LM edge plus offset
CommandedX: Field0TxX value at the marked position
CommandedY: Field0TxY value at the marked position
MeasuredX: Field0RxX value at the marked position
MeasuredY: Field0RxY value at the marked position
Example CSV output (tab-separated):
Timestamp CommandedX CommandedY MeasuredX MeasuredY 1234567 -10.5 5.2 -10.6 5.1 1456789 10.3 -5.1 10.2 -5.2 2234567 -10.5 5.2 -10.5 5.2 2456789 10.3 -5.1 10.4 -5.0
In this example:
Lines 1-2: First and last positions of sequence 1
Lines 3-4: First and last positions of sequence 2
The implementation uses a helper class PositionData to track position state:
// Maintains current, previous, and last-edge positions private PositionData _current = new(); private PositionData _previous = new(); private PositionData _lastEdge = new(); // PositionData validates that all 4 coordinates are present public bool IsValid => TxX.HasValue && RxX.HasValue && TxY.HasValue && RxY.HasValue;
This ensures that positions are only logged when all required signals (TxX, TxY, RxX, RxY) are available.
Scenario 1: Wafer Marking Validation
When marking multiple dies on a wafer, each die marking operation is a sequence. This condition logs the start and end positions for each die, allowing verification that the marking started and ended at the correct locations.
Scenario 2: Drift Analysis
Compare commanded vs. measured positions at sequence boundaries to detect positioning drift. Calculate the difference between first and last positions to identify systematic drift during the marking sequence.
Scenario 3: Process Quality Documentation
Generate position logs for each wafer processing run. Archive CSV files with wafer IDs for traceability and compliance. Analyze position data to identify process trends over time.
To use the CustomCondition_WaferPositionDiff with the Process Data Analyzer server:
Build the CustomCondition_WaferPositionDiff.dll from the sample code
Create a Configuration.json file with your desired LmOffsetUs and ResetTimeWindowUs values
Place both files in the same directory (or in the Process Data Analyzer server's plugin directory)
Configure the server to use the custom condition (see 4.2.3 Custom Trigger Streaming)
Ensure required signals are enabled: BisLm, BisField0TxX, BisField0TxY, BisField0RxX, BisField0RxY
Start acquisition - sequence boundary positions will be logged to WaferPosition.csv
This example can be extended with additional features:
Position deviation triggering: Return true when the difference between first and last position exceeds a threshold, triggering a trace save for sequences with significant drift
All edges logging: Log every LM rising edge position, not just first and last, for more detailed sequence analysis
Die identification: Include die numbers or coordinates in the CSV output based on position or sequence count
Statistical summary: Calculate and log per-sequence statistics (mean position, drift vector, position variance)
Multi-wafer tracking: Add wafer ID to output and create separate files per wafer
Real-time alerts: Monitor position deviations and trigger condition saves when positions fall outside acceptable tolerances