This project contains the software needed to create your own CAL. It depends on Python 3.x and some system libraries; configuration is stored in utils/config.json
.
Overview of some features available through the GUI:
- Print from USB
- Edit settings
- Control stepper and LEDs manually
- Scale the print size %
- Kill GUI (helps if testing other functions on the Pi)
This code was written to be run on a Raspberry Pi 5 without any exterior monitor (although one will be needed for setup) and includes software to operate the printer based on the CAL method. All configuration can be tweaked via utils/config.json
.
Prerequisites:
- System packages (listed in
apt_requirements.txt
)
Steps:
# Clone the repo
git clone https://github.com/computed-axial-lithography/OpenCAL.git
cd OpenCAL
# Install system dependencies
sudo apt update
xargs sudo apt install -y < apt_requirements.txt
# (Optional) create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt
Edit utils/config.json
to match your hardware setup. For example:
{
"rotary_encoder": {
"clk_pin": 5,
"dt_pin": 6,
"btn_pin": 19
},
"camera": {
"type": "rpi",
"index": 0,
"save_path": "/home/pi/OpenCAL/utils/prints"
}
}
To have OpenCAL start automatically at boot, register it as a systemd
service:
-
Copy the service file
sudo cp assets/opencal.service /etc/systemd/system/opencal.service
-
Edit the service definition
sudo nano /etc/systemd/system/opencal.service
Make sure these fields match your install location and user. For example, if you cloned into
/home/pi/OpenCAL
and created avenv
there, you might have:[Unit] Description=OpenCAL 3D Printer Service After=network.target [Service] User=pi WorkingDirectory=/home/pi/OpenCAL ExecStart=/home/pi/OpenCAL/venv/bin/python /home/pi/OpenCAL/main.py Restart=on-failure
-
Reload, enable, and start
sudo systemctl daemon-reload sudo systemctl enable opencal.service # start at boot sudo systemctl start opencal.service
-
Verify it’s running
sudo systemctl status opencal.service sudo journalctl -u opencal.service -f
daemon-reload
tellssystemd
to re-scan unit files.enable
makes it start on every boot;start
fires it now.status
shows exit codes and recent logs;journalctl -f
follows live output so you can spot errors immediately.
If everything is properly connected and installed, the system can run entirely from the GUI. Expected sequence for printing:
- Provide
.mp4
via USB storage device - Navigate to "Print from USB" on the GUI
- Select
.mp4
file for printing - Confirm the rotation speed (in rpm) of the resin
- Start the print or test