Software

Arduino Code: PI Control and Data Collection

The PI controller is implemented digitally using an Arduino Uno, which is also used to collect data. The PI controller calculated the proportional and integral signals of the output from the preamplifier and outputs a signal that will be used to provide the Z signal that controls the height of the scanning tip.

Data collection is done by recording the Z output value from the PI controller and printing it out to the serial port where the data can be streamed to an Excel document and saved for post-processing. 

RaspberryPi Code: X/Y Scanning

A Raspberry Pi is used to produce X and Y signals for scanning back and forth across the sample in a zig-zag fashion. This is done by using a while loop to increment the X and Y values until they reach their respective maximum values--at which point, the code decrements the X and Y values until they reach 0. 

above: output of the RPi X/Y scanning code