Click or drag to resize

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

Sequence-Based Position Logging

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

Configuration Structure

The condition uses a JSON configuration file to specify timing parameters:

Configuration.json
{
  "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.

Sequence Detection Logic

The condition implements state-machine-based sequence detection:

  1. Sequence Start: When an LM rising edge is detected and no active sequence is running, a new sequence begins

  2. First Position Capture: The position at the first LM rising edge (plus offset) is recorded and written to CSV

  3. Sequence Tracking: Each subsequent LM rising edge updates the "last edge" position but doesn't write to CSV yet

  4. Sequence End: When LM signal remains off for longer than ResetTimeWindowUs, the sequence ends

  5. Last Position Capture: At sequence end, the position from the last LM rising edge is written to CSV

Implementation Details

The Initialize method performs initialization:

  1. Loads configuration from Configuration.json

  2. Prepares output CSV file (deletes existing or creates backup)

  3. Writes CSV header with tab-separated columns

During acquisition, the Check method maintains state and processes each timestamp:

  1. Monitor the BuiltInSignal BisLm signal for rising and falling edges

  2. Update current position values from BisField0TxX/Y and BisField0RxX/Y signals

  3. Detect sequence boundaries based on LM activity and timing

  4. Capture and log first position when sequence starts

  5. Capture and log last position when sequence ends

  6. Maintain internal state for sequence tracking

Note  Note

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.

CSV Output Format

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):

WaferPosition.csv
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

Position Tracking Internals

The implementation uses a helper class PositionData to track position state:

Position State Management
// 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.

Usage Scenarios

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.

Integration with PDA Server

To use the CustomCondition_WaferPositionDiff with the Process Data Analyzer server:

  1. Build the CustomCondition_WaferPositionDiff.dll from the sample code

  2. Create a Configuration.json file with your desired LmOffsetUs and ResetTimeWindowUs values

  3. Place both files in the same directory (or in the Process Data Analyzer server's plugin directory)

  4. Configure the server to use the custom condition (see 4.2.3 Custom Trigger Streaming)

  5. Ensure required signals are enabled: BisLm, BisField0TxX, BisField0TxY, BisField0RxX, BisField0RxY

  6. Start acquisition - sequence boundary positions will be logged to WaferPosition.csv

Extending the Example

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

See Also