Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify Nova Px VB Script Commands #20

Open
mvbnano opened this issue Jan 21, 2018 · 9 comments
Open

Verify Nova Px VB Script Commands #20

mvbnano opened this issue Jan 21, 2018 · 9 comments
Assignees

Comments

@mvbnano
Copy link
Member

mvbnano commented Jan 21, 2018

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:

  • Get stage position,
            command =   ('{axis}Pos = GetParam(tBase, cValue, pi_ScrPos{axis}, 0, False)\n\n'
                        'SetSharedDataVal "shared{axis}Pos", {axis}Pos, "F64", 8'
                        .format(axis=axis.upper()))
  • Set stage position,
        command =   ('SetParam tBase, cValue, pi_ScrPosX, 0, {xpos}\n\n'
                     'SetParam tBase, cValue, pi_ScrPosX, 0, {ypos}\n\n'
                     'SetParam tBase, cValue, pi_ScrPosX, 0, {zpos}\n\n'
                     'Do\n\n'
                     '\tIdle\n\n'
                     'Loop Until GetParam(tScanner, cStatus, 0) = 0'
                     .format(xpos=param_dict['x'], ypos=param_dict['x'], zpos=param_dict['x']))
  • Set stage closed-loop feedback,
            command =   ('SetParam tBase, cValue, pi_Scr{axis}FBState, 0, {to_state}'
                        .format(axis=axis.upper(), to_state=int(to_state)))  # bool to int
  • Get scanner range.
            command =   ('Set ParInfo = GetParam(tBase, cInfo, pi_ScrPos{axis}, 0)\n\n'
                        'Val{axis} = ParInfo.MaxValue\n\n'
                        'SetSharedDataVal "shared{axis}PosMax", Val{axis}, "F64", 8'
                        .format(axis=axis.upper()))
@mvbnano mvbnano self-assigned this Jan 21, 2018
@mvbnano
Copy link
Member Author

mvbnano commented Feb 12, 2018

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.

@mvbnano
Copy link
Member Author

mvbnano commented Feb 12, 2018

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))

@mvbnano
Copy link
Member Author

mvbnano commented Feb 12, 2018

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.

@mvbnano
Copy link
Member Author

mvbnano commented Feb 12, 2018

This (above comment) might not be true, as then running get_pos returned x = 1.56.

@mvbnano mvbnano removed the question label Feb 12, 2018
@mvbnano
Copy link
Member Author

mvbnano commented Feb 12, 2018

I have corrected the z axis control code and it is now working. Unknown travel range, possible 7 microns.

@mvbnano
Copy link
Member Author

mvbnano commented Feb 15, 2018

Movement of the tube can be implemented by changing the scanner number.

@mvbnano
Copy link
Member Author

mvbnano commented Feb 19, 2018

Confusingly, the 'tube' has 3 axes available in Nova Px. This requires clarification.

image

@mvbnano
Copy link
Member Author

mvbnano commented Feb 22, 2018

Clarification of tube axes requested. Included was for additional information about nova px thermo tab.

@mvbnano
Copy link
Member Author

mvbnano commented Mar 6, 2018

How to find the range of each axis (and for each scanner):

unnamed

Note that it also depends do you use the closed-loop control or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant