Open mvbnano opened 6 years ago
get_pos
is working for x and y values (not yet z) with the below command:
command = ('{axis}Pos = GetParam(tScanner, scPosition, 0, {channel})\n\n'
'SetSharedDataVal "shared_{axis}Pos", {axis}Pos, "F64", 8'
.format(axis=axis, channel=channel))
To test z position (in Jupyter):
axis = 'z'
channel = 2
command = ('{axis}Pos = GetParam(tScanner, scPosition, 0, {channel})\n\n'
'SetSharedDataVal "shared_{axis}Pos", {axis}Pos, "F64", 8'
.format(axis=axis, channel=channel))
ntmdt_stage._run_script_text(command)
time.sleep(0.5)
ntmdt_stage._get_shared_float('shared_{axis}Pos'.format(axis=axis))
Always returns 0.0
.
To set stage position:
command = ('SetParam tScanner, scPosition, {scanner}, {channel}, {position}\n'
'Do\n'
'idle\n'
'Loop Until GetParam(tScanner, cStatus, {scanner}) = False'
.format(channel=0, position=position, scanner=1))
As mentioned above, running get and set position code with scanner = 1
and channel = 2
always returns the value of 0.0
.
However, it appears that running the code with scanner = 0 and channel = 0 produces a value, see below.
axis = 'z'
channel = 0
scanner = 0
position = 1.56
command = ('SetParam tScanner, scPosition, {scanner}, {channel}, {position}\n'
'Do\n'
'idle\n'
'Loop Until GetParam(tScanner, cStatus, {scanner}) = False'
.format(channel=0, position=position, scanner=1))
ntmdt_stage._run_script_text(command)
time.sleep(1)
command = ('{axis}Pos = GetParam(tScanner, scPosition, {scanner}, {channel})\n\n' # setting argument #2 = 1 (previously 0)
'SetSharedDataVal "shared_{axis}Pos", {axis}Pos, "F64", 8'
.format(axis=axis, channel=channel, scanner=1))
ntmdt_stage._run_script_text(command)
time.sleep(1)
ntmdt_stage._get_shared_float('shared_{axis}Pos'.format(axis=axis))
Returns
1.5600008373963368
This might be the "tube", a separate piezo component, which will provide satisfactory control if this is true.
This (above comment) might not be true, as then running get_pos
returned x = 1.56
.
I have corrected the z axis control code and it is now working. Unknown travel range, possible 7 microns.
Movement of the tube can be implemented by changing the scanner number.
Confusingly, the 'tube' has 3 axes available in Nova Px. This requires clarification.
Clarification of tube axes requested. Included was for additional information about nova px thermo tab.
How to find the range of each axis (and for each scanner):
Note that it also depends do you use the closed-loop control or not.
VB Script commands have been created on branch
dev_ntmdt_stage
, however, some commands need to be verified by NT-MDT.Commands to be verified include: