Skip to content

A synchronized timing system for Digital Image Correlation (DIC) experiments using Instron testing machines. This system consists of two applications that work together to provide precise timing synchronization between the mechanical testing frame and camera recording systems.

Notifications You must be signed in to change notification settings

ilegault/DICTiming

Repository files navigation

DIC Timing System

A synchronized timing system for Digital Image Correlation (DIC) experiments using Instron testing machines. This system consists of two applications that work together to provide precise timing synchronization between the mechanical testing frame and camera recording systems.

Overview

The DIC Timing System enables precise synchronization between:

  • Instron mechanical testing frame (data acquisition)
  • Camera computer (SpinView or similar DIC recording software)

This ensures accurate correlation between mechanical test data and visual deformation measurements in DIC analysis.

System Architecture

┌─────────────────┐    UDP Events    ┌─────────────────┐
│  Frame Computer │ ───────────────► │ Camera Computer │
│                 │                  │                 │
│ frame_forwarder │                  │ click_receiver  │
│                 │ ◄─────────────── │                 │
└─────────────────┘   Clock Sync     └─────────────────┘

Applications

1. Frame Forwarder (frame_forwarder.py)

Installed on: Instron Frame Computer

Purpose: Monitors Instron network traffic and forwards START/STOP events to the camera computer.

Key Features:

  • Packet Sniffing: Monitors Instron network interface for test start/stop events
  • UDP Broadcasting: Sends timing events to camera computer (192.168.1.1:9999)
  • Clock Synchronization: Maintains time sync with camera computer for precise timing
  • Auto-Detection: Automatically finds Instron network interface
  • Logging: Comprehensive session logging and statistics
  • Manual Testing: Built-in tools for testing UDP connectivity

Network Configuration:

  • Listens on Instron network interface (auto-detected)
  • Sends UDP events to: 192.168.1.1:9999 (camera computer)
  • Clock sync service on port: 9998

2. Click Receiver (click_receiver.py)

Installed on: Camera Computer (SpinView/DIC Recording)

Purpose: Receives UDP timing events and automatically controls camera recording software through simulated mouse clicks.

Key Features:

  • UDP Event Reception: Listens for START/STOP events from frame computer
  • Automated Clicking: Simulates mouse clicks on SpinView START/STOP buttons
  • Position Configuration: Visual overlay system for setting click positions
  • Clock Synchronization: Syncs with frame computer for accurate timestamps
  • Session Logging: Detailed logging of all recording sessions with timing data
  • Manual Override: Manual click testing and position adjustment
  • Export Capabilities: CSV and TXT export of session data

Network Configuration:

  • Listens on UDP port: 9999
  • Connects to frame computer: 192.168.1.2:9998 (for clock sync)

Installation

Prerequisites

pip install -r requirements.txt

Required packages:

  • pyinstaller>=5.0 (for building executables)
  • pyautogui>=0.9.54 (for automated clicking)
  • pillow>=9.0.0 (for image processing)

Building Executables

The project includes PyInstaller spec files for creating standalone executables:

# Build Frame Forwarder
pyinstaller frame_forwarder.spec

# Build Click Receiver  
pyinstaller click_receiver.spec

Setup and Configuration

1. Network Setup

Ensure both computers are on the same network with these IP addresses:

  • Frame Computer: 192.168.1.2
  • Camera Computer: 192.168.1.1

2. Frame Computer Setup

  1. Install frame_forwarder.exe on the Instron frame computer
  2. Run the application - it will auto-detect the Instron network interface
  3. Test UDP connectivity using the built-in test functions

3. Camera Computer Setup

  1. Install click_receiver.exe on the camera computer
  2. Open SpinView or your DIC recording software
  3. Run the click receiver application
  4. Configure click positions:
    • Use the visual overlay to set START button position
    • Use the visual overlay to set STOP button position
    • Test positions using the manual click feature

4. Clock Synchronization

The system automatically synchronizes clocks between computers:

  • Frame computer acts as time reference
  • Camera computer adjusts its timestamps accordingly
  • Sync accuracy typically <10ms over local network

Usage

Starting a DIC Recording Session

  1. Prepare SpinView: Open SpinView and prepare for recording
  2. Start Click Receiver: Launch the click receiver on camera computer
  3. Start Frame Forwarder: Launch the frame forwarder on frame computer
  4. Begin Test: Start your Instron test - the system will automatically:
    • Detect test start and send UDP event
    • Click START button in SpinView
    • Detect test end and send UDP event
    • Click STOP button in SpinView
    • Log all timing data with synchronized timestamps

Manual Operation

Both applications support manual operation for testing and troubleshooting:

  • Frame Forwarder: Manual UDP event broadcasting
  • Click Receiver: Manual START/STOP button clicking

Data Logging

Frame Forwarder Logs

  • Session statistics and packet analysis
  • UDP event transmission logs
  • Clock synchronization data
  • Network interface diagnostics

Click Receiver Logs

  • Recording session details with precise timestamps
  • Click position and timing data
  • Clock synchronization status
  • Session duration and statistics

Log Location: ~/Documents/DIC Quality Control/[App Name]/

Export Features

CSV Export

  • Session timing data
  • Synchronized timestamps (local and remote)
  • Click positions and success rates
  • Duration calculations

TXT Export

  • Human-readable session summaries
  • Clock synchronization status
  • Statistical analysis
  • Complete session logs

Troubleshooting

Common Issues

  1. UDP Events Not Received

    • Check network connectivity between computers
    • Verify IP addresses in configuration
    • Test UDP connectivity using built-in tools
  2. Click Positions Incorrect

    • Reconfigure click positions using visual overlay
    • Test positions manually before starting session
    • Ensure SpinView window is visible and not minimized
  3. Clock Sync Issues

    • Check network latency between computers
    • Restart both applications to reset sync
    • Verify both computers have stable network connections
  4. Instron Interface Not Detected

    • Run frame forwarder as administrator
    • Check Instron network cable connections
    • Manually specify network interface if needed

Technical Details

Clock Synchronization Algorithm

  • Uses NTP-like protocol for time synchronization
  • Multiple measurement samples with outlier filtering
  • Achieves sub-10ms accuracy over local networks
  • Automatic drift compensation

Packet Detection

  • Monitors Instron UDP traffic patterns
  • Distinguishes between background, command, and data packets
  • Reliable START/STOP event detection based on packet size analysis

Network Protocol

  • UDP-based for minimal latency
  • JSON message format for events
  • Separate sync protocol on dedicated port
  • Automatic retry and error handling

File Structure

DICTiming/
├── frame_forwarder.py          # Main forwarder application
├── click_receiver.py           # Main receiver application
├── frame_forwarder.spec        # PyInstaller spec for forwarder
├── click_receiver.spec         # PyInstaller spec for receiver
├── requirements.txt            # Python dependencies
├── test_files/                 # Development and testing utilities
│   ├── instron_packet_sniffer.py
│   ├── button_capture.py
│   └── mouseclicker.py
└── README.md                   # This file

Development

Testing Utilities

The test_files/ directory contains development utilities:

  • instron_packet_sniffer.py: Network packet analysis tool
  • button_capture.py: Live button detection utility
  • mouseclicker.py: Universal click timing tool

Contributing

When contributing to this project:

  1. Test on both frame and camera computers
  2. Verify clock synchronization accuracy
  3. Test with actual Instron equipment when possible
  4. Update documentation for any configuration changes

License

This project is designed for research and educational use in mechanical testing and DIC analysis applications.

Support

For issues or questions:

  1. Check the troubleshooting section
  2. Review log files in ~/Documents/DIC Quality Control/
  3. Test individual components using built-in diagnostic tools
  4. Verify network configuration and connectivity

Note: This system is designed for local network operation between dedicated testing computers. Ensure proper network security when deploying in production environments.

About

A synchronized timing system for Digital Image Correlation (DIC) experiments using Instron testing machines. This system consists of two applications that work together to provide precise timing synchronization between the mechanical testing frame and camera recording systems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages