EtherCAT interface for ME-Messsysteme GSV-8 force/torque sensor amplifier
Project description
gsv8-ethercat
Python interface for ME-Messsysteme GSV-8 force/torque sensor amplifier via EtherCAT.
Features
- Simple, intuitive API for sensor communication
- Automatic calibration handling (scale, offset)
- Real-time data acquisition from 8 channels
- Diagnostic tools and communication testing
- Calibration utilities (zero, calibrate with known values)
- Data logging and monitoring
- Command-line tools for quick operations
Installation
pip install gsv8-ethercat
From source
git clone https://github.com/kkats-mech/gsv8-ethercat.git
cd gsv8-ethercat
pip install -e .
Quick Start
from gsv8_ethercat import GSV8Sensor
# Initialize sensor
sensor = GSV8Sensor(r'\Device\NPF_{YOUR_ADAPTER_ID}')
# Connect
if sensor.connect():
# Read data
data = sensor.read_data()
print(f"Forces: {data.engineering_values}")
print(f"Status: {data.status}")
# Disconnect
sensor.disconnect()
Using Context Manager
from gsv8_ethercat import GSV8Sensor
with GSV8Sensor(adapter_name) as sensor:
forces = sensor.get_all_forces()
print(forces)
Command-Line Tools
After installation, three CLI tools are available:
# Run diagnostics
gsv8-diagnostics 'YOUR_ADAPTER_NAME'
# Interactive calibration wizard
gsv8-calibrate 'YOUR_ADAPTER_NAME'
# Monitor and log data
gsv8-monitor 'YOUR_ADAPTER_NAME' --log data.csv --duration 60
API Overview
Core Classes
GSV8Sensor
Main interface to the sensor hardware.
from gsv8_ethercat import GSV8Sensor
sensor = GSV8Sensor(adapter_name, slave_position=0)
sensor.connect()
# Read all channels
data = sensor.read_data()
# Get specific channel
force = sensor.get_channel_force(channel=0)
# Get all forces
forces = sensor.get_all_forces()
sensor.disconnect()
GSV8Diagnostics
Device diagnostics and testing.
from gsv8_ethercat import GSV8Sensor, GSV8Diagnostics
sensor = GSV8Sensor(adapter_name)
sensor.connect()
diag = GSV8Diagnostics(sensor)
diag.print_device_info()
diag.check_communication(cycles=100)
diag.analyze_channel_data(duration_sec=5.0)
GSV8Calibration
Calibration and zeroing utilities.
from gsv8_ethercat import GSV8Sensor, GSV8Calibration
sensor = GSV8Sensor(adapter_name)
sensor.connect()
cal = GSV8Calibration(sensor)
# Zero all channels (no load)
cal.zero_all_channels(samples=100)
# Calibrate with known value
cal.calibrate_channel(channel=0, known_value=100.0, samples=100)
# Save/load calibration
cal.save_calibration_to_file("my_cal.txt")
cal.load_calibration_from_file("my_cal.txt")
GSV8Monitor
Real-time monitoring and data logging.
from gsv8_ethercat import GSV8Sensor, GSV8Monitor
sensor = GSV8Sensor(adapter_name)
sensor.connect()
monitor = GSV8Monitor(sensor)
# Live terminal display
monitor.live_monitor(channels=[0, 1, 2])
# Log to CSV
monitor.log_to_file("data.csv", duration=60.0, sample_rate=100.0)
Data Structure
@dataclass
class GSV8Data:
raw_values: List[float] # 8 raw process values
engineering_values: List[float] # 8 calibrated values
status: List[int] # 8 status bytes
working_counter: int # EtherCAT working counter
timestamp: float # Unix timestamp
Examples
Simple Force Reading
from gsv8_ethercat import GSV8Sensor
import time
with GSV8Sensor(adapter_name) as sensor:
for i in range(100):
force = sensor.get_channel_force(0)
print(f"Force: {force:.3f} N")
time.sleep(0.01)
Multi-Channel Monitoring
from gsv8_ethercat import GSV8Sensor
import time
with GSV8Sensor(adapter_name) as sensor:
while True:
data = sensor.read_data()
print(f"Fx:{data.engineering_values[0]:>8.2f} "
f"Fy:{data.engineering_values[1]:>8.2f} "
f"Fz:{data.engineering_values[2]:>8.2f}")
time.sleep(0.1)
Calibration Workflow
from gsv8_ethercat import GSV8Sensor, GSV8Calibration
sensor = GSV8Sensor(adapter_name)
sensor.connect()
cal = GSV8Calibration(sensor)
# Step 1: Zero (no load)
print("Remove all loads...")
input("Press Enter...")
cal.zero_channel(0, samples=200)
# Step 2: Calibrate (known load)
print("Apply 100 N...")
input("Press Enter...")
cal.calibrate_channel(0, known_value=100.0, samples=200)
# Step 3: Verify
for i in range(10):
force = sensor.get_channel_force(0)
print(f"Reading: {force:.3f} N")
time.sleep(0.5)
# Step 4: Save
cal.save_calibration_to_file("calibrated.txt")
sensor.disconnect()
Data Logging
from gsv8_ethercat import GSV8Sensor, GSV8Monitor
with GSV8Sensor(adapter_name) as sensor:
monitor = GSV8Monitor(sensor)
monitor.log_to_file("experiment.csv", duration=60.0, sample_rate=200.0)
# Later, analyze with pandas
import pandas as pd
df = pd.read_csv("experiment.csv")
df[['ch0_eng', 'ch1_eng', 'ch2_eng']].plot()
Requirements
- Python 3.7+
- pysoem (EtherCAT communication)
System Requirements
Windows:
- Npcap driver (https://npcap.com/)
Linux:
- Root privileges or
CAP_NET_RAWcapability - EtherCAT-capable network adapter
Hardware Support
- Device: ME-Messsysteme GSV-8 amplifier
- Manufacturer: ME-Messsysteme GmbH
- Protocol: EtherCAT (CoE)
- Channels: 8 analog measurement channels
- Data Rate: Up to 10 kHz per channel
PDO Mapping
- Process Values (0x6130:1-8): 8 × 32-bit floats
- Status Bytes (0x6150:1-8): 8 × 8-bit status
- Scale Factors (0x6126:1-8): 8 × 32-bit floats
- Offsets (0x6127:1-8): 8 × 32-bit floats
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- ME-Messsysteme GmbH for the GSV-8 hardware
- OpenEtherCATsociety for SOEM
- pysoem developers
Support
- Hardware: ME-Messsysteme Website
- pysoem: pysoem GitHub
Handle with care. Use wisely. Do not drink and drive. Be responsible.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gsv8_ethercat-0.1.0.tar.gz.
File metadata
- Download URL: gsv8_ethercat-0.1.0.tar.gz
- Upload date:
- Size: 29.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ef4df92056b07d4456e5e50c59117fae9755747368683733a95acff1fb41068
|
|
| MD5 |
eb64783d63895cce67d0b4de96200568
|
|
| BLAKE2b-256 |
e5218ea16ddb8825c2e08b804c28f2d3ad605a9695f1b25737da8529ce67ccf0
|
Provenance
The following attestation bundles were made for gsv8_ethercat-0.1.0.tar.gz:
Publisher:
workflow.yml on kkats-mech/gsv8-python-package
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsv8_ethercat-0.1.0.tar.gz -
Subject digest:
9ef4df92056b07d4456e5e50c59117fae9755747368683733a95acff1fb41068 - Sigstore transparency entry: 654663210
- Sigstore integration time:
-
Permalink:
kkats-mech/gsv8-python-package@739d86b6a2044c94feb07153e87a440d1fccb83d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kkats-mech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@739d86b6a2044c94feb07153e87a440d1fccb83d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file gsv8_ethercat-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gsv8_ethercat-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afb6e568944dad81673a8e4f95cf10c30f7df3f7d729c699115a3f8f19c2a7a9
|
|
| MD5 |
088a31088c6e87dfbb3e27fdca374117
|
|
| BLAKE2b-256 |
b0a433b720328388fa5d7ef7b4e11b7e330c44c5c59322aebfbf0ca24f0a16d4
|
Provenance
The following attestation bundles were made for gsv8_ethercat-0.1.0-py3-none-any.whl:
Publisher:
workflow.yml on kkats-mech/gsv8-python-package
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsv8_ethercat-0.1.0-py3-none-any.whl -
Subject digest:
afb6e568944dad81673a8e4f95cf10c30f7df3f7d729c699115a3f8f19c2a7a9 - Sigstore transparency entry: 654663356
- Sigstore integration time:
-
Permalink:
kkats-mech/gsv8-python-package@739d86b6a2044c94feb07153e87a440d1fccb83d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/kkats-mech
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@739d86b6a2044c94feb07153e87a440d1fccb83d -
Trigger Event:
workflow_dispatch
-
Statement type: