-
Notifications
You must be signed in to change notification settings - Fork 33
Bottlecaps Example Machine
Hardware + Software Walkthrough
This example machine combines combines a WAGO 750-671 Stepper Controller with an Elrest IP20-EC-DI8-DO8 EtherCAT Fieldbus Controller to sort bottle caps by color.
While the Stepper Motor powers a conveyor belt, the inputs will be powered by an external algorithm, such as imaging AI, to determine if a bottlecap with the right color is at the right position. Powering an Inputs will simply set the corresponding output to HIGH to be used with, for example, pressured air to sort the bottle cap.
- 24 V DC power supply, for example WAGO 2787-2144
- WAGO 750-354 EtherCAT Coupler
- WAGO 750-602 EtherCAT Power Terminal
- WAGO 750-671 (alternatively 750-672) EtherCAT Stepper Controller Terminal
- WAGO 750-600 EtherCAT End Module
- Elrest IP20-EC-DI8-DO8 EtherCAT Fieldbus Controller
- Linux PC as EtherCAT master
- Standard Ethernet cables
- Wiring tools and appropriate conductors
See Device Example Basics for software prerequisites.
⚠️ Always disconnect power before wiring. See Device Example Basics for the safe wiring procedure.
Ensure motor power voltage does not exceed the rated maximum for your terminal model.
See Hardware Setup of Wago 750-671 and 750-672 on how to set up the stepper motor with WAGO 750-354, 750-602, 750-671 and 750-600.
See Hardware Setup of Elrest IP20-EC-DI8-DO8
Use standard LAN cables to connect your PC to the EtherCAT X1 port of the WAGO 750-354. Connect the IP20-EC-DI8-DO8 to the 750-354 EtherCAT X2 Port.

See Device Example Basics to install and run the software, then return here for the device-specific demo steps.
Once the backend and frontend are running, you should see:
- 750-354 (Coupler)
- 750-671 (Stepper Controller Terminal)
- IP20-EC-DI8-DO8
Steps:
- Click Assign on the IP20-EC-DI8-DO8
- Select Bottlecaps Example V1 as the machine type
- Enter a serial number
- Click Write
- Repeat for the 750-354 using the same serial number
Navigate to Bottlecaps Example on the left.
The control page has five panels:
| Panel | Description |
|---|---|
| Digital Inputs | Live view of each of the 8 inputs (DI1–DI8), displayed as HIGH or LOW |
| Input Overrides | Overrides for each of the 8 inputs to force the corresponding output to ON |
| Stepper Speed | Control the stepper motor speed |
| Frequency Prescaler | Control the Frequency Prescaler |
| Acceleration Factor | Control the Acceleration |
To do
Located in machines/src/bottlecaps_test_machine/.
| File | Description |
|---|---|
mod.rs |
Defines BottlecapsTestMachine struct; holds 8-element arrays for inputs, outputs, digital input (dins) and output (douts) HAL wrappers |
new.rs |
Initializes the IP20EcDi8Do8 device, creates DigitalInput / DigitalOutput wrappers for all 8 channels |
api.rs |
Handles mutations; emits StateEvent via Socket.IO |
act.rs |
Real-time loop: reads inputs, emits state |
Located in electron/src/machines/bottlecaps_test_machine/.
| File | Description |
|---|---|
useBottlecapsTestMachine.ts |
Custom hook; manages optimistic state and sends mutations to the backend |
BottlecapsTestMachineControlPage.tsx |
UI with toggle controls, live input badges, input summary and stepper motor controls |
BottlecapsTestMachineNamespace.ts |
Socket.IO namespace handler; updates the Zustand store with incoming StateEvent messages |
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: