Scanning system

Introduction

This configuration may be useful for building a galvanometer controller for an optical scanner or a scanning coil controller for a scanning electron microscope.

Some interesting links on scanning and imaging techniques:

Hardware

The system outputs the line scan signal to OUT1 and the raster scan signal to OUT2. The trigger and S&H pulses are available from the pins DIO0_N and DIO1_N on the E1 connector. The analog signals corresponding to each pixel are input to IN1 and IN2.

The basic blocks of the system are shown on the following diagram:

Scanner

The projects/scanner directory contains one Tcl file block_design.tcl that instantiates, configures and interconnects all the needed IP cores.

Software

The projects/scanner/server directory contains the source code of the TCP server (scanner.c) that receives control commands and transmits the data to the control program running on a remote PC.

The projects/scanner/client directory contains the source code of the control program (scanner.py).

Scanner client

Getting started with MS Windows

C:\Python34\python.exe -m pip install --upgrade pip
C:\Python34\Scripts\pip.exe install matplotlib
C:\Python34\pythonw.exe scanner.py

Getting started with GNU/Linux

sudo apt-get install python3-dev python3-pip python3-numpy python3-pyqt5
sudo pip3 install matplotlib
git clone https://github.com/pavel-demin/red-pitaya-notes
cd red-pitaya-notes/projects/scanner/client
python3 scanner.py

Building from source

The installation of the development machine is described at this link.

The structure of the source code and of the development chain is described at this link.

Setting up the Vivado environment:

source /opt/Xilinx/Vivado/2016.4/settings64.sh

Cloning the source code repository:

git clone https://github.com/pavel-demin/red-pitaya-notes
cd red-pitaya-notes

Building scanner.bit:

make NAME=scanner bit

Building scanner:

arm-linux-gnueabihf-gcc -static -O3 -march=armv7-a -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard projects/scanner/server/scanner.c -o scanner -lm

Building SD card image zip file:

source helpers/scanner-ecosystem.sh