Remote EtherCAT Motor Control over Ethernet via Python with QEC-M-01

This tutorial demonstrates how to remotely control an EtherCAT motor using Python over standard Ethernet.

A Windows PC sends simple commands to a QEC-M-01 running an 86Duino sketch. The QEC-M-01 handles EtherCAT CiA402 motor control and returns motor position feedback for logging.

The PC side does not need to handle EtherCAT directly. It only sends TCP/IP commands, while QEC-M-01 converts them into real-time EtherCAT motor control actions.

flow_en

1. At a glance

With this example, you can:

  • Control a Moon’s EtherCAT servo drive from a Windows PC
  • Send motor commands through a simple cmd.txt file
  • Record motor position feedback into log.txt
  • Use Python for quick testing, data logging, or upper-level automation
  • Keep real-time EtherCAT control on the QEC-M-01

No special PC-side EtherCAT SDK is required.


2. Workflow

The workflow is simple:

  1. Flash the .ino sketch to QEC-M-01
  2. Set the PC static IP
  3. Ping QEC-M-01
  4. Run the Python watcher
  5. Edit cmd.txt and send commands
  6. Check log.txt and motor action

In this example, QEC-M-01 uses 192.168.1.177, and the PC uses 192.168.1.100.

artitecture(en)

3. Command example

Once the Python watcher is running, edit and save cmd.txt to control the motor.

cmd.txtActionDescription
eEnableEnable the motor
pMove +Move to +100,000 pulses
nMove –Move to -100,000 pulses
dDisableDisable the motor

The Python program detects file changes and sends the command to QEC-M-01 automatically.

topology_1(en)

4. What you need

  • QEC-M-01 EtherCAT MDevice
  • Moon’s EtherCAT servo drive, CiA402-compatible
  • Windows PC
  • Ethernet cable
  • 86Duino IDE
  • Python 3.10.x recommended

5. Important note

Telnet is used in this tutorial for demonstration and testing in a closed LAN or lab environment.

For production systems, use a controlled TCP/socket protocol with authentication, command validation, or encryption as required.


6. Resources

Download the complete development guide and source code below.


7. Next steps

This example can be extended to multi-axis EtherCAT control, Python GUI tools, custom HMI software, data logging, SCADA/MES integration, or automated test systems.

Scroll to Top