A Python software architecture designed for the automation, control, and monitoring of Fischertechnik industrial plants/stations based on the Revolution Pi (RevPi) controller (with hardware I/O interface managed via revpimodio2) and data transmission integration via MQTT.
The project structure follows a modular, object-oriented approach, divided into the following main layers:
fishertechnik-revpi-controller/
├── requirements.txt
└── src/
├── __init__.py
├── multiprocess_manager.py
├── components/
│ ├── basic_components/
│ │ ├── generic_revpi_actuator.py
│ │ └── generic_revpi_sensor.py
│ ├── revpi_single_motion_actuator.py
│ ├── revpi_double_motion_actuator.py
│ ├── revpi_vacuum_actuator.py
│ ├── revpi_light_barrier_sensor.py
│ └── revpi_reference_sensor.py
├── machines/
│ ├── compressor_service.py
│ ├── conveyor_carrier.py
│ ├── oven_station.py
│ ├── oven_station_temperature_control.py
│ ├── saw_station.py
│ ├── turntable_carrier.py
│ ├── vacuum_carrier.py
│ ├── additional_components/
│ │ └── motor_retarder_system.py
│ └── configurations/
│ ├── compressor_service_conf.py
│ ├── conveyor_carrier_conf.py
│ ├── default_station_configs.py
│ ├── multiproc_dept_conf.py
│ ├── oven_station_conf.py
│ ├── saw_station_conf.py
│ ├── turntable_carrier_conf.py
│ └── vacuum_carrier_conf.py
└── mqtt/
├── mqtt_publisher.py
├── mqtt_conf_listener.py
├── mqtt_conf_pub_test.py
└── mqtt_conf/
└── mqtt_conf_parameters.py
Abstracts the actuators and sensors connected to the Revolution Pi hardware using the revpimodio2 library:
- Basic Components:
generic_revpi_actuator.pyandgeneric_revpi_sensor.py, which define the general interface for hardware signal manipulation. - Specific Actuators:
revpi_single_motion_actuator: Controls single-directional motors or actuators.revpi_double_motion_actuator: Controls two-directional motors (e.g., forward/backward, up/down).revpi_vacuum_actuator: Management of vacuum suction cups and suction valves.- Specific Sensors:
revpi_light_barrier_sensor: Management of photocells/light barriers for part detection.revpi_reference_sensor: Limit switch/reference position sensors.
Implements the status and work logic of the various physical modules of the Fischertechnik model:
conveyor_carrier: Management of the conveyor belt for moving parts.vacuum_carrier: Manipulator or arm with vacuum gripper for loading/unloading materials.turntable_carrier: Rotating table for redirecting machined parts.oven_station&oven_station_temperature_control: Oven station with temperature and cooking cycle regulation/control.saw_station: Processing/sawing station.compressor_service: Central compressed air generation and management service.configurations/: Contains the RevPi I/O pin mapping and configuration parameters for each individual station/machine.
MQTT-based network and messaging interface (paho-mqtt):
mqtt_publisher: Publishes machine statuses, sensor data, and telemetry in real time to dedicated topics.mqtt_conf_listener&mqtt_conf_parameters: Listens for remote configuration messages/commands and manages dynamic parameters.mqtt_conf_pub_test: Test script to verify message publishing and subscription.
Main script for starting and managing multiple physical stations simultaneously. It uses multiprocessing to run the stations in parallel, ensuring synchronization and independent execution on embedded/Linux systems.
The project's dependencies are listed in the requirements.txt file:
paho-mqtt(==1.6.1): MQTT client for managing data flows.revpimodio2(==2.5.10): Official Python framework for interfacing with the Kunbus Revolution Pi I/O image process.pkg-resources(==0.0.0): Python package management utility.
To install dependencies:
pip install -r requirements.txt-
Hardware Configuration: Make sure the I/O configuration (
PiCtory) on the Revolution Pi matches the assignments defined in the files in thesrc/machfolder. ines/configurations/`. -
Running the Orchestrator: To start the entire multi-control system and station management:
python src/multiprocess_manager.py- Test MQTT Communication: To test sending/receiving configuration parameters via MQTT:
python src/mqtt/mqtt_conf_pub_test.py