2D Camera Integration

From Wiki
Revision as of 12:00, 3 December 2018 by Peter (talk | contribs) (→‎First Run)

Different cameras can be integrated in the CPRog software. This allows to pick parts with a not precisely defined position.

Currently plugins are available for:

  • IFM O2D, a compact camera with integrated image processing
  • Matrox camera systems

Both systems aquire an image and process it internally. Then they send the target position via Ethernet to the CPRog software. Here they are received by an plugin and stored in a variable. This variable can be used in a motion.

A more in-depth explanation and an example program can be found in the documentation (german): Dokumentation_PlugIn_IFM-O2D_V03.pdf (DE) The english version of that same documentation is being worked on at the moment.





UNDER CONSTRUCTION. Currently the English translation of the documentation linked above is being generated

Scope

This document explains the use of an IFM 3D camera in CPRog.

Safety

  • Caution.png Caution! Personal safety has to be ensured during operation.
  • Caution.pngThis is especially relevant during configuration and set up of the camera application. All motion has to be carried out at slow speeds.
  • Caution.pngThe operator has to be ready to stop the robot
  • Caution.pngIt is recommanded that all programs are tested in the simulation prior to moving the robot.

Mechanical and electrical setup

Preferred camera mounting position

The camera has to be mounted at ample height above the work-pieces. Care has to be taken to avoid any collisions. For acceptance cone and minimum distance from camera, please look at the IFM-Documentation.

  • The camera should be mounted parallel to the coordinate axes of the robot, if at all possible. - That means either overhead, in front or from the side. This will simplify calibration significantly (see image on the right).


  • Power requirements: Connect the leads of the black power cable to a 24V supply:
    • blue lead: GND
    • brown lead: 24V (bitte verifizieren Sie die Belegung mit der IFM-Dokumentation).


PC network address configuration
  • Plug ethernet cable into camera and PC.
  • Set IP of PC to a free IP in the 192.168.0/24 range, e.g. 192.168.0.50
  • Camera IP is factory configured for 192.168.0.49


Camera configuration

IFM Camera TCP/IP setings

The image processing is done entirely in camera. To recognize a work-piece an "application" has to be set up containing the model of the work-piece. The camera settings are configured using the IFM Software efector dualis E2D200.

Communication with the CPRog-Plugin requires the following settings:

  • General TCP/IP settings: The TCP/IP address and port configuration have to remain the IFM factory defaults.


IFM Protocol Version settings
  • The Protocol Version has to remain in the factory default setting.


IFM IO configuration
  • Click on "Process Interface" and "Change Settings". The window "IO configuration" appears.
  • In the "TCP/IP settings" set
    • "Result Output" to On
    • "Model Detail Output" to On


Plugin Installation in CPRog

A plugin is used to use the IFM camera. It connects via ethernet to the camera and translates and transmits the data received from the camera to the robot control electronics.

Save the following files to C:\CPRog\Data\Plugins\

That's it.

An example program (Example_IFM_Camera.xml) can be saved to C:\CPRog\Data\Programs\

Use of the plugin within a robot program

File:CPRog Program Editor Camera PLugin Commands.png
Commands to get the camera up and running

Three commands have to be inserted in the Program editor to get the camera up and running. These commands can be added via the menu item "Advanced Commands"

  • In the first line a position variable is defined. This variable is used to store the target position in.
  • in the second line a Number variable is defined. This variable is used to store the model type in. Once the camera has recognized an object it is set to -1.
  • The command "PlugInTargetPos" calls a plugin that returns a target position. It takes the following arguments
    • Name of the plugin to be used (here "PluginSmartCameraIFMO2D").
    • a variable for the target position
    • a variable for the model type.
  • The plugin overwrites only the X, Y, Z and A (=rotation around Z) values. The rotation values B and C remain as they were. Therefore, upon definition of the variable the robot should already have been positioned so that it can grip the object with the current B and C values.

The example program uses the plugin. It moves the robot to a starting position and asks the plugin for a target position. Example Program

When the variable "modelclassvar" becomes -1 a small up and down movement is carried out.

Otherwise the robot will move to the target position by using the command "LinearByVariable".

First Run/Configuration

In general, a new program should always be run in simulation prior to using it on the actual robot. To run the program in simulation simply click the plug button in CPRog to disconnect the robot. As soon as the Status light in CPRog changes (from red or green) to grey, you are in simulation mode.

When running the program for the first time, the plugin configuration window opens. Keep it open. Here the camera position needs be configured. File:IFM camera config.png

Camera Configuration

  • This is the place where the IP-Address of the camera, which has been set earlier, has to be entered.

Hier werden IP-Adresse und Port der Kamera eingestellt. Die Voreinstellungen entsprechen den IFM-Standardwerten.  Picture Scale Die Kamera liefert die Ergebnisse in Pixeln an das Plugin. Um daraus eine Zielposition in mm zu erzeugen wird der Pixelwert mit dem Skalierungsfaktor multipliziert. Dieser Wert ist abhängig von dem Objektivtyp der Kamera und der Entfernung zur Greifebene. Siehe Abschnitt 4.3.  Geometry Setup Hier wird die Position der Kamera relativ zum Roboter definiert. Dies ist notwendig, um die Zielposition von Kamerapixeln in eine Absolutposition im Roboterkoordinatensystem zu übertragen. o Origin: Die Position der Kamera im Roboterkoordinatensystem, x-, y- und z-Wert o Look Vec: Die Blickrichtung der Kamera. Im oben eingestellten Bild schaut die Kamera in die negative z-Richtung, also nach unten. o Up Vec: Dieser Vektor definiert die Drehung der Kamera um die Zielachse, also wo die Oberseite der Kamera ist. o Pick Distance: Die Entfernung der Werkstückebene von der Kamera. o Beispiel: Bei den oben dargestellten Werten würde ein Werkstück, dass in der Mitte des Kamerabildes liegt, als Position (120, 120, 35) übergeben.  Test Configuration Das Plugin zu Testzwecken so eingestellt werden, dass es auch ohne Kamera Zielpositionen liefert. Damit kann der Programmablauf in Simulation getestet werden. Wenn der Haken bei „Override Camera“ gesetzt ist wird die darunter definierte Position und Modellklasse zurückgegeben.  Status Hier wird der Status der verbundenen Kamera angezeigt, also die Verbindung und die aktuelle Position in Pixeln und mm. Wenn Werte geändert werden muss das Bedienfeld „Update“ gedrückt werden. Dann werden die Werte vom Plugin verwendet, aber auch für den nächsten Start im Parameterfile abgespeichert.