Gwyscope documentation

open hardware SPM controller with advanced sampling support

User Tools

Site Tools


simple_scan_by_lua

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
simple_scan_by_lua [2026/06/01 13:52] pklapeteksimple_scan_by_lua [2026/06/03 11:47] (current) pklapetek
Line 1: Line 1:
-===== Scan by Lua =====+===== Lua scan =====
  
-This simple client 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 1x1 micrometer in 50x50 pixels using a Lua script. Finally, it stops the feedback, shrinks the z-piezo and exits.+This simple client scans topography in contact mode, using Lua script, going point by point. 
 + 
 +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 1x1 micrometer in 50x50 pixels using a Lua script, scanning point by point, i.e. using the simplest possible commands (see [[simple_scan_by_lua_lines|Lua line scan]] for an alternative). Finally, it stops the feedback, shrinks the z-piezo and exits.
  
 Used commands and their parameters: Used commands and their parameters:
Line 13: Line 15:
 ''set_scan: speed: 1e-6'' to set the scanning speed to 1 micrometer per second ''set_scan: speed: 1e-6'' to set the scanning speed to 1 micrometer per second
  
-''run_scan_script: n: 2500, script: +''run_scan_script: n: 2500, script:'' 
-local scan = {}\\ + 
-\\ +<code> 
-function scan.runit()\\ +local scan = {} 
-  gws_clear(p)\\ + 
-  for x = 0, 10e-6, 0.2e-6\\ +function scan.runit() 
-  do\\ +  gws_clear(p) 
-      for y = 0, 10e-6, 0.2e-6\\ +  for x = 0, 9.8e-6, 0.2e-6 
-         do\\ +  do 
-            gws_move_to(p, x, y, 0)\\ +      for y = 0, 9.8e-6, 0.2e-6 
-            gws_store_point(p, x, y, 0)\\ +         do 
-         end\\ +            gws_move_to(p, x, y, 0) 
-   end\\ +            gws_store_point(p, x, y, 0) 
-end\\+         end 
 +   end 
 +end
 return scan return scan
-''+</code>
  
 ''get_scan_ndata: n''  to get how many points were already measured (repeated until all 50 values are measured) ''get_scan_ndata: n''  to get how many points were already measured (repeated until all 50 values are measured)
simple_scan_by_lua.1780314760.txt.gz · Last modified: 2026/06/01 13:52 by pklapetek