Gwyscope documentation

open hardware SPM controller with advanced sampling support

User Tools

Site Tools


simple_scan_by_lines

This is an old revision of the document!


Scan by lines

This simple client scans surface in contact mode.

It connects to the server and sets the operation regime to proportional feedback (typically used in contact mode, difference between value of signal on input and some setpoint value makes piezo to extend or shrink, depending on settings). Then it sets some basic parameters of feedback loop and sets feedback on. It sets the scanning velocity and then it scans 1×1 micrometer in 50×50 pixels using built-in line scan functions and prints the result (or shows them if you use Python version). Finally, it stops the feedback, shrinks the z-piezo and exits.

Used commands and their parameters:

state: mode: proportional to set the mode, which connects inputs, outputs and sets many other parameters as defined in hwserver.ini file on the server

set: pid_p: 0, pid_i: 0.1, pid_d: 0, pid_setpoint: 0.2 to set the feedback loop parameters

set_feedback: feedback: true to start the feedback loop, which should make z-piezo to extend and probe to reach the surface if the sample is in reachable distance, setpoint is correct and settings in hwserver.ini match the experimental configuration.

set_scan: speed: 1e-6 to set the scanning speed to 1 micrometer per second

run_scan_line: n: 50, xfrom: 0, xto: 1e-6, yfrom: 0, yto: 1e-6 to set the scan parameters for individual line (single profile).

get_scan_ndata: n to get how many points were already measured (repeated until all 50 values are measured)

get_scan_data: from: 0, to: 2500 to get all the data at once (data could be red also sequentially as they are measured altering the “from” and “to” value).

set_feedback: feedback: false to stop the feedback

move_to: zreq: 0.0 to move the z-piezo to zero after the feedback is stopped.

To explore it further, see the simple client implementations in C and in Python.

simple_scan_by_lines.1780319252.txt.gz · Last modified: 2026/06/01 15:07 by pklapetek