-
Notifications
You must be signed in to change notification settings - Fork 33
Minimal Example El7031 Motor
A complete hardware + software walkthrough
This project documents the successful integration of a Beckhoff EL7031-0030 Stepper Motor Terminal into the QiTech control software stack. The goal was to control a 24V stepper motor via EtherCAT using a custom Rust backend and a React/Electron frontend.
See Device Example Basics for software prerequisites.
- EtherCAT Master: Linux PC
- Bus Coupler: EtherCAT Beckhoff EK1100
- Stepper Driver: Beckhoff EL7031-0030 (THIS IS DIFFERENT FROM EL7031)
- Motor: Standard 4-wire Stepper Motor
- Power Supply: 24V DC
- Ethernet Cable: Standard Ethernet cable
- Wiring Tools: Screwdriver, wires
This wiring configuration powers the EL7031-0030.
It is not the only possible wiring but is the simplest functional setup.
⚠️ Always disconnect power before wiring. See Device Example Basics for the safe wiring procedure.
We supply power using a DC hollow-plug adapter, like this one:
https://www.amazon.de/dp/B093FTFZ8Q
Perform the following wiring on the EK1100:
- Red wire (+24 V) → Terminal 2
- Black wire (0 V) → Terminal 3
- Jumper wire from Terminal 1 → Terminal 6
- Jumper wire from Terminal 5 → Terminal 7
After wiring, your module should look like Figure 1.
Slide the EL7031-0030 onto the right side of the EK1100 until it locks. The EtherCAT E-Bus and power contacts connect automatically — no wiring required.
Now the motor is wired via the pins 4, 5, 12, 13 on the EL7031-0030.
That's what the pin should look like.
Crucial: The EL7031 requires two power sources: E-Bus (side contacts) for logic, and Front Terminal (6 & 14) for motor power.
| Terminal Point | Function | Cable Color (Example) |
|---|---|---|
| 4 | Motor Coil A1 | Red |
| 12 | Motor Coil A2 | Blue |
| 5 | Motor Coil B1 | Green |
| 13 | Motor Coil B2 | Black |
| 6 | Power +24V | PSU Red (+) |
| 14 | Power 0V/GND | PSU Black (-) |
-
Mandatory Power Supply: Without 24V connected to Pin 6 (+24V) and Pin 14 (GND), the terminal will remain in
PREOPstate or show a "Warning" LED (No Power). The motor will not move without this external supply.
- Never connect the 24V Power Supply to the Motor Output pins (4, 5, 12, 13). This will instantly destroy the terminal (causing pins 12 & 13 to glow red/burn).
- Ensure strict separation: Pins 4/5/12/13 are for the MOTOR ONLY.
- Pins 6/14 are for POWER ONLY.
Also, see the documentation of the EtherCAT terminal (EL7031-0030) for the different power modes (page 46 ff.)
See Device Example Basics to install and run the software, then return here for the device-specific demo steps.
Once the backend + frontend are running, you should see:

Make sure that under "Assign" → "Machine Assignment" the correct serial number is selected (each device should have the same one, here it is 1). Under "Machine" select your new Machine however you named it (I named it "TestMotor V1"), else it will detect that there is something connected to it but the connection won't work.

NOW THE MOTOR SHOULD TURN!
In the interface "TestMotor" on the left side, you can now control the motor (its state and its speed).

Use the official documentation of the EL7031-0030 for more information:
Beckhoff EL7031-0030 Documentation
Located in machines/src/motor_test_machine/.
-
mod.rs: Defines theMotorTestMachinestruct and holds the state (driver wrapper, enabled state, target velocity). -
api.rs: Handles incoming JSON commands from the frontend (Enable/Disable, Set Velocity) via WebSockets/SocketIO. -
act.rs: The real-time control loop. It updates theStepperVelocityEL70x1driver wrapper in every cycle based on the current state. -
new.rs: Initializes the hardware.
Located in electron/src/machines/motor_test_machine/ and electron/src/routes/routes.tsx.
-
useTestMotor.ts: Custom hook managing the optimistic state and communication with the backend. -
TestMotorControlPage.tsx: The UI using QiTech UI components (ControlCard,EditValue,SelectionGroupBoolean) to match the look and feel of the Winder2. -
Routing: Integrated into
routes.tsxusing TanStack Router, ensuring the machine appears in the sidebar and navigation works correctly.
QiTech Control | GitHub | Video Demo | Open Source Framework for Industrial Control
- Getting Started
- Adding a Machine
- Adding a minimal machine e.G. 4CH DO
- Code Style
- Performance
- Testing
- Adding Presets to Machines
- NixOS
Beckhoff:
WAGO:
- 4 Digital In (750-402)
- 8 Digital In (750-430)
- 8 Digital In + 8 Digital Out (750-1506)
- 4 Analog In (750-455)
- 2 Digital Out (750-501)
- 8 Digital Out (750-530)
- Stepper (750-671 & 750-672)
- Power Supply (2789‐9052)
- Serial Interface (750-652)
- 4-channel Analog input module Pt100 RTD (750-460)
- 8 Digital In + 8 Digital Out (750-430 + 750-530)
Elrest:
WAGO: