GithubHelp home page GithubHelp logo

cuasas / pixel-gantry-control Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 10.0 192.68 MB

Control system for the Aerotech 3200 Gantry system and associated hardware for doing CMS FPIX module assembly

LabVIEW 99.95% C++ 0.05%

pixel-gantry-control's People

Contributors

cfangmeier avatar hswanson13 avatar jmonroym avatar rishabhcms avatar sgurdasa avatar souvik1982 avatar vargasa avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pixel-gantry-control's Issues

Serial connection support

External devices supporting serial connections are common and potentially useful in gantry setups. Therefore a set of new commands is outlined below which will supply at least rudimentary support for serial connections using the underlying LabVIEW VISA implementation.

  • SERIALLIST: List out the VISA-complient names of all available connections
  • SERIALOPEN $cid "Port Name" (baud) (bits) (parity) (flow-control) Attempt to open a serial port with the supplied name and settings (settings optional). Return an integer reference to the connection used in other commands.
  • SERIALCLOSE $cid Close the port with the specified id.
  • SERIALSTATUS $cid Print connection status information to the console
  • SERIALPRINT $cid "string with string {$var:%f.2} interpolation" Format and send a line of ASCII text over the connection. All lines are implicitly terminated with a new line character \n.
  • SERIALECHO $cid Read a line from the connection and just print to terminal. Incoming lines should be delineated by a new line character \n.
  • SERIALPARSE $cid $var1 $var2 "format %f string %d" Read and parse a line based on supplied format string. Parsed values are assigned to supplied variables in the order they appear in the format string

Migrate site-specific configurations out of this repository

As more sites start regularly using gScript, it's quickly becoming a bottleneck for everyone to commit changes to their flex_configs or gScript files and submit PRs to this repository.

At some point over the next few weeks, the Config/ and Scripts/ directories will be cleared out. I'll leave a minimalistic example flex_config.txt and some example gScript files. (Everything that currently exists will still be there in the git history so nobody panic)

From that point forward individual sites/projects will need to be responsible for their own configurations and scripts. I'll add a section to the readme with relevant links to help people know where to find the files for their specific work.

As we work through this transition at UNL, I'll update this thread with recommended best-practices on how to organize files outside this repository.

POTLINE and POTDOT simpler functionality

Hi Caleb,

I am attempting to use the POTLINE and POTDOT commands with our Nordson Ultimus II dispenser setup. Ideally, all I need is a command to turn on and off the dispenser (we are dispensing a thermal grease). The POTLINE and POTDOT commands have additionally functionality built in that I do not need (such as variables for curing time, needing to load a syringe tool, syringe state, etc). Is there a way to create a simpler function to just turn on and off the dispenser? Thank you!

Interpreter doesn't say which command was "Unrecognized"

We see the following error message when we try to run our script.

09/04/2021 06:23:43 PM >>> Error Status: 1
Code: 5003
Unrecognized Command:

Below is the script. It would be helpful to highlight the exact command it is failing on for debugging.

Thanks!
Cameron and Souvik

==============

Steps:

1. Locate Glass Piece

2. Record/Locate target position

3. Pickup and place glass piece

4. Record final position

HOME
SETLOG pick_and_place.txt

CLEARLOG

COPY $speed 50
COPY $img_idx 0
COPY $correction_pos {0.0156,0.0023,0}
COPY $correction_angle 0.007952654196415835
COPY $center2glass_pad {-10.082,-20.813,0}
COPY $glass_pad2HDI_pad {1.250,0,0}

COPY $start_pos {559.363,218.562,87.957}
COPY $start_rot {0,0,0,1}

COPY $uncorr_end_pos {107.634,549.559,99.656033}
COPY $uncorr_end_rot 0.2419

SUB $corr_angle $uncorr_end_rot $correction_angle
EULER2QUAT $end_rot $corr_angle 0 0
ADD $end_pos $uncorr_end_pos $correction_pos

FLEXREAD $tl_local geometry.TFPX_1X2_MOCKUP.fid_tl
FLEXREAD $tr_local geometry.TFPX_1X2_MOCKUP.fid_tr
FLEXREAD $br_local geometry.TFPX_1X2_MOCKUP.fid_br
FLEXREAD $bl_local geometry.TFPX_1X2_MOCKUP.fid_bl

@PROCESS_START COPY $pos $start_pos
COPY $rot $start_rot
CALL @Survey

LOADTOOL picker_tool

MOVENAME stagingArea

#Pickup Step
COPY $target_pos $meas_pos
CALL @CALCPICKUP
MOVETO $pickup_pos_z0 50
ROTATE $meas_rot
MOVETO $pickup_pos 10
SETVAC gantry_head_inner 1
WAIT 500
SETVAC module_chuck_0_slot_2 0
WAIT 2000
MOVETO $pickup_pos_z0 10
INVERT $neg_meas_rot $meas_rot
ROTATE $neg_meas_rot

Place Step

COPY $target_pos $end_pos
CALL @CALCPICKUP
MOVETO $pickup_pos_z0 50
ROTATE $end_rot
MOVETO $pickup_pos 10
SETVAC gantry_head_inner 0
WAIT 500
SETVAC module_chuck_0_slot_1 1
WAIT 2000
MOVETO $pickup_pos_z0 10
INVERT $neg_end_rot $end_rot
ROTATE $neg_end_rot

UNLOADTOOL

CHOICEPOPUP $choice_1 "Did you put the HDI and the Weight Tool on the Sensor?" "Yes, survey bond pads" "No, quit"
GOTOIF @CHECK_BOND_PADS_1 $choice_1
GOTOIFN @DONT_CHECK_BOND_PADS $choice_1
@CHECK_BOND_PADS_1 CALL @CHECK_BOND_PADS
@DONT_CHECK_BOND_PADS

END

SURVEY

Arguments:

$pos - expected position of piece

$rot - expected orientation of piece

$**_local - local coordinates of the fiducials

@Survey COPY $SURVEY_RET $RET
MOVENAME stagingArea
# MPGON
MOVETO $pos $speed

    TRANSFORML2G $tl_global $tl_local $pos $rot
    MOVETO $tl_global $speed

WAIT 500

FINDFID $fidpos FPIX_Glass

MOVETO $fidpos $speed

CALL @SAVE_SNAPSHOT

    VIDEO
    GETPOS $tl_meas

    TRANSFORML2G $tr_global $tr_local $pos $rot
    MOVETO $tr_global $speed

WAIT 500

FINDFID $fidpos FPIX_Glass

MOVETO $fidpos $speed

CALL @SAVE_SNAPSHOT

    VIDEO
    GETPOS $tr_meas

    TRANSFORML2G $br_global $br_local $pos $rot
    MOVETO $br_global $speed

WAIT 500

FINDFID $fidpos FPIX_Glass

MOVETO $fidpos $speed

CALL @SAVE_SNAPSHOT

    VIDEO
    GETPOS $br_meas

    TRANSFORML2G $bl_global $bl_local $pos $rot
    MOVETO $bl_global $speed

WAIT 500

FINDFID $fidpos FPIX_Glass

MOVETO $fidpos $speed

CALL @SAVE_SNAPSHOT

    VIDEO
    GETPOS $bl_meas

    # MPGOFF
    FIT $meas_pos $meas_rot TFPX_1X2_MOCKUP $tr_meas $br_meas $bl_meas $tl_meas
    PRINT "Measured position: %v" $meas_pos
    PRINT "Measured rotation: %q (%r)" $meas_rot $meas_rot
    GOTO $SURVEY_RET

CALCPICKUP

Arguments:

$target_pos - center of piece to pickup/place

@CALCPICKUP FLEXREAD $picker_height geometry.PICKER_TOOL.center_offset
FLEXREAD $ghco geometry.tool_holder_offset
ADD $netoffset $picker_height $ghco
SUB $pickup_pos $target_pos $netoffset
COPY $pickup_pos_z0 $pickup_pos
COPY $pickup_pos_z0.z 0
GOTO $RET

CHECK_BOND_PADS

Arguments:

N/A

@CHECK_BOND_PADS
#Check the positions of the bond pads
COPY $pos $end_pos
COPY $rot $end_rot

         MOVETO $pos $speed

         #Top Bond Pads
         MOVEREL $center2glass_pad $speed
         VIDEO
         GETPOS $top_glass

         MOVEREL $glass_pad2HDI_pad $speed
         VIDEO
         GETPOS $top_HDI

         #Bottom Bond Pads
         MOVETO $pos $speed
         
         MUL $center2bottom_glass $center2glass_pad -1
         MOVEREL $center2bottom_glass $speed
         VIDEO
         GETPOS $bottom_glass

         MOVEREL $glass_pad2HDI_pad $speed
         VIDEO
         GETPOS $bottom_HDI

         #Printing
         SUB $delta_top $top_HDI $top_glass
         SUB $delta_bottom $bottom_HDI $bottom_glass
         PRINT "Top Bond Pads Distance = %v" $delta_top
         PRINT "Bottom Bond Pads Distance = %v" $delta_bottom


         GOTO $RET

============

Ueye camera freezes during VIDEO

A failure mode has been observed where at some point the video feed from the gantryhead camera will stop updating. The VIDEO interface is otherwise responsive, clicking moves the gantry around, autofocus runs (albeit yielding a flat focus-vs-height curve), and the VIDEO can be closed and re-opened with no change. Associated with this is when the user tries to exit gScript the interface freezes and must be closed with the task handler.

No errors are logged into the gScript terminal.

Best guess at this point is that some error is passing undetected which causes the camera to enter some undefined state. This causes a failure to acquire new images and a freeze when the code attempts to close the camera connection upon exiting.

Database integration in gScript

Over in the pixel-gantry-extra there has been some work to create an interface for talking to the TFPX module tracking database. This is now tested and working. What remains to be done is to implement the Labview wrappers and the gScript commands to use them. I currently foresee 3 new commands that I'll describe below.

  • DBLOGIN. This will present the user with a pop-up where they can enter in their username/password. These will be checked against the information in the database to verify the user. This will also open a connection to the database that will be kept open in the case of a successful login.
  • DBFINDCOMP. This will open a window that will show a table of all constituent components (ie CROCs, RD53A's, or whatever is specified) that are located at the current assembly site. The user will then select items from the table and assign them positions that map to where they are physically located on the gantry table.
  • DBSAVEASSEMBLY. This is run after completing an assembly and will
    1. Create a new "Assembled Module" component in the database
    2. Update the previously selected constituents to associate them with the assembled module
    3. Serialize and save any relevant assembly data to the tests table.

Add command to dump a particular in-memory namespace to a log file

eg

FLEXWRITE process_summary.chip1_center $chip1_center
FLEXWRITE process_summary.chip2_center $chip2_center
FLEXWRITE process_summary.chip3_center $chip3_center
FLEXWRITE process_summary.chip4_center $chip4_center

SAVESTATE process_summary.*  "assembly_intermediate_values_{$chuck_num}.txt"

Modify SETVAC to allow turning groups of vacuum lines on/off

It's not unusual to be in a situation where one wants to set the state of a group of vacuum lines. For example: I'm finished with the gantry and wish to turn off all vacuum lines, or I've staged a set of parts on a chuck and wish to turn on all vacuum lines for that chuck.

The proposed syntax would be

SETVAC chuck_1_pos*_a 1

If the first argument (the channel name) has a "*" in it, it is interpreted as a glob-pattern and selects any channels whose name matches the glob, otherwise an exact match is required.

Add ability to run FINDFID on composite images

Currently the pattern recognition command, FINDFID, can only run on a single image taken with the camera. This can lead to an issue where if the fiducial pattern is larger than the camera's field-of-view then it cannot be captured in a single image. The solution is to allow for multiple images to be stitched together first followed by the pattern recognition step. This logic is already developed for the SURVEY command. It just has to be hooked up to the FINDFID command.

To specify the size of the extended field-of-view, new (optional) entries will be added to the fiducial specification. e.g.

vision.example2.method: find_rects
vision.example2.scan_window_x: 5  # mm
vision.example2.scan_window_y: 3  # mm

AUTOFOCUS error

Hi!
I found a bug of the AUTOFOCUS function.
When I run the function, the scan (drawing gaussian distribution) works well.
But the measured height, which means the peak location of the gaussian, is wrong.
The height is the lower or upper boundary of the scanning range as shown in the attached file.
This happened occasionally.
Would you check it?

AUTOFOCUS_fit

SERIALOPEN, SERIALPRINT issue

I am able to connect with SERIALOPEN (i.e. there is no error message in the gScript application), but occasionally when I attempt to send commands through SERIALPRINT, the commands have no effect. Without any visible error message, I am not sure why this communication is failing. I have tested communication with the device (an arduino in this case) with another interface and am able to communicate with it.

Additional fitting functions

Currently gScript only natively supports fitting a set of four fiducials using Horn's method. It has become apparent that other, more basic, fitting procedures would be helpful. Some ideas below

  • FITLINE - takes a set of coordinates and performs a least-squares fit and returns the intercept, slope, and R^2 of the fit
  • FITCIRCLE - again, takes a set of coordinates and performs a fit (method TBD) and returns the center, radius, normal vector, and some quality-of-fit metric

gScript: Reload Config Command

Add a gScript command to reload the config file during execution. This would mostly be useful for instances when the user has changed something in the config file (eg. a fiducial finding parameter) and would like to test it without restarting the application.

Syntax:

LOADCONFIG prefix filename

both prefix and filename are optional. If prefix is provided, only keys starting with prefix will be loaded. If filename is provided, keys will be loaded from that file instead of the default one.

Add option to throw error if homing with a tool attached

The FNAL gantry has the tool rack mounted near the home position. If one homed while holding a tool, it would crash into the rack. An option should be added which, if enabled, would throw an error if attempting to HOME while the gantry_head_outer vacuum line is on.

Remove dependency on IMAQdx

The IMAQdx toolkit is the last remaining component that requires a paid license on the deploy machine. If this can be removed, no NI licenses would be required to be purchased or managed for gantry machines. This transition will be handled in 2 stages. In the first stage, the IMAQdx drivers will be replaced with the uEye-specific interface provided by IDS. The 2nd stage will re-add support for miscellaneous webcams using either the OpenCV or ESCAPI interface (both of which are wrappers around Windows Media Foundation). Camera configuration will now require specifying which driver should be used with each camera - initially either "ueye" or "wmf" (or whatever).

Smart Homing

Add an optional argument to the HOME gScript command to make actual homeing contingent on necessity - ie only home if either the axes are not homed or if the current named position is null.

SETDISPENSE issue

Occasionally, the following error occurs:
image
I noticed this is reproducible if I first call VIDEO on one line and the next line try to use SETDISPENSE. I am not sure why this causes this error.

On the other hand, sometimes no error message occurs but SETDISPENSE simply does not turn on the dispenser. In order to get it to work, I usually close gScript, open NI Max and test the dispenser by turning it on and off with the test panels (which always works), reopen gScript, and retry the code/command (which usually fixes the issue).

In both cases, the command is not functioning entirely as expected. Please let me know if any other information would be useful.

Add Interrupt to SURVEY Command

Currently, the software ESTOP is inaccessible while the SURVEY command is running. This is a problem since the gantry is moving during the execution of SURVEY. Furthermore, SURVEY can sometimes take up to 20 minutes to complete depending on the size of the area to image. The operator should have the opportunity to stop the command prematurely for whatever reason (typo in parameters for example).

Add gScript versioning

A user of gScript currently has no way of knowing if a script they want to run is compatible with the version of the interpreter they are using. To help with this, I propose to add a new command "VERSION", which would allow the user to declare which version of the language the script was written for.

The action of this command would be to check the first argument (eg "1.0", "2.3" or whatever) against the version as declared in gScript Interpreter\version.vi. If they do not match, a popup window will be raised informing the user that their code might not run as expected on this version. They can then choose to continue or abort the script.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.