| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Automated resin material changing system for Anycubic Photon Mono X 6K
A collaborative project between Scion Research and the Massey AgriFood Digital Lab.
This system enables automated multi-material resin 3D printing by coordinating an Anycubic printer with custom stepper-driven pump hardware via a Raspberry Pi controller. Define a recipe of material changes by layer number, and the system handles the rest—pausing the print, swapping materials, and resuming automatically.
# Clone repository
git clone https://github.com/ScionResearch/multi-material-printer.git
cd multi-material-printer
# Install dependencies
pip3 install -r requirements.txt
# Enable I2C interface (first time only)
sudo raspi-config
# Navigate to: Interface Options → I2C → Enable → Reboot
# Configure system
cp config/network_settings.ini.template config/network_settings.ini
nano config/network_settings.ini # Set printer IP address
# Start services
chmod +x start_services.sh stop_services.sh
./start_services.shAccess web interface: http://<raspberry-pi-ip>:5000
Create Recipe (Recipe Builder page):
A,50:B,120:C,200
(Switch to material A at layer 50, B at layer 120, C at layer 200)
Start Print on printer touchscreen or via web UI
Activate Multi-Material Mode (Dashboard):
Monitor Progress:
Comprehensive documentation is available in the docs/ folder:
Operating Manual - User guide for operators and technicians
Programming Manual - Technical documentation for developers
┌─────────── Browser Client ──────────────┐
│ Dashboard │ Recipe Builder │ Manual │
└──────────────┬──────────────────────────┘
│ HTTP REST + WebSocket
▼
┌─────────── Flask Web App ───────────────┐
│ • HTTP API endpoints │
│ • WebSocket server (Socket.IO) │
│ • Command router │
└──────────────┬──────────────────────────┘
│ WebSocket IPC
▼
┌─────────── Print Manager ───────────────┐
│ • Printer status monitoring (4s poll) │
│ • Recipe execution │
│ • Material change orchestration │
└──────────────┬──────────────────────────┘
│ Python modules
▼
┌─────────── Hardware Modules ────────────┐
│ printer_comms │ mmu_control │
│ photonmmu_pump │ solenoid_control │
└──────────────┬──────────────────────────┘
│ WiFi / I2C / GPIO
▼
┌─────────── Physical Hardware ───────────┐
│ • Anycubic Printer (WiFi) │
│ • Stepper Pumps A/B/C/D (I2C) │
│ • Air Solenoid Valve (GPIO 22) │
└──────────────────────────────────────────┘
Design Principles:
multi-material-printer/ ├── web-app/ # Flask web application │ ├── app.py # Main server, HTTP API, WebSocket │ ├── static/ # JavaScript, CSS │ └── templates/ # HTML pages │ ├── src/controller/ # Hardware control modules │ ├── print_manager.py # Main orchestration service │ ├── printer_comms.py # Printer WiFi communication │ ├── mmu_control.py # Material change sequences │ ├── photonmmu_pump.py # Stepper pump control (I2C) │ ├── solenoid_control.py # Air valve control (GPIO) │ └── websocket_ipc.py # WebSocket client library │ ├── config/ # Configuration files │ ├── network_settings.ini # Printer IP, port, timeouts │ ├── pump_profiles.json # Pump parameters, timing │ └── recipe.txt # Current material change recipe │ ├── docs/ # Documentation │ ├── OPERATING_MANUAL.md # User guide │ └── PROGRAMMING_MANUAL.md # Developer guide │ ├── start_services.sh # Start both services ├── stop_services.sh # Stop both services ├── web_app.log # Web app logs └── print_manager.log # Print manager logs
[printer]
ip_address = 192.168.4.2
port = 6000
timeout_seconds = 5
polling_interval_seconds = 4{
"pumps": {
"pump_a": {
"name": "Pump A",
"flow_rate_ml_per_second": 5.0,
"max_volume_ml": 200
}
},
"material_change": {
"quiescence_seconds": 10,
"bed_raise_time_seconds": 15,
"drain_volume_ml": 50,
"fill_volume_ml": 45,
"settle_time_seconds": 5
},
"solenoid": {
"enabled": true,
"gpio_pin": 22,
"activate_before_drain_delay_seconds": 0.5,
"deactivate_after_drain_delay_seconds": 1.0
}
}./start_services.shStarts both web app and print manager in background with logging.
./stop_services.shGracefully stops both services.
pgrep -f "app.py" # Web app PID
pgrep -f "print_manager.py" # Print manager PID
tail -f web_app.log print_manager.log # Monitor logs# Pull latest code and restart services
ssh pidlp@<raspberry-pi-ip> "cd /home/pidlp/pidlp/multi-material-printer && \
git stash && \
git pull origin main && \
./stop_services.sh && \
./start_services.sh"cd src/controller
python3 -c "import printer_comms; print(printer_comms.get_status('192.168.4.2'))"cd src/controller
python3 mmu_control.py A F 5 # Pump A, Forward, 5 secondscd src/controller
python3 solenoid_control.py 3 # 3-second test cyclei2cdetect -y 1
# Should show devices at 0x60 and 0x61Solution:
# Restart services
./stop_services.sh
./start_services.sh
# Check logs
tail -f web_app.log print_manager.logCheck:
Check:
Check:
For detailed troubleshooting, see Operating Manual
Printer Control:
POST /api/printer/pause
POST /api/printer/resume
POST /api/printer/stopPump Control:
POST /api/pump
{
"motor": "A", # A, B, C, or D
"direction": "F", # F = forward, R = reverse
"duration": 10 # seconds
}Solenoid Control:
POST /api/solenoid/activate
POST /api/solenoid/deactivate
POST /api/solenoid/test
{
"duration": 2 # seconds (for test action)
}Multi-Material:
POST /api/multi-material/start
POST /api/multi-material/stop
GET /api/recipe
POST /api/recipeServer → Client:
Client → Server:
⚠️ Important Safety Information:
For complete safety procedures, see Operating Manual
Development:
Acknowledgments:
This project is proprietary to Scion Research and Massey University.
Questions or Issues?
For technical support, refer to the troubleshooting sections in the documentation or contact the development team.
| Back | FazBrowse Home | New Git URL |