Skip to content

Commit

Permalink
Merge pull request #145 from missirol/master
Browse files Browse the repository at this point in the history
[assembly] latest version of assembly/ application
  • Loading branch information
Negusbuk authored May 23, 2019
2 parents 042606f + 012a4ea commit 270f0a3
Show file tree
Hide file tree
Showing 33 changed files with 1,483 additions and 820 deletions.
36 changes: 18 additions & 18 deletions assembly/assembly.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ startup_motion_stage 1
startup_camera 1

# AssemblyParameters
AssemblyParameters_file_path assembly_parameters_DAF_180824.cfg # format: relative path from where binary is executed
AssemblyParameters_file_path assembly_parameters_DAF_190513_balljoint.cfg # format: relative path from where binary is executed

# AssemblyZFocusFinder
AssemblyZFocusFinder_zrange_max 3.0
Expand All @@ -55,44 +55,44 @@ AssemblyMultiPickupTester_useBaseplateVacuum 1

# AssemblyObjectAlignerView
AssemblyObjectAlignerView_PSS_deltaX 94.30 # marked-glass top
AssemblyObjectAlignerView_PSS_deltaY -48.70 # marked-glass top
AssemblyObjectAlignerView_PSS_deltaY 0.00 # marked-glass top

AssemblyObjectAlignerView_PSP_deltaX 96.80 # marked-glass bottom
AssemblyObjectAlignerView_PSP_deltaY -48.70 # marked-glass bottom
AssemblyObjectAlignerView_PSP_deltaX 97.00 # marked-glass bottom
AssemblyObjectAlignerView_PSP_deltaY 0.00 # marked-glass bottom

AssemblyObjectAlignerView_target_angle_deg -26.71165 # marked-glass bottom
AssemblyObjectAlignerView_target_angle_deg 0.00 # marked-glass bottom

AssemblyObjectAlignerView_angle_max_dontIter 0.50 # maximum angular difference (required-measured) allowed for single-rotation correction, otherwise iterative procedure for alignment is used
AssemblyObjectAlignerView_angle_max_complete 0.01 # maximum angular difference (required-measured) allowed to declare alignment procedure completed

# AssemblyObjectFinderPatRecView
AssemblyObjectFinderPatRecView_template_fpath share/assembly/markedglass_marker1_drawing_588x588.png
AssemblyObjectFinderPatRecView_threshold 100
AssemblyObjectFinderPatRecView_template_fpath share/assembly/markedglass_marker1_drawing_588x588_BL.png
AssemblyObjectFinderPatRecView_threshold 30
AssemblyObjectFinderPatRecView_adaptiveThreshold 587
AssemblyObjectFinderPatRecView_angles_prescan 0
AssemblyObjectFinderPatRecView_angles_finemax 2
AssemblyObjectFinderPatRecView_angles_finestep 0.2
AssemblyObjectFinderPatRecView_angles_finestep 0.15

# AssemblyObjectAligner

# AssemblyObjectAlignerView
AssemblyObjectAlignerView_PatRec1_template_fpath share/assembly/markedglass_marker1_drawing_588x588.png
AssemblyObjectAlignerView_PatRec1_threshold 100
AssemblyObjectAlignerView_PatRec1_template_fpath share/assembly/markedglass_marker1_drawing_588x588_BL.png
AssemblyObjectAlignerView_PatRec1_threshold 30
AssemblyObjectAlignerView_PatRec1_adaptiveThreshold 587
AssemblyObjectAlignerView_PatRec1_angles_prescan 0
AssemblyObjectAlignerView_PatRec1_angles_finemax 2
AssemblyObjectAlignerView_PatRec1_angles_finestep 0.2
AssemblyObjectAlignerView_PatRec1_angles_finestep 0.15

AssemblyObjectAlignerView_PatRec2_template_fpath share/assembly/markedglass_marker1_drawing_588x588.png
AssemblyObjectAlignerView_PatRec2_threshold 100
AssemblyObjectAlignerView_PatRec2_template_fpath share/assembly/markedglass_marker1_drawing_588x588_TL.png
AssemblyObjectAlignerView_PatRec2_threshold 30
AssemblyObjectAlignerView_PatRec2_adaptiveThreshold 587
AssemblyObjectAlignerView_PatRec2_angles_prescan 180
AssemblyObjectAlignerView_PatRec2_angles_prescan 0
AssemblyObjectAlignerView_PatRec2_angles_finemax 2
AssemblyObjectAlignerView_PatRec2_angles_finestep 0.2
AssemblyObjectAlignerView_PatRec2_angles_finestep 0.15

# AssemblySmartMotionManager
AssemblySmartMotionManager_steps_dZ 0.2,0.2,0.2,0.1,0.1
AssemblySmartMotionManager_steps_dZ 0.5,0.5,0.2,0.2,0.2,0.2,0.1,0.1

# AssemblyAssembly
AssemblyAssembly_pickup1_dZ 80.0
AssemblyAssembly_pickup2_dZ 200.0
AssemblyAssembly_pickup1_Z 130.0
AssemblyAssembly_pickup2_Z 130.0
26 changes: 16 additions & 10 deletions assembly/assembly/AssemblyMainWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ AssemblyMainWindow::AssemblyMainWindow(const QString& outputdir_path, const QStr
// ---------------------------------------------------------

// IMAGE-THRESHOLDING VIEW ---------------------------------
const QString tabname_ImageThresholding("Thresholding");
const QString tabname_ImageThresholding("Convert Image to B/W");

thresholder_ = new AssemblyThresholder();

Expand Down Expand Up @@ -208,8 +208,9 @@ AssemblyMainWindow::AssemblyMainWindow(const QString& outputdir_path, const QStr

connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), this, SLOT(disconnect_objectAligner()));
connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), motion_manager_, SLOT(emergency_stop()));
connect(aligner_view_->button_emergencyStop(), SIGNAL(clicked()), zfocus_finder_ , SLOT(emergencyStop()));

connect(motion_manager_->model(), SIGNAL(emergencyStopSignal()), motion_manager_, SLOT(clear_motion_queue()));
connect(motion_manager_->model(), SIGNAL(emergencyStop_request()), motion_manager_, SLOT(clear_motion_queue()));

NQLog("AssemblyMainWindow", NQLog::Message) << "added view " << tabname_Alignm;
// ---------------------------------------------------------
Expand Down Expand Up @@ -346,19 +347,23 @@ AssemblyMainWindow::AssemblyMainWindow(const QString& outputdir_path, const QStr

/// Upper Toolbar ------------------------------------------
toolBar_ = addToolBar("Tools");
toolBar_ ->addAction("Camera ON" , this, SLOT( enable_images()));
toolBar_ ->addAction("Camera OFF", this, SLOT(disable_images()));
toolBar_ ->addAction("Snapshot" , this, SLOT( get_image ()));
toolBar_ ->addAction("Camera ON" , this, SLOT( enable_images()));
toolBar_ ->addAction("Camera OFF" , this, SLOT(disable_images()));
toolBar_ ->addAction("Snapshot" , this, SLOT( get_image ()));

toolBar_ ->addAction("Emergency Stop", motion_manager_->model(), SLOT(emergencyStop()));

autofocus_checkbox_ = new QCheckBox("Auto-Focusing", this);
toolBar_->addWidget(autofocus_checkbox_);

connect(autofocus_checkbox_, SIGNAL(stateChanged(int)), this, SLOT(changeState_autofocus(int)));
connect(autofocus_checkbox_, SIGNAL(stateChanged(int)), aligner_view_, SLOT(update_autofocusing_checkbox(int)));
/// --------------------------------------------------------

/// Main Tab -----------------------------------------------
QTabWidget* main_tab = new QTabWidget;

main_tab->setTabPosition(QTabWidget::South);
main_tab->setTabPosition(QTabWidget::North);

main_tab->addTab(assembly_tab, tr("Module Assembly"));
main_tab->addTab(controls_tab, tr("Manual Controls and Parameters"));
Expand All @@ -380,14 +385,12 @@ AssemblyMainWindow::AssemblyMainWindow(const QString& outputdir_path, const QStr

NQLog("AssemblyMainWindow", NQLog::Message) << "///////////////////////////////////////////////////////";
NQLog("AssemblyMainWindow", NQLog::Message) << "// //";
NQLog("AssemblyMainWindow", NQLog::Message) << "// DESY-CMS //";
NQLog("AssemblyMainWindow", NQLog::Message) << "// //";
NQLog("AssemblyMainWindow", NQLog::Message) << "// Automated Pixel-Strip Module Assembly //";
NQLog("AssemblyMainWindow", NQLog::Message) << "// //";
NQLog("AssemblyMainWindow", NQLog::Message) << "// - AssemblyMainWindow initialized successfully - //";
NQLog("AssemblyMainWindow", NQLog::Message) << "// //";
NQLog("AssemblyMainWindow", NQLog::Message) << "///////////////////////////////////////////////////////";

NQLog("AssemblyMainWindow", NQLog::Message) << "application initialized successfully";

// enable camera at startup
const bool startup_camera = config->getValue<bool>("startup_camera", false);

Expand Down Expand Up @@ -551,6 +554,9 @@ void AssemblyMainWindow::connect_images()

connect(image_view_->autofocus_button(), SIGNAL(clicked()), image_ctr_, SLOT(acquire_autofocused_image()));

connect(image_view_->autofocus_emergencyStop_button(), SIGNAL(clicked()), zfocus_finder_, SLOT(emergencyStop()));
connect(image_view_->autofocus_emergencyStop_button(), SIGNAL(clicked()), image_ctr_ , SLOT(restore_autofocus_settings()));

NQLog("AssemblyMainWindow", NQLog::Message) << "connect_images"
<< ": enabled images in application view(s)";

Expand Down
8 changes: 4 additions & 4 deletions assembly/assembly/assembly_parameters_DAF_180824.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ RefPointSensor_Z -74.7897
RefPointSensor_A 1.000

# position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis)
RefPointSpacer_X -47.3278
RefPointSpacer_Y -76.3889
RefPointSpacer_Z -73.8228
RefPointSpacer_A -89.722
RefPointSpacer_X -47.2578
RefPointSpacer_Y -76.6889
RefPointSpacer_Z -73.8812
RefPointSpacer_A -89.8290

# position: camera on baseplate's Ref-Point (baseplate aligned along x-axis)
RefPointBaseplate_X -49.6478
Expand Down
82 changes: 82 additions & 0 deletions assembly/assembly/assembly_parameters_DAF_190116.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

# Sensor Ref-Point = edge of fiducial marker measured with Pattern Recognition
# Spacer Ref-Point = edge of spacer in correspondence with the Sensor Ref-Point
# Baseplate Ref-Point = edge [...]

####################################
### DIMENSIONS #####################
####################################

# dimensions: thickness of assembly components
Thickness_VacuumCups 0.000
Thickness_Baseplate 0.000
Thickness_PSS 0.700
Thickness_PSP 0.700
Thickness_Spacer 1.600
Height_SpacerSlots 0.000
Thickness_GlueLayer 0.030

####################################
### POSITIONS ######################
####################################

# position: Camera pointing to Sensor Ref-Point (using reference mark on platform to place sensor)
RefPointSensor_X -69.0283
RefPointSensor_Y -77.4945
RefPointSensor_Z -62.7329
RefPointSensor_A -0.307

# position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis)
RefPointSpacer_X -61.258
RefPointSpacer_Y -78.749
RefPointSpacer_Z -63.137
RefPointSpacer_A -90.157

# position: camera on baseplate's Ref-Point (baseplate aligned along x-axis)
RefPointBaseplate_X -63.278
RefPointBaseplate_Y -67.390
RefPointBaseplate_Z -62.769
RefPointBaseplate_A -0.069

# position: Z-position (height) to put pickup tool in contact with rotation stage
PickupToolOnRotStage_Z 0.00

# position: XYZ-position with pickup tool in contact with glue-dispensing platform
PickupToolOnGluingStage_X 0.00
PickupToolOnGluingStage_Y 0.00
PickupToolOnGluingStage_Z 0.00

# position: z-position where camera is focused on Gluing Stage surface
CamerFocusOnGluingStage_Z -50.0

####################################
### DISTANCES ######################
####################################

# distance: Angle of Camera Frame in the XY Motion Stage Ref-Frame [deg]
AngleOfCameraFrameInRefFrame_dA -89.5954

# distance: from Sensor Ref-Point to Sensor Pickup position
FromSensorRefPointToSensorPickup_dX 88.00
FromSensorRefPointToSensorPickup_dY 37.00

# distance: from PS-p Ref-Point to PS-s Ref-Point
FromPSPRefPointToPSSRefPoint_dX 1.25
FromPSPRefPointToPSSRefPoint_dY 0.00

# distance: from Spacer Ref-Point to Sensor Ref-Point
FromSpacerRefPointToSensorRefPoint_dX 0.85
FromSpacerRefPointToSensorRefPoint_dY 0.75

# distance: from Baseplate Ref-Point to PS-p Ref-Point
FromBaseplateRefPointToPSPRefPoint_dX 1.60
FromBaseplateRefPointToPSPRefPoint_dY -10.65

# distance: dZ distance to go from Z position where camera provides best-focus on object,
# to Z position where free pickup-tool (i.e. with no other objects attached) touches the object
# - empirical value calibrated with multi-pickup tests
FromCameraBestFocusToPickupHeight_dZ -31.85

# distance: XY distance from 'final position to lower PSs+Spacers onto PSp' to 'position to lower PSs+Spacers onto Gluing Stage'
FromPSPToPSSPosToGluingStage_dX -130.0
FromPSPToPSSPosToGluingStage_dY 0.0
82 changes: 82 additions & 0 deletions assembly/assembly/assembly_parameters_DAF_190326_balljoint.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

# Sensor Ref-Point = edge of fiducial marker measured with Pattern Recognition
# Spacer Ref-Point = edge of spacer in correspondence with the Sensor Ref-Point
# Baseplate Ref-Point = edge [...]

####################################
### DIMENSIONS #####################
####################################

# dimensions: thickness of assembly components
Thickness_VacuumCups 0.000
Thickness_Baseplate 0.000
Thickness_PSS 0.700
Thickness_PSP 0.700
Thickness_Spacer 1.600
Height_SpacerSlots 0.000
Thickness_GlueLayer 0.030

####################################
### POSITIONS ######################
####################################

# position: Camera pointing to Sensor Ref-Point (using reference mark on platform to place sensor)
RefPointSensor_X -69.0283
RefPointSensor_Y -77.4945
RefPointSensor_Z -2.7629
RefPointSensor_A -0.307

# position: camera on spacer's Ref-Point (bottom-left edge, in camera view) (spacer aligned along x-axis)
RefPointSpacer_X -61.368
RefPointSpacer_Y -78.979
RefPointSpacer_Z -3.154
RefPointSpacer_A -90.157

# position: camera on baseplate's Ref-Point (baseplate aligned along x-axis)
RefPointBaseplate_X -64.278
RefPointBaseplate_Y -67.99
RefPointBaseplate_Z -3.169
RefPointBaseplate_A -0.238

# position: Z-position (height) to put pickup tool in contact with rotation stage
PickupToolOnRotStage_Z 0.00

# position: XYZ-position with pickup tool in contact with glue-dispensing platform
PickupToolOnGluingStage_X 0.00
PickupToolOnGluingStage_Y 0.00
PickupToolOnGluingStage_Z 0.00

# position: z-position where camera is focused on Gluing Stage surface
CamerFocusOnGluingStage_Z -2.6538

####################################
### DISTANCES ######################
####################################

# distance: Angle of Camera Frame in the XY Motion Stage Ref-Frame [deg]
AngleOfCameraFrameInRefFrame_dA -89.5954

# distance: from Sensor Ref-Point to Sensor Pickup position
FromSensorRefPointToSensorPickup_dX 86.00
FromSensorRefPointToSensorPickup_dY 38.00

# distance: from PS-p Ref-Point to PS-s Ref-Point
FromPSPRefPointToPSSRefPoint_dX 1.25
FromPSPRefPointToPSSRefPoint_dY 0.00

# distance: from Spacer Ref-Point to Sensor Ref-Point
FromSpacerRefPointToSensorRefPoint_dX 0.85
FromSpacerRefPointToSensorRefPoint_dY 0.75

# distance: from Baseplate Ref-Point to PS-p Ref-Point
FromBaseplateRefPointToPSPRefPoint_dX 1.60
FromBaseplateRefPointToPSPRefPoint_dY -10.65

# distance: dZ distance to go from Z position where camera provides best-focus on object,
# to Z position where free pickup-tool (i.e. with no other objects attached) touches the object
# - empirical value calibrated with multi-pickup tests
FromCameraBestFocusToPickupHeight_dZ -31.85

# distance: XY distance from 'final position to lower PSs+Spacers onto PSp' to 'position to lower PSs+Spacers onto Gluing Stage'
FromPSPToPSSPosToGluingStage_dX -130.0
FromPSPToPSSPosToGluingStage_dY 0.0
Loading

0 comments on commit 270f0a3

Please sign in to comment.