A comprehensive solution for connecting industrial saws to the MTConnect standard for real-time monitoring, data collection, and advanced control capabilities.
MTConnect is an open, royalty-free manufacturing communications protocol designed to facilitate data exchange between machine tools and software applications. It provides a common vocabulary with standardized definitions for the meaning of data generated by manufacturing equipment, making the data interpretable by various software applications.
This standardized approach enables:
- Real-time machine monitoring and data collection
- Integration with analytics and business systems
- Improved operational visibility and decision-making
- Enhanced productivity and reduced downtime
The SmartSaw MTConnect system consists of the following containerized components:
- MTConnect Agent: Central component that receives and processes data from the adapter and serves it to client applications using the MTConnect protocol
- HEMsaw Adapter: Interfaces with the saw control system to collect real-time operational data
- ODS (Object Database System): Manages data storage and retrieval for parts, materials, and operational metrics
- MQTT Broker: Manages message queuing and communication between system components with bridge configuration support
- MongoDB: Stores parts, jobs, material data, and historical information with custom configuration support
- Watchtower: Automatically updates Docker containers with the latest available images
All components are containerized using Docker and orchestrated with Docker Compose for simplified deployment and management.
- H130 (508mm x 508mm x 3048mm)
- DC22 (572mm x 572mm x 3048mm)
- DC26 (660mm x 660mm x 3048mm)
- DC30 (762mm x 762mm x 3048mm)
- WF1827 (457mm x 686mm x 3048mm)
- WF160 (635mm x 762mm x 3048mm)
- WF190 (635mm x 1172mm x 3048mm)
Each model is available in both standard and SCT (Smart Cut Technology) variants.
- Real-time Monitoring: Track machine status, operational parameters, and performance metrics
- Servo Control: Precise control of saw head (X-axis) and feed (Z-axis) movements
- Band Motor Monitoring: Track band motor performance and health
- Door State Monitoring: Monitor drive and idle door states for safety and operational insights
- Performance Tracking: Monitor cut time and CPU on time for productivity analysis
- Material Handling: Advanced material handling capabilities integrated with the control system
- Smart Cut Technology (SCT): Available on all models for optimized cutting performance
- Alarm Management: Comprehensive alarm system with JSON-based configuration for condition monitoring
- Message Events: Real-time service and switch status monitoring through message event data items
- Enhanced Logging: Comprehensive logging support across all components with log repair utilities
- Docker Compose V2 Support: Full compatibility with both Docker Compose V1 and V2 commands with auto-detection
- Containerized Deployment: All components run in Docker containers for easy installation and updates
To get the system working on the IPC (Industrial PC) for the first time, clone the GitHub repository:
git clone --recurse-submodules --progress --depth 1 https://github.com/HEM-Inc/MTConnect_SmartSaw.git mtconnect
After cloning the repository, run the installation script to place files in the correct locations:
sudo bash ssInstall.sh
If the agent has already been loaded, use the update script to update the files and restart the service:
sudo bash ssUpgrade.sh
Edit the env.sh
file to set the default installation file names for your specific installation, or run the ssInstall.sh
/ssUpgrade.sh
script with the appropriate options. The chosen files will be defined in the env.sh
file, allowing for persistence of these settings across all updates and installs on that machine.
The system automatically detects whether you're using Docker Compose V1 or V2 and adjusts commands accordingly. You can also force a specific version using the -v
option if needed.
The system includes several management scripts for installation, updates, and maintenance:
Installs the MTConnect components, including the Agent, Adapter, ODS, DEVCTL, MQTT Broker, and MongoDB.
Syntax: ssInstall.sh [-h|-a File_Name|-j File_Name|-d File_Name|-c File_Name|-u Serial_number|-v version|-f]
options:
-a File_Name Declare the afg file name; Defaults to - SmartSaw_DC_HA.afg
-j File_Name Declare the JSON file name; Defaults to - SmartSaw_alarms.json
-d File_Name Declare the MTConnect agent device file name; Defaults to - SmartSaw_DC_HA.xml
-c File_Name Declare the Device control config file name; Defaults to - devctl_json_config.json
-u Serial_number Declare the serial number for the uuid; Defaults to - SmartSaw
-b Use the MQTT bridge configuration file name; Defaults to - mosq_bridge.conf
-v version Force Docker Compose version (1 or 2); Defaults to auto-detect
-f Force install of the files
-h Print this Help.
Note: The system supports MTConnect protocol version 2.3+ and uses standard port configurations:
- MTConnect Agent: Port 5000 (HTTP)
- HEMsaw Adapter: Port 7878 (TCP)
- MQTT Broker: Port 1883 (MQTT), Port 9001 (WebSocket)
- ODS: Port 9625 (HTTP)
- MongoDB: Port 27017 (Internal only, bound to localhost)
Upgrades existing components and restarts services. The upgrade process now runs in parallel for improved performance and includes support for reinitializing MongoDB parts and job databases.
Syntax: ssUpgrade.sh [-A|-a File_Name|-j File_Name|-d File_Name|-c File_Name|-u Serial_number|-v version|-b|-m|-i|-h]
options:
-A Update the MTConnect Agent, HEMsaw adapter, ODS, MQTT, Devctl, and Mongodb application
-a File_Name Declare the afg file name; Defaults to - SmartSaw_DC_HA.afg
-j File_Name Declare the JSON file name; Defaults to - SmartSaw_alarms.json
-d File_Name Declare the MTConnect agent device file name; Defaults to - SmartSaw_DC_HA.xml
-c File_Name Declare the Device control config file name; Defaults to - devctl_json_config.json
-u Serial_number Declare the serial number for the uuid; Defaults to - SmartSaw
-v version Force Docker Compose version (1 or 2); Defaults to auto-detect
-b Update the MQTT broker to use the bridge configuration; runs - mosq_bridge.conf
-m Update the MongoDB database with default materials
-i ReInit the MongoDB parts and job databases
-h Print this Help.
Removes installed components and cleans up the system.
Syntax: ssClean.sh [-A|-H|-a|-M|-O|-C|-S|-d|-D|-L|-h]
options:
-A Uninstall ALL
-H Uninstall the HEMsaw adapter application
-a Uninstall the MTConnect Agent application
-M Uninstall the MQTT Broker application
-O Uninstall the HEMsaw ods application
-C Uninstall the HEMsaw devctl application
-S Uninstall the HEMSaw MongoDB application
-d Disable mongod, ods, and agent daemons
-D Uninstall Docker
-L Container_Name Log repair for any NULL or ^@ char
-h Print this Help.
Checks the status of all system components.
The system includes comprehensive logging capabilities with automatic log rotation (10MB max size, 3 files) and repair utilities. Use the -L
option in ssClean.sh
to repair logs with NULL or control characters.
All containers use JSON file logging driver with size and rotation limits to prevent disk space issues.
The MTConnect Agent serves as the central component of the system, receiving data from the adapter and serving it to client applications in the MTConnect standard format. It handles data translation, buffering, and protocol compliance.
The adapter interfaces directly with the saw control system, collecting real-time operational data and translating it into a format usable by the MTConnect Agent. It monitors various parameters such as axis positions, motor status, door states, and operational modes.
The ODS manages data storage and retrieval for parts, materials, and operational metrics. It provides a structured way to store and access this information for analysis and reporting.
The Device Control Platform enables remote programming of materials and jobs. It provides an interface for defining, scheduling, and managing cutting operations.
The MQTT Broker manages message queuing and communication between system components. It enables flexible, efficient, and reliable message passing within the system.
MongoDB serves as the database backend for the system, storing parts, jobs, material data, and historical information. It uses MongoDB 4.4 with custom configuration support and automatic material database initialization. The database is only accessible from localhost for security.
- Added auto-detection for Docker Compose version with option to force specific version
- Enhanced compatibility with both Docker Compose V1 and V2
- Added logs folder support to DEVCTL component
- Fixed DEVCTL configuration file JSON syntax issues
- Major refactoring of upgrade and install scripts for Docker Compose V2 support
- Parallel execution support in upgrade scripts for improved performance
- Deprecated legacy Docker Compose version options
- If components don't start properly, check the logs with
docker-compose logs [service_name]
ordocker compose logs [service_name]
(V2) - Use the ssStatus.sh script to check the status of all components
- Ensure proper permissions on configuration files and directories
- Verify network connectivity between components
- Use the log repair functionality (
ssClean.sh -L
) for corrupted log files - Check the ChangeLog.md for recent updates and known issues
- Verify Docker and Docker Compose are properly installed and running
- Ensure all required directories have proper permissions (adapter, agent, ods, devctl, mongodb, mqtt)
- For Ubuntu 24.04+ systems, Docker Compose V2 is automatically detected and used
The system uses a well-defined directory structure for configuration and data storage:
/etc/
├── adapter/
│ ├── config/ # AFG files (e.g., SmartSaw_DC_HA.afg)
│ ├── data/ # JSON alarm files (e.g., SmartSaw_alarms.json)
│ └── log/ # Adapter log files
├── mtconnect/
│ ├── config/ # agent.cfg and device XML files
│ └── data/ruby/ # Ruby scripts and styles
├── mqtt/
│ ├── config/ # mosquitto.conf, bridge configurations
│ ├── data/ # ACL files
│ └── certs/ # SSL certificates
├── ods/
│ └── config/ # ODS configuration files
├── devctl/
│ ├── config/ # devctl_json_config.json
│ └── logs/ # Device control logs
└── mongodb/
├── config/ # mongod.conf
└── data/db/ # Database files
- AFG Files: Adapter configuration files defining data collection parameters
- Device XML Files: MTConnect device definitions (must have device name on line 11)
- JSON Alarm Files: Alarm condition definitions for monitoring
- Agent Configuration: MTConnect agent settings and device mappings
- MQTT Configuration: Message broker settings and bridge configurations
- MongoDB Configuration: Database settings and connection parameters
The env.sh
file defines default configuration file names:
Afg_File
: Default AFG configuration fileJson_File
: Default JSON alarm fileDevice_File
: Default MTConnect device XML fileSerial_Number
: Default serial number for UUID generationDevCTL_File
: Default device control configuration file
The SmartSaw MTConnect implementation provides comprehensive data collection and monitoring capabilities:
- Axis Position Data: Real-time position feedback for X (saw head), Z (feed), and A (rotation) axes
- Servo Control: Position commands and feedback for precise movement control
- Band Motor: Motor status, speed, and health monitoring
- Door States: Drive and idle door position monitoring for safety compliance
- Performance Metrics: Cut time tracking and CPU on-time monitoring
- System Status: Machine operational state and mode information
- Condition Monitoring: Axis conditions, communication status, hydraulic levels, and end-of-bar detection
- Message Events: Service status and switch status reporting
- Work Envelope: Dimensional constraints and operational boundaries
- Protocol Version: MTConnect 2.3+ compliant
- Schema Support: Full MTConnect device schema implementation
- Data Streaming: Real-time data streaming with configurable buffer sizes
- Asset Management: Support for cutting tool and material asset tracking
- Condition Handling: Comprehensive alarm and condition management system
- Generic Condition Functions: Configurable condition monitoring through JSON alarm files
- Custom Data Items: Support for saw-specific data items and measurements
- Historical Data: Integration with MongoDB for historical data storage and retrieval
- Remote Control: Device control capabilities through DEVCTL platform
For support, please contact HEM Inc. technical support or visit our website for documentation and resources.
This project is released under the license included in the LICENSE file.