Laser scanning is the controlled deflection of laser beams, visible or invisible.
In a high-speed polygon scanner system, the laser is deflected by a rotating prism or mirror.
The position of the laser is determined via a photodiode.
Hexastorm is a full toolkit for working with polygon lasers scanners using FPGA technology; and provides hardware, gateware, and software
to enable laser scanning applications.
Code is tested on the system shown above, branded as Hexastorm.
The FreeCAD design is shared here
and PCB designs are found here.
A blog can be found on Hackaday.
The code took most inspiration from LDGraphy.
Making a PCB with scanner is shown in the video;
.
The alignment procedure is shown in the following video.
Code is tested on a Raspberry Pi 3B and 4B. The SD-card should be at least 8 GB, ideally 16 GB.
Both 32 bit and 64 bit are tested, with camera.
Development is done on the main or master branch. Look through to commit history to find the right working version which was used in the video.
Install poetry and python.
sudo apt install python3 python3-pip
curl -sSL https://install.python-poetry.org | python3 -
Use poetry to install the dependencies in pyproject.toml. The virtual environment needs to be installed in project for VSCode to detect it.
poetry config virtualenvs.in-project true
poetry install --without raspberry,64bit
Poetry creates a virtual environment for you.
poetry run python
gives you access to the packages installed.
Depending on your operating system you also need to install certain extras.
Look into the pyproject.toml file for the possibilities.
Yosys must be compiled or installed via oss-cad-suite.
An alternative is to install python packages which use wasm but these are experimental.
poetry install --without raspberry
If this doesn't work try You can test code as follows.
poetry run python3 -m hexastorm.movement
If you want to interact with the stepper motors and flash the fpga.
./install.sh
An idea, I am working on is to call controller.py from Micropython. Most dependencies can be moved to ESP32.
The following lines need to be in the /boot/config.txt;
# I2C for laserdriver and camera
dtparam=i2c_arm=on
dtparam=i2c_vc=on
# SPI
dtoverlay=spi0-1cs,cs0_pin=18
dtoverlay=spi1-1cs,cs0_pin=7
# camera
dtoverlay=vc4-fkms-v3d
start_x=1
gpu_mem=300
There should not be dtparam=spi=on, somewhere. This would enable two chip selects for SPI0 and creates a conflict with the pin select of SPI1.
Install my version of the Python libary available at ArducamPython.