Difference between revisions of "Bin Picking Tutorial: Setting up Photoneo Bin Picking Studio with STAUBLI robots"

From 3D scanning Knowledge base - Photoneo wiki
Jump to: navigation, search
(4.2 VAL3 CONFIG)
(4.4 main_module application)
Line 245: Line 245:
 
''NOTE: If you use a pre-generated program from Robot Studio simulation do not use MainModule.mod directly. The following description serves only as an example of how to use Photoneo RAPID API.''  
 
''NOTE: If you use a pre-generated program from Robot Studio simulation do not use MainModule.mod directly. The following description serves only as an example of how to use Photoneo RAPID API.''  
  
==== 4.4.1 main() ====
+
==== 4.4.1 start() ====
 +
The '''start()''' procedure is simply a selection of which particular sub-procedure is about to be executed. Comment bin picking if you want to execute calibration comment calibration line if you want to execute bin picking.
 +
 
 +
    begin
 +
      //----------------------------------------------------------------------
 +
      // Copyright (c) 2018 Photoneo s.r.o.
 +
      // All rights reserved
 +
      // Description: Photoneo Staubli Module v.1.2.0 -  Start()
 +
      //----------------------------------------------------------------------
 +
 
 +
      call photoneo_common:start()
 +
     
 +
      // Start PHOMAIN task
 +
      // Comment this code, when you can calibrate
 +
      if((taskStatus("PHOMAIN") == -1))
 +
        taskCreate "PHOMAIN", 50, main()
 +
      endIf
 +
     
 +
      // Start WATCHDOG task
 +
      if((taskStatus("WATCHDOG") == -1))
 +
        taskCreate "WATCHDOG", 50, watchdog_main()
 +
      endIf
 +
     
 +
     
 +
      // Start PHOCALIB task
 +
      // Uncomment this code when you can calibrate
 +
      //if((taskStatus("PHOCALIB") == -1))
 +
      //  taskCreate "PHOCALIB", 50, calibration()
 +
      //endIf
 +
       
 +
    end
 +
 
 +
==== 4.4.2 main() ====
  
 
This is a basic bin picking template. '''The main program loop is defined here'''. The sser is can reteach bin picking start and end positions, set IP Address and Port of Vision Controller and adopt the placing part of the code to meet specific workcell and application requirements here.
 
This is a basic bin picking template. '''The main program loop is defined here'''. The sser is can reteach bin picking start and end positions, set IP Address and Port of Vision Controller and adopt the placing part of the code to meet specific workcell and application requirements here.
  
 
     begin
 
     begin
 +
 
       //---------------------------------------------------------------
 
       //---------------------------------------------------------------
 
       // Copyright (c) 2018 Photoneo s.r.o.
 
       // Copyright (c) 2018 Photoneo s.r.o.
Line 302: Line 335:
 
          
 
          
 
           //=================== PHOTONEO BIN PICKING END ===========================
 
           //=================== PHOTONEO BIN PICKING END ===========================
 +
       
 
           // Clear error counter if result is ok
 
           // Clear error counter if result is ok
 
           l_nErrorCounter = 0
 
           l_nErrorCounter = 0
Line 312: Line 346:
 
           // Triger next scan and localization, trajectory for next cycle is calculated while object is being placed  
 
           // Triger next scan and localization, trajectory for next cycle is calculated while object is being placed  
 
           call photoneo_common:scan_request()
 
           call photoneo_common:scan_request()
           call place_part()  
+
           call place_part()
 +
         
 
           // ==================== PLACING START==================================
 
           // ==================== PLACING START==================================
 
         else
 
         else
Line 323: Line 358:
 
           // In case of communication failure, rapid program is terminated immediatelly
 
           // In case of communication failure, rapid program is terminated immediatelly
 
           if(photoneo_common:nErrCode == photoneo_common:nERR_COM_FAILURE)
 
           if(photoneo_common:nErrCode == photoneo_common:nERR_COM_FAILURE)
             call photoneo_common:printLog("Communication failure", "CLIENT")
+
             popUpMsg("Communication failure")
 
             movej(jHomePose, flange, mNomSpeed)
 
             movej(jHomePose, flange, mNomSpeed)
 
             waitEndMove()
 
             waitEndMove()
Line 330: Line 365:
 
             //If bin picking service returned error response, reinitialize and trigger new scan (Adopt if needed)  
 
             //If bin picking service returned error response, reinitialize and trigger new scan (Adopt if needed)  
 
           elseIf(photoneo_common:nErrCode == photoneo_common:nERR_SERVICE or photoneo_common:nErrCode == photoneo_common:nERR_NOT_INITIALIZED)
 
           elseIf(photoneo_common:nErrCode == photoneo_common:nERR_SERVICE or photoneo_common:nErrCode == photoneo_common:nERR_NOT_INITIALIZED)
             call photoneo_common:printLog("Service error from VC", "CLIENT")
+
             popUpMsg("Service error from VC")
 
             movej(jHomePose, flange, mNomSpeed)
 
             movej(jHomePose, flange, mNomSpeed)
 
             waitEndMove()
 
             waitEndMove()
Line 340: Line 375:
 
             //  If planning failed or no part was found, notify user and continue by next scan (Adopt if needed)
 
             //  If planning failed or no part was found, notify user and continue by next scan (Adopt if needed)
 
           elseIf(photoneo_common:nErrCode == photoneo_common:nERR_PLANNING_FAILED or photoneo_common:nErrCode == photoneo_common:nERR_NO_PART_FOUND)
 
           elseIf(photoneo_common:nErrCode == photoneo_common:nERR_PLANNING_FAILED or photoneo_common:nErrCode == photoneo_common:nERR_NO_PART_FOUND)
             call photoneo_common:printLog("No part found or planning failed", "CLIENT")
+
             popUpMsg("No part found or planning failed", "CLIENT")
 
             movej(jHomePose, flange, mNomSpeed)
 
             movej(jHomePose, flange, mNomSpeed)
 
             waitEndMove()
 
             waitEndMove()
Line 355: Line 390:
 
     end
 
     end
  
==== 4.4.2 calibration() ====
+
==== 4.4.3 calibration() ====
  
 
'''Reteach calibration positions''' and call '''pho_request_calib_add_point()''' requests after reaching each calibration pose. Users are recommended to run calibration in MANUAL mode in order to have full control over the process. Always make sure that the robot does not collide with the workcell during transitions between specific waypoints.
 
'''Reteach calibration positions''' and call '''pho_request_calib_add_point()''' requests after reaching each calibration pose. Users are recommended to run calibration in MANUAL mode in order to have full control over the process. Always make sure that the robot does not collide with the workcell during transitions between specific waypoints.
Line 407: Line 442:
  
  
==== 4.4.3 err_handling() ====
+
==== 4.4.5 watchdog_main() and error handling ====
 +
 
 +
Several error situations might occur during bin picking procedures. Some problems are more serious, some less. For example, if no part is found or the trajectory planning fails, the program simply attempts to repeat the whole sequence. However, if a communication failure is detected, the program is halted immediately. '''photoneo_common:nErrCode''' contains the error state from the last response from the Vision Controller. Example of Error handling is described in chapter 4.4.2
 +
 
 +
Kedze error handling je nastaveny, tak ze ked pride error, tak sa robot dostane do definovanej home pozicie a ukonci proceduru main(). Watchdog to bude zistovat kazdu sekundu a v pripade chyby nastartuje main()
  
Several error situations might occur during bin picking procedures. Some problems are more serious, some less. For example, if no part is found or the trajectory planning fails, the program simply attempts to repeat the whole sequence. However, if a communication failure is detected, the program is halted immediately. '''photoneo_common:nErrCode''' contains the error state from the last response from the Vision Controller. Example of Error handling is described in chapter 4.4.3
+
    begin
 +
     
 +
      while(true)
 +
        // Check PHOMAIN State
 +
        if((taskStatus("PHOMAIN") == -1))
 +
            popUpMsg("Main program is down! Restarting...")
 +
          taskCreate "PHOMAIN",  50, main()
 +
        endIf
 +
        // Check Tasks State Every Second
 +
        delay(1)
 +
      endWhile
 +
     
 +
    end
  
 
=== 4.4.4 watchdog_main() ===
 
=== 4.4.4 watchdog_main() ===

Revision as of 11:24, 11 April 2018

1. Prerequisities

Photoneo Stäubli Interface is compatible with CS9 controler.

Mozno by to islo aj na CS8 len je potrebne spravit upravy v kode. Pre instalaciu photoneo aplikacie je potrebne pouzit Stäubli Robotics Suite a mat k dispozicii licencny kluc


NOTE: Use of Stäubli Robotics Suite 2016.6.1 or higher is highly recommended for Photoneo Stäubli Interface setup.

2. CS9 Controller setup

The following tutorial gives a step by step guide of how to configure your Stäubli CS9 controller and install all necessary VAL3 applications you will need to get the robot interface for Photoneo Binpicking Solution up and running.

This tutorial was originally written using the latest Stäubli Robotics Suite 2016.6.1, however it should be compatible with older versions with minor changes.

2.1 Network configuration

Turn on the CS9 Controller, wait for the Initialization Screen to appear, open the Settings and select the Network option:


Staubli menu network.png


In the Network pane, setup your network interfaces. Jeden pre Robot Suite, druhy pre binpicking


Staubli network setup.png


3 STAUBLI Robotics Suite

3.1 Create new project

Klikny na new a potom na new cell wizard

Staubli new project.png

Zadaj nazov projektu a cestu

Klikny next

vyber Add a local controller from a remote controller. Pre vyber je Add a local controller je potom potrebne rucne nastavit kontroler a robota

Staubli remote controller.png

Nastav host kliknut na ...

Staubli conection.png

Nastav IP robota, nastav user name na maintenance. Default heslo spec_cal

klikny na ok a nasledne na next

Ak je vsetko ok, tak sa napise hlaska

Staubli success transfer.png

3.2 Copy the application

Nakopirovat progamy resp. priecinky (photoneo_common, customer_definitions, main_application) vo windows filesysteme z val3 (miesto kde budu ulozene programy) do vytvoreneho projektu: Project_name\Controller_name\usr\usrapp

V Staubli Robotics Suite kliknut v cell explorer na project_name->controller_name (pravym tlacidlom na controller_name) a vybrat open application a postupne vybrat vsetky 3 aplikacie. Otvarat je potrebne subory typu .pjx

Staubli open app.png


Vysledkom by malo byt otvorene 3 aplikacie znazornene na obrazku

Staubli apps.png

3.3 Nevyhnutne upravy phptoneo_common

3.3.1 Nastavenie fBaseLink

treba nastavit spravnu hodnotu Z offsetu (asi podla tabulky)


FBaseLink.png

3.3.2 Nastavenie socketu

V hornej liste v home kliknut na Physical IO's. V tabulke pravym kliknut na socket a vybrat Edit Board


Socket setup.png

V novom okne je potrebne kliknut na + a vybrat tcp client


Add tcp client.png

Vyplnit udaje podla fotky

Staubli tcp client.png

Zopakovat to iste pre tcp server

Staubli tcp server.png


Na zaver treba skontrolovat, ci globalna premenna sPHOCLIENT a sPHOSERVER su naozaj nalinkovane na vytvorene sockety.

sPHOCLIENT by mal v stlpci lo obsahovat Sockets\PhotoneoClient. Ak nie treba mu vybrat spravny socket dvojklikom na bunku v stlpci lo.

Socket link.png

To iste je potrebne skontrolovat aj pre sPHOSERVER, ktory by mal obsahovat Sockets\PhotoneoStateServer.

3.3.3 Nastavenie start a end pose

V globalnych premennych jStartPose a jEndPose, treba nastavit vhodne hodnoty klbovych premmenych pre startovu a koncovu polohu binpickingu

Staubli start pose.png

3.4 Transfer files

Na presun suborov existuje nastroj Transfer manager v hornej liste v zalozke home. Po kliknuty na ikonu je potrebne pripojit sa na CS9 pod uzivatelom maintenance s prednastavenym heslom spec_cal

Staubli conection.png

Na zaver v okne transfer manager, treba zakliknut IO a VAL3 Applications, nasledne >> transfer >>.

Robot staubli transfer manager.png


3.5 Load Application

Ako prvy krok treba kliknut na tlacidlo na pendante, ktore je znazornene na obrazku zo simulacie

Staubli pendant load app.png

V skaredom ciernobielom okne treba nahrat applikaciu. V Main menu vybrat Application manager (Kliknut enter alebo Right). V application manger je potrebne otvorit aplikacie kliknutim na F7 (open). Nasledne z disku vyberte main_application


Vratte sa na spat na hlavnu obrazku (Tlacidlo home). A nasledne otvorte VAL3 applications. Klik na dolnu listu, ktora vyroluje widget a v nom kliknut na V, tak ako je to znazornene na obrazku


Open app.png


Rolovaci widget zatvorte a kliknite na main_application a nastavte ju na autostart


Autostart application.png

Aplikacia je tak nachystana na spustenie


At this point your Robot Controller is configured to work with Photoneo Binpicking Solution. However your VAL3 code must be adopted to meet your application requirements - you need to reteach HOME, START and END poses, update part placing, application logic, etc. The following section of the tutorial provides basic examples of how this can be programmed as well as a detailed explanation of Photoneo VAL3 API.

4. VAL3

Photoneo Staubli interface was designed to be easily integrated into existing application written in VAL3 code. It provides two means which influence the final robot behavior:

- VAL3 API - set of VAL3 requests (or procedures) used to control the bin picking sequence. Requests are defined in photoneo_common application and used within main_module application

- VAL3 CONFIG - customer_definitions application holds an application specific settings such as gripper commands, motion speed, precision and overall bin picking sequence definition.

4.1 VAL3 API

The following API describes the functionality of requests provided by Photoneo Stabli Interface. These requests are intended for high level control of bin picking sequences and are usually called in main_module application.


pho_request_init() - request to initialize bin picking application from the Vision Controller side. Start and End Poses defined by the operator from thephotoneo_common in chapter 3.3.3 side are transferred to the Vision Controller and used in the trajectory planning pipeline as start and terminus points.

wait_for_server() - Tu je to len ako volitelna funkci - ak chce integrator cakat, ci je sponenie s VC. Fyzicke pripojenie sa deje vo photoneo_client function to establish a connection to the Vision Controller. Blocking function; suspends the program until a proper connection is established.

scan_request() - request to trigger the next scan and localization. Non-blocking request; the VAL3 program continues immediately at the next line.

wait_for_scan_completition() - function to wait for scan to be finished. This should be called after triggering the scan, but not immediately

trajectory_request() - request to start trajectory planning for current goal. Non-blocking function; the VAL3 program continues immediately at the next line.

trajectory_receive() - function to receive requested bin picking trajectories (consisting of a sequence of trajectory and gripper operations). This is usually called inside pick_part() function by default. Blocking function; waits for motion data to be received.

calib_add_point_request() - request to add calibration point - a scan is triggered and the calibration is recalculated. Blocking request; the program will not continue until the calibration result is recalculated and has been received by the Robot Controller.

calib_set_to_scanner_request() - request to set current calibration result to the PhoXi Scanner

calib_reset_request() - request to reset current calibration and remove all previously added points

pick_part() - request to execute bin picking operation. This usually receives the requested trajectory and performs motion execution. Blocking function; the program does not continue until the whole sequence is finished. Always make sure that the robot is in photoneo_common:jStartPose before calling this function.


4.2 VAL3 CONFIG

customer_definitions application enables the user to configure several bin picking settings, including gripper command implementations, trajectory speed and precision adjustments.


- gripper_attach() - implement function for opening your gripper here

- griper_detach() - implement function for closing your gripper here

- gripper_user_1() - implement custom user gripper command (reserved for future use)

- gripper_user_2() - implement custom user gripper command (reserved for future use)

- gripper_user_3() - implement custom user gripper command (reserved for future use)

- gripper_user_4() - implement custom user gripper command (reserved for future use)

- gripper_user_5() - implement custom user gripper command (reserved for future use)

- gripper_user_6() - implement custom user gripper command (reserved for future use)

- pick_part() - standard bin picking sequence. This flexible, operation-based implementation allows performing bin picking sequences, which consist of various numbers of operations to be performed. Do not edit !!!

Nastavenie rychlosti a aproximacii V globalnej premmenej customer_definitions:mPickingSpeed typu mdesc definujte vsetky potrebne rychlost index riadku prislucha k idndexu trajektorie. Cize pre approach trajektoriu prisluchaju hodnoty v prvom riadku.

Staubli mdesc.png


4.3 VAL3 ERROR HANDLING

Photoneo BP solution provides basic error handling. If an error occurs during bin picking operations the photoeno_common:nErrCode variable contains the code of the specific error which will helps to identify the source of the problem.

photonoe_common:nERR_OK := 0 - Service response from Vision Controller is valid

photonoe_common:nERR_SERVICE := 1 - Service response from Vision Controller is invalid.

photonoe_common:nERR_UNKNOWN_REQ := 2 - The Vision Controller received an unknown request.

photonoe_common:nERR_COM_FAILURE := 3 - Communication failure due to socket closure.

photonoe_common:nERR_BAD_DATA := 4 - Data validation check has failed.

photonoe_common:nERR_TIMEOUT := 5 - Communication failure due to socket timeout.

photonoe_common:nERR_PLANNING_FAILED := 201 - Trajectory planning has failed

photonoe_common:nERR_NO_PART_FOUND := 202 - No part has been localized

photonoe_common:nERR_NOT_INITIALIZED := 203 - Bin picking application has not been properly initialized on Vision Controller

photonoe_common:nERR_PART_LOST := 204 - Part has been lost during motion execution

photonoe_common:nERR_UNKNOWN_ERR := 299 - Unspecified internal error


4.4 main_module application

The following section provides a detailed explanation of main_application - the module through which the user's application and Photoneo Bin Picking API are integrated together.

NOTE: If you use a pre-generated program from Robot Studio simulation do not use MainModule.mod directly. The following description serves only as an example of how to use Photoneo RAPID API.

4.4.1 start()

The start() procedure is simply a selection of which particular sub-procedure is about to be executed. Comment bin picking if you want to execute calibration comment calibration line if you want to execute bin picking.

   begin
     //----------------------------------------------------------------------
     // Copyright (c) 2018 Photoneo s.r.o.
     // All rights reserved
     // Description: Photoneo Staubli Module v.1.2.0 -  Start()
     //----------------------------------------------------------------------
     call photoneo_common:start()
     
     // Start PHOMAIN task
     // Comment this code, when you can calibrate
     if((taskStatus("PHOMAIN") == -1))
       taskCreate "PHOMAIN", 50, main()
     endIf
     
     // Start WATCHDOG task
     if((taskStatus("WATCHDOG") == -1))
       taskCreate "WATCHDOG", 50, watchdog_main()
     endIf
     
     
     // Start PHOCALIB task 
     // Uncomment this code when you can calibrate
     //if((taskStatus("PHOCALIB") == -1))
     //  taskCreate "PHOCALIB", 50, calibration()
     //endIf
       
   end

4.4.2 main()

This is a basic bin picking template. The main program loop is defined here. The sser is can reteach bin picking start and end positions, set IP Address and Port of Vision Controller and adopt the placing part of the code to meet specific workcell and application requirements here.

   begin
     //---------------------------------------------------------------
     // Copyright (c) 2018 Photoneo s.r.o.
     // All rights reserved
     // Description: Photoneo Staubli Module v.1.2.0 - Main Module
     //              Adopt this program to meet your requirements
     //---------------------------------------------------------------
     //                                         BIN PICKING
     // This is a basic bin picking template. The main program loop is defined here. User is expected to reteach 
     // bin picking start and end positions, set IP Address and Port of Vision Controller and adopt placing part
     // of the code to meet specific workcell and application requirements here. 
    
     // Clear error counter for err_handling procedure
     l_nErrorCounter = 0
     
     //  Wait for connection to the the Vision Controller 
     call photoneo_common:wait_for_server()
     
     // Send bin picking initialization request to the Vision Controller, 
     call photoneo_common:initialize_request()
     
      // Move robot away from scanning area - reteach this position for your robot and workcell
     movej(jHomePose, flange, mNomSpeed)
     waitEndMove()
     
     // When robot is away from scanning area, trigger first scan and localization
     call photoneo_common:scan_request()
     while true
       //==================== PHOTONEO BIN PICKING START ===========================
       // wait until scanning is completed
       call photoneo_common:wait_for_scan_completition()
       
        // Check Error Status
       if(photoneo_common:nErrCode == photoneo_common:nOK)
         
         // Trigger trajectory planning
         call photoneo_common:trajectory_request()
       
         // While trajectory is being calculated, move robot to bin picking start position
         movej(photoneo_common:jStartPose, flange, mNomSpeed)
         
         // Calculated trajectory is received here
         call photoneo_common:trajectory_receive()
       endIf
       
       // Check Error Status
       if(photoneo_common:nErrCode == photoneo_common:nOK)
         
         // If trajectory is valid pick part execute bin picking application
         call customer_definitions:pick_part()
       
         //=================== PHOTONEO BIN PICKING END ===========================
       
         // Clear error counter if result is ok
         l_nErrorCounter = 0
         
         //==================== PLACING START==================================
         // Adopt code for placing operations
         movej(jHomePose, flange, mNomSpeed)
         waitEndMove()
         // Triger next scan and localization, trajectory for next cycle is calculated while object is being placed 
         call photoneo_common:scan_request()
         call place_part()  
         
         // ==================== PLACING START==================================
       else
         
         //                                         ERROR HANDLING
         // Shit happens. Several error situations might occur during bin picking procedure. Some of them are more serious some are less.
         // For example if no part is found or trajectory planning fails, program just tries to repeat the whole sequence. However if 
         // communication failure is detected, program is halted immediately. It is possible to adopt this behavior here if needed
         
         // In case of communication failure, rapid program is terminated immediatelly
         if(photoneo_common:nErrCode == photoneo_common:nERR_COM_FAILURE)
           popUpMsg("Communication failure")
           movej(jHomePose, flange, mNomSpeed)
           waitEndMove()
           return
           
           //If bin picking service returned error response, reinitialize and trigger new scan (Adopt if needed) 
         elseIf(photoneo_common:nErrCode == photoneo_common:nERR_SERVICE or photoneo_common:nErrCode == photoneo_common:nERR_NOT_INITIALIZED)
           popUpMsg("Service error from VC")
           movej(jHomePose, flange, mNomSpeed)
           waitEndMove()
           return
           delay(10)
           call photoneo_common:initialize_request()
           call photoneo_common:scan_request()
       
           //  If planning failed or no part was found, notify user and continue by next scan (Adopt if needed)
         elseIf(photoneo_common:nErrCode == photoneo_common:nERR_PLANNING_FAILED or photoneo_common:nErrCode == photoneo_common:nERR_NO_PART_FOUND)
           popUpMsg("No part found or planning failed", "CLIENT")
           movej(jHomePose, flange, mNomSpeed)
           waitEndMove()
           call photoneo_common:scan_request()
         endIf
         
         l_nErrorCounter = l_nErrorCounter + 1
         if(l_nErrorCounter > 2)
           return
         endIf
         
       endIf   
     endWhile
   end

4.4.3 calibration()

Reteach calibration positions and call pho_request_calib_add_point() requests after reaching each calibration pose. Users are recommended to run calibration in MANUAL mode in order to have full control over the process. Always make sure that the robot does not collide with the workcell during transitions between specific waypoints.

    begin
     //----------------------------------------------------------------------
     // Copyright (c) 2018 Photoneo s.r.o.
     // All rights reserved
     // Description: Photoneo Staubli Module v.1.2.0 -  Calibration Routine
     //              Reteach points and use as many as you need
     //----------------------------------------------------------------------

     //                                         CALIBRATION
     // Reteach calibration positions and call add calibration point request after reaching each calibration pose
     // It it recomended to run calibration in MANUAL mode step by step to have a proper control over the process. 
     // Always make sure that robot does not collide with workcell during transitions between specific waypoints
     
     movej(jCalib1, flange, mNomSpeed)
     waitEndMove()
     call photoneo_common:printLog("Calibration Point 1 reached", "CLIENT")
     call photoneo_common:calib_add_point_request()
      
     movej(jCalib2, flange, mNomSpeed)
     waitEndMove()
     call photoneo_common:printLog("Calibration Point 2 reached", "CLIENT")
     call photoneo_common:calib_add_point_request()
        
     movej(jCalib3, flange, mNomSpeed)
     waitEndMove()
     call photoneo_common:printLog("Calibration Point 3 reached", "CLIENT")
     call photoneo_common:calib_add_point_request()
         
     movej(jCalib4, flange, mNomSpeed)
     waitEndMove()
     call photoneo_common:printLog("Calibration Point 4 reached", "CLIENT")
     call photoneo_common:calib_add_point_request()
     
     movej(jCalibReserved1, flange, mNomSpeed)
     waitEndMove()
     call photoneo_common:printLog("Calibration Helping WayPoint reached", "CLIENT")
     
     movej(jCalib5, flange, mNomSpeed)
     waitEndMove()
     call photoneo_common:printLog("Calibration Point 4 reached", "CLIENT")
     call photoneo_common:calib_add_point_request()
     
     call photoneo_common:calib_set_to_scanner_request()
      
   end


4.4.5 watchdog_main() and error handling

Several error situations might occur during bin picking procedures. Some problems are more serious, some less. For example, if no part is found or the trajectory planning fails, the program simply attempts to repeat the whole sequence. However, if a communication failure is detected, the program is halted immediately. photoneo_common:nErrCode contains the error state from the last response from the Vision Controller. Example of Error handling is described in chapter 4.4.2

Kedze error handling je nastaveny, tak ze ked pride error, tak sa robot dostane do definovanej home pozicie a ukonci proceduru main(). Watchdog to bude zistovat kazdu sekundu a v pripade chyby nastartuje main()

   begin
     
     while(true)
       // Check PHOMAIN State
       if((taskStatus("PHOMAIN") == -1))
           popUpMsg("Main program is down! Restarting...")
         taskCreate "PHOMAIN",   50, main()
       endIf
       // Check Tasks State Every Second
       delay(1)
     endWhile
     
   end

4.4.4 watchdog_main()

treba toto este opisat a dorobit

5. Runtime

Send VAL3 changes, reload the application. If everything is set correctly, you should see the following info screen on the Pendant:


Staubli waitting.png


Make sure that the Bin Picking application on the Vision Controller side is running and waiting for a connection:

[[File: ]] (Tu asi pride screenshot z webu)


Ked sa vytvori server na Vision controlery tak na pendante bude vidiet nasledujuci screen:

Staubli connected.png


You should receive the notification that the Vision Controller has established a successful connection:

[[File: ]] (Tu asi pride screenshot z webu)


Choose if you want to run the application in AUTO or MANUAL mode and adopt the speed override if required.


Enable the power (Button I) and Hit the Play (Button II)


Staubli program run.png


The robot should now start sending requests to the Vision Controller and execute bin picking movements.