JPH05228866A - Controller of automatic holding device in use of visual sense - Google Patents

Controller of automatic holding device in use of visual sense

Info

Publication number
JPH05228866A
JPH05228866A JP10798291A JP10798291A JPH05228866A JP H05228866 A JPH05228866 A JP H05228866A JP 10798291 A JP10798291 A JP 10798291A JP 10798291 A JP10798291 A JP 10798291A JP H05228866 A JPH05228866 A JP H05228866A
Authority
JP
Japan
Prior art keywords
instruction
image processing
robot
program
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP10798291A
Other languages
Japanese (ja)
Inventor
Yusaku Azuma
雄策 我妻
Katsumi Ishihara
勝己 石原
Youzou Touhou
容三 東方
Masaru Shibata
優 柴田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP10798291A priority Critical patent/JPH05228866A/en
Publication of JPH05228866A publication Critical patent/JPH05228866A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To make a parameter unitarily manageable by storing the parameter required for the holding operation and image processing of a work in the same storage part as a program comprising both image processing and holding operation commands, and transferring it to an image processing part from this storage part at need. CONSTITUTION:A controller is provided with a robot action control part 62 controlling four axial motors 6a-6d of a robot and a motor 6e of a shuttle, a hand action control part 63 controlling three axial motors 22a-22c of a hand, and an image processing part 64 controlling each of driving motors 4a-4b of an XY table and a camera 2, and so on. In this case, there is provided a command interpretive part 87 which performs the interpretive execution of a command pertaining to a robot program. On the other hand, there is also provided a common memory 60 being held each in common among both these action control parts 62, 63, the image processing part 64 and the common interpretive part 87. In succession, a program comprising both image processing and holding operation commands of a work and a parameter for calculating position information of the work are stored in this common memory 60.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、把持対象のワークの画
像からそのワークの把持位置を認識し、その上で該ワー
クを把持する自動把持装置を制御するための制御装置に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control device for recognizing a gripping position of a work to be gripped and controlling an automatic gripping device for gripping the work.

【0002】[0002]

【従来の技術】自動組立装置の制御において手間がかか
る作業はワーク等の位置座標のテイーチングである。ロ
ボットはテイーチングされた位置にしかハンドやフィン
ガーを移動できないために、そのテイーチング位置が不
正確であったり、誤ったりしていると、組立動作を失敗
したり、ハンドやフィンガーを破壊してしまったりす
る。
2. Description of the Related Art A laborious task in controlling an automatic assembly apparatus is teaching of position coordinates of a work or the like. Since the robot can move hands and fingers only to the taught position, if the teaching position is incorrect or incorrect, the assembly operation will fail or the hand and fingers will be destroyed. To do.

【0003】そこで、昨今、視覚センサ(例えば、CC
Dカメラ)を備えた自動組立装置が提案されている。こ
のような自動組立装置の例として、例えば、特開昭60
−56884号、特開昭60−123974号、特開昭
62−140724号等がある。また、本出願人からの
提案された技術として、特願平1−71895号、2−
55032号がある。これらは、視覚センサによりワー
クの画像を取り込み、この画像から画像処理によりワー
ク位置をロボット座標系に変換して、このロボット座標
系のワーク位置に基づいて組立作業を行なうものであ
る。
Therefore, recently, a visual sensor (for example, CC
An automatic assembling apparatus having a D camera) has been proposed. As an example of such an automatic assembling apparatus, for example, JP-A-60
-56884, JP-A-60-123974 and JP-A-62-140724. In addition, Japanese Patent Application No. 1-71895, 2-
There is 55032. In these systems, an image of a work is taken in by a visual sensor, the work position is converted into a robot coordinate system by image processing from this image, and an assembly work is performed based on the work position in the robot coordinate system.

【0004】このような従来の視覚センサを備えた自動
組立装置は、ロボツト・ハンド等の動作を制御するロボ
ツト制御装置と、CCDカメラの画像を入力し処理する
画像処理装置を有し、さらに、これらを例えばRS23
2C等のケーブルで電気的に結合させ、各々の両方の制
御装置に通信可能とするインターフエース及び通信プロ
グラムを準備するのが普通である。そして、ロボツト制
御装置内には、一連のロボツトの動作プログラムをあら
かじめ入力する。このプログラムには、前記インターフ
エース及びケーブルを通して画像処理装置に、情報を送
つたり受けたりする命令を用いる。同様に、画像処理装
置内にも、ワークの画像入力から、その画像から認識処
理を行なう一連のプログラムと、その一連のプログラム
内に前記通信手段を通して情報の授受を行なわせる命令
を準備しておくように構成する。
An automatic assembling apparatus having such a conventional visual sensor has a robot controller for controlling the operation of a robot hand and the like, and an image processing device for inputting and processing an image of a CCD camera, and further, These are for example RS23
It is usual to prepare an interface and a communication program that can be electrically connected to each other by a cable such as 2C and can communicate with both control devices. Then, a series of robot operation programs are input in advance into the robot controller. This program uses commands for sending and receiving information to the image processing apparatus through the interface and cable. Similarly, in the image processing device, a series of programs for performing recognition processing from the image input of the work and commands for exchanging information through the communication means are prepared in the series of programs. To configure.

【0005】[0005]

【発明が解決しようとしている課題】しかしながら上記
従来技術若しくは提案技術では、それぞれ独立で動作可
能な画像処理装置と、ロボツトの制御装置を準備し、そ
れぞれを通信手段で連結し、一連の組立動作を行なわせ
るようにするために、次のような欠点があつた。 (1):ワークをパターン認識するために使う特徴パラ
メータは画像処理装置内に記憶させ、ロボツトの動作等
に使われるプログラムやパラメータはロボツト制御装置
内に記憶させる必要があるため、画像処理装置やロボッ
ト制御装置の夫々に、入出力装置であるキーボードやC
RT、記憶装置としてフロツピーデイスクドライブを設
置する必要があり、コストUPとなる。 (2):入出力を受けもつプログラムを上記両装置に準
備する必要があり、開発のコストUPと長大化がさけら
れない。 (3):画像処理装置を交換した場合、上記の各パラメ
ータを再度入力し直す必要がある。
However, in the above-mentioned conventional technique or the proposed technique, an image processing device which can operate independently and a robot control device are prepared, and they are connected by a communication means to perform a series of assembling operations. There were the following drawbacks in order to make it possible. (1): Since the characteristic parameters used for pattern recognition of the work need to be stored in the image processing apparatus, and the programs and parameters used for robot operation and the like need to be stored in the robot control apparatus, the image processing apparatus and Each of the robot control devices has a keyboard or C that is an input / output device.
It is necessary to install a RT and a floppy disk drive as a storage device, which results in cost increase. (2): It is necessary to prepare a program that handles input / output in both of the above-mentioned devices, and development cost UP and lengthening cannot be avoided. (3): When the image processing device is replaced, each of the above parameters needs to be input again.

【0006】本発明は上記従来技術の問題点に鑑みてな
されたものであり、その目的は、画像処理により把持対
象のワークを認識し、その認識に基づいてそのワークを
把持するような自動把持装置の制御装置であって、把持
動作と画像処理とに必要なパラメータを一元的に管理す
ることの可能な視覚を用いた自動把持装置の制御装置を
提供するものである。
The present invention has been made in view of the above problems of the prior art, and an object thereof is to automatically grasp a work to be grasped by image processing and grasp the work based on the recognition. A control device for an automatic gripping device that uses vision and is capable of centrally managing parameters required for gripping operations and image processing.

【0007】[0007]

【課題を解決するための手段】上記課題を達成するため
の本発明の制御装置は、ワークの画像を撮像し、この画
像から前記ワークの位置情報を算出する画像処理部と、
前記ワークを前記位置情報に基づいて把持する把持部と
からなる自動把持装置を制御する制御装置であって、前
記ワークを撮像しそのワークの画像から位置情報を算出
する一連の画像処理命令とこのワークを前記位置情報に
基づいて把持する一連の把持動作命令とを含むプログラ
ムと、ワークの位置情報を算出するためのパラメータと
を記憶する記憶部と、このプログラム中の前記画像処理
命令と把持動作命令とを識別して解釈すると共に、前記
画像処理命令を前記画像処理部に渡し、前記把持動作命
令を前記把持部に渡すための1つの解釈部と、前記パラ
メータを、前記プログラムの実行に先立って、前記画像
処理部若しくは把持部に転送する転送手段とを具備した
ことを特徴とする。
The control device of the present invention for achieving the above object includes an image processing unit for picking up an image of a work and calculating position information of the work from the image.
A control device for controlling an automatic gripping device comprising a gripping part for gripping the work on the basis of the position information, and a series of image processing commands for imaging the work and calculating position information from an image of the work, A program including a series of gripping operation commands for gripping a workpiece based on the position information, a storage unit that stores parameters for calculating the position information of the workpiece, the image processing command and the gripping operation in the program And an interpretation unit for identifying and interpreting the command, passing the image processing command to the image processing unit, and passing the gripping operation command to the gripping unit, and the parameter prior to execution of the program. And a transfer means for transferring to the image processing unit or the gripping unit.

【0008】[0008]

【作用】パラメータは、画像処理命令と把持動作命令と
を含むプログラムと同じ記憶部に記憶され、必要に応じ
て、この記憶部から、それが使われる把持部及び/又は
画像処理部に転送される。
The parameter is stored in the same storage unit as the program including the image processing command and the gripping operation command, and is transferred from this storage unit to the gripping unit and / or the image processing unit in which it is used, if necessary. It

【0009】[0009]

【実施例】以下添付図面を参照しながら本発明の実施例
を詳細に説明する。この実施例は、本発明を、所謂シャ
トル式の自動組立装置の制御装置に適用したものであ
る。 〈全体構成〉第1図はこの実施例のロボット組立装置と
その制御装置からなるシステムの斜視図である。このシ
ステムは、大きくは、部品供給装置11,12と、組立
を行なうシャトル式のロボット6と、自動組立制御装置
17とからなる。
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. In this embodiment, the present invention is applied to a control device of a so-called shuttle type automatic assembly device. <Overall Configuration> FIG. 1 is a perspective view of a system including a robot assembling apparatus and its controller according to this embodiment. This system is mainly composed of component supply devices 11 and 12, a shuttle type robot 6 for assembling, and an automatic assembly control device 17.

【0010】9はロボット6を搭載するシヤトルであ
る。シヤトル9はシヤトル移動用モータ6eにより、ガ
イド16a,16b上を一方向に移動可能となつてい
る。15はシヤトルベースであり、本実施例では床に固
定され、上面にガイドレール16a,16bが平行な状
態でボルト等にて取付けられている。
Reference numeral 9 is a shuttle in which the robot 6 is mounted. The shuttle 9 can be moved in one direction on the guides 16a and 16b by a shuttle moving motor 6e. Reference numeral 15 denotes a shuttle base, which is fixed to the floor in the present embodiment, and has guide rails 16a and 16b mounted on the upper surface in parallel with bolts or the like.

【0011】シヤトル9は制御装置17により、あらか
じめ教示された位置へ移動停止するように制御される。
また、シヤトルベース15には、パレツト等に収納され
た組立てる為の物品を供給する為の部品供給装置11,
12が取り付けられている。本実施例のシステムでは、
異なる2つの部品が供給可能な2つの第1の部品供給装
置11と第2の部品供給装置12が設けられている。そ
れぞれの供給装置は、複数のパレツト13a,13bを
収納可能であると共に、夫々の供給制御部14,21が
パレツト内の部品が空になるとその空のパレットを部品
を収納した新たなパレツトと交換するように供給装置1
1,12を制御する。
The shuttle 9 is controlled by the control device 17 so as to stop moving to a position taught in advance.
Further, the shuttle base 15 is provided with a parts supply device 11 for supplying articles for assembly stored in a pallet or the like.
12 is attached. In the system of this embodiment,
Two first component supply devices 11 and two second component supply devices 12 capable of supplying two different components are provided. Each of the supply devices can store a plurality of pallets 13a and 13b, and when the respective supply control units 14 and 21 empty the parts in the pallet, the empty pallets are exchanged for new pallets containing the parts. Supply device 1
1 and 12 are controlled.

【0012】組付用のロボツト6はシヤトル9上に固定
されているものの、部品供給装置11,12から部品を
取れるように、そのパレツト13a,13bの位置まで
16a,16bのガイドレールに沿つて移動する。
Although the assembly robot 6 is fixed on the shuttle 9, the assembly robot 6 is provided along the guide rails 16a and 16b to the positions of the pallets 13a and 13b so that the parts can be taken out from the parts feeders 11 and 12. Moving.

【0013】本実施例のロボツトは、いわゆる水平多関
節の4自由度をもつたもので、モータ6a,6bにより
水平の2本のアームが駆動され、モータ6cによりアー
ム先端部が昇降し、モータ6dにより前記アーム先端部
が回転させられる。なお、ロボツト6の手首部にはハン
ド7が取りつけられており、3つのモータ22a,22
b,22cによりフィンガーが駆動され、部品を把持す
ることが可能である。
The robot of this embodiment has what is called a horizontal multi-joint having four degrees of freedom. Two horizontal arms are driven by motors 6a and 6b, and the tip of the arm is raised and lowered by a motor 6c. The tip of the arm is rotated by 6d. A hand 7 is attached to the wrist of the robot 6, and the three motors 22a, 22
Fingers are driven by b and 22c, and a component can be gripped.

【0014】なお、前記6a,6b,6c,6d,6
e,22a,22b,22cのモータは制御装置17に
よりあらかじめ記憶されている動作に従つて動作するも
のである。
The above 6a, 6b, 6c, 6d, 6
The motors e, 22a, 22b, 22c operate according to the operation stored in advance by the controller 17.

【0015】第1図におけるロボツト6の位置は部品供
給装置11上のパレツト13a上の部品をつかむことが
可能な位置にある。
The position of the robot 6 in FIG. 1 is at a position where the component on the pallet 13a on the component supply device 11 can be grasped.

【0016】ハンドの脱着部7aは、制御装置17の指
令により不図示のクランパーを解放することにより外れ
る。ハンドの保持台10は複数のハンドを保持しておく
ためのものである。ロボツト6は、保持台10上の任意
のハンドを制御装置17の指令により自動で付けること
も可能であり、かつ、現在手首部に取り付いているハン
ドをハンド保持台10に外して乗せることも可能であ
る。また、組付ステージ8はロボツト6がつかんだ部品
を組立てる場所であって、必要に応じてガイド,補助機
能を付けることが可能である。この補助機能の動作が必
要な場合は、組付ステージ8上に駆動源を置き、この駆
動源を制御装置17とケーブルでつなぐことにより制御
可能となる。また、組付ステージ8はロボツト6と同じ
くシヤトル9上に乗つているために、ロボツト6がパレ
ツトより部品をつかんで、わずかに上昇した後は、シヤ
トル9が移動を開始しても、ロボツトの組付動作を続行
することが可能である。
The attaching / detaching portion 7a of the hand is detached by releasing a clamper (not shown) in response to a command from the control device 17. The hand holding table 10 is for holding a plurality of hands. The robot 6 can automatically attach an arbitrary hand on the holding base 10 in response to a command from the control device 17, and can remove the hand currently attached to the wrist from the hand holding base 10 and place it on the hand holding base 10. Is. Further, the assembling stage 8 is a place for assembling the parts grasped by the robot 6, and it is possible to provide a guide and an auxiliary function if necessary. When the operation of this auxiliary function is required, it can be controlled by placing a drive source on the assembly stage 8 and connecting the drive source to the control device 17 with a cable. Also, since the assembly stage 8 is mounted on the shuttle 9 as well as the robot 6, the robot 6 grabs parts from the pallet and slightly moves up. It is possible to continue the assembly operation.

【0017】5は視覚柱であり、その根元はシヤトル9
上に固定されている。先端部にはXYテーブル3が設け
られている。XYテーブル3の固定部にはレンズ1が取
り付けられている。CCDカメラ2は、XY2方向のス
テツピングモータ4a,4bにより移動可能となってい
る。即ち、レンズ1は1つのパレットの全領域を視野に
入れているが、CCDカメラ2を移動することにより、
パレットの任意の部分領域を高精度に画像情報として取
り込むことが可能である。つまり、13bのパレツト全
面をレンズ1を通して結像させた面内を結像面積より十
分小さなCCDに移動させ、13bのパレツトの入力さ
せたい場所のみの画像情報を取り込むようにしている。
Reference numeral 5 is a visual column, the root of which is a shuttle 9
It is fixed on. An XY table 3 is provided at the tip. The lens 1 is attached to the fixed portion of the XY table 3. The CCD camera 2 can be moved by stepping motors 4a and 4b in the XY2 directions. That is, the lens 1 covers the entire area of one pallet, but by moving the CCD camera 2,
It is possible to accurately capture an arbitrary partial area of the palette as image information. In other words, the entire surface of the pallet of 13b is moved through the lens 1 to a CCD which is sufficiently smaller than the image forming area, and the image information of only the place where the pallet of 13b is desired to be input is fetched.

【0018】視覚柱5はシヤトル9上に搭載されている
ために、組付けたい部品を収納した供給装置へシヤトル
と共に移動される。ピツクする部品を収納しているパレ
ットの画像は、その画像を入力可能な位置にCCDカメ
ラ2(即ちシャトル9)を移動させることで得ることが
でき、その画像を処理して、その処理結果に応じてロボ
ツトにより前記画像処理した部品を把持できる。
Since the visual column 5 is mounted on the shuttle 9, it is moved together with the shuttle to the supply device that houses the parts to be assembled. The image of the pallet containing the parts to be picked up can be obtained by moving the CCD camera 2 (that is, the shuttle 9) to a position where the image can be input. Accordingly, the image-processed component can be gripped by the robot.

【0019】組立装置全体の制御をする自動組立制御装
置17はケーブル18にてロボツト6,シヤトル9,X
Yテーブル3,ハンド7等のアクチユエータの制御及び
不図示のセンサーの入力等が可能となつている。19は
CRTで、20はキーボードで入出力が可能となる。 〈実施例装置の特徴〉この実施例システムに特有の機能
は、主に、後述の制御装置17により実現される。その
ような機能とは: :組み付け対象(把持対象)の部品を、パレット内で
特定し認識するために、パレット内の部品の画像を取り
込んで、パターンマツチングを行なう。この認識によ
り、パレット内にどのように部品が収納されていても、
部品の認識が可能となる。 :パターンマツチングにより、目的とする部品の存在
がパレット内に認識できると、その部品の位置を視覚系
の座標系で認識し、更に、ロボット系の座標系に変換す
る。ロボットは、ロボット系の座標系での把持位置で目
的部品を把持することができる。 :目的の部品を認識する処理を記述する画像処理プロ
グラムと、認識された部品を把持し移動する制御を記述
する組み付けプログラムとは、後述の命令解釈部87内
のRAM52に記憶されている。これらの2つのプログ
ラムは、マルチタスク制御により実行される。 :画像処理プログラム(タスク)は、組み付けプログ
ラム内に含まれる特別なタスク起動命令により起動され
る。起動された画像処理プログラムは組み付けプログラ
ムと並列処理される。 :画像処理プログラムと、組み付けプログラムは同じ
命令解釈部により解釈され、それらに含まれる種々の命
令は、命令コードに変換される。命令コードに変換する
ことにより、画像処理プログラム中の命令と組み付けプ
ログラムのそれとの性質上の相違を吸収し、画像処理プ
ログラムと組み付けプログラムとの一元管理が容易にな
る。 :画像処理プログラムの命令コードは、後述のデユア
ルポートRAMに記憶される。また、組み付けプログラ
ムの命令コードは後述の共有メモリ60に記憶される。
デユアルポートRAMの使用により、画像処理部のマイ
クロコンピユータと動作制御部におけるマイクロコンピ
ユータとを夫々の目的に適したものから選択することが
可能となる。
The automatic assembly control device 17 for controlling the entire assembling device uses a cable 18 to connect the robot 6, the shuttle 9, and the X.
It is possible to control an actuator such as the Y table 3 and the hand 7 and input a sensor (not shown). 19 is a CRT, and 20 is a keyboard for input / output. <Characteristics of Device of Embodiment> The functions peculiar to the system of this embodiment are mainly realized by the control device 17 described later. Such functions include :: In order to identify and recognize a component to be assembled (holding target) in the pallet, an image of the component in the pallet is captured and pattern matching is performed. With this recognition, no matter how the parts are stored in the pallet,
The parts can be recognized. : When the existence of the target part can be recognized in the pallet by pattern matching, the position of the part is recognized in the coordinate system of the visual system and further converted into the coordinate system of the robot system. The robot can grip the target component at the grip position in the coordinate system of the robot system. : An image processing program that describes a process for recognizing a target part and an assembly program that describes a control for gripping and moving the recognized part are stored in the RAM 52 in the command interpreting unit 87 described later. These two programs are executed by multitask control. : The image processing program (task) is activated by a special task activation instruction included in the assembly program. The activated image processing program is processed in parallel with the assembly program. : The image processing program and the assembling program are interpreted by the same instruction interpreting unit, and various instructions contained therein are converted into instruction codes. By converting into the instruction code, the difference in the property between the instruction in the image processing program and that of the assembling program is absorbed, and the unified management of the image processing program and the assembling program becomes easy. : The instruction code of the image processing program is stored in the dual port RAM described later. The instruction code of the assembly program is stored in the shared memory 60 described later.
By using the dual port RAM, it becomes possible to select the microcomputer of the image processing unit and the microcomputer of the operation control unit from those suitable for each purpose.

【0020】以下、制御装置17の構成及びそこにおけ
る動作について説明する。 〈制御装置17の構成〉第2図は制御装置17の全体構
成図である。
The structure of the control device 17 and the operation thereof will be described below. <Configuration of Control Device 17> FIG. 2 is an overall configuration diagram of the control device 17.

【0021】この制御装置17は、ロボット6の4軸の
モータ(6a乃至6d)とシャトル9のモータ6eを駆
動制御するロボット動作制御部62と、ハンド7の3軸
のモータ(22a乃至22c)を駆動制御するハンド動
作制御部63と、XYテーブルの駆動モータ4a,4b
を制御すると共にカメラ2を制御する画像処理部64
と、2つの供給装置11,12の制御部14,21との
インターフェースを司どるインターフェース54と、ロ
ボットプログラムの命令の解釈実行を行なう命令解釈部
87と、上記ロボット動作制御部62,,ハンド動作制
御部63,画像処理部64,命令解釈部87間で共有さ
れる共有メモリ60とを有する。
The controller 17 includes a robot operation controller 62 for driving and controlling the four-axis motors (6a to 6d) of the robot 6 and the motor 6e of the shuttle 9, and the three-axis motors (22a to 22c) of the hand 7. And a hand operation control unit 63 for driving and controlling the XY table drive motors 4a and 4b.
Image processing unit 64 for controlling the camera 2 and the camera 2.
And an interface 54 that controls the interfaces with the control units 14 and 21 of the two supply devices 11 and 12, an instruction interpreting unit 87 that interprets and executes a command of a robot program, the robot operation control unit 62, and a hand operation. The shared memory 60 is shared among the control unit 63, the image processing unit 64, and the instruction interpretation unit 87.

【0022】これらの構成要素はシステムバス59に接
続されており、本実施例では、このバス59はマルチバ
スである。命令解釈部87 命令解釈部87について第2図により説明する。
These components are connected to the system bus 59, and in the present embodiment, the bus 59 is a multibus. The instruction interpretation unit 87 will be described with reference to FIG.

【0023】50はCPUで、51はROMである。こ
のROM51内には、第5図に示すように、ロボット言
語命令の解釈プログラムと、この命令解釈プログラム中
の視覚処理命令とロボツト及びハンドの動作命令の夫々
を必要に応じて解釈するマルチタスク・オペレーテイン
グ・システム(以下、「OS」と略す)と、それらをサ
ポートする種々のプログラムがあらかじめ記憶されてい
る。これらのプログラムの詳細については後述する。
Reference numeral 50 is a CPU and 51 is a ROM. As shown in FIG. 5, the ROM 51 includes a multitasking program for interpreting a robot language command interpreting program, and a visual processing command and a robot and hand motion command in the command interpreting program as required. An operating system (hereinafter abbreviated as "OS") and various programs supporting them are stored in advance. Details of these programs will be described later.

【0024】命令解釈部87のRAM52内にはキーボ
ード20により入力されたところの、画像処理プログラ
ム及びロボツト/ハンドのための動作プログラムが収納
されている。
The RAM 52 of the instruction interpreting unit 87 stores the image processing program and the operation program for the robot / hand, which are input by the keyboard 20.

【0025】命令解釈部87内の各要素はローカルバス
86により接続されている。即ち、ローカルバス86に
はROM51とRAM52とインターフエースIF53
が結合されている。RAM52内のデータは、CRT1
9に表示することが可能であり、キーボード20により
入力することも削除等することも可能である。また、本
システムの実際の動作の指令はキーボード20により行
なう。
The elements in the instruction interpreting section 87 are connected by a local bus 86. That is, the local bus 86 has a ROM 51, a RAM 52, and an interface IF 53.
Are combined. The data in RAM52 is CRT1
9 can be displayed, and can be input with the keyboard 20 or deleted. The keyboard 20 is used to issue an instruction for the actual operation of this system.

【0026】62,63はロボツト及びハンドのための
動作制御部である。これらの制御部62,63は、共有
メモリ60内に、ロボツト動作及びハンド動作に対応す
る命令コードが書かれると、その命令コードに従つた動
作処理を行ない、各デバイスつまり各モータ6a〜6e
の回転・停止を行なう。前述したように、上記命令コー
ドは、命令解釈部87がこの共有メモリ60に書込む。
Reference numerals 62 and 63 are operation control units for the robot and the hand. When the instruction code corresponding to the robot operation and the hand operation is written in the shared memory 60, the control units 62 and 63 perform the operation processing according to the instruction code, and each device, that is, each motor 6a to 6e.
Rotation and stop. As described above, the instruction code is written in the shared memory 60 by the instruction interpretation unit 87.

【0027】画像処理部64は部品を認識するための画
像処理を行なう部分で、IF61に書き込まれた命令コ
ードにより処理を行なう。
The image processing unit 64 is a portion for performing image processing for recognizing the parts, and performs processing by the instruction code written in the IF 61.

【0028】69は公知の磁気式の外部記憶手段であ
り、たとえばフロツピーデイスクドライブ又はハードデ
イスクドライブであり、IF53を通し、ロボツト・ハ
ンドの動作命令画像の処理命令をキーボード20を操作
することにより記憶させることが可能となつている。
Reference numeral 69 denotes a known magnetic external storage means, for example, a floppy disk drive or a hard disk drive, which stores a processing instruction of a robot hand operation instruction image by operating the keyboard 20 through the IF 53. It is possible to make it.

【0029】また、外部のコンピユータ等で記憶させて
あるフロツピーデイスク又はすでに記憶してあるフロツ
ピーデイスクをもつて来ることにより、RAM52内に
処理命令,動作命令をそれぞれのきめられた領域に格納
することも可能である。
Further, by bringing a floppy disk stored in an external computer or the like or a floppy disk already stored in the RAM 52, processing instructions and operation instructions are stored in respective designated areas in the RAM 52. It is also possible to do so.

【0030】部品供給装置の制御部14,21は、光通
信回路56a,56bをもち、シヤトル9上の光通信回
路55a,55bと情報の授受が可能となつている。こ
れらの光通信回路はそれぞれ発光手段と受光手段を持
ち、それぞれ発光と受光が対向し、ロボツト6が所定の
供給装置の位置で停止したとき、通信可能となる。
The control units 14 and 21 of the component supply device have optical communication circuits 56a and 56b, and can exchange information with the optical communication circuits 55a and 55b on the shuttle 9. Each of these optical communication circuits has a light emitting means and a light receiving means, and the light emission and the light reception face each other, and when the robot 6 is stopped at a predetermined position of the supply device, communication is possible.

【0031】インターフェースIF57は外部のコンピ
ユータ等との通信するためのインターフエースであり、
本組立装置内の情報を外部へ送つたり、外部からの情報
の入力を行なう。たとえば、無人倉庫を管理するコンピ
ユータと通信することで、パレツトの自動配送のタイミ
ングを算出することも可能である。
The interface IF57 is an interface for communicating with an external computer or the like,
The information in this assembly device is sent to the outside and the information is input from the outside. For example, it is possible to calculate the timing of automatic delivery of pallets by communicating with a computer that manages an unmanned warehouse.

【0032】59はCPU50と62のロボツト動作部
63ハンド動作部61のIF61と共有メモリ60を結
ぶコモンバスであって、本実施例ではマルチバスであ
る。
Reference numeral 59 denotes a common bus connecting the IF 61 of the robot operation unit 63 and the hand operation unit 61 of the CPUs 50 and 62 and the shared memory 60, which is a multi-bus in this embodiment.

【0033】解釈部87のCPU50で解釈実行され生
成された命令コードは共有メモリ60にセツトされる。
これらの命令コードをロボツト動作制御部62又はハン
ド動作制御部63が受ける。制御部62,63において
実際の動作を行ない動作が終了すると、共有メモリ60
上へ前記制御部が動作の終了信号を書き込む。
The instruction code generated by being interpreted and executed by the CPU 50 of the interpretation unit 87 is set in the shared memory 60.
The robot operation controller 62 or the hand operation controller 63 receives these instruction codes. When the control units 62 and 63 perform the actual operation and the operation ends, the shared memory 60
The control unit writes an operation end signal to the top.

【0034】また、CPU50で解釈実行された命令が
画像処理に関連する命令である場合、その命令コードは
IF61内に設けられたツー・ポートRAM(2-PORT-RA
M)内に書かれ、前述の組み付け動作命令と同様に、画像
処理が終了すると処理結果の通信が必要なときは、処理
結果と処理の終了信号を同じく、前記IF61内のツー
・ポートRAM上に書き込む。画像処理部64 第3図は画像処理部64の詳細の構成図である。
When the instruction interpreted and executed by the CPU 50 is an instruction related to image processing, the instruction code is a two-port RAM (2-PORT-RA) provided in the IF 61.
M), and when the processing result communication is required when the image processing is completed, the processing result and the processing end signal are also stored on the two-port RAM in the IF61 as in the case of the assembly operation command described above. Write in. Image Processing Unit 64 FIG. 3 is a detailed block diagram of the image processing unit 64.

【0035】65は画像処理部全体の制御を行なうCP
Uである。ツー・ポート・RAM61では、制御装置1
7の他の要素とのデータのやりとりが可能なように、第
2図のバス59と第3図のバス72とが両方向から接続
されて、その両方向から読み書きが可能である。
Reference numeral 65 is a CP for controlling the entire image processing section.
U. In the two-port RAM 61, the controller 1
The bus 59 shown in FIG. 2 and the bus 72 shown in FIG. 3 are connected from both directions so that data can be exchanged with the other elements, and reading and writing can be performed from both directions.

【0036】CPU50とCPU65のバス間にツー・
ポートRAM61を設けることにより、CPU50とC
PU65のCPUの種類を異ならせることが可能とな
る。尚、第2図の共有メモリ60で通信可能であったよ
うに、CPU65とCPU50の形式を同等にしても何
ら問題はない。また、第2図のロボツト動作制御部6
2,ハンド動作制御部63と命令解釈部87とのデータ
の授受も、画像処理部64と同様にツー・ポート・RA
M61をインターフエースとして設けることにより通信
を行なわせても何ら問題はない。
Two buses are connected between the CPU 50 and the CPU 65.
By providing the port RAM 61, the CPU 50 and C
It is possible to change the type of CPU of the PU 65. It should be noted that there is no problem even if the CPU 65 and the CPU 50 have the same format as the communicable memory 60 shown in FIG. In addition, the robot operation control unit 6 of FIG.
2. The data transfer between the hand operation control unit 63 and the command interpretation unit 87 is also performed by the two-port RA as in the image processing unit 64.
There is no problem even if communication is performed by providing M61 as an interface.

【0037】画像処理部64において、2は画像を取り
込むためのカメラで、本実施例においてはX−Yテーブ
ルにそのレンズが固定されている。XYテーブル3はC
CDを撮像面内で移動させることにより、パレツトの必
要な場所の画像情報を取り込むようにすることができ
る。カメラ2が取った画像信号は、A/D変換部73に
より明るさのレベルでデジタル化され、フレームメモリ
75内に記憶される。
In the image processing unit 64, reference numeral 2 is a camera for capturing an image, and in the present embodiment, the lens is fixed to the XY table. XY table 3 is C
By moving the CD within the imaging plane, it is possible to capture the image information of the place where the pallet is required. The image signal captured by the camera 2 is digitized by the A / D conversion unit 73 at the brightness level and stored in the frame memory 75.

【0038】第4図は部品供給装置における部品収納に
用いられるパレットの外観を示す。同図に示すように、
パレット内では部品が分割されたセル内に納められてい
る。部品は、パレットのセル位置情報により特定され
る。本組立装置は、画像処理で部品の正確な位置を認識
するので、あらかじめ部品をパレット内に正確に固定す
る必要はない。また、パレットのセルも正確な寸法を有
する必要もない。必要とする部品を収納しているセルの
凡その位置が分れば十分である。即ち、必要とする部品
のセル位置がロボットプログラムにおいて特定されれ
ば、そのセル位置周辺の画像に対して画像処理を行な
い、そのセル内において、要求部品の正確な位置をパタ
ーン認識で求める。
FIG. 4 shows the appearance of a pallet used for storing components in the component supply device. As shown in the figure,
In the pallet, parts are contained in divided cells. The part is specified by the cell position information of the pallet. Since the assembly apparatus recognizes the accurate position of the component by image processing, it is not necessary to fix the component in the pallet accurately in advance. Also, the cells of the pallet do not have to have exact dimensions. It suffices to know the approximate location of the cell containing the required component. That is, if the cell position of the required component is specified in the robot program, image processing is performed on the image around the cell position, and the accurate position of the required component is found in the cell by pattern recognition.

【0039】CCDカメラ2の視野をパレット全体をカ
バーするほどの大きさに設定したならば、コスト増加を
甘受してCCD素子を大きいものにするか、あるいは解
像度の劣化を甘受して小さなCCD素子によりパレット
全体を視野に入れるようにしなければならない。そこ
で、本実施例では、カメラ2を移動式にし、パレットの
画像の必要部分のみを取出すようにしている。そこで、
カメラ2にはXYテーブル駆動部76が設けられてい
る。この駆動部76は、XYテーブルの2つのステツピ
ングモータ4a,4bを回転駆動させ、カメラを所定の
位置へ移動させる。領域設定部74は、カメラ2で画像
を取り込む際に、CCDの全域の画像情報を取り込む必
要がないときに領域を限定する機能を有する。組立機に
おいて、組付部品の形状及び大きさは、あらかじめわか
つているため、1つの部品の画像情報のみを取り込みた
い場合には、画像の処理命令内に領域を限定する処理命
令をプログラムしておく。
If the field of view of the CCD camera 2 is set so as to cover the entire pallet, the cost is increased and the CCD element is made large, or the resolution is deteriorated and the small CCD element is accepted. Must ensure that the entire pallet is in view. Therefore, in the present embodiment, the camera 2 is of a movable type so that only a necessary portion of the image of the palette is taken out. Therefore,
The camera 2 is provided with an XY table drive unit 76. The drive unit 76 rotationally drives the two stepping motors 4a and 4b of the XY table to move the camera to a predetermined position. The area setting unit 74 has a function of limiting the area when it is not necessary to capture image information of the entire area of the CCD when capturing an image with the camera 2. In the assembling machine, the shape and size of the assembled parts are known in advance, so if you want to capture only the image information of one part, program a processing command that limits the area within the image processing command. deep.

【0040】二値化部66は、フレームメモリ75に格
納されている画像情報を処理命令であらかじめ指定され
た明るさのレベルを基準にして、たとえば明るいものを
“1”、暗いものを“0”として二値化する。二値画像
は、再度、フレームメモリ75に格納する。
The binarizing unit 66 uses the image information stored in the frame memory 75 as a reference based on the brightness level designated in advance by a processing command, for example, a bright one is "1" and a dark one is "0". It is binarized as ". The binary image is stored in the frame memory 75 again.

【0041】ラベリング部67はラベリングを行なう。
このラベリング処理は、二値化された画像情報中に、た
とえば、連結しているドットの塊グループ、つまり
“1”の塊のグループを見つけ、それぞれのグループに
各々異なつたラベルを付ける。
The labeling section 67 performs labeling.
In this labeling process, for example, a group of connected dot clusters, that is, a group of "1" clusters is found in the binarized image information, and a different label is attached to each group.

【0042】ラベリングされた連結領域の各々に対し
て、たとえば重心位置面積,慣性主軸を算出するのが特
徴パラメータ算出部68である。算出部68で算出され
たあるワークの画像の特徴パラメータと、ツー・ポート
・RAM61内に格納されている基準特徴パラメータと
を比較することにより、その画像が指定された部品の画
像であるかどうかを判別する。その画像の部品が指定さ
れた部品であると判定された場合には、その部品の視覚
座標系における位置と傾きを求め、ツー・ポート・RA
M61内にあらかじめ格納されているロボツト座標系へ
の変換パラメータを用いて、ロボツト座標系へ変換し、
ツー・ポート・RAM61上へ位置データとして格納す
る。ロボツトの動作命令中、該位置データが必要なとき
は、位置データを読み、その結果で動作する動作命令を
実行することにより画像処理部が算出した位置情報でパ
レツト内の部品をつかみ、組付を行なえる。また、ツー
・ポート・RAM61内に格納されている特徴パラメー
タ及び座標変換のパラメータは、第2図のRAM52の
バツテリーバツクUPされているところに記憶されてお
り、本制御装置の電源を入れると自動的にツー・ポート
・RAM61上にも記憶されるよう、構成されている。
The feature parameter calculator 68 calculates, for example, the center of gravity position area and the principal axis of inertia for each of the labeled connected regions. Whether the image is the image of the designated part by comparing the characteristic parameter of the image of a certain work calculated by the calculation unit 68 with the reference characteristic parameter stored in the two-port RAM 61. To determine. When it is determined that the part of the image is the specified part, the position and the tilt of the part in the visual coordinate system are obtained, and the two-port RA is calculated.
Convert to the robot coordinate system using the conversion parameters to the robot coordinate system stored in M61 beforehand,
The data is stored on the two-port RAM 61 as position data. If the position data is required in the robot operation command, the position data is read, and the operation command that operates based on the result is executed to grasp the part in the pallet with the position information calculated by the image processing unit and assemble it. Can be done. Further, the characteristic parameters and the coordinate conversion parameters stored in the two-port RAM 61 are stored in the RAM 52 of FIG. 2 where the battery is backed up and are automatically set when the power of the control device is turned on. It is also configured to be stored in the two-port RAM 61.

【0043】第3図において、ROM71は、画像の一
連の処理を行なわせるプログラムをあらかじめ記憶して
いる。 〈プログラム構造〉第5図は、第2図に関連して説明し
た命令解釈部87のローカルメモリ用ROM51に格納
されたプログラムの格納状況を示す。
In FIG. 3, the ROM 71 stores in advance a program for performing a series of image processing. <Program Structure> FIG. 5 shows the storage status of the program stored in the ROM 51 for the local memory of the instruction interpretation unit 87 described with reference to FIG.

【0044】ROM51には、電源立ち上げ時に先つ実
行される起動プログラム100と、複数のタスクの管理
・実行を行なうマルチタスクOS101と、プログラム
を作成するためのテキストエデイタ102と、作成され
たテキストプログラムを解釈可能な中間コードに変換す
るためのコンパイラ103と、コンパイラ103により
変換された中間コードを解釈し、下位の制御部(ロボッ
ト動作制御部62,ハンド動作制御部63,画像処理部
64)のための命令コード(第13図〜第15図)を発
生する命令解釈プログラム104と、キーボード,CR
T等の入出力装置の入出力を制御するIFドライバプロ
グラム105と、ロボツトの動作状態、作成した組付動
作プログラム等のロボツトタスクの状態を表示するため
のロボツトタスク表示プログラム106と、画像処理部
64の動作状態、作成したビジヨン動作プログラム等の
ビジヨンタスクの状態を表示するビジヨンタスク表示プ
ログラム107とが格納されている。
The ROM 51 has a start program 100 that is executed first when the power is turned on, a multitask OS 101 that manages and executes a plurality of tasks, a text editor 102 for creating a program, and a created text. A compiler 103 for converting a program into an interpretable intermediate code, and interprets the intermediate code converted by the compiler 103, and a lower control unit (robot motion control unit 62, hand motion control unit 63, image processing unit 64) Instruction program 104 for generating an instruction code (FIGS. 13 to 15) for a keyboard, a keyboard, and a CR
An IF driver program 105 for controlling the input / output of an input / output device such as T, a robot task display program 106 for displaying the operation state of the robot, the state of the robot task such as the created assembly operation program, and an image processing unit. A 64 task status display program 107 for displaying the status of the task, such as the created task operation program, is stored.

【0045】第6図は命令解釈部87のローカルメモリ
用RAM52におけるデータの格納状況を示す図であ
る。このRAM52には、ロボツトの組付動作のための
一連の動作命令群からなる組付動作プログラム108
(第9図,第10図)と、画像処理部の処理動作のため
の一連の処理動作命令群からなるビジヨン動作プログラ
ム109(第11図)と、XYステージの目標位置デー
タ110と、シヤトルの目標位置データ111と、ロボ
ツトを位置決めするための目標位置データ112と、組
付されるワークの特徴を示す基準特徴パラメータ113
と、座標変換パラメータ114とが格納されている。こ
のパラメータ114はロボツト座標系からXYステージ
座標系の座標変換演算に用いる演算パラメータと、XY
ステージ座標系からロボツト座標系への同様の演算パラ
メータである。
FIG. 6 is a diagram showing a data storage state in the local memory RAM 52 of the instruction interpreting section 87. In the RAM 52, an assembling operation program 108 including a series of operation instructions for robot assembling operation.
(FIGS. 9 and 10), a vision operation program 109 (FIG. 11) consisting of a series of processing operation instructions for the processing operation of the image processing unit, the target position data 110 of the XY stage, and the shuttle. Target position data 111, target position data 112 for positioning the robot, and reference feature parameters 113 indicating the features of the work to be assembled.
And the coordinate conversion parameter 114 are stored. This parameter 114 is a calculation parameter used for coordinate conversion calculation from the robot coordinate system to the XY stage coordinate system, and XY
It is the same calculation parameter from the stage coordinate system to the robot coordinate system.

【0046】RAM52は揮発性であるが、それに格納
されているデータ類は重要であるので、後述するよう
に、バツテリー・バツクアツプされている。 〈ロボットプログラム〉第7図,第8図は、第1図の組
立システムにおける、部品供給部11,12から2つの
部品供給を受けてワークを組立てる組立動作の過程を表
わす図である。即ち、第7図は、ロボット6が第1の部
品供給部11のパレツト13aに収納された部品Aをア
クセス可能となるような位置に、シヤトル9が停止した
状態を示す。第8図は、ロボット6が部品Aの組立に続
いて把持される部品B(この部品Bは部品供給部12の
パレツト13bに収納されている)をアクセス可能とな
るような位置に、シヤトル9が停止した状態を示してい
る。
The RAM 52 is volatile, but the data stored in it is important, so it is backed up and backed up as will be described later. <Robot Program> FIGS. 7 and 8 are views showing a process of an assembling operation for assembling a work by receiving two component supplies from the component supply units 11 and 12 in the assembly system of FIG. That is, FIG. 7 shows a state in which the shuttle 9 is stopped at a position where the robot 6 can access the component A stored in the pallet 13a of the first component supply unit 11. FIG. 8 shows that the shuttle 9 is placed at a position where the robot 6 can access the component B (the component B is stored in the pallet 13b of the component supply unit 12) which is held after the assembly of the component A. Shows that it has stopped.

【0047】第7図、特に第8図を見ても分るように、
ロボット6が部品Aを組み付けている動作を行なってい
る最中は、カメラ2がワークBを収納しているパレット
13bの上空にある限りは、部品Aの組み付け動作と部
品Bの撮像動作とは並行で行なうことができる。この組
み付け動作処理と撮像動作(画像処理)の並列性故に、
第6図で示したように、組み付け動作プログラムとビジ
ョン動作プログラムとをタスク化することの意義があ
る。
As can be seen from FIG. 7, particularly FIG. 8,
While the robot 6 is performing the operation of assembling the part A, as long as the camera 2 is above the pallet 13b storing the work B, the assembling operation of the part A and the imaging operation of the part B are performed. Can be done in parallel. Due to the parallelism of this assembling operation processing and the imaging operation (image processing),
As shown in FIG. 6, it is significant to convert the assembly operation program and the vision operation program into tasks.

【0048】第9図は部品Aを組立てる一連のロボツト
動作命令群(プログラム)であり、第10図は部品Bを
組立てる一連のロボツト動作命令群(プログラム)であ
り、第11図は部品Bの画像を画像処理して位置情報を
算出する一連の画像処理命令群(プログラム)である。
FIG. 9 is a series of robot operation command groups (program) for assembling the part A, FIG. 10 is a series of robot operation command groups (program) for assembling the part B, and FIG. 11 is for the part B. It is a series of image processing command groups (programs) for performing image processing on an image and calculating position information.

【0049】尚、第9図乃至第11図には、部品Aの画
像を画像処理して位置情報を算出するためのプログラム
は示されていない。また、ワークを完成するために、更
に、例えば部品Cが必要であるものであるならば、その
部品Cの画像を画像処理して位置情報を算出する一連の
画像処理命令群(プログラム)と、部品Cを組立てる一
連のロボツト動作命令群(プログラム)とが、第9図乃
至第11図のプログラムに追加して必要となる。また、
便宜上、第9図のプログラムをプログラム1と、第10
図のプログラムをプログラム2と、第11図のプログラ
ムをプログラム3と呼ぶ。
Note that FIGS. 9 to 11 do not show a program for image-processing the image of the part A to calculate the position information. Further, in order to complete the work, for example, if the part C is required, a series of image processing command groups (programs) for image-processing the image of the part C to calculate position information, A series of robot operation command groups (programs) for assembling the part C are required in addition to the programs shown in FIGS. 9 to 11. Also,
For the sake of convenience, the program of FIG.
The program shown in the figure is called program 2, and the program shown in FIG. 11 is called program 3.

【0050】第9図乃至第11図のプログラムは第7
図,第8図の動作を記述している。部品Aを組立て、次
に部品Bを組み付ける組立動作を行なうには、先ず、プ
ログラム1(第9図)が前もって起動されてている必要
がある。プログラム1が実行されていて、プログラム1
自身がプログラム2を起動する。プログラム1によるプ
ログラム2の起動は、行番390の CALL 2 で行なって、プログラム2をコールすることによりなさ
れる。また、部品Bの組立が終了して部品Cの組立動作
を起動するには、行番250の CALL 3 を実行して、プログラム3(不図示)をコールすること
によりなされる。部品Aの組立動作中に、部品Bの画像
の取得及びその画像処理が可能となったときは、行番3
60で、 START 3,2 を実行して、プログラム3(第11図)をマルチタスク
制御の下でコールする。即ち、プログラム1とプログラ
ム3とは並列動作する。部品Bの組立動作中に、部品C
の画像の取得及びその画像処理が可能となったときは、
行番220で、 START 3,3 を実行して、プログラム2とプログラム3とを並列動作
させる。尚、並列処理の起動命令であるSTART命令
の2番目のオペランドは起動対象のプロシジャ番号を、
3番目のオペランドは当該の起動プログラム中のプロシ
ジャ番号を表わす。プログラム3の3番目のプロシジャ
は不図示ではあるが、部品Cが特殊な形状を有するもの
ではないために、即ち、形状に即した特別な画像処理を
要するものではないために、第11図のプログラムと同
じものを援用できる。
The programs shown in FIGS. 9 to 11 are shown in FIG.
The operation of FIGS. 8 and 9 is described. In order to assemble the part A and then assemble the part B, the program 1 (FIG. 9) must first be started in advance. Program 1 is running and program 1
The program itself is activated. The program 2 is activated by the program 1 by calling CALL 2 on line 390 and calling the program 2. In order to start the assembly operation of the component C after the assembly of the component B is completed, the CALL 3 of the line number 250 is executed and the program 3 (not shown) is called. If the image of the part B and its image processing are possible during the assembly operation of the part A, the line number 3
At 60, execute START 3,2 to call program 3 (FIG. 11) under multitasking control. That is, the program 1 and the program 3 operate in parallel. During the assembly operation of the part B, the part C
When it becomes possible to obtain the image of
At line number 220, START 3,3 is executed to operate the programs 2 and 3 in parallel. The second operand of the START instruction that is the parallel processing start instruction is the procedure number of the start target,
The third operand represents the procedure number in the starting program. Although the third procedure of the program 3 is not shown, since the part C does not have a special shape, that is, it does not require special image processing according to the shape, the third procedure of FIG. The same program can be used.

【0051】第9図乃至第11図のプログラム中におけ
る各ステートメントの命令の意味は、後述する。 〈並列処理〉第7図,第8図に示すように、本実施例の
ロボットシステムにおける、組立動作と画像処理とは並
列動作が可能である。また、第9図乃至第11図に示し
たように、これらの動作を記述するプログラムも並列処
理を意識したものである。そこで、以下に、この並列処
理を実現するために、制御装置17の特徴ある制御につ
いて説明する。これらの特徴とは、第12図に示すよう
に、 :所謂ロボットプログラム(第9図乃至第11図のプ
ログラム)を解釈するのは、命令解釈部87の命令解釈
プログラム104(第5図)が行ない、 :上記プログラム104は、プログラム中の命令(ス
テートメント)を、組立動作に関するもの(ロボット動
作制御部62若しくはハンド動作制御部63)か、画像
処理に関連するもの(画像処理部64のためのもの)か
を判別し、夫々、対応する命令コードを生成する。 :組立動作に関する命令から生成された命令コードは
共有メモリ60に書込まれ、画像処理に関連する命令か
ら生成された命令コードはツー・ポート・RAM61に
書込まれる。 :ロボット動作制御部62またはハンド動作制御部6
3は、共有メモリ60内に書込まれた命令コードを実行
する。また、画像処理部64のCPU65は、ツー・ポ
ート・RAM61に書込まれた命令コードを実行する。
The meaning of the instruction of each statement in the programs of FIGS. 9 to 11 will be described later. <Parallel Processing> As shown in FIGS. 7 and 8, in the robot system of this embodiment, the assembly operation and the image processing can be performed in parallel. Further, as shown in FIGS. 9 to 11, the programs describing these operations are also conscious of parallel processing. Therefore, the characteristic control of the control device 17 in order to realize the parallel processing will be described below. These features are, as shown in FIG. 12 ,: The so-called robot program (the programs of FIGS. 9 to 11) is interpreted by the instruction interpretation program 104 (FIG. 5) of the instruction interpretation unit 87. The program 104 executes commands (statements) in the program relating to an assembly operation (robot operation control unit 62 or hand operation control unit 63) or image processing (for the image processing unit 64). And the corresponding instruction code is generated. : The instruction code generated from the instruction related to the assembling operation is written in the shared memory 60, and the instruction code generated from the instruction related to the image processing is written in the two-port RAM 61. : Robot operation controller 62 or hand operation controller 6
3 executes the instruction code written in the shared memory 60. Further, the CPU 65 of the image processing unit 64 executes the instruction code written in the two-port RAM 61.

【0052】第13図乃至第15図は、上記命令コード
のメモリ格納形式の一例を示す図である。命令コード 第13図は命令コードの一般的な格納形式を示す図であ
る。第13図の格納形式は、次の命令が格納されている
メモリ番地を示す「次命令格納番地ポインタ」200
と、命令の種類を示す「Pコード」201と、命令を補
足するためのパラメータの型(例えば、直接の数字であ
るか、変数であるか、実数であるか、整数であるかの区
別)を示すデータタイプ202Aと、そのパラメータの
データ部分203Aと、データの終りを示すデリミツタ
204Aと、命令コードの終りを示すと共に内容の誤り
を検出するためのチエツクサム205、という順で格納
されている。
FIGS. 13 to 15 are diagrams showing an example of the memory storage format of the instruction code. Instruction Code FIG. 13 is a diagram showing a general storage format of the instruction code. The storage format of FIG. 13 is "next instruction storage address pointer" 200 indicating the memory address where the next instruction is stored.
And "P code" 201 indicating the type of instruction, and the type of parameter for supplementing the instruction (for example, whether it is a direct number, a variable, a real number, or an integer) , A data portion 203A of the parameter thereof, a delimiter 204A indicating the end of the data, and a checksum 205 for indicating the end of the instruction code and detecting an error in the contents are stored in this order.

【0053】命令には、命令コード中にパラメータを必
要としないものもある。かかる命令の命令コードは、第
14図に示す様に、Pコード201の後に、命令の終り
を示すチエツクサム205が格納されている。
Some instructions do not require parameters in the instruction code. In the instruction code of such an instruction, as shown in FIG. 14, a checksum 205 indicating the end of the instruction is stored after the P code 201.

【0054】また、命令コード中にパラメータが複数組
必要である命令の場合には、第15図に示す様に、Pコ
ード201の後に、データタイプ202,データ20
3,デリミツト204からなる組が必要な組数だけ格納
された後に、チエツクサム205が格納されている。
In the case of an instruction that requires a plurality of parameters in the instruction code, as shown in FIG. 15, after the P code 201, the data type 202 and the data 20
3, the checksum 205 is stored after the required number of sets of the delimiters 204 are stored.

【0055】この様に、命令ステートメントを、命令の
種類(Pコード201)とパラメータとからなる命令コ
ード(中間コード)に構成し直し、メモリ中に格納する
事により、組付動作プログラム108とビジヨン動作プ
ログラム109を同一形式で格納する事が可能である。
また、組付動作プログラム108とビジヨン動作プログ
ラム109との命令のいずれも同一形式の命令コードに
変換されるということは、それらを格納するためのメモ
リを共通化することができることを意味する。即ち、具
体的には、画像処理部64のための命令コードの格納用
メモリであるツー・ポート・RAM61の代りに、画像
処理部のための命令コードを共有メモリ60に格納する
ことも可能であることを意味する。本実施例で、共有メ
モリ60の他にツー・ポート・RAM61を用いた理由
は、メモリを一本化したことによるそのメモリへのアク
セス競合を避けることと、ツー・ポート・RAM61が
異なる2方向から同時にアクセスされることによる高速
度処理が可能なこと、そして、組み付け動作と画像処理
とが容易に並列処理化できること、更に、画像処理部6
4のCPUに、命令解釈部87のCPUとは異なるアー
キテクチャのCPUを使うことができることである。 〈並列処理のための制御〉第16図は、本システムにお
ける並列処理を制御するためのプログラム間の構造を説
明する図である。組付動作プログラム108を解釈する
一連の手続きを「ロボツトタスク」と呼び、組付動作プ
ログラム108の解釈を開始する事を「ロボツトタスク
を起動する」と呼ぶ。同様に、ビジヨン動作プログラム
109を解釈する一連の手続きを「ビジヨンタスク」と
呼び、ビジヨン動作プログラム109の解釈を開始する
事を「ビジョンタスクを起動する」と呼ぶ。ビジョンタ
スクを起動することは、前述のSTART指令で行なわ
れる。本組立システムでは、組立工程の最中に補助的に
画像処理を行なうという手順を踏んでいるために、組立
プログラム中にビジョンタスクを起動するSTARTス
テートメントが記述されることとなる。これにより、ロ
ボットタスクとビジョンタスクの競合調停が容易にな
る。そして、更に、ロボットタスクの起動は、制御装置
17のキーボード20からのスタートキーの入力があっ
た時点でなされる。
In this manner, the instruction statement is reconfigured into an instruction code (intermediate code) consisting of the instruction type (P code 201) and the parameter and stored in the memory, so that the assembling operation program 108 and the vision are executed. The operation program 109 can be stored in the same format.
Further, the fact that the instructions of the assembling operation program 108 and the vision operation program 109 are both converted into the same type of instruction code means that the memory for storing them can be shared. That is, specifically, instead of the two-port RAM 61 which is a memory for storing the instruction code for the image processing unit 64, the instruction code for the image processing unit can be stored in the shared memory 60. Means there is. In the present embodiment, the reason why the two-port RAM 61 is used in addition to the shared memory 60 is to avoid access competition to the memory due to the unification of the memory, and to use the two-port RAM 61 in two different directions. High-speed processing is possible by being simultaneously accessed from each other, and the assembling operation and the image processing can be easily parallelized, and further, the image processing unit 6
The CPU of No. 4 has a different architecture from the CPU of the instruction interpreting unit 87. <Control for Parallel Processing> FIG. 16 is a diagram illustrating a structure between programs for controlling parallel processing in the present system. A series of procedures for interpreting the assembly operation program 108 is called a "robot task", and starting interpretation of the assembly operation program 108 is called "activating a robot task". Similarly, a series of procedures for interpreting the vision operation program 109 is called a "vision task", and starting interpretation of the vision operation program 109 is called "activating a vision task". The activation of the vision task is performed by the above-mentioned START command. In this assembling system, since the procedure of auxiliary image processing is performed during the assembling process, the START statement for activating the vision task is described in the assembling program. This facilitates competitive arbitration between robot tasks and vision tasks. Further, the robot task is activated when the start key is input from the keyboard 20 of the control device 17.

【0056】ロボットタスクにおいて解釈されたロボッ
ト命令は命令コード(第13図乃至第15図)に変換さ
れて、前述したように、共有メモリ60に格納される。
また、ビジョンタスクにおいて解釈された画像処理命令
は同じように命令コードに変換されてツー・ポート・R
AM61に格納される。共有メモリ60の命令コード
は、ロボット動作制御部62,ハンド動作制御部63に
よりフエツチされて実行される。ロボット動作制御部6
2,ハンド動作制御部63は、不図示ではあるが、夫々
専用のマイクロプロセサと、第18図,第19図に示し
たプログラムを格納するメモリと、サーボ制御回路やサ
ーボアンプ等を有している。
The robot command interpreted in the robot task is converted into a command code (FIGS. 13 to 15) and stored in the shared memory 60 as described above.
In addition, the image processing command interpreted in the vision task is also converted into a command code in the same manner, and the two-port R
It is stored in the AM 61. The instruction code of the shared memory 60 is fetched and executed by the robot operation control unit 62 and the hand operation control unit 63. Robot operation control unit 6
2. Although not shown, the hand operation control unit 63 has a dedicated microprocessor, a memory for storing the programs shown in FIGS. 18 and 19, a servo control circuit, a servo amplifier, etc., respectively. There is.

【0057】第16図に示されるように、命令解釈プロ
グラムには3つのフラグ(MWF,TWF,PWF)が
用意されている。即ち、「動作完了待フラグ」(MW
F)は、ロボットタスクの命令の中の、その命令の実行
終了を待つことが必要な命令が現在ロボットタスクで実
行中であることを示す。動作完了待フラグMWFは、例
えば、 MOV P(4) 等の命令の実行によりセットされる。これらの命令は、
ロボットの実際の移動等の動作が必要な命令であり、次
の命令の実行には、その命令の終了を待つ必要があるか
らである。IF … THEN …等の制御命令につい
ては、ロボットの実際の移動が伴なわないので、動作完
了待フラグMWFはセットされない。
As shown in FIG. 16, the instruction interpreting program has three flags (MWF, TWF, PWF). That is, "operation completion wait flag" (MW
F) indicates that among the instructions of the robot task, an instruction that needs to wait for the completion of the execution of the instruction is currently being executed by the robot task. The operation completion wait flag MWF is set by executing an instruction such as MOV P (4). These instructions are
This is because it is an instruction that requires an action such as actual movement of the robot, and it is necessary to wait for the end of that instruction before executing the next instruction. For control commands such as IF ... THEN ..., since the actual movement of the robot is not involved, the operation completion waiting flag MWF is not set.

【0058】また、「処理終了待フラグ」(PWF)
は、ビジョンタスクの命令の中の、その命令の実行終了
を待つことが必要な命令が現在ビジョンタスクで実行中
であることを示す。
Further, "process end wait flag" (PWF)
Indicates that among the instructions of the vision task, an instruction that needs to wait for the end of execution of the instruction is currently being executed by the vision task.

【0059】これらのMWF,PWFは、ロボットタス
ク若しくはビジョンタスクにおいて、2つ以上の命令が
オーバラツプされて実行されることを防ぐためにある。
These MWF and PWF are for preventing two or more instructions from being overlapped and executed in the robot task or the vision task.

【0060】「タイミング待フラグ」TWFは次の理由
により本システムに導入された。即ち、マルチタスク制
御の下では、ロボットタスク中の命令とビジョンタスク
中の命令とが並行して実行される。そして、ロボットタ
スクのある1つの命令を開始するためには、ビジョンタ
スクのある1つの命令の終了を確認する、即ち、2つの
タスク間の調停をとることが必要な場合がある。例え
ば、CCDカメラ2で対象物の像を撮像している時に、
ロボツト6のアームがカメラ2の視野に入つたり、シヤ
トル9が移動する事などにより、撮像不能になる事をさ
ける必要があるからである。上述のMWF,PWFは、
あくまでも、同じタスク間の命令実行の調停をとるもの
である。そこで、一方のタスクが他方のタスクを一時中
断させるためのフラグとして「タイミング待フラグ」T
WFがある。
The "timing wait flag" TWF was introduced into this system for the following reasons. That is, under multitask control, the instructions in the robot task and the instructions in the vision task are executed in parallel. Then, in order to start one command with the robot task, it may be necessary to confirm the end of one command with the vision task, that is, to arbitrate between the two tasks. For example, when the CCD camera 2 is capturing an image of an object,
This is because it is necessary to prevent the imaging of the robot 6 from becoming impossible due to the arm of the robot 6 entering the field of view of the camera 2 or the movement of the shuttle 9. The above MWF and PWF are
To the end, it arbitrates instruction execution between the same tasks. Therefore, the "timing wait flag" T is used as a flag for one task to suspend the other task.
There is WF.

【0061】一方のタスクが他方のタスクを一時中断さ
せる命令として、本実施例のシステムでは、WAIT命
令が用意されている。このWAIT命令は、主にビジョ
ンタスクで用いられ、それが実行されると停止フラグS
F(suspended flag)がセットされる。フラグSFはツー
・ポート・RAM61内に設けられこのWAIT命令
は、プログラム内に明示的にそれらの命令を記述しなく
とも、システム(第5図のコンパイラ103)が自動的
に付加するようにしている。即ち、第11図の例では、
CCDカメラ2で撮像するための撮像命令(GET)の
後や、パターン認識命令(MATCH)の後に、コンパ
イラ103がWAIT命令を自動的に付加する。換言す
れば、GET命令やMATCH命令が実行されると、自
動的にWAIT命令が実行されて、フラグSFがセット
される。このフラグSFのリセットは、上記特殊命令
(GET命令やMATCH命令)の終了でなされる。従
って、ロボットタスク側では、このフラグSFのセット
状態を検査する命令、即ちタイミング確認命令(例え
ば、CHECKF命令)をロボットタスク中に挿入し
て、ロボットタスクとビジョンタスクとの協調を取って
いる。
In the system of this embodiment, a WAIT instruction is prepared as an instruction for one task to temporarily suspend the other task. This WAIT instruction is mainly used in the vision task, and when it is executed, the stop flag S
F (suspended flag) is set. The flag SF is provided in the two-port RAM 61, and the WAIT instruction is automatically added by the system (compiler 103 in FIG. 5) without explicitly describing those instructions in the program. There is. That is, in the example of FIG.
The compiler 103 automatically adds the WAIT command after the imaging command (GET) for imaging with the CCD camera 2 or after the pattern recognition command (MATCH). In other words, when the GET instruction or the MATCH instruction is executed, the WAIT instruction is automatically executed and the flag SF is set. The flag SF is reset at the end of the special instruction (GET instruction or MATCH instruction). Therefore, on the robot task side, a command for inspecting the set state of the flag SF, that is, a timing confirmation command (for example, a CHECKF command) is inserted into the robot task to coordinate the robot task and the vision task.

【0062】また、命令解釈プログラムには、第16図
に示すように、2つのカウンタ(RPCとIPC)とが
用意されている。カウンタRPCはロボットタスクの組
立動作プログラム108中の次の実行命令の行番を格納
している。例えば、ロボットタスクが次に実行すべき命
令が行番300のSSHUTL(第9図)ならばカウン
タRPCには300が格納されている。また、カウンタ
IPCはビジョンタスクのビジョン動作プログラム10
9中の次の実行命令の行番を格納している。例えば、ビ
ジョンタスクが次に実行すべき命令が行番20のBIN
(第11図)ならばカウンタRPCには20が格納され
ている。
Further, the instruction interpretation program is provided with two counters (RPC and IPC) as shown in FIG. The counter RPC stores the line number of the next execution instruction in the robot task assembly operation program 108. For example, if the next instruction to be executed by the robot task is SSHHUTL at line number 300 (FIG. 9), 300 is stored in the counter RPC. Further, the counter IPC is the vision operation program 10 of the vision task.
The line number of the next execution instruction in 9 is stored. For example, the command to be executed next by the vision task is BIN at line 20.
If it is (FIG. 11), 20 is stored in the counter RPC.

【0063】第17図,第18図,第19図に従って、
ロボットタスクとビジョンタスクの並列実行制御につい
て説明する。ロボットタスクの制御 ステツプS200で、キーボード20から組立動作の開
始が指示されると、命令解釈部87はステツプS201
でロボットタスクを起動することにより、RAM52内
の組付動作プログラム108の解釈を開始する(ステツ
プS201)。
According to FIGS. 17, 18 and 19,
The parallel execution control of the robot task and the vision task is explained. When the start of the assembling operation is instructed from the keyboard 20 in the control step S200 of the robot task , the command interpretation unit 87 causes the step S201.
Then, the robot task is activated to start the interpretation of the assembly operation program 108 in the RAM 52 (step S201).

【0064】ステツプ202ではロボットタスクが起動
されているかを調べる。ステツプS202でロボットタ
スクが起動されているか否かを調べるのは、ロボットプ
ログラム自体の中で、またはビジョンタスクのプログラ
ム自体の中に、ロボットタスクの停止を行なうステート
メントを記述することができるからである。従って、ロ
ボットタスクが停止されている場合は、ビジョンタスク
だけが実行され、ロボットタスクをプログラム的に再起
動するには、ビジョンタスク内でロボットタスクを起動
する命令を実行することが必要である。第9図乃至第1
1図の例のプログラムが実行されている場合は、ロボッ
トタスクがプログラム的に停止されないから、ステツプ
S203に進み、ここで動作完了待ち状態の判定を動作
完了待フラグMWFに基づいて行なう。前述したよう
に、MWFは移動命令等に対してセットされるものであ
るから、前のサイクルでそのような命令が実行されてい
なければ、あるいは、MWFのセットの不要な命令が実
行されていた場合には、MWF=0であるので、ステツ
プS204に進む。
At step 202, it is checked whether the robot task is activated. The reason why the robot task is activated in step S202 is that a statement for stopping the robot task can be described in the robot program itself or in the vision task program itself. .. Therefore, when the robot task is stopped, only the vision task is executed, and in order to programmatically restart the robot task, it is necessary to execute an instruction to start the robot task in the vision task. 9 to 1
When the program in the example of FIG. 1 is being executed, the robot task is not stopped programmatically, so the routine proceeds to step S203, where the judgment of the operation completion waiting state is made based on the operation completion waiting flag MWF. As described above, since the MWF is set for a move instruction or the like, if such an instruction has not been executed in the previous cycle, or an unnecessary instruction of the MWF set has been executed. In this case, since MWF = 0, the process proceeds to step S204.

【0065】MWF=0のときは、ステツプS204に
進んで、組付動作プログラム108から1つの命令を読
み、その命令の解釈を行う。1つの命令解釈がなされる
と、カウンタRPCは次の行番を示すように変更され
る。
When MWF = 0, the process proceeds to step S204, one instruction is read from the assembling operation program 108, and the instruction is interpreted. When one instruction is interpreted, the counter RPC is changed to indicate the next line number.

【0066】ステツプS205では、その解釈した命令
の内容がビジヨンタスク起動命令(“START
3”)であるか否かの判定を行う。ビジヨンタスクの起
動命令である場合は、ステツプS220でビジヨンタス
クの起動処理を行なってからステツプS221に進む。
ビジヨンタスク起動命令以外の場合は、ステツプS20
6に進み、タイミング確認命令(前述のCHECKF
等)であるか否かの判定を行なう。
In step S205, the contents of the interpreted instruction are the business task start instruction ("START").
3 "). If it is a vision task activation instruction, the vision task activation processing is performed in step S220, and the flow advances to step S221.
If the command is not a task start command, step S20
Proceed to step 6 and confirm the timing (command CHECKF
Etc.) is determined.

【0067】ステツプS206で命令内容がタイミング
確認命令でないと判定した場合は、ロボツト動作部6
2,ハンド動作部63,画像処理部64に命令コードを
発行する必要のある命令(例えば、シヤトル9の移動命
令やハンド7の動作命令)か、命令コードの発行が不要
の命令(例えば、IF…THEN…等の制御命令)かの
判定をステツプS207で行う。
If it is determined in step S206 that the instruction content is not the timing confirmation instruction, the robot operation unit 6
2, an instruction that needs to issue an instruction code to the hand operation unit 63 and the image processing unit 64 (for example, a movement instruction of the shuttle 9 or an operation instruction of the hand 7) or an instruction that does not need to issue an instruction code (for example, IF It is determined in step S207 whether it is a control command such as "THEN ...".

【0068】命令コードの発行が必要な命令である場合
には、ステツプS208で、その命令がロボット動作に
関連する命令であるかハンド動作に関連する命令である
かに応じて、その命令コードが、ロボット動作制御部若
しくはハンド動作制御部により区別されて実行可能なよ
うに、共有メモリ60に格納される。ロボット動作制御
部若しくはハンド動作制御部は、第18図若しくは第1
9図の制御手順に従って、共有メモリ60から対応する
命令コードをフエツチして実行する。そして、ステツプ
S209では、動作完了待フラグMWFをセットする。
そしてステツプS221に進む。
If the instruction code needs to be issued, in step S208, the instruction code is determined according to whether the instruction code is a robot motion related instruction or a hand motion related instruction. , And is stored in the shared memory 60 so that the robot operation control unit or the hand operation control unit can be executed separately. The robot motion control unit or the hand motion control unit is shown in FIG.
According to the control procedure of FIG. 9, the corresponding instruction code is fetched from the shared memory 60 and executed. Then, in step S209, the operation completion waiting flag MWF is set.
Then, the process proceeds to step S221.

【0069】動作制御部62,63に命令コードを発行
する必要のある命令は、シヤトル9の移動(MOV)や
ロボツト6の移動の様に、命令に対応した動作が完了す
るまでに時間がかかるものである。フラグMWFは移動
命令等が連続して発行されることを防止する意味でステ
ツプS209でセットされる。しかし、命令コードの発
行の不要な命令(例えば、IF…THEN…等の制御命
令)は連続して実行されるべきである。このような発行
不要命令を実行するものとステツプS207で判断され
た場合には、ステツプS207→ステツプS208と進
んで、MWFのセットを行なわずに、直接その命令の実
行を行なう。そしてステツプS221に進む。
For an instruction that needs to issue an instruction code to the operation control units 62 and 63, it takes a long time to complete an operation corresponding to the instruction, such as movement of the shuttle 9 (MOV) or movement of the robot 6. It is a thing. The flag MWF is set in step S209 in order to prevent the movement command and the like from being continuously issued. However, instructions that do not require issuance of instruction codes (for example, control instructions such as IF ... THEN ...) should be continuously executed. When it is determined in step S207 that such an issue-unnecessary instruction is to be executed, the process proceeds directly from step S207 to step S208, and the instruction is directly executed without setting the MWF. Then, the process proceeds to step S221.

【0070】ステツプS206で、命令内容がタイミン
グ確認命令であると判定された場合は、ステツプS21
0に進んで、ツー・ポート・RAM61内のフラグSF
のセット状態を調べる。このフラグSFは、前述したよ
うに、他のタスク(本実施例では、ビジョンタスク)で
ある特殊な命令(GETやMATCH)を実行した場合
にそのタスクによりセットされ、その命令の終了をもっ
てそのタスクがリセットする。また、フラグSFは、ツ
ー・ポート・RAM61内に置かれているために、画像
処理部64は勿論、命令解釈部87もアクセスが可能で
ある。従って、このフラグSFがセツトされているとス
テツプS210で判定された場合は、ロボットタスクに
おける命令の解釈/実行を中断させなくてはならないの
で、その旨を記憶するために、フラグTWFをステツプ
S212でセツトする。そして、ステツプS209でフ
ラグMWFをセットする。即ち、フラグMWFは、命令
コードの発行が必要な命令を解釈部87が解釈した場合
と、タイミング確認命令を解釈してTWFがセットされ
た場合との両方おいて、セットされる。
If it is determined in step S206 that the instruction content is the timing confirmation instruction, step S21
Go to 0 and flag SF in the two-port RAM 61
Check the set state of. As described above, this flag SF is set by another task (in this embodiment, a vision task) when a special instruction (GET or MATCH) is executed by that task, and at the end of that instruction, the task is set. Resets. Since the flag SF is placed in the two-port RAM 61, it can be accessed not only by the image processing section 64 but also by the instruction interpreting section 87. Therefore, if it is determined in step S210 that the flag SF has been set, the interpretation / execution of the instruction in the robot task must be interrupted. Therefore, in order to store that fact, the flag TWF is set in step S212. To set. Then, in step S209, the flag MWF is set. That is, the flag MWF is set both when the interpreting unit 87 interprets an instruction that requires the issuance of an instruction code and when the TWF is set by interpreting the timing confirmation instruction.

【0071】ステツプS221では、ビジョンタスクが
起動されているか否かを調べ、起動されていない場合に
はステツプS202に戻る。
In step S221, it is checked whether or not the vision task is activated. If not activated, the process returns to step S202.

【0072】あるロボットプログラムを実行している場
合に、命令コードを発行する必要のない命令を実行して
いる限りは、フラグMWFはセットされないので、ステ
ツプS202→ステツプS203→ステツプS204と
進んで、次の命令を解釈実行する。即ち、ロボットプロ
グラムの命令の実行は待たされることなく連続的に行わ
れる。
When a certain robot program is being executed, the flag MWF is not set as long as an instruction that does not need to be issued an instruction is executed. Therefore, the process proceeds to step S202 → step S203 → step S204. Interpret and execute the next instruction. That is, the instructions of the robot program are continuously executed without waiting.

【0073】一方、第9図のプログラムの行番300乃
至行番350におけるロボット動作命令はフラグMWF
をセットする。かかる場合は、制御は、ステツプS20
2→ステツプS203と進み、更に、フラグMWFは既
にセットされているので、ステツプS214に進む。ス
テツプS214では、フラグMWFのセットが、命令コ
ード発行の必要な命令に実行によるものか、あるいはタ
イミング確認命令の実行によるものかを調べるために、
フラグTWFのセット状態を調べる。
On the other hand, the robot operation command in the line numbers 300 to 350 of the program shown in FIG. 9 is the flag MWF.
Set. In this case, the control is step S20.
The process proceeds from step 2 to step S203, and since the flag MWF has already been set, the process proceeds to step S214. In step S214, in order to check whether the flag MWF is set by the execution of an instruction that needs to issue an instruction code or by the execution of a timing confirmation instruction,
Check the set state of the flag TWF.

【0074】ステツプS214でTWFフラグがリセッ
トしている場合には、フラグMWFのセットは命令コー
ド発行の必要な命令に実行によるものであったのだか
ら、ステツプS215に進んでロボット動作の完了を調
べる。この動作完了のチェックは共有RAM60に命令
コードが残っているか否かにより分る。共有メモリ60
中に命令コードの格納は、命令解釈プログラムがステツ
プS208で行なう。また、共有メモリ60中の命令コ
ードのクリアはロボット動作制御部62,ハンド動作制
御部63によりなされる。
If the TWF flag is reset in step S214, it means that the flag MWF has been set by the execution of an instruction that requires the issuing of an instruction code, so the flow advances to step S215 to check the completion of the robot operation. .. This operation completion check can be made by checking whether or not the instruction code remains in the shared RAM 60. Shared memory 60
The instruction code is stored in the instruction interpreting program in step S208. The instruction code in the shared memory 60 is cleared by the robot operation control unit 62 and the hand operation control unit 63.

【0075】第18図はロボット動作制御部62,ハン
ド動作制御部63における制御手順を示すフローチヤー
トである。
FIG. 18 is a flow chart showing a control procedure in the robot operation control section 62 and the hand operation control section 63.

【0076】ロボット動作制御部62,ハンド動作制御
部63は、夫々、ステツプS300において、共有メモ
リ60内をスキャンしながら、自分向けの命令コードが
メモリ60に格納されたかをチェックしている。自分向
けの命令コードであるか否かの判定は、Pコード(第1
3図乃至第15図)が示す命令の型で判断される。自分
向けの命令コードが発見されたならば、その命令コード
をステツプS301で実行し、ステツプS302で、そ
の終了(例えば、アームの上昇または下降動作の終了)
を待つ。動作が終了すれば、ステツプS303で、当該
命令コードをクリアする。
In step S300, the robot operation control section 62 and the hand operation control section 63 respectively scan the shared memory 60 and check whether the instruction code for themselves is stored in the memory 60. Whether or not the instruction code is for oneself is determined by the P code (first
It is determined by the type of instruction shown in FIGS. 3 to 15). If the instruction code for itself is found, the instruction code is executed in step S301, and is ended in step S302 (for example, the end of the raising or lowering operation of the arm).
Wait for When the operation is completed, the instruction code is cleared in step S303.

【0077】第19図の画像処理部64における命令コ
ードの処理の制御手順においても、命令コードのスキャ
ン/実行/クリアは第18図のそれと同じである。
Also in the control procedure of the instruction code processing in the image processing section 64 of FIG. 19, the scanning / execution / clearing of the instruction code is the same as that of FIG.

【0078】第17図のフローチヤートに戻って、ステ
ツプS215で、共有RAMに格納した命令コードがク
リアされたことが確認されたならば、ステツプS216
に進んで、フラグMWFをリセットする。そして、ステ
ツプS221に進み、ビジョンタスクが起動されていな
ければ、ステツプS221→ステツプS202→ステツ
プS203→ステツプS204と進んで、ロボットプロ
グラム中の次の命令を実行する。
Returning to the flowchart of FIG. 17, if it is confirmed in step S215 that the instruction code stored in the shared RAM has been cleared, step S216.
Then, the flag MWF is reset. Then, in step S221, if the vision task is not activated, the process proceeds to step S221 → step S202 → step S203 → step S204 to execute the next command in the robot program.

【0079】ステツプS214の待ち理由の判別処理に
おいて、TWF=1と判定された場合は、フラグSFが
ビジョンタスクによりリセットされるのを待つために、
ステツプS217でフラグSFを調べる。このフラグS
Fがセットされている(SF=1)ということは、まだ
待たなければならないことを意味するから、ステツプS
221を介してステツプS202に戻る。
In the process for determining the reason for waiting in step S214, when it is determined that TWF = 1, in order to wait for the flag SF to be reset by the vision task,
The flag SF is checked in step S217. This flag S
The fact that F is set (SF = 1) means that we still have to wait.
The process returns to step S202 via 221.

【0080】ステツプS217で、フラグSFがリセッ
トされたことが確認された場合には、ステツプS218
でフラグTWFをリセットして、待状態が解除されたこ
とを示す。さらに、ステツプS212→ステツプS20
9の過程でセットされたフラグMWFをステツプS21
6でリセットする。ロボットタスクとビジョンタスクの並列実行 以上のようにして、命令コードの発行の必要な命令の実
行、不要な命令の実行、更にはタイミング確認命令の実
行がなされる。次にビジョンタスクが起動された場合に
ついて更に詳細に説明する。
If it is confirmed in step S217 that the flag SF has been reset, step S218 is performed.
The flag TWF is reset with to indicate that the waiting state has been released. Further, step S212 → step S20
In step S21, the flag MWF set in the process of 9 is set.
Reset with 6. Parallel execution of robot task and vision task As described above, the instruction code issuance is executed, the unnecessary instruction is executed, and the timing confirmation instruction is executed. Next, the case where the vision task is activated will be described in more detail.

【0081】ステツプS205で、行番360の START 3 命令が実行されると、ステツプS220でビジョンタス
クを起動した後に、ステツプS221に進む。ステツプ
S221で、現在が、以前に実行されていたビジョンタ
スクの何等かの命令の処理の終了を待っている待状態に
あるかをフラグPWFに基づいて判定する。このフラグ
PWFはロボットタスクにおけるフラグMWFと同じ機
能を有する。以前に画像処理の命令を何等発行していな
い場合には、PWF=0であるので、ステツプS223
に進んで、1つの画像処理命令をカウンタIPCに従っ
て解釈する。ステツプS223,ステツプS224は、
ステツプS223で解釈した命令の種類を判断する。即
ち、その命令がEND命令(第11図の行番50のステ
ートメント)である場合には、ステツプS225でビジ
ョンタスクを停止する。また、END命令でない場合に
は、ステツプS226で当該命令が命令コードの発行が
必要なものであるか否かを調べる。命令コードの発行が
必要なものとは、画像処理部64において何等かの処理
が必要な命令であり、例えば、撮像命令(GET)、二
値化命令(BIN)、マツチング命令(MATCH)等
である。また、IF…THEN…等の制御命令や、前述
のWAIT命令はツー・ポート・RAM61にアクセス
するだけで足り、画像処理部64による処理は不要なの
で、命令コードの発行は不要である。
When the START 3 instruction at line number 360 is executed in step S205, the vision task is activated in step S220, and then the process proceeds to step S221. In step S221, it is determined based on the flag PWF whether the present state is in the waiting state waiting for the completion of the processing of some instruction of the previously executed vision task. This flag PWF has the same function as the flag MWF in the robot task. If no image processing command has been issued before, PWF = 0, so step S223
Proceed to and interpret one image processing instruction according to the counter IPC. Step S223 and Step S224 are
The type of instruction interpreted in step S223 is determined. That is, if the command is the END command (statement at line number 50 in FIG. 11), the vision task is stopped at step S225. If it is not the END instruction, it is checked in step S226 whether or not the instruction requires the issuance of an instruction code. The instruction code needs to be issued is an instruction that requires some processing in the image processing unit 64, such as an imaging instruction (GET), a binarization instruction (BIN), and a matching instruction (MATCH). is there. Further, control instructions such as IF ... THEN ... and the above-mentioned WAIT instruction only need to access the two-port RAM 61, and the processing by the image processing unit 64 is unnecessary, so that the issue of the instruction code is not necessary.

【0082】命令コードの発行が必要な命令を実行する
場合には、ステツプS227で、ツー・ポート・RAM
61に当該命令コードを書込む。そして、ステツプS2
28で処理完了待フラグPWFをセットして、ステツプ
S202に戻る。
When executing an instruction that requires the issuance of an instruction code, in step S227, the two-port RAM is used.
The instruction code is written in 61. And step S2
In step 28, the processing completion waiting flag PWF is set, and the process returns to step S202.

【0083】ビジョンタスクの命令の解釈に先立って、
以前に実行した命令が未だ処理が終了していない場合に
は、ステツプS222からステツプS230に進む。ス
テツプS230では、ツー・ポート・RAM61中に以
前発行した命令コードが画像処理部64によりクリアさ
れているかを調べる。この命令コードのクリアは第19
図の制御手順に従って画像処理部64が行なう。
Prior to the interpretation of the vision task commands,
If the previously executed instruction has not been processed yet, the process proceeds from step S222 to step S230. In step S230, it is checked whether the previously issued instruction code in the two-port RAM 61 has been cleared by the image processing unit 64. This instruction code is cleared in 19th
The image processing unit 64 performs this according to the control procedure shown.

【0084】命令コードのクリアが既にされていたとス
テツプS222で判定された場合にはステツプS231
でフラグPWFをリセットする。
If it is determined in step S222 that the instruction code has already been cleared, step S231.
The flag PWF is reset with.

【0085】以上のようにして、ロボットタスクとビジ
ョンタスクとの並列処理がなされる。
As described above, the parallel processing of the robot task and the vision task is performed.

【0086】尚、前述したように、解釈部87がビジョ
ンタスクの特殊な命令(GET,WATCH)を解釈実
行して、その命令コードをRAM61に格納した場合に
は、第19図のフローチヤートに従って、画像処理部6
4がその命令コードをRAM61からフエツチし、ステ
ツプS312において実行する。そして、ステツプS3
11において、RAM61内にフラグSFがセットされ
る。また、そのような特殊命令の実行が終了した場合
は、ステツプS313において、当該命令コードをクリ
アする動作とフラグSFをリセットする動作を合せて行
なう。
As described above, when the interpreting unit 87 interprets and executes a special command (GET, WATCH) of the vision task and stores the command code in the RAM 61, according to the flow chart of FIG. , Image processing unit 6
4 fetches the instruction code from the RAM 61 and executes it in step S312. And step S3
At 11, the flag SF is set in the RAM 61. When the execution of such a special instruction is completed, the operation of clearing the instruction code and the operation of resetting the flag SF are performed together in step S313.

【0087】第20図は、第9図,第10図に示した具
体的な組付けプログラム並びに第11図に示したビジョ
ン動作プログラムを、第17図の命令解釈プログラムが
解釈し、それが生成した命令コードを動作制御部62,
63並びに画像処理部64が第18図,第19図の制御
手順に従って実行した場合において、ロボット部及び画
像処理部64がどのように動作するかをタイミングチヤ
ートとして表わしたものである。即ち、第20図は、部
品Aの組立て動作の一部と、部品Bの組立て動作と、そ
して部品Cの組立て動作の一部のタイムチヤートを表わ
している。また第20図においては、説明の便宜上、本
タイムチヤートのスタート時に、ロボツト6は部品供給
部11のパレツト13aより、ハンド7で部品Aを把持
し、ロボツト6はパレツト13aの上空に退避した状態
となつているものとする。
FIG. 20 shows the concrete assembly program shown in FIGS. 9 and 10 and the vision operation program shown in FIG. 11 interpreted by the instruction interpretation program shown in FIG. The operation command 62
The timing chart shows how the robot unit and the image processing unit 64 operate when the image processing unit 63 and the image processing unit 64 execute the control procedures of FIGS. 18 and 19. That is, FIG. 20 shows part of the assembling operation of the part A, the assembling operation of the part B, and part of the assembling operation of the part C. Further, in FIG. 20, for convenience of explanation, at the time of starting the present time chart, the robot 6 grasps the component A with the hand 7 from the pallet 13a of the component supply unit 11, and the robot 6 is retracted above the pallet 13a. It is assumed that

【0088】以下、第20図に基づいて本実施例の組立
動作順を説明する。
The assembly operation sequence of this embodiment will be described below with reference to FIG.

【0089】期間T1 ,T2 ,T5 ,T6 ではロボツト
動作の制御のみが行なわれる。即ち、T5 期間で、シヤ
トル9は、部品Bを組立る位置へ移動開始(行番300
のSSHUTL命令)し、期間T6 で、X−Yテーブル
3は次に組立てる部品Bのパレツト13bの視覚対象位
置に移動開始(行番310のCSET命令)する。次
に、ロボツト6は、T1 期間で、部品Aをハンド7に把
持したまま、組付ステージ8の上空点に移動し、さら
に、組付ステージ8と垂直方向に下降停止する(行番3
20,330のMOV命令)。
During the periods T 1 , T 2 , T 5 , and T 6 , only the robot operation is controlled. That is, in the period T 5 , the shuttle 9 starts moving to the position where the part B is assembled (line number 300).
Of SSHUTL instruction) and, in the period T 6, CSET command X-Y table 3 is then assembled movement start the visual object position of the pallet 13b of the part B (row number 310) to. Next, the robot 6 moves to the upper empty point of the assembling stage 8 while holding the part A in the hand 7 in the period T 1 , and further stops descending vertically to the assembling stage 8 (line number 3).
MOV command of 20,330).

【0090】T3 ,T4 ,T7 ,T8 ,T910では、
ロボツト制御及び画像処理制御が並行して行なわれる。
前記シヤトル9の移動及びXYステージ3の移動が終了
した事を確認(340,350行番のSCHECK,C
CHECK命令)し、画像処理制御が開始される(36
0行番のSTART命令)する。これによりロボットタ
スクとビジョンタスクとが並列して実行される。
For T 3 , T 4 , T 7 , T 8 , T 9 T 10 ,
Robot control and image processing control are performed in parallel.
It is confirmed that the movement of the shuttle 9 and the movement of the XY stage 3 are completed (the lines 340 and 350, CHECK and C).
Then, the image processing control is started (36).
START command at line 0). As a result, the robot task and the vision task are executed in parallel.

【0091】並列処理におけるロボツトタスクにおける
制御では、T3 期間に、ハンド7を動かし、部品Aを離
す(行番370のOUT命令)。そして、T4 期間で、
ロボツト6がハンド7を上昇・停止(行番380のMO
V命令)して、部品Aの組立を終了する。
In the control in the robot task in the parallel processing, the hand 7 is moved and the part A is released during the period T 3 (OUT instruction at line number 370). And in the T 4 period,
Robot 6 raises / stops hand 7 (MO on line 380
V command) to complete the assembly of the part A.

【0092】前記ロボットタスクにおける制御と併行し
て行なわれる画像処理側の制御では、T7 期間に、視覚
対象の部品BのCCDカメラ2の画像を画像処理部64
に取り込み(行番10のGET命令)、T8 期間に、そ
の画像を画像処理部64にて2値化処理(行番20の命
令BIN)し、さらに、T9 期間で前記2値化された画
像の特徴抽出処理(行番30の命令SOP)を行ない、
10期間で視覚対象部品Bの位置検出処理(行番40の
命令MATCH)を行なう。
In the control on the image processing side which is carried out concurrently with the control in the robot task, the image of the CCD camera 2 of the part B to be visualized is image-processed by the image processing section 64 during the period T 7.
(The GET command of line number 10) is taken in, and the image is binarized by the image processing unit 64 in the period of T 8 (command BIN of line number 20), and further binarized in the period of T 9. The image feature extraction process (command SOP of line number 30),
The position detection process (command MATCH of line number 40) of the visual target part B is performed in the period T 10 .

【0093】T4 期間が満了し、さらにT10期間が満了
した時点では、ハンド7は組み付けステージ8の上空に
あって部品供給部にある部品Bを把持可能であり、ま
た、画像処理部64は部品Bのパレット13bにおける
位置を検出している。
At the time when the T 4 period has expired and the T 10 period has further expired, the hand 7 is capable of gripping the component B in the component supply unit above the assembly stage 8 and the image processing unit 64. Detects the position of the part B on the pallet 13b.

【0094】行番380のMOV命令でハンド7がステ
ージ8の上空に退避すると、行番390で、プログラム
2(第10図)をコールする。このプログラム2は部品
Bを供給部12から受けその組み付けを行なう手順を記
述する。
When the hand 7 retreats above the stage 8 by the MOV instruction at line number 380, program 2 (FIG. 10) is called at line number 390. This program 2 describes the procedure for receiving the component B from the supply unit 12 and assembling it.

【0095】プログラム2の行番100では、命令 CHECKF 3,2 を実行する。この命令はタスク3(即ち、ビジョンタス
クのプログラム2、即ち、部品Bの画像処理)の終了を
確認する命令である。この命令で部品Bの位置検出処理
が終了した事が確認されると、行番110以降の処理が
行なわれる。
At line number 100 of program 2, the instruction CHECKF 3,2 is executed. This command is a command for confirming the end of the task 3 (that is, the program 2 of the vision task, that is, the image processing of the part B). When it is confirmed by this command that the position detection processing of the component B has been completed, the processing of the line number 110 and thereafter is performed.

【0096】第20図のT11〜T16,T19,T20では、
ロボツト制御のみが行なわれる。ロボツト制御では、行
番110で、ロボツト6の移動目標位置として、位置検
出結果を読み込む。
At T 11 to T 16 , T 19 and T 20 in FIG. 20 ,
Only robot control is performed. In the robot control, line number 110 reads the position detection result as the movement target position of the robot 6.

【0097】P(20)=VREAD(2) そして、部品Bを把持する為に、T11で、ロボツト6は
ハンド7をパレツト13bの上空点に移動(行番12
0)し、T12で、下降・停止(行番130)する。次
に、T13でハンド7は対象部品Bを把持(行番140の
OUT命令)し、T14でロボツト6は部品Bを把持した
ハンド7をパレツト13bの上空点に移動停止する(行
番150)。
P (20) = VREAD (2) Then, in order to grip the component B, at T 11 , the robot 6 moves the hand 7 to the upper point of the pallet 13b (line number 12).
0), and at T 12 , descend and stop (line number 130). Next, at T 13 , the hand 7 grips the target part B (OUT command of the line number 140), and at T 14 , the robot 6 stops moving the hand 7 holding the part B to the upper point of the pallet 13b (line number). 150).

【0098】T15,T16,T19,T20の部品Bについて
のロボツト制御の動作は、前記部品AについてのT1
2 ,T5 ,T6 と同様である。また、T17,T18,T
21〜T24の部品Bについてのロボツト制御と部品Cにつ
いての画像処理制御とが並行して行なわれる動作に関し
ても、T3 ,T4 ,T7 〜T10の動作と同様である。
[0098] Operation of the robot control for component B of the T 15, T 16, T 19 , T 20 is, T 1 for the component A,
It is the same as T 2 , T 5 , and T 6 . Also, T 17 , T 18 , T
The operations in which the robot control of the part B of 21 to T 24 and the image processing control of the part C are performed in parallel are the same as the operations of T 3 , T 4 , and T 7 to T 10 .

【0099】第21図は、第9図の行番330乃至39
0の命令と、第10図の行番100乃至120までの命
令を順に実行した過程での、命令解釈部87と、ロボツ
ト動作制御部62,ハンド動作制御部63,画像処理部
64における命令解釈実行の詳細タイムチヤートであ
る。
FIG. 21 shows line numbers 330 to 39 of FIG.
The instruction interpretation in the instruction interpreting unit 87, the robot operation control unit 62, the hand operation control unit 63, and the image processing unit 64 in the process of sequentially executing the instruction of 0 and the instructions of the line numbers 100 to 120 in FIG. Details of execution It is a time chart.

【0100】まず、T100 で、第9図の行番330のロ
ボツト動作命令を命令解釈部が解釈し、ロボツトの移動
の命令コードを発生して、ロボツト動作部62に命令コ
ードを受け渡す為の共有メモリ60に命令コードをセツ
トする。
First, at T 100 , the instruction interpreting section interprets the robot operation instruction at line number 330 in FIG. 9, generates an instruction code for moving the robot, and transfers the instruction code to the robot operating section 62. The instruction code is set in the shared memory 60 of FIG.

【0101】T120 で、ロボツト動作制御部62は、共
有メモリ60を通して、受け取つた命令コードによりロ
ボツト6を駆動し、アームを指示された位置に停止させ
る。ロボツト動作制御部62は、その命令コードの実行
終了を、その命令コードのクリアにより、命令解釈部8
7に対して連絡する。T120 において、命令解釈部87
は、ロボツト動作制御部62からの命令コードの実行終
了を待ち状態となつている。
At T 120 , the robot operation control unit 62 drives the robot 6 by the received instruction code through the shared memory 60 and stops the arm at the instructed position. The robot operation control unit 62 terminates the execution of the instruction code by clearing the instruction code, and then the instruction interpretation unit 8
Contact 7. At T 120 , the instruction interpretation unit 87
Waits for the end of execution of the instruction code from the robot operation control unit 62.

【0102】T101 で命令解釈部87は、第9図の次の
行番340のロボツト動作命令を解釈し、シヤトル停止
確認(SCHECK)の命令コードを発生して、ロボツ
ト動作制御部62に、共有メモリを介して命令コードを
送る。ロボツト動作制御部62では、前記命令コードに
よりシヤトル停止状態を確認し、命令コード実行終了を
命令解釈部87に共有メモリ60を介して連絡する。続
いて、MWFのリセットの待ち状態となつていた命令解
釈部87は、次の動作命令の解釈を再開する。
At T 101 , the instruction interpreting section 87 interprets the robot operation instruction at the next line number 340 in FIG. 9, generates the instruction code for shuttle stop confirmation (CHECK), and causes the robot operation control section 62 to Send the instruction code through the shared memory. The robot operation control unit 62 confirms the shutdown state of the shuttle by the instruction code, and notifies the instruction interpreting unit 87 of the termination of the instruction code execution via the shared memory 60. Subsequently, the instruction interpreting unit 87, which has been in the waiting state for resetting the MWF, restarts the interpretation of the next operation instruction.

【0103】T102 は命令解釈部87が行番350のロ
ボツト動作命令を解釈し、X−Yテーブル3の停止確認
の命令コードを発生し、ロボツト動作制御部62に対し
てT 101 と同様の手続きで命令コードの引渡し、命令コ
ード実行終了の引渡しを行なう。
T102 Is the command interpreter 87
Interpret the bot operation command and confirm the stop of XY table 3
To the robot operation control unit 62.
T 101 Instruction code delivery and instruction code
Hand over the code execution.

【0104】T103 では、命令解釈部87が行番360
のロボツト動作命令(START)を解釈し、第11図
に示した画像処理命令群(ビジョンタスク)の解釈実行
を開始する。T103 後は、ロボツト動作命令群と、画像
処理命令群を並列に解釈していく。
At T 103 , the instruction interpretation unit 87 causes the line number 360 to be displayed.
The robot operation command (START) is interpreted, and the interpretation execution of the image processing command group (vision task) shown in FIG. 11 is started. After T 103 , the robot operation instruction group and the image processing instruction group are interpreted in parallel.

【0105】T110 では、命令解釈部87が第11図の
行番10の画像処理命令を解釈し、CCDカメラの画像
を画像処理部に取り込む命令コードを発生し、画像処理
部64に対してツー・ポート・RAM61を介してその
命令コードを送る。
At T 110 , the instruction interpreting section 87 interprets the image processing instruction of line number 10 in FIG. 11, generates an instruction code for capturing the image of the CCD camera into the image processing section, and instructs the image processing section 64. The instruction code is sent via the two-port RAM 61.

【0106】T130 では、前記画像取込命令コードをツ
ー・ポート・RAM61から受け取つた画像処理部64
が、CCDカメラ2の画像を画像処理部に取り込み、取
り込み完了後に、その命令コードの実行終了をツー・ポ
ート・RAM61を介して命令解釈部87に連絡する。
At T 130 , the image processing unit 64 which receives the image capture instruction code from the two-port RAM 61.
Captures the image of the CCD camera 2 in the image processing section, and after the completion of the capture, informs the instruction interpreting section 87 of the completion of execution of the instruction code via the two-port RAM 61.

【0107】T104 では、命令解釈部87が、T110
画像処理命令の解釈及び命令コードのセツト終了後に、
第12図の行番370のロボツト動作命令を解釈する。
10 4 では、ハンド7を動かす命令コードを発生し、共
有メモリ60に命令コードをセツトする。次の状態とし
て、命令解釈部87は、T110 で画像処理部に発行した
命令コードの実行終了を待っている状態で、かつロボツ
ト動作制御部62に発行した命令コードの実行終了の待
ち状態になつている。
At T 104 , the instruction interpreting section 87 interprets the image processing instruction at T 110 and completes the instruction code set.
The robot operation command at line number 370 in FIG. 12 is interpreted.
In T 10 4, and generates an instruction code to move the hand 7 and excisional the instruction code in the shared memory 60. In the next state, the instruction interpreting unit 87 waits for the completion of the execution of the instruction code issued to the image processing unit at T 110 and waits for the completion of the execution of the instruction code issued to the robot operation control unit 62. I'm running.

【0108】T111 では、画像処理部64からツー・ポ
ート・RAM61を介して命令コードの実行終了が連絡
される。さらにロボツト動作制御部62から実行終了が
連絡されていない状態では、命令解釈部87は第11図
の行番20の画像処理命令を解釈し、前記取り込み画像
の2値化処理の命令コードを発生し、ツー・ポート・R
AM61上にセツトする。
At T 111 , the end of execution of the instruction code is notified from the image processing unit 64 via the two-port RAM 61. Further, in the state where the end of execution has not been notified from the robot operation control section 62, the instruction interpreting section 87 interprets the image processing instruction of the line number 20 in FIG. 11 and generates the instruction code of the binarization processing of the captured image. And two port R
Set on AM61.

【0109】以下、同様にして、命令解釈部87は、ロ
ボツト動作命令及び画像処理命令を前記いずれかの命令
が実行終了した時点で、終了した命令群を解釈セツトす
る(T105 ,T112 ,T113 ,T106 )。
In the same manner, the instruction interpreting unit 87 interprets the finished instruction group at the time when any one of the robot operation instruction and the image processing instruction has been executed (T 105 , T 112 , T 113 , T 106 ).

【0110】さらに、進んでT114 で命令解釈部87が
行番50の画像処理命令を解釈する。この行番50の命
令は解釈実行終了命令(END)であるので、命令解釈
部87はビジョンタスクを停止する。
Further, at T 114 , the instruction interpretation unit 87 interprets the image processing instruction at line number 50. Since the command at the line number 50 is the interpretation execution end command (END), the command interpreting unit 87 stops the vision task.

【0111】T107 以降は、解釈部87はロボツト動作
命令群のみ解釈命令セツトする。 〈画像処理〉以下、画像処理部64で行なわれる画像処
理について説明する。
After T 107 , the interpreting unit 87 sets the interpreting instruction only for the robot operation instruction group. <Image Processing> Image processing performed by the image processing unit 64 will be described below.

【0112】本システムにおける画像処理の目的は、部
品の認識と、更にパレット内におけるその部品の姿勢の
検出及びその部品の重心座標の検出である。特徴パラメータ 第22図は本実施例に用いた一例としての部品Bの平面
図である。部品Bは平板で、3ケ所に大きさの異なる穴
があいている。第23図は部品Bの特徴パラメータの基
準値を表わしている。s1 は穴H1 の面積で、s2 は穴
2 の面積、s 3 は穴H3 の面積である。
The purpose of image processing in this system is to
The recognition of the product and the posture of the part in the pallet
Detection and detection of the barycentric coordinates of the component.Feature parameters FIG. 22 is a plan view of the part B as an example used in this embodiment.
It is a figure. Part B is a flat plate and has holes of three different sizes.
Is open. FIG. 23 shows the basis of the characteristic parameters of the part B.
It represents a quasi value. s1 Is hole H1 Area of s2 Is a hole
H2 Area of s 3 Is hole H3 Area.

【0113】本実施例においては、穴H1 の中心の座標
(X1 ,Y1)を部品の原点とし、それを、ロボツト6が
部品の把持が可能となるように画像処理部64が部品位
置を算出するときの基準点とする。また、穴H2 の中心
(X2 ,Y2)と穴H1 の中心(X1 ,Y1)とを通り、穴
2 から穴H1 の方向へ向かうベクトルαを、部品Bの
傾きを表わすものと考える。この基準軸α(ベクトル
α)と、穴H1 の中心(X1 ,Y1)と穴H3 の中心(X
3 ,Y3)とを結ぶ線分のなす角度をβ3 とする。また、
穴H1 の中心(X1 ,Y1)と穴H2 の中心(X2 ,Y2)
との距離をl2 とし、 l2 ={(X1 −X2)2 +(Y1 −Y2)2}1/2 であらわす。また、穴H1 の中心(X1 ,Y1)と穴H3
の中心(X3 ,Y3)間の距離をl3 とし、 l3 ={(X2 −X3)2 +(Y2 −Y3)2}1/2 で表わす。第23図に示されたs1 ,s2 ,s3 ,β
3 ,l2 ,l3 並びに、部品全体の面積Sを、部品Bの
特徴を表わす基準量とする。換言すれば、ある部品が目
的の部品Bであるか否かは、その部品の画像から、
1',s2',s3',β3',l2',l3',S' を計算し
て、これらを基準パラメータs1 ,s2 ,s3 ,β 3
2 ,l3 ,Sと比較することにより判断する。これら
の基準パラメータは予め計算してRAM52内に記憶し
ておく。基準パラメータが用いられるのは画像処理部6
4内であり、RAM52内の基準パラメータは制御装置
17に電源が投入された時点で画像処理部64のツー・
ポート・RAM61に転送される。部品の認識 第24図は、カメラ2により画像を取り込み、部品に形
成された穴の重心(中心)を計算する原理を説明する図
である。前述したように、部品はパレット内のセルに収
納されている。第3図の領域設定部74は目的の部品が
収納されているパレットの1つのセル全体の画像を切り
出す機能を有する。
In this embodiment, the hole H1 Coordinates of the center of
(X1 , Y1) Is the origin of the part, and the robot 6
The image processing unit 64 positions the parts so that the parts can be gripped.
Use as a reference point when calculating the position. Also, the hole H2 Heart of
(X2 , Y2) And hole H1 Center of (X1 , Y1) And through, hole
H2 From hole H1 The vector α in the direction of
Think of it as an inclination. This reference axis α (vector
α) and hole H1 Center of (X1 , Y1) And hole H3 Center of (X
3 , Y3) Is the angle formed by the line segment connecting3 And Also,
Hole H1 Center of (X1 , Y1) And hole H2 Center of (X2 , Y2)
The distance to2 And l2 = {(X1 -X2)2 + (Y1 -Y2)2}1/2 It represents. Also, the hole H1 Center of (X1 , Y1) And hole H3 
Center of (X3 , Y3) Between l3 And l3 = {(X2 -X3)2 + (Y2 -Y3)2}1/2 Express with. S shown in FIG.1 , S2 , S3 , Β
3 , L2 , L3 In addition, the area S of the entire component is
It is used as a reference quantity that represents the characteristics. In other words, certain parts are
Whether or not it is the target part B is determined from the image of the part.
s1', S2', S3', Β3', L2', L3Calculate ', S'
And these are the reference parameters s1 , S2 , S3 , Β 3 ,
l2 , L3 , S to judge. these
The reference parameters of are calculated in advance and stored in the RAM 52.
Keep it. The image processing unit 6 uses the reference parameter.
4 and the reference parameter in the RAM 52 is the control device.
When the power of 17 is turned on, the image processing unit 64
It is transferred to the port RAM 61.Part recognition Fig. 24 shows images captured by the camera 2 and formed into parts.
Diagram explaining the principle of calculating the center of gravity (center) of the created hole
Is. As mentioned above, the parts are stored in cells in the pallet.
Has been paid. The area setting unit 74 in FIG.
Cut the image of the whole cell of the stored palette.
Has a function to put out.

【0114】第24図の(a)は、カメラ2で部品の画
像を取り込み、その画像を明るさのレベルにより“1”
と“0”に2値化した結果がフレームメモリ75内に入
っていることを模式的に示した図である。(a)の各々
のセルはCCDの素子1ケ1ケに対応し、かつフレーム
メモリ75内のメモリの1ケ1ケに対応している。穴の
エッジ部分が“1”と量子化されるか“0”と量子化さ
れるかは微妙であるが、本実施例では、最大輝度の50
%以上のセルは“1”と、50%未満のセルは“0”と
なつている。
In FIG. 24A, the image of the part is captured by the camera 2 and the image is set to "1" depending on the brightness level.
5 is a diagram schematically showing that the result of binarizing "0" and "0" is stored in the frame memory 75. FIG. Each cell in (a) corresponds to one CCD element and also corresponds to one memory in the frame memory 75. It is delicate whether the edge portion of the hole is quantized as "1" or "0", but in this embodiment, the maximum brightness is 50.
A cell of% or more is "1", and a cell of less than 50% is "0".

【0115】次に、第24図の(a)の画像が穴である
と判断するラベリング処理方式について説明する。セル
のはじから順に、セル毎に濃度の0/1を判断し、
“1”を見つけると、“1”を見つけたセルを中心にし
て3×3のセルからなるブロツク部分に以前に“1”を
見つけたものがあるかを判断する。見つけた“1”のセ
ルが、全く始めての“1”であるセルの場合、その
“1”のセルにラベルを付ける。同様の処理を、すべて
の処理すべきセルについて行なう。このようにすると、
“1”のセルからなる複数の閉領域が出来上がる。そし
て、各々の閉領域にラベルが付けられる。第22図の部
品Bを例にとつて述べると、3つの穴にそれぞれ穴“H
1 ”,穴“H2 ”,穴“H3 ”としてラベルを付けるこ
とが可能となる。
Next, the labeling processing method for judging that the image shown in FIG. 24 (a) is a hole will be described. From the beginning of the cell, determine 0/1 of the concentration for each cell,
When a "1" is found, it is determined whether or not there is a block in which a "1" is found in the block portion composed of 3 × 3 cells before the "1" is found. If the found "1" cell is the first "1" cell, the "1" cell is labeled. Similar processing is performed for all cells to be processed. This way,
A plurality of closed regions consisting of "1" cells are created. Then, each closed region is labeled. Taking the part B in FIG. 22 as an example, the holes "H" are respectively provided in the three holes.
It becomes possible to label as 1 ”, hole“ H 2 ”, and hole“ H 3 ”.

【0116】次に、ラベル付けされた穴に関しての面積
1'〜s3'及び中心位置(重心位置)の求め方につい
て、第24図にて説明する。まず、穴の面積はラベル付
けされたとじられた領域内の“1”のセルの個数をカウ
ントし、その合計を面積とする。次に、穴の中心を求め
る場合は、第24図の(a)の画像のX,Yの各々の方
向に対して、“1”であるセルの個数のヒストグラムを
作成し、このヒストグラムの重心位置を、穴H1 の重心
点(X1',Y1')とする。
Next, how to obtain the areas s 1 ′ to s 3 ′ and the center position (center of gravity position) of the labeled holes will be described with reference to FIG. First, for the area of the hole, the number of "1" cells in the labeled and bound area is counted, and the total is taken as the area. Next, when the center of the hole is to be obtained, a histogram of the number of cells which is "1" is created for each of the X and Y directions of the image of FIG. The position is the center of gravity (X 1 ', Y 1 ') of the hole H 1 .

【0117】以上のような処理を、3つの穴の画像に対
して行なえば、把持しようとする部品の3つの穴の面積
1',s2',s3'及び3つの穴のCCD座標系における
中心の座標(X1',Y1'),(X2',Y2'),(X3',
3')を求めることができる。この求まつた値と,第2
3図のようにあらかじめ記憶されていた特徴量の基準値
とを比較することにより、正しい部品であるかどうかが
判断が付く。
If the above processing is performed on the images of the three holes, the areas s 1 ', s 2 ', s 3 'of the three holes of the part to be gripped and the CCD coordinates of the three holes are obtained. Coordinates of the center of the system (X 1 ', Y 1 '), (X 2 ', Y 2 '), (X 3 ',
Y 3 ') can be obtained. This calculated value and the second
As shown in FIG. 3, by comparing with the reference value of the characteristic amount stored in advance, it is possible to judge whether or not the component is correct.

【0118】つまり特徴量の比較として、s1 ≒s1',
2 ≒s2',s3 ≒s3',l2 ≒l 2',l3 ≒l3',β
3 =β3'を行なうことである。座標変換 次に、画像処理の座標系とロボツトの座標の変換につい
て説明する。
In other words, as a comparison of feature quantities, s1 ≒ s1',
s2 ≒ s2', S3 ≒ s3', L2 ≒ l 2', L3 ≒ l3', Β
3 = Β3'To do.Coordinate transformation Next, regarding the conversion of the coordinate system of image processing and the coordinates of the robot,
Explain.

【0119】第25図は、ロボツトの座標系のXRR
と視覚の座標系XVV との関係を示す。ロボツトの座
標系での目標位置を、 (PxR,PYR,1) とし、視覚の座標系での目標位置を (PxV,PYV,1) とする。また、ロボツトの座標系XRR の原点OR
と、視覚の座標系XVVの原点OV のずれが(δx
δY )であり、ロボツト座標系XRr がθ度だけ回転
しているとし、更に、視覚系の分解能がkmm/画素とす
ると、
FIG. 25 shows X R Y R of the robot coordinate system.
And the visual coordinate system X V Y V. The target position in the robot coordinate system is (P xR , P YR , 1), and the target position in the visual coordinate system is (P xV , P YV , 1). Furthermore, the coordinate system of the robot X R Y origin of R O R
And the deviation of the origin O V of the visual coordinate system X V Y V is (δ x ,
δ Y ), assuming that the robot coordinate system X R Y r is rotated by θ degrees and the resolution of the visual system is kmm / pixel,

【0120】[0120]

【数1】 の関係がある。[Equation 1] Have a relationship.

【0121】上記変換パラメータは第2図のRAM52
にあらかじめ記憶されており、制御装置17の電源を入
れると、自動的にツー・ポート・RAM61にも書き込
まれ、画像処理部64は座標変換する場合は、このパラ
メータを用いて、部品の位置情報を、画像座標系よりロ
ボツト座標系へ、又はロボツト座標系より画像座標系へ
と変換する。
The conversion parameters are RAM 52 shown in FIG.
Stored in advance in the two-port RAM 61 when the control device 17 is turned on, and the image processing unit 64 uses this parameter to convert the position information of the component when coordinate conversion is performed. Is converted from the image coordinate system to the robot coordinate system or from the robot coordinate system to the image coordinate system.

【0122】第26図は、制御装置17に電源が入れら
れ、キーボード20により起動がかけられる状態になる
までの準備動作ルーチン(第5図の起動プログラム10
0)のフローチヤート図である。
FIG. 26 shows a preparatory operation routine until the controller 17 is powered on and the keyboard 20 is activated (the activation program 10 of FIG. 5).
It is a flowchart chart of 0).

【0123】まず、本制御装置17に電源がステツプS
400のステツプで入れられると、ステツプS401
で、特徴パラメータの基準値が部品毎に、命令解釈部8
7のRAM52の内部より、バス86,59を通して、
ツー・ポート・RAM61のあらかじめ指定された領域
に転送される。このとき、もちろんRAM52内のデー
タはそのまま残つているのは言うまでもない。
First, the power supply to the control unit 17 is step S.
If entered in 400 steps, step S401
Then, the reference value of the characteristic parameter is set to the instruction interpreter 8 for each part.
From inside RAM 52 of 7 through buses 86 and 59,
The data is transferred to a predetermined area of the two-port RAM 61. At this time, it goes without saying that the data in the RAM 52 remains unchanged.

【0124】次に、ステツプS402にて、座標変換の
演算に使われる上述の変換パラメータも、RAM52よ
りツー・ポート・RAM61へ転送する。
Next, in step S402, the above-mentioned conversion parameters used for the coordinate conversion calculation are also transferred from the RAM 52 to the two-port RAM 61.

【0125】次に、ステツプのステツプS403で、X
Yテーブル3の原点出しを行なう。このテーブル3は視
覚カメラ2とレンズ間を平面的に移動させるためのもの
である。次にステツプS404とステツプS405で、
ロボツト6とシヤトル9の原点出しを行ない、ステツプ
S406で本装置が起動可能な状態となる。
Next, in step S403 of the step, X
The origin of the Y table 3 is set. The table 3 is for moving the visual camera 2 and the lens in a plane. Next, in steps S404 and S405,
The origins of the robot 6 and the shuttle 9 are set, and in step S406, the apparatus is ready to start.

【0126】電源投入後、ステツプS406に行くまで
はキーボードの入力は受け付けない状態となることは言
うまでもない。 〈実施例の効果〉以上説明した実施例によれば、次のよ
うな効果が得られる。即ち、 :制御装置17では、1つの命令解釈部87が、組付
を行なうロボツト動作命令と画像処理を行なう画像処理
命令という2つの異なる系統の命令を解釈するようにし
ている。その一方で、ロボット動作の実際の実行を制御
するのは組み付け動作制御(即ち、ロボット動作制御部
62,ハンド動作制御部63)が行なうようにし、画像
処理は画像処理部64が実際に行なうようにしている。
即ち、ロボット動作と画像処理という2つの異質の処理
をモジュール化された2つのプログラムにより記述し、
それらのプログラムモジュールを1つの命令解釈部が行
ない、その一方で、ロボット動作の実行と画像処理の実
行は組み付け動作制御部(即ち、ロボット動作制御部6
2,ハンド動作制御部63)が行ない、画像処理は画像
処理部64が行なうという二本立てとなっている。
Needless to say, after the power is turned on, the keyboard input is not accepted until the process goes to step S406. <Effects of Embodiment> According to the embodiment described above, the following effects can be obtained. That is, in the control device 17, one instruction interpreting section 87 interprets two different types of instructions, that is, a robot operation instruction for assembling and an image processing instruction for performing image processing. On the other hand, the actual execution of the robot operation is controlled by the assembly operation control (that is, the robot operation control unit 62, the hand operation control unit 63), and the image processing is performed by the image processing unit 64. I have to.
In other words, two different processes, robot motion and image processing, are described by two modularized programs,
One instruction interpreting unit performs those program modules, while the robot motion and the image processing are performed by the assembly motion control unit (that is, the robot motion control unit 6).
2, the hand operation control unit 63) performs the image processing, and the image processing unit 64 performs the image processing.

【0127】そのために、制御装置17の開発負荷を大
幅に削減できる効果がある。何故ならば、命令解釈を一
本化したことにより、並列動作を行なう2つのプログラ
ムモジュールの調停制御と同期化制御とを容易に行なう
ことができる。又、同一仕様の命令解釈部であることか
ら、工場導入後ユーザにとつても使いやすい装置にでき
る効果があるからである。さらに、命令解釈手段が同一
であることから、各々の装置間の通信用インターフエー
ス及び通信用プログラムも、各々の命令として簡素化さ
れ、装置も安価でユーザにとつてさらに使い安くできる
からである。また、ロボット動作の実行と画像処理の実
行とは二本立てで行なわれるために、組み付け動作制御
部における制御手順の開発は画像処理部64における制
御手順の開発と独立して行なうことができ効率的である
からである。
Therefore, there is an effect that the development load of the control device 17 can be greatly reduced. Because the instruction interpretation is unified, the arbitration control and the synchronization control of the two program modules that operate in parallel can be easily performed. Also, since the instruction interpreting unit has the same specifications, there is an effect that the device can be easily used by the user even after the factory is installed. Furthermore, since the command interpreting means are the same, the communication interface and communication program between the respective devices are also simplified as the respective commands, and the devices are inexpensive and can be used more easily for the user. .. Further, since the execution of the robot operation and the execution of the image processing are performed in two lines, the development of the control procedure in the assembling operation control unit can be performed independently from the development of the control procedure in the image processing unit 64, which is efficient. Because there is.

【0128】具体的には、制御装置17では、1つの命
令解釈部87は、CPU50とメモリ(51,52)及
びキーボード20,CRT19からなる入出力手段から
なる。そして、それらは命令解釈部87内のみで通信可
能なローカルバス86で接続され、また、CPU50と
ロボツト動作制御部62とハンド動作制御部63と画像
処理部64とは前記ローカルバス86とは別個のコモン
バス59により接続されている。かつ、このコモンバス
59は一般的な規格でマルチバスとしてある。また、命
令解釈部87のメモリの1部であるROM51内に、命
令解釈プログラム及びこの命令解釈プログラムを適宜ロ
ボツトとハンドの動作命令と画像の処理命令とにより使
いわける、マルチタスクOSやプログラムの入出力をサ
ポートするプログラム等をあらかじめ記憶させてある。
そして、命令解釈部87のランダム・アクセス・メモリ
であるRAM52内に領域をあらかじめ区分してこれら
のプログラムを格納してある。更に、ロボツト及びハン
ドの動作命令と画像の処理命令は、別個にキーボード等
の入力手段で入力可能とされている。そして、本組立装
置がキーボード等の入力手段で起動させられると、本制
御装置は、まずロボツト及びハンドの動作命令を解釈
し、実行することから始め、ロボツトの動作命令中に画
像の処理を起動させる命令を見つけると、前記命令解釈
部のCPUが画像処理の命令をも順次解釈実行を開始
し、画像の処理命令内に処理を終了させる命令を見つけ
たことにより、前記CPUは画像の命令処理動作をや
め、ロボツトの命令解釈のみ行なう様にしたものであ
る。
Specifically, in the control device 17, one instruction interpreting section 87 is composed of an input / output means including a CPU 50, memories (51, 52), a keyboard 20, and a CRT 19. Then, they are connected by a local bus 86 capable of communicating only within the command interpreting section 87, and the CPU 50, the robot operation control section 62, the hand operation control section 63, and the image processing section 64 are separate from the local bus 86. Are connected by a common bus 59. Moreover, the common bus 59 is a multi-bus according to a general standard. Further, in the ROM 51 which is a part of the memory of the instruction interpreting unit 87, an instruction interpreting program and a multitasking OS or a program for appropriately using the instruction interpreting program by a robot, a hand operation instruction, and an image processing instruction are stored. Programs that support output are stored in advance.
The RAM 52, which is a random access memory of the instruction interpreting unit 87, is divided into areas and these programs are stored in advance. Further, the robot and hand operation commands and the image processing commands can be separately input by an input means such as a keyboard. Then, when the assembly apparatus is activated by an input means such as a keyboard, the control apparatus first interprets and executes the operation command of the robot and the hand, and starts image processing during the operation command of the robot. When the CPU for the instruction interpreting unit finds the instruction to be executed, the CPU of the instruction interpreting unit sequentially starts interpreting and executing the image processing instruction, and finds the instruction to end the processing in the image processing instruction, and thus the CPU executes the image instruction processing. The operation is stopped and only the robot command is interpreted.

【0129】そのために、例えば、ロボツトのアームが
カメラのエリアより逃げたタイミングで画像を取り込む
等の動作を容易に記述可能となつた。また、タイミング
を共有メモリ2−PORT−RAMを介して行なえるの
で、コンピユータのアクセス時間レベルの非常に高速で
調停を取ることが可能となつた。また、画像処理の不要
な場合は、命令解釈部のCPUはロボツトの動作の命令
解釈のみに専念でき、1つのCPUで複数の処理を行な
つているが、処理時間の遅れ問題にならなくなつた。
Therefore, for example, an operation such as capturing an image at a timing when the robot arm escapes from the camera area can be easily described. Further, since the timing can be performed via the shared memory 2-PORT-RAM, it is possible to arbitrate the access time level of the computer at a very high speed. When the image processing is not necessary, the CPU of the instruction interpreting unit can concentrate on only the instruction interpretation of the robot operation, and a single CPU performs a plurality of processes. However, this does not cause a delay in processing time. It was

【0130】又、同一仕様の命令解釈手段であることか
ら、工場導入後ユーザにとつても使いやすい装置にでき
る効果がある。
Further, since the instruction interpreting means has the same specifications, there is an effect that the apparatus can be easily used by the user even after the factory is installed.

【0131】さらに、命令解釈手段が同一であることか
ら、各々の装置間の通信用インターフエース及び通信用
プログラムも各々の命令として簡素化され、装置も安価
でユーザにとつてさらに使い安くできる効果がある。 :動作制御部62,63用の命令や画像処理部64の
命令等は統一した形式の命令コード(第13図〜第15
図)に変換され、メモリ60やRAM61に格納され
る。即ち、上位の制御部(解釈部87)と下位の制御部
(動作制御部62,63)との間では、命令コード及び
メモリという媒体が存在し、上位の制御部(解釈部8
7)におけるロボットタスクとビジョンタスクの命令の
相違を吸収している。 :主タスクであるロボットタスク内に、子タスクであ
るビジョンタスクを起動する命令(START)を準備
しているので、両タスク間の起動の調停が容易となる。
更に、タイミング確認指令等を用意しているので、タス
ク間の調歩が容易となる。 :座標変換パラメータや基準特徴パラメータ等の種々
のパラメータは、バッテリーバツクアツプされたRAM
に記憶されており、電源投入時に、それらのパラメータ
が必要とされるRAM61に転送されるようになってい
るので、これらのパラメータの一元的な管理が容易とな
る。具体的には: −1:キーボード,CRTフロツピーデイスクドライ
ブ等の入出力手段を1つだけ、かつロボツト等の動作命
令の入出力の必要な部分に設けることで、すべて行なえ
る。
Further, since the command interpreting means are the same, the communication interface and the communication program between the respective devices are also simplified as respective commands, and the device is inexpensive and can be used more easily for the user. There is. : Instruction codes for the operation control units 62 and 63, instructions for the image processing unit 64, and the like have a unified format instruction code (see FIGS. 13 to 15)
Figure) and stored in the memory 60 or the RAM 61. That is, a medium called an instruction code and a memory exists between the upper control unit (interpretation unit 87) and the lower control unit (operation control units 62 and 63), and the upper control unit (interpretation unit 8).
It absorbs the difference in instructions between the robot task and the vision task in 7). : Since a command (START) for activating a vision task which is a child task is prepared in the robot task which is the main task, arbitration of activation between both tasks becomes easy.
Furthermore, since a timing confirmation command and the like are prepared, it becomes easy to start and stop between tasks. : Various parameters such as coordinate conversion parameters and reference feature parameters are stored in the battery backed up RAM.
Since these parameters are stored in the RAM 61 and are transferred to the required RAM 61 when the power is turned on, unified management of these parameters becomes easy. Specifically: -1: All can be done by providing only one input / output means such as a keyboard and a CRT floppy disk drive, and at a portion required to input / output operation commands such as a robot.

【0132】−2:画像処理部のRAMをバツテリー
バツクUPさせる必要がない。
-2: The RAM of the image processing unit need not be backed up.

【0133】−3:画像処理部を故障等で交換しても
パラメータを再度入力する必要がない。
-3: It is not necessary to input the parameters again even if the image processing unit is replaced due to a failure or the like.

【0134】−4:二重にパラメータを記憶しておく
必要がないため、ずれ等による誤動作がない。 〈変形例〉本発明はその主旨を逸脱しない範囲で種々変
形が可能である。 :例えば、上記実施例では、第4図に示すように、マ
トリツクス状にパレット内に配置されたワークについて
説明したが、パレット内のワークの配置は、これにかぎ
らず、たとえば、直線等の一列に並べても構わず、ま
た、パレット内にランダムに収納されていてもよい。要
は、パレット内におけるワークの位置が大体決まってい
ればよく、その各ワークの概略の位置をロボツトに教え
こますことができることが重要である。 :また、上記実施例では、セルの大きさは一定であ
り、ワークも1種類とした。本発明は、セルの大きさが
異なっていても、また、1つのパレット内で異なるワー
クが存在する場合にも適用できる。この場合は、セルの
位置とそのセルの大きさとそのセル内のワークの種類と
の対応とを、制御装置17が画像処理部64へ送ればよ
い。また、1つのセル内に複数のワークが存在する場合
にも本発明を適用できる。 :前記実施例では、座標変換は、視覚系で行なわれて
いたが、ロボツト制御装置側で行なってもよい。 :また、前記実施例では、穴A,Bの重心位置は第2
4図に説明したように、ヒストグラムの極大値をとる位
置を重心位置と定めたが、次のようにしてもよい。即
ち、第24図で、全ドットの数がn個の場合は、頻度の
累積がn/2 となる点を重心とする。この手法によれば、
対象でない形状の穴等についても重心を演算できる。 :前記実施例では、特徴パラメータと座標変換パラメ
ータを命令解釈部87のメモリ52に常時格納してお
き、電源打込後、画像処理部がアクセス可能な2−PO
RT−RAM上に転送するようにしている。本発明はこ
れに限定されず、例えば、画像が独自に用いるパラメー
タ、たとえば画像取り込みの絶対的なスタート位置,カ
メラ2の入力のゲイン等を命令解釈部のメモリに格納し
ておき、前記と同様に転送してもよい。また、ロボツト
動作部,ハンド動作部に必要なパラメータも同等に命令
解釈部のメモリより共有メモリに転送しても良い。 :前記実施例は、まずロボツトの動作が起動され、ロ
ボツトの動作命令内に画像の処理を起動させる様に説明
してあるが、画像の処理の時間が長く、組立装置を間欠
的に動かす装置等に応用し場合、画像の処理命令からロ
ボツトの動作命令解釈を起動させ、かつロボツトの動作
命令中に停止する命令を入れ、CPUの処理を行なわせ
ない様に構成しても何ら問題はない。 :前記実施例において、一連の動作及び処理命令の中
にロボツト動作部及び画像処理部への命令コード以外の
シーケンス制御命令(ジヤンプ命令,繰返し命令,タイ
マー命令)が存在した場合には、命令解釈手段で理解
し、命令解釈部自体が実行することは、第9図の行番3
60のビジョンタスク開始命令の説明から容易に考えら
れる。 :前記実施例において、画像処理部が命令解釈部から
の命令コードの授受を行なう手段を2PORT−RAM
61としているが、前記実施例のロボツト動作部と同じ
く共有メモリ60とする事も可能である。
-4: Since it is not necessary to store parameters twice, there is no malfunction due to misalignment or the like. <Modifications> The present invention can be variously modified without departing from the spirit thereof. For example, in the above embodiment, as shown in FIG. 4, the workpieces arranged in the pallet in the shape of a matrix have been described. They may be arranged side by side or randomly stored in a pallet. In short, it suffices that the position of the work in the pallet is roughly determined, and it is important to be able to teach the robot the approximate position of each work. In addition, in the above-mentioned embodiment, the size of the cell is constant, and the work is one kind. The present invention can be applied even when the sizes of cells are different and different works are present in one pallet. In this case, the controller 17 may send the correspondence between the position of the cell, the size of the cell, and the type of work in the cell to the image processing unit 64. The present invention can also be applied to the case where a plurality of works are present in one cell. : In the above embodiment, the coordinate conversion is performed by the visual system, but it may be performed by the robot controller side. In addition, in the above embodiment, the center of gravity of the holes A and B is the second position.
As described with reference to FIG. 4, the position where the maximum value of the histogram is taken is defined as the barycentric position, but it may be set as follows. That is, in FIG. 24, when the number of all dots is n, the point at which the cumulative frequency is n / 2 is the center of gravity. According to this technique,
The center of gravity can be calculated for holes and the like that are not of interest. In the above-described embodiment, the characteristic parameter and the coordinate conversion parameter are always stored in the memory 52 of the instruction interpreting unit 87, and the 2-PO accessible by the image processing unit after the power is turned on.
The data is transferred to the RT-RAM. The present invention is not limited to this, and for example, the parameters uniquely used by the image, such as the absolute start position of image capture and the gain of the input of the camera 2, are stored in the memory of the command interpreting unit, and the same as above. May be forwarded to. Further, the parameters required for the robot operation unit and the hand operation unit may be similarly transferred from the memory of the instruction interpretation unit to the shared memory. In the above embodiment, the operation of the robot is first activated, and the image processing is activated within the operation command of the robot. However, the processing time of the image is long, and the apparatus for intermittently moving the assembling apparatus. In the case of application to etc., there is no problem even if it is configured so that the operation instruction interpretation of the robot is activated from the image processing instruction and the stop instruction is inserted in the robot operation instruction so that the CPU processing is not performed. . : In the above embodiment, if there is a sequence control command (jump command, repeat command, timer command) other than the command code to the robot motion unit and the image processing unit in the series of motion and processing commands, command interpretation What is understood by the means and executed by the instruction interpreting unit itself is line number 3 in FIG.
It can be easily considered from the description of the 60 vision task start commands. In the above-mentioned embodiment, the image processing unit is a means for transmitting and receiving the instruction code from the instruction interpreting unit to the 2PORT-RAM.
Although it is set to 61, it is also possible to use the shared memory 60 like the robot operation unit of the above-mentioned embodiment.

【0135】同様に、前記実施例において、ロボツト動
作部及びハンド動作部が命令解釈部からの命令コードの
授受を行なう手段を共有メモリ60としているが、前記
実施例の画像処理部と同じく2PORT−RAMとする
事も可能である。部に記憶され、必要に応じて、この記
憶部から、それが使われる把持部及び/又は画像処理部
に転送される。このために、パラメータを記憶するとこ
ろは1つで済み、従って、その管理も一元化できる。
Similarly, in the above-described embodiment, the shared memory 60 is used as the means for the robot operation unit and the hand operation unit to send and receive the instruction code from the instruction interpretation unit, but like the image processing unit of the above-described embodiment, 2PORT- is used. It is also possible to use RAM. It is stored in the unit and is transferred from this storage unit to the gripping unit and / or the image processing unit in which it is used, if necessary. For this reason, there is only one place for storing the parameters, and therefore the management thereof can be unified.

【0136】[0136]

【発明の効果】以上説明したように、本発明の視覚を用
いた自動把持装置の制御装置によれば、パラメータは、
画像処理命令と把持動作命令とを含むプログラムと同じ
記憶部に記憶され、必要に応じて、この記憶部から、そ
れが使われる把持部及び/又は画像処理部に転送され
る。このために、パラメータを記憶するところは1つで
済み、従って、その管理も一元化できる。
As described above, according to the control device of the visual grasping automatic gripping device of the present invention, the parameters are
The program including the image processing instruction and the gripping operation instruction is stored in the same storage unit, and is transferred from the storage unit to the gripping unit and / or the image processing unit in which the program is used, as necessary. For this reason, there is only one place for storing the parameters, and therefore the management thereof can be unified.

【0137】本発明の好適な1態様によれば、前記パラ
メータは、把持対象のワークの形状を認識するための特
徴パラメータである。
According to a preferred aspect of the present invention, the parameter is a characteristic parameter for recognizing the shape of the workpiece to be gripped.

【0138】本発明の好適な1態様によれば、前記パラ
メータは、前記画像処理部の視覚座標系と前記把持部の
座標系との間の座標変換パラメータである。
According to a preferred aspect of the present invention, the parameter is a coordinate conversion parameter between the visual coordinate system of the image processing section and the coordinate system of the grip section.

【0139】本発明の好適な1態様によれば、転送手段
は、前記特徴パラメータを、この制御装置の電源を入れ
た後に、把持動作が起動される前に、前記画像処理部の
メモリに転送する。
According to a preferred aspect of the present invention, the transfer means transfers the characteristic parameter to the memory of the image processing unit after the control device is turned on and before the gripping operation is started. To do.

【0140】本発明の好適な1態様によれば、前記メモ
リはツー・ポート・RAMである。
According to a preferred aspect of the present invention, the memory is a two-port RAM.

【0141】かくして、本発明により、具体的には、例
えば、 キーボード,CRTフロツピーデイスクドライブ等の
入出力手段を1つだけ、かつロボツト等の動作命令の入
出力の必要な部分に設けることで、すべて行なえる。 画像処理部のRAMをバツテリーバツクUPさせる必
要がない。 画像処理部を故障等で交換してもパラメータを再度入
力する必要がない。 二重にパラメータを記憶しておく必要がないため、ず
れ等による誤動作がない。
Thus, according to the present invention, specifically, for example, by providing only one input / output means such as a keyboard and a CRT floppy disk drive, and at a portion where input / output of operation commands such as a robot is required. , You can do everything. The RAM of the image processing unit need not be backed up. Even if the image processing unit is replaced due to a failure, it is not necessary to input the parameters again. Since it is not necessary to store parameters twice, there is no malfunction due to misalignment.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明が適用された好適な実施例に係るロボッ
ト組立システムの斜視図。
FIG. 1 is a perspective view of a robot assembly system according to a preferred embodiment to which the present invention is applied.

【図2】第1図システムの制御装置17の構成を示すブ
ロツク図。
FIG. 2 is a block diagram showing the configuration of a control device 17 of the system shown in FIG.

【図3】制御装置17の画像処理部64のブロツク図。FIG. 3 is a block diagram of an image processing unit 64 of the control device 17.

【図4】第1図システムに利用されるパレットの構造を
示す平面図。
FIG. 4 is a plan view showing the structure of a pallet used in the system shown in FIG.

【図5】解釈部87のROM51のデータ構成を示す
図。
FIG. 5 is a diagram showing a data configuration of a ROM 51 of an interpretation unit 87.

【図6】解釈部87のROM52のデータ構成を示す
図。
FIG. 6 is a diagram showing a data configuration of a ROM 52 of an interpretation unit 87.

【図7】,[Fig. 7]

【図8】第1図システムのシャトル及びロボットの動作
を具体的に示す図。
FIG. 8 is a diagram specifically showing the operations of the shuttle and the robot of the system shown in FIG. 1;

【図9】,[FIG. 9]

【図10】一例としての、ロボットタスクを記述するプ
ログラムのフローチヤート。
FIG. 10 is a flow chart of a program describing a robot task as an example.

【図11】一例としての、ビジョンタスクを記述するプ
ログラムのフローチヤート。
FIG. 11 is a flow chart of a program describing a vision task as an example.

【図12】ロボットプログラムが解釈部87により命令
コードに変換され、その命令コードが実行される様子を
模式的に示した図。
FIG. 12 is a diagram schematically showing how a robot program is converted into an instruction code by an interpretation unit 87 and the instruction code is executed.

【図13】,FIG. 13

【図14】,FIG. 14

【図15】命令コードのフォーマツトを示す図。FIG. 15 is a diagram showing an instruction code format.

【図16】解釈プログラムと各タスク間の関係を示すと
共に、そこにおける解釈の制御に必要なフラグを示す
図。
FIG. 16 is a diagram showing a relationship between an interpreting program and each task, and also showing flags necessary for controlling the interpretation therein.

【図17A】、17A],

【図17B】解釈部87の解釈手順を示すフローチヤー
ト。
FIG. 17B is a flowchart showing an interpretation procedure of the interpretation unit 87.

【図18】ロボット/ハンド動作制御部における制御手
順を示すフローチヤート。
FIG. 18 is a flow chart showing a control procedure in the robot / hand operation control unit.

【図19】画像処理部64の制御手順を示すフローチヤ
ート。
FIG. 19 is a flow chart showing a control procedure of the image processing unit 64.

【図20】,FIG. 20:

【図21】第9図乃至第11図のプログラムを実行した
ときの各部の動きを示すタイミングチヤート。
FIG. 21 is a timing chart showing the movement of each part when the program of FIGS. 9 to 11 is executed.

【図22】,FIG. 22:

【図23】部品認識における特徴パラメータの定義を説
明する図。
FIG. 23 is a diagram illustrating the definition of characteristic parameters in component recognition.

【図24】部品認識に必要な重心位置の検出の原理を説
明する図。
FIG. 24 is a view for explaining the principle of detection of the position of the center of gravity necessary for component recognition.

【図25】視覚座標系とロボット座標系との関係を示す
図。
FIG. 25 is a diagram showing a relationship between a visual coordinate system and a robot coordinate system.

【図26】起動プログラム100の制御手順を示すフロ
ーチヤート。
FIG. 26 is a flowchart showing the control procedure of the startup program 100.

【符号の説明】[Explanation of symbols]

2 CCDカメラ 3 XYテーブル 6 ロボット 7 ハンド 8 組み付けステージ 9 シャトル 11,12 部品供給部 13a,13bパレット 17 制御部 18 ケーブル 19 CRT 50 CPU 51 ROM 52 RAM 60 共有メモリ 61 ツー・ポート・RAM 62 ロボット動作制御部 63 ハンド動作制御部 64 画像処理部 87 命令解釈部 2 CCD camera 3 XY table 6 Robot 7 Hand 8 Assembly stage 9 Shuttle 11, 12 Parts supply section 13a, 13b Pallet 17 Control section 18 Cable 19 CRT 50 CPU 51 ROM 52 RAM 60 Shared memory 61 Two-port RAM 62 Robot operation Control unit 63 Hand operation control unit 64 Image processing unit 87 Command interpretation unit

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.5 識別記号 庁内整理番号 FI 技術表示箇所 G05B 19/18 H 9064−3H 19/19 H 9064−3H 19/403 S 9064−3H (72)発明者 柴田 優 東京都太田区下丸子3丁目30番2号 キヤ ノン株式会社内─────────────────────────────────────────────────── ─── Continuation of the front page (51) Int.Cl. 5 Identification number Office reference number FI technical display location G05B 19/18 H 9064-3H 19/19 H 9064-3H 19/403 S 9064-3H (72) Inventor Yu Shibata 3-30-2 Shimomaruko, Ota-ku, Tokyo Canon Inc.

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】ワークの画像を撮像し、この画像から前記
ワークの位置情報を算出する画像処理部と、前記ワーク
を前記位置情報に基づいて把持する把持部とからなる自
動把持装置を制御する制御装置であって、 前記ワークを撮像しそのワークの画像から位置情報を算
出する一連の画像処理命令とこのワークを前記位置情報
に基づいて把持する一連の把持動作命令とを含むプログ
ラムと、ワークの位置情報を算出するためのパラメータ
とを記憶する記憶部と、 このプログラム中の前記画像処理命令と把持動作命令と
を識別して解釈すると共に、前記画像処理命令を前記画
像処理部に渡し、前記把持動作命令を前記把持部に渡す
ための1つの解釈部と、 前記パラメータを、前記プログラムの実行に先立って、
前記画像処理部若しくは把持部に転送する転送手段とを
具備したことを特徴とする視覚を用いた自動把持装置の
制御装置。
1. An automatic gripping device comprising an image processing unit for picking up an image of a work and calculating position information of the work from this image, and a gripping unit for gripping the work based on the position information. A control device, a program including a series of image processing commands for imaging the work and calculating position information from an image of the work, and a series of gripping operation commands for gripping the work based on the position information; A storage unit for storing a parameter for calculating the position information of, and interpreting the image processing command and the gripping operation command in this program while distinguishing and interpreting the image processing command to the image processing unit, One interpreting unit for passing the gripping operation command to the gripping unit, and the parameter, prior to the execution of the program,
A control device for an automatic gripping device using vision, comprising: a transfer unit that transfers the image to the image processing part or the gripping part.
【請求項2】前記パラメータは、把持対象のワークの形
状を認識するための特徴パラメータであることを特徴と
する請求項の第1項に記載の視覚を用いた自動把持装置
の制御装置。
2. The control device for an automatic visual grasping device according to claim 1, wherein the parameter is a characteristic parameter for recognizing the shape of a workpiece to be grasped.
【請求項3】前記パラメータは、前記画像処理部の視覚
座標系と前記把持部の座標系との間の座標変換パラメー
タであることを特徴とする請求項の第1項に記載の視覚
を用いた自動把持装置の制御装置。
3. The visual sense according to claim 1, wherein the parameter is a coordinate conversion parameter between the visual coordinate system of the image processing unit and the coordinate system of the gripping unit. The control device for the automatic gripping device.
【請求項4】前記転送手段は、前記特徴パラメータを、
この制御装置の電源を入れた後に、把持動作が起動され
る前に、前記画像処理部のメモリに転送することを特徴
とする請求項の第1項に記載の視覚を用いた自動把持装
置の制御装置。
4. The transfer means sets the characteristic parameter to
The automatic visual grasping device according to claim 1, wherein after the control device is turned on, it is transferred to the memory of the image processing unit before the grasping operation is activated. Control device.
【請求項5】前記メモリはツー・ポート・RAMである
ことを特徴とする請求項の第4項に記載の視覚を用いた
自動把持装置の制御装置。
5. The control device for an automatic visual grasping device according to claim 4, wherein the memory is a two-port RAM.
JP10798291A 1991-05-14 1991-05-14 Controller of automatic holding device in use of visual sense Withdrawn JPH05228866A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10798291A JPH05228866A (en) 1991-05-14 1991-05-14 Controller of automatic holding device in use of visual sense

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10798291A JPH05228866A (en) 1991-05-14 1991-05-14 Controller of automatic holding device in use of visual sense

Publications (1)

Publication Number Publication Date
JPH05228866A true JPH05228866A (en) 1993-09-07

Family

ID=14472985

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10798291A Withdrawn JPH05228866A (en) 1991-05-14 1991-05-14 Controller of automatic holding device in use of visual sense

Country Status (1)

Country Link
JP (1) JPH05228866A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7035711B2 (en) 2002-08-23 2006-04-25 Fanuc Ltd. Machining system
JP2007181908A (en) * 2006-01-10 2007-07-19 Toyota Motor Corp Traveling robot device and its control method
JP2011530414A (en) * 2008-08-09 2011-12-22 ダイムラー・アクチェンゲゼルシャフト Method and apparatus for performing work on a moving workpiece
JP2019025566A (en) * 2017-07-27 2019-02-21 株式会社日立物流 Picking robot and picking system
WO2020049765A1 (en) * 2018-09-07 2020-03-12 オムロン株式会社 Mobile manipulator, mobile robot, server, and mobile manipulator system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7035711B2 (en) 2002-08-23 2006-04-25 Fanuc Ltd. Machining system
JP2007181908A (en) * 2006-01-10 2007-07-19 Toyota Motor Corp Traveling robot device and its control method
JP2011530414A (en) * 2008-08-09 2011-12-22 ダイムラー・アクチェンゲゼルシャフト Method and apparatus for performing work on a moving workpiece
JP2019025566A (en) * 2017-07-27 2019-02-21 株式会社日立物流 Picking robot and picking system
WO2020049765A1 (en) * 2018-09-07 2020-03-12 オムロン株式会社 Mobile manipulator, mobile robot, server, and mobile manipulator system

Similar Documents

Publication Publication Date Title
CN108724179B (en) Control device, robot, and robot system
US4890241A (en) Robotic system
US7383100B2 (en) Extensible task engine framework for humanoid robots
KR910000873B1 (en) The method and system colntrolling assembling robot
JP2005500597A (en) Integrated robot cell
CN110465951A (en) For the method for robotic programming, equipment, computer-readable storage medium and computer program
CN107391211A (en) The general detection traceability system and method for a kind of intelligent switch group
JPH05228866A (en) Controller of automatic holding device in use of visual sense
JP2000081906A (en) Virtual plant simulation device and its method
JP2834597B2 (en) Control method and control device for automatic gripping device using visual sense
CN111993423A (en) Modular intelligent assembling system
EP0541900A1 (en) Method for automatically programming spatial information in robotic systems
US20170312918A1 (en) Programming Method of a Robot Arm
Nitzan Machine intelligence research applied to industrial automation
JP2834598B2 (en) Control device for automatic gripping device using vision
JP7067017B2 (en) Control and robot systems
CN112621765A (en) Automatic equipment assembly control method and device based on manipulator
JPH04352204A (en) Method for controlling automatic gripping device using visual sensations
CN111899629B (en) Flexible robot teaching system and method
TW201729959A (en) Method and system for adjusting position of robot
CN106808463A (en) Carbide chip automation disk loading system and the method for a kind of integrated manipulator
US6330485B1 (en) High-speed multi-task system
Fulbright et al. SWAMI: An autonomous mobile robot for inspection of nuclear waste storage facilities
JPH07164285A (en) Returning method at trouble generation, and device therefor
KR20070025126A (en) Programming system for educational robot

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19980806