JP2021089206A - Angle detection method, encoder unit, and robot - Google Patents
Angle detection method, encoder unit, and robot Download PDFInfo
- Publication number
- JP2021089206A JP2021089206A JP2019219697A JP2019219697A JP2021089206A JP 2021089206 A JP2021089206 A JP 2021089206A JP 2019219697 A JP2019219697 A JP 2019219697A JP 2019219697 A JP2019219697 A JP 2019219697A JP 2021089206 A JP2021089206 A JP 2021089206A
- Authority
- JP
- Japan
- Prior art keywords
- angle
- image
- mark
- movement amount
- calibration
- 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.)
- Pending
Links
Images
Landscapes
- Transmission And Conversion Of Sensor Element Output (AREA)
- Optical Transform (AREA)
- Manipulator (AREA)
Abstract
Description
本発明は、角度検出方法、エンコーダーユニットおよびロボットに関するものである。 The present invention relates to an angle detection method, an encoder unit and a robot.
従来、エンコーダーの一種として光学式のロータリーエンコーダーが知られている。例えば、特許文献1に記載のロータリーエンコーダーは、目盛盤と、目盛盤の周縁付近に設けられたコードパターンと、対称位置のコードパターンを読み取る一対のCCDリニアセンサーと、を備える。このロータリーエンコーダーでは、目盛盤の偏心に関する偏心因子をあらかじめ記憶しておき、測角した値を偏心因子で補正して、偏心による角度誤差を取り除くようにしている。
Conventionally, an optical rotary encoder is known as a kind of encoder. For example, the rotary encoder described in
減速機やモーター等の出力軸は、回転に伴って軸振れ(動的な偏心)が生じるため、特許文献1に記載の方法のように、あらかじめ記憶しておいた偏心因子を用いて偏心による角度誤差を取り除こうとしても、軸振れに起因する誤差については、軽減することができない。このため、従来のロータリーエンコーダーでは、軸振れを伴う場合、検出精度を高めることが難しいという課題がある。
Since the output shafts of speed reducers, motors, etc. cause shaft runout (dynamic eccentricity) as they rotate, eccentricity is caused by using an eccentric factor stored in advance as in the method described in
本発明の適用例に係る角度検出方法は、
回動軸まわりに環状に並ぶ第1マークおよび第2マークを含む複数のマークを有するスケール部と、前記第1マークを撮像する第1撮像素子と、前記回動軸に対して前記第1撮像素子と対称の位置に配置され、前記第2マークを撮像する第2撮像素子と、を有し、前記第1撮像素子および前記第2撮像素子に対して前記スケール部が前記回動軸まわりに相対的に回動するエンコーダーを用いて、前記回動軸の回動角度を検出する角度検出方法であって、
前記スケール部が第[i]校正角にあるとき、前記第1撮像素子により前記第1マークを撮像して第1[i]基準画像を生成し、第1[i]テンプレート画像および前記第1[i]基準画像における前記第1マークの第1[i]基準座標を取得するステップと、
前記スケール部が前記第[i]校正角にあるとき、前記第2撮像素子により前記第2マークを撮像して第2[i]基準画像を生成し、第2[i]テンプレート画像および前記第2[i]基準画像における前記第2マークの第2[i]基準座標を取得するステップと、
前記第[i]校正角を変化させたとき、その変化量と、前記第1マークの移動量と、前記第2マークの移動量と、の間に成り立つ相関関係を求めるステップと、
前記スケール部が計測角にあるとき、前記第1撮像素子により前記第1マークを撮像して第1測角画像を生成し、前記第1[i]テンプレート画像に基づくテンプレートマッチングにより、前記第1測角画像における前記第1マークの前記第1[i]基準座標からの第1測角移動量を求めるステップと、
前記スケール部が前記計測角にあるとき、前記第2撮像素子により前記第2マークを撮像して第2測角画像を生成し、前記第2[i]テンプレート画像に基づくテンプレートマッチングにより、前記第2測角画像における前記第2マークの前記第2[i]基準座標からの第2測角移動量を求めるステップと、
前記第[i]校正角、前記第1測角移動量、前記第2測角移動量、および前記相関関係に基づいて、前記計測角を求めるステップと、
を有することを特徴とする。
The angle detection method according to the application example of the present invention is
A scale unit having a plurality of marks including the first mark and the second mark arranged in an annular shape around the rotation axis, a first image sensor that images the first mark, and the first image pickup with respect to the rotation axis. It has a second image sensor that is arranged at a position symmetrical to the element and images the second mark, and the scale portion is around the rotation axis with respect to the first image sensor and the second image sensor. An angle detection method for detecting the rotation angle of the rotation shaft using a relatively rotating encoder.
When the scale unit is at the first [i] calibration angle, the first mark is imaged by the first image sensor to generate a first [i] reference image, and the first [i] template image and the first [I] A step of acquiring the first [i] reference coordinates of the first mark in the reference image, and
When the scale unit is at the [i] calibration angle, the second mark is imaged by the second image sensor to generate a second [i] reference image, and the second [i] template image and the first 2 [i] A step of acquiring the second [i] reference coordinates of the second mark in the reference image, and
[I] When the calibration angle is changed, the step of obtaining the correlation established between the amount of change, the amount of movement of the first mark, and the amount of movement of the second mark.
When the scale unit is at the measurement angle, the first mark is imaged by the first image sensor to generate a first angle measurement image, and the first is performed by template matching based on the first [i] template image. The step of obtaining the first angle-measurement movement amount from the first [i] reference coordinate of the first mark in the angle-measurement image, and
When the scale unit is at the measurement angle, the second mark is imaged by the second image sensor to generate a second angle measurement image, and template matching based on the second [i] template image is performed to obtain the second mark. 2. A step of obtaining the second angle movement amount of the second mark from the second [i] reference coordinate in the angle measurement image, and
The step of obtaining the measurement angle based on the first [i] calibration angle, the first angle movement amount, the second angle measurement movement amount, and the correlation.
It is characterized by having.
以下、本発明の角度検出方法、エンコーダーユニットおよびロボットの好適な実施形態を添付図面に基づいて詳細に説明する。 Hereinafter, preferred embodiments of the angle detection method, encoder unit, and robot of the present invention will be described in detail with reference to the accompanying drawings.
1.ロボット
図1は、実施形態に係るロボットを示す側面図である。なお、以下では、説明の便宜上、図1中の上側を「上」、下側を「下」と言う。また、図1中の基台側を「基端側」、その反対側を「先端側」と言う。
1. 1. Robot FIG. 1 is a side view showing a robot according to an embodiment. In the following, for convenience of explanation, the upper side in FIG. 1 is referred to as “upper” and the lower side is referred to as “lower”. Further, the base side in FIG. 1 is referred to as a "base end side", and the opposite side is referred to as a "tip side".
図1に示すロボット100は、いわゆる水平多関節ロボット(スカラロボット)であり、例えば、精密機器等を製造する製造工程等で用いられ、精密機器や部品等の把持や搬送等を行うことができる。
The
図1に示すように、ロボット100は、基台110と、第1アーム120と、第2アーム130と、作業ヘッド140と、エンドエフェクター150と、配線引き回し部160と、を有している。以下、ロボット100の各部を順次簡単に説明する。
As shown in FIG. 1, the
基台110は、例えば、図示しない床面にボルト等によって固定されている。基台110の上端部には、第1アーム120が連結されている。第1アーム120は、基台110を通る第1軸J1まわりに回動可能となっている。
The
基台110内には、第1アーム120を回動させる駆動力を発生させるモーター111と、モーター111の駆動力を減速する減速機112とが設置されている。減速機112の入力軸は、モーター111の回動軸に連結され、減速機112の出力軸は、第1アーム120に連結されている。そのため、モーター111が駆動し、その駆動力が減速機112を介して第1アーム120に伝達されると、第1アーム120が基台110に対して第1軸J1まわりに回動する。
A
また、基台110および第1アーム120には、減速機112の出力軸の回動角度を検出することで、基台110に対する第1アーム120の回動状態を検出する第1エンコーダーであるエンコーダー1が設けられている。
Further, the
第1アーム120の先端部には、第2アーム130が連結している。第2アーム130は、第1アーム120に対して第2軸J2まわりに回動可能となっている。図示しないが、第2アーム130内には、第2アーム130を回動させる駆動力を発生させる第2モーターと、第2モーターの駆動力を減速する減速機とが設置されている。そして、第2モーターの駆動力が減速機を介して第1アーム120に伝達されることにより、第2アーム130が第1アーム120に対して第2軸J2まわりに回動する。また、図示しないが、第2モーターには、第1アーム120に対する第2アーム130の回動状態を検出する、前述したエンコーダー1とは別のエンコーダーが設けられている。
A
第2アーム130の先端部には、作業ヘッド140が配置されている。作業ヘッド140は、第2アーム130の先端部に同軸的に配置された、図示しないスプラインナットおよび図示しないボールネジナットに挿通されたスプラインシャフト141を有している。スプラインシャフト141は、第2アーム130に対して第3軸J3まわりに回転可能であり、かつ、上下方向に移動(昇降)可能となっている。
A
第2アーム130内には、図示しないが、回転モーターおよび昇降モーターが配置されている。回転モーターの駆動力は、図示しない駆動力伝達機構によってスプラインナットに伝達され、スプラインナットが正逆回転すると、スプラインシャフト141が鉛直方向に沿う第3軸J3まわりに正逆回転する。また、図示しないが、回転モーターには、第2アーム130に対するスプラインシャフト141の回動状態を検出する、前述したエンコーダー1とは別のエンコーダーが設けられている。
Although not shown, a rotary motor and an elevating motor are arranged in the
一方、昇降モーターの駆動力は、図示しない駆動力伝達機構によってボールネジナットに伝達され、ボールネジナットが正逆回転すると、スプラインシャフト141が上下に移動する。昇降モーターには、第2アーム130に対するスプラインシャフト141の移動量を検出する、前述したエンコーダー1とは別のエンコーダーが設けられている。
On the other hand, the driving force of the elevating motor is transmitted to the ball screw nut by a driving force transmission mechanism (not shown), and when the ball screw nut rotates in the forward and reverse directions, the
スプラインシャフト141の先端部(下端部)には、エンドエフェクター150が連結されている。エンドエフェクター150としては、特に限定されず、例えば、被搬送物を把持するもの、被加工物を加工するもの等が挙げられる。
An
第2アーム130内に配置された各電子部品、例えば、第2モーター、回転モーター、昇降モーター、各エンコーダー等に接続される複数の配線は、第2アーム130と基台110とを連結する管状の配線引き回し部160内を通って基台110内まで引き回されている。さらに、かかる複数の配線は、基台110内でまとめられることによって、モーター111およびエンコーダー1に接続される配線とともに、基台110の外部に設置され、ロボット100を統括制御する図示しない制御装置まで引き回される。
A plurality of wirings connected to each electronic component arranged in the
以上、ロボット100の構成について簡単に説明したが、このロボット100は、前述したように、第1部材である基台110と、基台110に対して回動する第2部材である第1アーム120と、エンコーダーユニット10と、を備える。ここで、本実施形態に係るエンコーダーユニット10は、回動軸まわりに回転して駆動力を出力する出力軸を有する減速機112と、減速機112の出力軸の回動角度を検出するエンコーダー1と、を有する。そして、基台110内には減速機112が設置されていて、減速機112の出力軸が第1アーム120に接続されている。このようなロボット100によれば、後述するように第1アーム120の回動角度を高精度に検出し、その検出結果に基づいて、第1アーム120の駆動制御を高精度に行うことができる。
The configuration of the
2.第1実施形態
2.1.エンコーダーユニット
以下、第1実施形態に係るエンコーダーユニット10について説明する。なお、エンコーダーユニット10は、様々な機器に組み込まれるが、以下では、エンコーダーユニット10をロボット100に組み込む場合を例に説明する。
2. First Embodiment 2.1. Encoder Unit Hereinafter, the
図2は、第1実施形態に係るエンコーダーユニットを示す断面図である。図3は、図2のエンコーダーを示す機能ブロック図である。図4は、図2のエンコーダーが備えるスケール部を説明するための図である。図5は、図4に示すスケール部のE1部拡大図である。図6は、図4に示すスケール部のE2部拡大図である。図7は、図5に示すスケール部の部分拡大図である。なお、図2および図4〜図7では、説明の便宜上、各部の縮尺が適宜変更されており、図示の構成は実際の縮尺と必ずしも一致するわけではなく、また、各部の図示を適宜簡略化している。 FIG. 2 is a cross-sectional view showing an encoder unit according to the first embodiment. FIG. 3 is a functional block diagram showing the encoder of FIG. FIG. 4 is a diagram for explaining a scale unit included in the encoder of FIG. FIG. 5 is an enlarged view of the E1 portion of the scale portion shown in FIG. FIG. 6 is an enlarged view of the E2 portion of the scale portion shown in FIG. FIG. 7 is a partially enlarged view of the scale portion shown in FIG. In FIGS. 2 and 4 to 7, the scale of each part is appropriately changed for convenience of explanation, the structure shown does not necessarily match the actual scale, and the illustration of each part is simplified as appropriate. ing.
図2に示すように、前述したロボット100の基台110は、モーター111と減速機112を支持する支持部材114を有し、モーター111および減速機112を収納している。このような基台110に対して、第1アーム120は、第1軸J1まわりに回動可能になっている。
As shown in FIG. 2, the
第1アーム120は、図2の左右に延在するアーム本体部121と、アーム本体部121から下方に向けて突出している軸部122と、を有し、これらが互いに接続されている。そして、軸部122は、軸受115を介して基台110に対して第1軸J1まわりに回動可能になっているとともに、減速機112の出力軸に接続されている。また、減速機112の入力軸は、モーター111の回動軸1111に接続されている。減速機112としては、特に限定されないが、例えば、波動減速機、遊星歯車減速機、サイクロ減速機、RV減速機等が挙げられる。
The
ここで、基台110は、その自重や基台110が支える他の質量による荷重が加わる構造体である。同様に、第1アーム120も、その自重や第1アーム120が支える他の質量による荷重が加わる構造体である。このような基台110および第1アーム120の構成材料としては、それぞれ、特に限定されないが、例えば、金属材料が挙げられる。
Here, the
本実施形態では、基台110および第1アーム120の外表面は、ロボット100の外表面の一部を構成している。なお、基台110および第1アーム120の外表面上には、カバー、衝撃吸収材等の外装部材が装着されていてもよい。
In the present embodiment, the outer surfaces of the
このような相対的に回動する基台110および第1アーム120には、これらの回動状態を検出するエンコーダー1が設けられている。
Such a relatively
エンコーダー1は、第1アーム120に設けられているスケール部2と、基台110に設けられている第1検出部3aおよび第2検出部3bと、第1検出部3aおよび第2検出部3bに電気的に接続された回路部4と、を有する。回路部4は、処理部5と、記憶部6と、を有する。
The
図2に示すように、スケール部2は、アーム本体部121の基台110と対向する部分、すなわち、アーム本体部121の下面であって軸部122を囲む部分に設けられている。このスケール部2は、図4に示すように、第1軸J1とは異なる位置で第1軸J1まわりに沿って配置されているドットパターンを有している。
As shown in FIG. 2, the
スケール部2は、例えば第1アーム120の表面に設けられる。これにより、スケール部2を設けるための部材を第1アーム120とは別に設ける必要がない。そのため、部品点数を少なくすることができる。なお、スケール部2は、第1アーム120の表面に直に設けられている場合に限定されず、例えば、第1アーム120の表面に貼着されたシート状の部材に設けられていてもよいし、第1アーム120とともに回動するように設けられた板状の部材に設けられていてもよい。すなわち、スケール部2が設けられる部材は、第1アーム120とともに基台110に対して第1軸J1まわりに回動する部材であればよい。
The
図4ないし図7に示すように、スケール部2は、複数のドット20が列状に配置されてなるマーク21を複数有している。複数のマーク21は、第1軸J1を中心とする円周に沿って、ほぼ等間隔で配置されている。なお、以下の説明では、第1軸J1を中心とする円の半径が延在する方向を「半径方向DR」といい、半径方向DRに直交する方向を「周方向DC」という。
As shown in FIGS. 4 to 7, the
マーク21は、図5および図6に示すように、それぞれ、周方向DCにおける長さに比べて半径方向DRにおける長さが長い形状をなしている。このマーク21は、図7に示すように、複数のドット20が半径方向DRに沿って列をなし、かつ、その列が周方向DCに沿って4列並んだものである。各列では、一部のドット20が周方向DCに沿ってずれているが、このドット20のずれのパターンが、マーク21を一意に識別する固有の識別子として機能する。本実施形態では、半径方向DRに並んだ4つのドット20で形成される列を1つの単位とし、この単位が周方向DCに4列並んでなる16個のドット20によって、後述するテンプレートマッチングにおいてテンプレート画像になり得る配列パターンが構成されている。したがって、各マーク21は、それぞれ、それ自身以外のマーク21とは異なる配列パターンを含んでいる。
As shown in FIGS. 5 and 6, the
そうすると、このようなマーク21を有するスケール部2を第1軸J1まわりに回動させたとき、後述する撮像画像内の所定領域において、同じ配列パターンは2回以上出現しないことになる。本願明細書では、このような識別性を持つことを「ユニーク」といい、ユニークなパターンのことを「ユニークパターンUP」という。各マーク21に含まれた固有のユニークパターンUPを識別することができれば、スケール部2の周方向における絶対位置を識別することができる。
Then, when the
また、ユニークパターンUPは、マーク21の半径方向DRにおいて繰り返し含まれているのが好ましい。これにより、図5に示す撮像領域RI1および図6に示す撮像領域RI2がそれぞれ半径方向DRにずれた場合でも、これらの領域にユニークパターンUPを捉えることができる。
Further, it is preferable that the unique pattern UP is repeatedly included in the radial DR of the
図7に示すドット20の位置、大きさ、数、配列パターン等は、一例であり、これに限定されるものではない。また、図2とは逆に、スケール部2を基台110側に配置し、検出部3a、3bを第1アーム120側に配置してもよい。
The positions, sizes, numbers, arrangement patterns, and the like of the
各図に示すマーク21は、白地に複数の黒色のドット20をユニークに配置することにより構成されている。なお、ドット20の形状は、図示では円形であるが、これに限定されず、例えば、楕円形、四角形、異形状等であってもよい。また、マーク21は、複数のドット20で構成されたドットパターンに限定されず、例えば、直線状のラインで構成されたパターン、曲線状のラインで構成されたパターン、ドット、直線状のラインおよび曲線状のラインのうちの少なくとも2つを組み合わせて構成されたパターンであってもよい。さらに、マーク21は、上述したパターンの白地と黒色のドットまたはラインを反転したパターン、すなわち黒地と白色のドットまたはラインのパターンであってもよい。また、ドット20は、例えば、染料、顔料等のインクで形成されたものであってもよいし、凹凸形状によるものであってもよい。
The
また、マーク21は、ドット20のような図柄を用いたものに限定されず、例えば、数字を含んでいてもよいし、ローマ字、アラビア文字、漢字等の文字を含んでいてもよいし、文字以外の記号、符号、しるし、標章、図案、1次元バーコード、QRコード(登録商標)等を含んでいてもよい。
Further, the
図2に示す第1検出部3aは、基台110内に設けられている第1撮像素子31aと、基台110が有する開口に設けられている第1光学系32aと、を有し、第1撮像素子31aが第1光学系32aを介してスケール部2の周方向DCの一部、具体的には図5の撮像領域RI1を撮像する。撮像領域RI1の画角は、複数のマーク21を同一画像内に捉えられる角度に設定されるのが好ましい。なお、必要に応じて、第1撮像素子31aの撮像領域RI1を照明する光源を設けてもよい。
The
第1撮像素子31aとしては、例えば、CCD(Charge Coupled Devices)、CMOS(Complementary Metal Oxide Semiconductor)等が挙げられる。このような第1撮像素子31aは、撮影された画像を画素ごとの電気信号に変換して出力する。第1撮像素子31aは、2次元撮像素子(エリアイメージセンサ)、あるいは1次元撮像素子(ラインイメージセンサ)のどちらであってもよい。1次元撮像素子は、画素の並びがアームの旋回円に接する方向に配置することが望ましい。2次元撮像素子を用いた場合は、情報量の多い2次元画像を生成でき、後述のテンプレートマッチングによるドット20の検出精度を高めやすい。その結果、第1アーム120の回動状態を高精度に検出することができる。1次元撮像素子を用いた場合は、画像のサンプリング周期いわゆるフレームレートが高いため、検出頻度を高めることが可能になり、高速動作時に有利である。なお、本実施形態では、第1撮像素子31aは、2次元撮像素子である。
Examples of the
第1光学系32aは、スケール部2と第1撮像素子31aとの間に配置されている結像光学系である。この第1光学系32aは、少なくとも物体側(スケール部2側)がテレセントリックであることが好ましい。これにより、スケール部2と第1撮像素子31aとの間の距離が変動しても、第1撮像素子31aへの結像倍率の変化を低減することができ、その結果、エンコーダー1の検出精度の低下を低減することができる。特に、第1光学系32aが両側テレセントリックである場合、第1光学系32aが有するレンズと第1撮像素子31aとの間の距離が変動しても、第1撮像素子31aへの結像倍率の変化を低減することができる。そのため、第1光学系32aの組み立てが容易になるという利点がある。
The first
ここで、図5に示すように、第1撮像素子31aの撮像領域RI1は、スケール部2の周方向DCにおける一部と重なるように設定されている。これにより、第1撮像素子31aは、撮像領域RI1内にあるドット20を撮像することができる。したがって、回路部4においてこのドット20を読み取ることにより、第1アーム120の回動状態を知ることができる。
Here, as shown in FIG. 5, the image pickup region RI1 of the first
一方、第2検出部3bは、回動軸である第1軸J1に対して第1検出部3aと対称となる位置に配置されている。第2検出部3bは、前述した第1検出部3aと同様に構成されている。すなわち、第2検出部3bは、基台110内に設けられている第2撮像素子31bと、基台110が有する開口に設けられている第2光学系32bと、を有し、第2撮像素子31bが第2光学系32bを介してスケール部2の周方向での一部、具体的には図6の撮像領域RI2を撮像する。
On the other hand, the second detection unit 3b is arranged at a position symmetrical to the
第2撮像素子31bは、第1撮像素子31aと同じ解像度でスケール部2を撮像することが好ましい。これにより、後述する方法でスケール部2の回動角を算出する際に、その計算が簡単となる。このような観点から、第2撮像素子31bは、第1撮像素子31aと同じサイズおよび画素数であることが好ましく、また、第2光学系32bは、第1光学系32aと同じ倍率であることが好ましい。
It is preferable that the
なお、対称となる位置とは、回動軸である第1軸J1に沿った方向から見たとき、第1軸J1を対称軸として第1撮像素子31aと第2撮像素子31bとが互いに点対称の関係を満たす位置のことをいう。ただし、この位置には、多少のずれが許容される。例えば、第1撮像素子31aの中心と第1軸J1とを結ぶ線分と、第2撮像素子31bの中心と第1軸J1とを結ぶ線分と、のなす角度は、前述した点対称の関係を完全に満たす場合には180°となるが、180±6°程度のずれは許容される。この程度のずれがあっても、本実施形態の効果を得ることができる。
The symmetrical position means that the
図2および図3に示す回路部4は、処理装置である処理部5(プロセッサー)と、ROM(Read only memory)、RAM(Random Access Memory)等の記憶部6(メモリー)と、を有する。ここで、記憶部6には、処理部5で読み取り可能な指示や情報が記憶されており、処理部5は、記憶部6から指示や情報を適宜読み取って実行することで、各種機能を実現する。このような回路部4は、例えば、マイコンやASIC(application specific integrated circuit)またはFPGA(field-programmable gate array)等を用いて構成することができる。特にASICまたはFPGAを用いて回路部4をハードウェア化することで、回路部4の高処理速度化、小型化および低コスト化を図ることができる。なお、回路部4の少なくとも一部は、前述したロボット100の制御装置に組み込まれていてもよい。
The
処理部5は、第1検出部3aおよび第2検出部3bの検出結果に基づいて、基台110および第1アーム120の相対的な回動状態を推定する。この回動状態としては、例えば、回動角度、回動速度、回動方向等が挙げられる。
The
特に、処理部5は、第1撮像素子31aおよび第2撮像素子31bの撮像画像に対してテンプレート画像を用いてテンプレートマッチングすることでユニークパターンUPを画像認識し、その認識結果を用いて、基台110に対する第1アーム120の相対的な回動状態を推定する。このように、第1撮像素子31aおよび第2撮像素子31bの双方の撮像画像を用いて回動状態を推定することで、減速機112の出力軸の回転に伴う軸振れ(偏心)に起因する検出誤差を低減することができる。これにより、第1撮像素子31aまたは第2撮像素子31bのいずれかのみを用いて回動状態を推定する場合に比べて、検出精度を高めることができる。なお、この点については、後に詳述する。
In particular, the
また、処理部5は、第1撮像素子31aおよび第2撮像素子31bの撮像画像内におけるユニークパターンUPの位置に基づいて、基台110に対する第1アーム120の相対的な回動角度をより細かく推定する機能を有する。さらに、処理部5は、ユニークパターンUPが検出される時間間隔およびユニークパターンUPの移動量に基づいて回動速度を求めたり、検出されるユニークパターンUPの種類の順序に基づいて回動方向を推定したりする機能も有する。そして、処理部5は、前述した推定結果に応じた信号、すなわち、基台110に対する第1アーム120の相対的な回動状態に応じた信号を出力する。この信号は、例えば、図示しない制御装置に入力され、ロボット100の動作の制御に用いられる。
Further, the
また、処理部5は、第1撮像素子31aの撮像画像および第2撮像素子31bの撮像画像の一部を切り取ってテンプレート画像を生成する機能を有する。このテンプレート画像の生成は、基台110に対する第1アーム120の相対的な回動状態を推定するのに先立って、あるいは、必要に応じて適時、基台110に対する第1アーム120の相対的な回動角度における所定の校正角ごとに行われる。そして、生成したテンプレート画像は、校正角ごとに対応して記憶部6に記憶される。そして、処理部5は、記憶部6に記憶されているテンプレート画像を用いて、テンプレートマッチングを行う。なお、テンプレートマッチングおよびそれを用いた回動状態の推定については、後に詳述する。
In addition, the
なお、処理部5は、基台110内に設けられた機器(内部機器)と基台110外に設けられた機器(外部機器)の双方を含む構成であってもよい。この場合、外部機器は、例えばパーソナルコンピューターで構成される。外部機器は、撮像画像の一部を切り取ってテンプレート画像を生成する機能を担うのが好ましい。この機能を外部機器に担わせることにより、内部機器の機能を簡素化することができ、基台110の小型化および低コスト化を図りやすくなる。
The
記憶部6には、処理部5で読み取り可能な指示(プログラム)の他、処理部5で読み取り可能な各種情報(データ)が記憶されている。具体的には、記憶部6には、基台110に対する第1アーム120の相対的な回動状態ごとに、前述した撮像画像が、撮像画像内でのユニークパターンUPの座標(基準座標)に関する情報、および、第1アーム120の回動角度に関する情報(角度情報)とともに記憶されている。このような記憶部6は、不揮発性メモリー、揮発性メモリーのいずれであってもよいが、電力を供給しなくても情報を記憶した状態を保持することができ、省電力化を図ることができるという観点から、不揮発性メモリーであることが好ましい。
In addition to instructions (programs) that can be read by the
2.2.角度検出方法
次に、第1実施形態に係る角度検出方法について説明する。
2.2. Angle detection method Next, the angle detection method according to the first embodiment will be described.
第1実施形態に係る角度検出方法は、テンプレート画像とそれに関する情報を取得するステップS1と、取得したテンプレート画像に基づいてスケール部2の回動角度を検出するステップS2と、を有する。かかる角度検出方法によれば、軸振れを伴う場合であっても、検出精度を高めることができる。
The angle detection method according to the first embodiment includes a step S1 for acquiring a template image and information related thereto, and a step S2 for detecting the rotation angle of the
図8は、第1実施形態に係る角度検出方法を示すフローチャートである。図9は、図8に示す角度検出方法のうち、ステップS1を詳細に示すフローチャートである。図10は、図9に示すステップS1を説明するための図である。図11は、図9に示す角度検出方法で取得される、校正角、テンプレート画像、基準座標、および、係数を示す一覧表である。 FIG. 8 is a flowchart showing the angle detection method according to the first embodiment. FIG. 9 is a flowchart showing step S1 in detail among the angle detection methods shown in FIG. FIG. 10 is a diagram for explaining step S1 shown in FIG. FIG. 11 is a list showing the calibration angle, the template image, the reference coordinates, and the coefficients acquired by the angle detection method shown in FIG.
ステップS1は、図9に示すように、ステップS101〜S118を含んでいる。以下、各ステップについて説明する。 Step S1 includes steps S101 to S118, as shown in FIG. Hereinafter, each step will be described.
2.2.1.テンプレート画像等の取得
図8に示すステップS1では、テンプレートマッチングを用いて基台110に対する第1アーム120の相対的な回動状態を推定するのに先立って、テンプレートマッチングに用いるテンプレート画像とそれに関する情報を含むデータセットを取得する。このテンプレート画像等の取得は、最初のテンプレートマッチングの前に1回行うだけでよいが、その後必要に応じて適時行ってもよい。その場合、テンプレートマッチングに用いるテンプレート画像を、新たに取得したテンプレート画像に更新することができる。
2.2.1. Acquisition of template image, etc. In step S1 shown in FIG. 8, prior to estimating the relative rotation state of the
このステップS1では、まず、ステップS101として、エンコーダー1の回動軸と図示しない校正用エンコーダーとを機械的に接続する。校正用エンコーダーは、エンコーダー1の回動軸の回動角度、すなわちスケール部2の回動角度を十分な高精度で検出する角度校正用のエンコーダーである。これにより、テンプレート画像に対し、高精度の角度情報を付与することができる。
In step S1, first, as step S101, the rotation shaft of the
次に、ステップS102として、エンコーダー1の回動軸を回動させ、スケール部2を開始角に合わせる。開始角は、特に限定されないが、スケール部2が含む複数のマーク21の1つを、第1撮像素子31aの撮像画像に捉えたときの回動角度とする。
Next, in step S102, the rotation shaft of the
ここで、校正用エンコーダーで検出したエンコーダー1の回動軸の回動角度、すなわちスケール部2の回動角度を校正角θ[i](第[i]校正角)とする。変数iは、周方向DCに沿ってマーク21に付した番号に相当する値であり、スケール部2に設けられたマーク21の個数n+1に対応して、0からnまでの整数をとる。
Here, the rotation angle of the rotation shaft of the
次に、ステップS103として、変数iを0とする。エンコーダー1の回動軸が前述した開始角にあるとき、第1撮像素子31aの撮像画像および第2撮像素子31bの撮像画像には、それぞれ、いずれかのマーク21が捉えられている。
Next, in step S103, the variable i is set to 0. When the rotation axis of the
次に、ステップS104として、校正用エンコーダーで検出した校正角θ[i]を記憶部6に記憶させる。ここでは、変数iとして0を設定しているため、校正角θ[0]を記憶させる。
Next, in step S104, the calibration angle θ [i] detected by the calibration encoder is stored in the
次に、ステップS105として、エンコーダー1の第1撮像素子31aにマーク21を撮像させる。これにより、撮像画像1[i](第1[i]基準画像)を生成する。ここでは、変数iとして0を設定しているため、撮像画像1[0]を生成する。撮像画像1[0]には、マーク21に含まれたユニークパターンUP(第1マーク)が捉えられている。また、エンコーダー1の第2撮像素子31bにマーク21を撮像させる。これにより、撮像画像2[i](第2[i]基準画像)を生成する。ここでは、変数iとして0を設定しているため、撮像画像2[0]を生成する。撮像画像2[0]にも、マーク21に含まれたユニークパターンUP(第2マーク)が捉えられている。生成した撮像画像1[0]および撮像画像2[0]は、記憶部6に一時的に記憶させる。
Next, in step S105, the
次に、ステップS106として、変数iが0より大きいか否かを判断する。変数iが0より大きい場合、ステップS107〜S109に移行する。変数iが0である場合、ステップS110〜S118に移行する。この時点では、変数iが0であるため、まず、ステップS110〜S118について説明し、ステップS107〜S109については、後述する。 Next, in step S106, it is determined whether or not the variable i is larger than 0. If the variable i is larger than 0, the process proceeds to steps S107 to S109. If the variable i is 0, the process proceeds to steps S110 to S118. Since the variable i is 0 at this point, steps S110 to S118 will be described first, and steps S107 to S109 will be described later.
ステップS110では、変数iがn以下であるか否かを判断する。この変数iがn以下である場合、後述するテンプレート画像の取得を引き続き進める必要があるため、ステップS111に移行する。変数iがnより大きい場合、つまり、n+1である場合、全てのマーク21について、テンプレート画像の取得を終了したことになるため、テンプレート画像の取得等についてのステップフローは終了する。なお、この時点では変数iが0であるため、以下の説明では、まず、ステップS111等について説明する。
In step S110, it is determined whether or not the variable i is n or less. If this variable i is n or less, it is necessary to continue to acquire the template image described later, so the process proceeds to step S111. When the variable i is larger than n, that is, when it is n + 1, it means that the acquisition of the template image is completed for all the
ステップS111では、記憶部6から撮像画像1[i](第1[i]基準画像)を読み出し、ユニークパターンUP(第1マーク)が欠けることなく含まれるように、撮像画像1[i]の切り出し位置を決定する。ここでは、変数iとして0を設定しているため、撮像画像1[0]の切り出し位置を決定する。
In step S111, the captured image 1 [i] (first [i] reference image) is read from the
ステップS112では、撮像画像1[i]における切り出し位置の左上端の座標を基準座標1[i](第1[i]基準座標)とする。ここでは、変数iとして0を設定しているため、図10に示すように、撮像画像1[i]における切り出し位置の左上端の座標を基準座標1[0](第1[0]基準座標)とする。 In step S112, the coordinates of the upper left end of the cutout position in the captured image 1 [i] are set as the reference coordinates 1 [i] (first [i] reference coordinates). Here, since 0 is set as the variable i, as shown in FIG. 10, the coordinates of the upper left end of the cutout position in the captured image 1 [i] are set to the reference coordinates 1 [0] (first [0] reference coordinates. ).
ステップS113では、撮像画像1[i]の基準座標1[i]に基づいて、ユニークパターンUPの画像を切り出す。これにより、テンプレート画像1[i](第1[i]テンプレート画像)を取得する。ここでは、変数iとして0を設定しているため、図10に示すように、テンプレート画像1[0](第1[0]テンプレート画像)を取得する。取得したテンプレート画像1[0]および基準座標1[0]は、記憶部6に記憶させる。一方、一時的に記憶されていた撮像画像1[i]は、これ以降、任意のタイミングで破棄するか、新たな撮像画像を生成したときに上書きされる。
In step S113, an image of the unique pattern UP is cut out based on the reference coordinate 1 [i] of the captured image 1 [i]. As a result, the template image 1 [i] (the first [i] template image) is acquired. Here, since 0 is set as the variable i, the template image 1 [0] (first [0] template image) is acquired as shown in FIG. The acquired template image 1 [0] and reference coordinates 1 [0] are stored in the
このように本実施形態では、テンプレート画像1[i]の取得に際し、ユニークパターンUPよりもサイズが大きい撮像画像1[i]から、ユニークパターンUPが欠けることなく含まれる領域を切り出し位置として選択し、そこから切り出した画像をテンプレート画像1[i]として採用するという方法を用いている。これにより、ユニークパターンUPの形成精度を必要以上に高めることなく、テンプレート画像1[i]を取得することができる。このため、スケール部2の形成が容易になるとともに、形成コストの低減を図ることができる。換言すれば、形成精度が低いスケール部2を用いた場合でも、テンプレート画像1[i]の取得に際して、低い形成精度を不問にすることができる。
As described above, in the present embodiment, when the template image 1 [i] is acquired, the region including the unique pattern UP is selected as the cutout position from the captured image 1 [i] having a size larger than that of the unique pattern UP. , The method of adopting the image cut out from the template image 1 [i] is used. As a result, the template image 1 [i] can be acquired without increasing the formation accuracy of the unique pattern UP more than necessary. Therefore, the
図10には、エンコーダー1の回動軸が校正角θ[0]にあるときに撮像された撮像画像1[0]の例が示されている。撮像画像1[0]で捉えられている複数のマーク21のうち、画像中心に近いものを選択し、そこからユニークパターンUP(第1マーク)を特定して、それが欠けることなく含まれる領域を切り出し位置とする。そして、撮像画像1[0]から、切り出し位置の左上端の座標を求め、これを基準座標1[0](第1[0]基準座標)として求める。また、切り出し位置に含まれるユニークパターンUPの画像を図11に示すようなテンプレート画像1[0]として切り出す。
FIG. 10 shows an example of the captured image 1 [0] captured when the rotation axis of the
ステップS114では、記憶部6から撮像画像2[i](第2[i]基準画像)を読み出し、ユニークパターンUP(第2マーク)が欠けることなく含まれるように、撮像画像2[i]の切り出し位置を決定する。ここでは、変数iとして0を設定しているため、撮像画像2[0]の切り出し位置を決定する。
In step S114, the captured image 2 [i] (second [i] reference image) is read from the
ステップS115では、撮像画像2[i]における切り出し位置の左上端の座標を基準座標2[i](第2[i]基準座標)とする。ここでは、変数iとして0を設定しているため、撮像画像2[0]における切り出し位置の左上端の座標を基準座標2[0](第2[0]基準座標)とする。 In step S115, the coordinates of the upper left end of the cutout position in the captured image 2 [i] are set as the reference coordinates 2 [i] (second [i] reference coordinates). Here, since 0 is set as the variable i, the coordinates of the upper left end of the cutout position in the captured image 2 [0] are set as the reference coordinates 2 [0] (second [0] reference coordinates).
ステップS116では、撮像画像2[i]の基準座標2[i]に基づいて、ユニークパターンUPの画像を切り出す。これにより、テンプレート画像2[i](第2[i]テンプレート画像)を取得する。ここでは、変数iとして0を設定しているため、テンプレート画像2[0](第2[0]テンプレート画像)を取得する。取得したテンプレート画像2[0]および基準座標2[0]は、記憶部6に記憶させる。一方、一時的に記憶されていた撮像画像2[i]は、これ以降、任意のタイミングで破棄するか、新たな撮像画像を生成したときに上書きされる。
In step S116, an image of the unique pattern UP is cut out based on the reference coordinate 2 [i] of the captured image 2 [i]. As a result, the template image 2 [i] (second [i] template image) is acquired. Here, since 0 is set as the variable i, the template image 2 [0] (second [0] template image) is acquired. The acquired template image 2 [0] and reference coordinates 2 [0] are stored in the
このように本実施形態では、テンプレート画像2[i]の取得に際し、ユニークパターンUPよりもサイズが大きい撮像画像2[i]から、ユニークパターンUPが欠けることなく含まれる領域を切り出し位置として選択し、そこから切り出した画像をテンプレート画像2[i]として採用するという方法を用いている。これにより、ユニークパターンUPの形成精度を必要以上に高めることなく、テンプレート画像2[i]を取得することができる。このため、スケール部2の形成が容易になるとともに、形成コストの低減を図ることができる。換言すれば、形成精度が低いスケール部2を用いた場合でも、テンプレート画像2[i]の取得に際して、低い形成精度を不問にすることができる。
As described above, in the present embodiment, when the template image 2 [i] is acquired, the region including the unique pattern UP is selected as the cutout position from the captured image 2 [i] having a size larger than that of the unique pattern UP. , The method of adopting the image cut out from the template image 2 [i] is used. As a result, the template image 2 [i] can be acquired without increasing the formation accuracy of the unique pattern UP more than necessary. Therefore, the
図10には、エンコーダー1の回動軸が校正角θ[0]にあるときに撮像された撮像画像2[0]の例が示されている。撮像画像2[0]に捉えられている複数のマーク21のうち、画像中心に近いものを選択し、そこからユニークパターンUP(第2マーク)を特定して、それが欠けることなく含まれる領域を切り出し位置とする。そして、撮像画像2[0]から、切り出し位置の左上端の座標を求め、これを基準座標2[0](第2[0]基準座標)として求める。また、切り出し位置に含まれるユニークパターンUPの画像を図11に示すようなテンプレート画像2[0]として切り出す。
FIG. 10 shows an example of the captured image 2 [0] captured when the rotation axis of the
次に、ステップS117では、エンコーダー1の回動軸を所定の角度進める。所定の角度とは、例えばマーク21の配置間隔に相当する角度であり、校正角θ[i]において撮像画像1[i]の中心付近に捉えたマーク21と、それに隣り合うマーク21と、の離角に相当する角度とされる。これにより、第1撮像素子31aおよび第2撮像素子31bでは、隣のマーク21、すなわち後述する校正角θ[i2]に対応するマーク21を視野に捉えることができる。
Next, in step S117, the rotation axis of the
次に、ステップS118では、変数iとしてi+1を設定する(変数iを更新する)。ここでは、更新前の変数iと更新後の変数iとを区別するため、更新後の変数iを「i2」と表記する。なお、各フローチャートでは、図示の便宜上、更新前および更新後を区別することなく変数iを使用している。 Next, in step S118, i + 1 is set as the variable i (the variable i is updated). Here, in order to distinguish between the variable i before the update and the variable i after the update, the variable i after the update is referred to as “i2”. In each flowchart, the variable i is used without distinguishing between before and after the update for convenience of illustration.
本ステップS118の直前では、変数iとして0を設定していたので、本ステップS118では変数i2として1が設定されることになる。ステップS118が終了すると、ステップフローは、ステップS104に戻る。 Immediately before this step S118, 0 was set as the variable i, so in this step S118, 1 is set as the variable i2. When step S118 is completed, the step flow returns to step S104.
2回目のステップS104でも、記憶部6に校正角θ[i2](第[i2]校正角)を記憶させる。ここでは、変数i2として1を設定しているため、校正角θ[1]を記憶させる。
Also in the second step S104, the
2回目のステップS105でも、第1撮像素子31aにマーク21を撮像させる。これにより、撮像画像1[i2](第1[i2]基準画像)を生成する。ここでは、変数i2として1を設定しているため、撮像画像1[1]を生成する。また、第2撮像素子31bにマーク21を撮像させる。これにより、撮像画像2[i2](第2[i2]基準画像)を生成する。ここでは、変数i2として1を設定しているため、撮像画像2[1]を生成する。生成した撮像画像1[1]および撮像画像2[1]は、記憶部6に一時的に記憶させる。
Also in the second step S105, the
2回目のステップS106でも、変数i2が0より大きいか否かを判断する。変数i2が0より大きい場合、ステップS107〜S109に移行する。この説明の例では、この時点で変数i2が1であるため、以下、ステップS107〜S109について説明する。 Also in the second step S106, it is determined whether or not the variable i2 is larger than 0. If the variable i2 is larger than 0, the process proceeds to steps S107 to S109. In the example of this explanation, since the variable i2 is 1 at this point, steps S107 to S109 will be described below.
ステップS107では、記憶部6からテンプレート画像1[i2−1]を読み出し、生成した撮像画像1[i2]に対してテンプレートマッチングを行う。そうすると、撮像画像1[i2]において、テンプレート画像1[i2−1]と合致するユニークパターンUP(第1マーク)が捉えられるので、捉えたユニークパターンUPの左上端の座標を、合致座標1[i2−1]とする。ここでは、変数i2として1を設定しているため、テンプレート画像1[0]を読み出し、生成した撮像画像1[1]に対してテンプレートマッチングを行う。そうすると、図10に示すように合致座標1[0]が求められる。求めた合致座標1[0]を、記憶部6に一時的に記憶させる。
In step S107, the template image 1 [i2-1] is read out from the
ステップS108では、記憶部6からテンプレート画像2[i2−1]を読み出し、生成した撮像画像2[i2]に対してテンプレートマッチングを行う。そうすると、撮像画像2[i2]において、テンプレート画像2[i2−1]と合致するユニークパターンUP(第2マーク)が捉えられるので、捉えたユニークパターンUPの左上端の座標を、合致座標2[i2−1]とする。ここでは、変数i2として1を設定しているため、テンプレート画像2[0]を読み出し、生成した撮像画像2[1]に対してテンプレートマッチングを行う。そうすると、図10に示すように合致座標2[0]が求められる。
In step S108, the template image 2 [i2-1] is read out from the
なお、ステップS107、S108では、テンプレートマッチングを行う際、サブピクセル推定という処理を行うようにしてもよい。サブピクセル推定によれば、テンプレートマッチングによってユニークパターンUPの位置を推定する際、1画素以下の単位で位置を推定することができる。その結果、合致座標1[i2−1]および合致座標2[i2−1]をより高精度に求めることができる。 In steps S107 and S108, a process called sub-pixel estimation may be performed when performing template matching. According to the sub-pixel estimation, when the position of the unique pattern UP is estimated by template matching, the position can be estimated in units of one pixel or less. As a result, the matching coordinates 1 [i2-1] and the matching coordinates 2 [i2-1] can be obtained with higher accuracy.
ステップS109では、求めた合致座標1[i2−1]と、記憶部6に記憶させておいた基準座標1[i2−1]と、の差を求める。この差は、エンコーダー1の回動軸が校正角θ[i2−1](第[i2−1]校正角)から校正角θ[i2](第[i2]校正角)へと回動したときの、撮像画像1[i2]におけるユニークパターンUPの移動量に相当する。そして、求めた差を、移動量1[i2−1](第1[i2−1]基準移動量)とする。ここでは、変数i2として1を設定しているので、図10に示すように、合致座標1[0]と、記憶部6に記憶させておいた基準座標1[0]と、の差を求める。そして、求めた差を、移動量1[0]とする。
In step S109, the difference between the obtained matching coordinates 1 [i2-1] and the reference coordinates 1 [i2-1] stored in the
これと同様に、求めた合致座標2[i2−1]と、記憶部6に記憶させておいた基準座標2[i2−1]と、の差を求める。この差は、エンコーダー1の回動軸が校正角θ[i2−1](第[i2−1]校正角)から校正角θ[i2](第[i2]校正角)へと回動したときの、撮像画像2[i2]におけるユニークパターンUPの移動量に相当する。そして、求めた差を、移動量2[i2−1](第2[i2−1]基準移動量)とする。ここでは、変数i2として1を設定しているので、図10に示すように、合致座標2[0]と、記憶部6に記憶させておいた基準座標2[0]と、の差を求める。そして、求めた差を、移動量2[0]とする。
Similarly to this, the difference between the obtained matching coordinates 2 [i2-1] and the reference coordinates 2 [i2-1] stored in the
そして、校正角θ[i2−1](第[i2−1]校正角)、校正角θ[i2](第[i2]校正角)、移動量1[i2−1](第1[i2−1]基準移動量)、および、移動量2[i2−1](第2[i2−1]基準移動量)、の間に成り立つ相関関係を求め、記憶部6に記憶させる。この相関関係は、スケール部2の回動角度と撮像画像内の距離との相関関係を示すものであり、どのような形態で表されたものであってもよいが、後述するステップS2において、移動量から回動角度を逆算することができる形態とされる。
Then, the calibration angle θ [i2-1] (the [i2-1] calibration angle), the calibration angle θ [i2] (the [i2] calibration angle), the movement amount 1 [i2-1] (the first [i2-]). 1] Reference movement amount) and movement amount 2 [i2-1] (second [i2-1] reference movement amount) are obtained, and stored in the
ここで、移動量1[i2−1]を算出するのに用いた撮像画像1[i2−1]、および、移動量2[i2−1]を算出するのに用いた撮像画像2[i2−1]は、エンコーダー1の回動軸が互いに同じ回動角度(校正角θ[i2−1])にあるタイミングで生成された画像である。エンコーダー1の回動軸が互いに同じ回動角度にあるタイミングとは、撮像画像1[i2−1]を撮像するときの回動角度と、撮像画像2[i2−1]を撮像するときの回動角度と、が同じであるタイミングということである。
Here, the captured image 1 [i2-1] used to calculate the movement amount 1 [i2-1] and the captured image 2 [i2-] used to calculate the movement amount 2 [i2-1]. 1] is an image generated at the timing when the rotation axes of the
同様に、移動量1[i2−1]を算出するのに用いた撮像画像1[i2]、および、移動量2[i2−1]を算出するのに用いた撮像画像2[i2]も、エンコーダー1の回動軸が互いに同じ回動角度(校正角θ[i2])にあるタイミングで生成された画像である。この場合も、前述したように、エンコーダー1の回動軸が互いに同じ回動角度にあるタイミングとは、撮像画像1[i2]を撮像するときの回動角度と、撮像画像2[i2]を撮像するときの回動角度と、が同じであるタイミングということである。
Similarly, the captured image 1 [i2] used to calculate the movement amount 1 [i2-1] and the captured image 2 [i2] used to calculate the movement amount 2 [i2-1] are also This is an image generated at the timing when the rotation axes of the
なお、エンコーダー1の回動軸が停止している場合には、撮像画像1[i2−1]を撮像する時刻と、撮像画像2[i2−1]を撮像する時刻と、が異なっていてもよく、同様に、撮像画像1[i2]を撮像する時刻と、撮像画像2[i2]を撮像する時刻と、が異なっていてもよいが、これらは好ましくは同時とされる。
When the rotation axis of the
また、撮像画像1[i2−1]および撮像画像1[i2]を撮像する第1撮像素子31aと、撮像画像2[i2−1]および撮像画像2[i2]を撮像する第2撮像素子31bは、前述したように、回動軸である第1軸J1に対して互いに対称(点対称)となる位置に配置されている。
In addition, the
このような条件を満たすことにより、撮像画像1[i2−1]および撮像画像2[i2−1]、ならびに、撮像画像1[i2]および撮像画像2[i2]は、それぞれ、エンコーダー1の回動軸が軸振れを伴っていたとしても、並進方向が互いに逆で、かつ、並進長さが互いに等しい、という軸並進成分を含んだものとなる。したがって、撮像画像1[i2−1]および撮像画像1[i2]から求められた移動量1[i2−1]、ならびに、撮像画像2[i2−1]および撮像画像2[i2]から求められた移動量2[i2−1]には、エンコーダー1の回動軸が校正角θ[i2−1]から校正角θ[i2]に変化する間に生じた軸並進成分の変化が、並進方向が互いに逆で、かつ、並進長さが互いに等しい、という関係を満たしつつ反映されていることになる。
By satisfying such conditions, the captured image 1 [i2-1] and the captured image 2 [i2-1], and the captured image 1 [i2] and the captured image 2 [i2] are each rotated by the
したがって、本ステップS109で相関関係を求めるにあたって、移動量1[i2−1]および移動量2[i2−1]を用いることにより、軸並進成分の影響を減少または相殺することができる。その結果、後述するステップS2において移動量から回動角度を逆算する際、軸並進成分の影響が低減または除去される、換言すれば、軸回転成分のみが抽出されることになり、誤差の少ない回動角度を算出することができる。つまり、このような軸並進成分の影響を低減または除去し得る相関関係を本ステップS109であらかじめ求めておくことにより、後述するステップS2では、この相関関係に基づいて、より短時間で精度の高い回動角度を求めることができる。また、それに伴い、検出する回動角度の分解能を高めることも容易になる。 Therefore, by using the movement amount 1 [i2-1] and the movement amount 2 [i2-1] in obtaining the correlation in this step S109, the influence of the axial translation component can be reduced or offset. As a result, when the rotation angle is calculated back from the movement amount in step S2 described later, the influence of the shaft translation component is reduced or eliminated, in other words, only the shaft rotation component is extracted, and there is little error. The rotation angle can be calculated. That is, by obtaining in advance a correlation capable of reducing or eliminating the influence of such an axial translation component in this step S109, in step S2 described later, based on this correlation, the accuracy is higher in a shorter time. The rotation angle can be obtained. Along with this, it becomes easy to improve the resolution of the rotation angle to be detected.
以上のように、前述した相関関係を求めるステップS1は、スケール部2が校正角θ[i2](第[i2]校正角)にあるとき、第1撮像素子31aに第1マークを含むマーク21を撮像させて撮像画像1[i2](第1[i2]基準画像)を生成し、テンプレート1[i2−1](第1[i2−1]テンプレート画像)に基づくテンプレートマッチングにより、撮像画像1[i2]における第1マークの基準座標1[i2−1](第1[i2−1]基準座標)からの移動量1[i2−1](第1[i2−1]移動量)を求めるステップS107と、スケール部2が校正角θ[i2](第[i2]校正角)にあるとき、第2撮像素子31bに第2マークを含むマーク21を撮像させて撮像画像2[i2](第2[i2]基準画像)を生成し、テンプレート2[i2−1](第2[i2−1]テンプレート画像)に基づくテンプレートマッチングにより、撮像画像2[i2]における第2マークの基準座標2[i2−1](第2[i2−1]基準座標)からの移動量2[i2−1](第2[i2−1]移動量)を求めるステップS108と、を含んでいる。
As described above, in step S1 for obtaining the correlation described above, when the
一例として、この相関関係は、校正角θ[i2](第[i2]校正角)と校正角θ[i2−1](第[i2−1]校正角)との差、および、移動量1[i2−1](第1[i2−1]基準移動量)と移動量2[i2−1](第2[i2−1]基準移動量)との和、の間に成り立つ相関関係とされる。移動量1[i2−1]と移動量2[i2−1]との和を含むことにより、少ない計算量で、軸並進成分を減少または相殺し得る相関関係を導くことができる。このため、かかる相関関係を反映させることによって、回動角度を算出する際の演算負荷を軽減し、高速化を図ることができる。
As an example, this correlation is the difference between the calibration angle θ [i2] (the [i2] calibration angle) and the calibration angle θ [i2-1] (the [i2-1] calibration angle), and the amount of
また、相関関係の具体的な形態としては、例えば、移動量1[i2−1](第1[i2−1]基準移動量)と移動量2[i2−1](第2[i2−1]基準移動量)との和、に対する、校正角θ[i2](第[i2]校正角)と校正角θ[i2−1](第[i2−1]校正角)との差、の比として求められる係数[i2−1]が挙げられる。相関関係の形態としては、例えば前述した和と差に基づいて移動量から回動角度を求める一覧表(計算テーブル)という形態も考えられるが、この場合、回動角度の算出に時間を要する場合もある。これに対し、このような係数[i2−1]を算出し、記憶部6に記憶させておくことにより、後述するステップS2において移動量から回動角度を逆算する際、計算の高速化を図ることができる。
Further, as specific forms of the correlation, for example, the movement amount 1 [i2-1] (first [i2-1] reference movement amount) and the movement amount 2 [i2-1] (second [i2-1]). ] Reference movement amount), and the ratio of the difference between the calibration angle θ [i2] (the [i2] calibration angle) and the calibration angle θ [i2-1] (the [i2-1] calibration angle). The coefficient [i2-1] obtained as the above can be mentioned. As a form of correlation, for example, a list (calculation table) for obtaining the rotation angle from the movement amount based on the sum and difference described above can be considered, but in this case, when it takes time to calculate the rotation angle. There is also. On the other hand, by calculating such a coefficient [i2-1] and storing it in the
係数[i2−1]は、例えば、以下の式で求められる。 The coefficient [i2-1] is obtained by, for example, the following equation.
なお、ここでは、変数i2として1を設定しているため、係数[0]は、図11に示す式で求められる。 Since 1 is set as the variable i2 here, the coefficient [0] is obtained by the formula shown in FIG.
ステップS109の終了後、ステップS110に移行する。
ステップS110では、前述したように、変数i2がn以下であるか否かを判断する。ここでは、変数i2が1であるため、ステップS111に移行する。そして、これ以降は、上述したステップS111〜S118と同様にしてステップフローを進めた後、ステップS104に戻る。なお、ステップS118では、変数i2としてi2+1を設定する(変数i2を更新する)。更新後の変数i2を「i3」と表記する。
After the end of step S109, the process proceeds to step S110.
In step S110, as described above, it is determined whether or not the variable i2 is n or less. Here, since the variable i2 is 1, the process proceeds to step S111. After that, the step flow is advanced in the same manner as in steps S111 to S118 described above, and then the process returns to step S104. In step S118, i2 + 1 is set as the variable i2 (the variable i2 is updated). The updated variable i2 is referred to as "i3".
以降、同様にして、3回目のステップS104〜S106、および、2回目のステップS107〜S109を行い、係数[i3−1]を求めることができる。 Subsequently, in the same manner, the third steps S104 to S106 and the second steps S107 to S109 can be performed to obtain the coefficient [i3-1].
さらにその後、同様にして、係数[i4−1]、係数[i5−1]、・・・、係数[i(n+1)−1]を求めることができる。これにより、全てのマーク21について、係数による相関関係を求め、記憶部6に記憶することができる。そして、これらの相関関係を用いることにより、後述するステップS2において、エンコーダー1の回動軸の回動角度によらず、精度の高い回動角度を求めることができる。
After that, the coefficient [i4-1], the coefficient [i5-1], ..., The coefficient [i (n + 1) -1] can be obtained in the same manner. As a result, for all the
その後、再び、ステップS110に移行する。ステップS110では、前述したように、変数i(n+2)がn以下であるか否かを判断する。全てのマーク21について相関関係を求めた後では、変数i(n+2)としてn+1が設定されているため、図9に示すステップフローを終了する。このとき、校正用エンコーダーは不要となるため、ステップS110の判断後、校正用エンコーダーを取り外す(ステップS120)。
After that, the process proceeds to step S110 again. In step S110, as described above, it is determined whether or not the variable i (n + 2) is n or less. After obtaining the correlation for all the
以上のようにして、後述するステップS2で回動角度を検出するために必要な校正角、テンプレート画像、基準座標および係数で構成されるデータセットを得ることができる。 As described above, it is possible to obtain a data set composed of the calibration angle, the template image, the reference coordinates, and the coefficients necessary for detecting the rotation angle in step S2 described later.
2.2.2.回動角度の検出
図8に示すステップS2では、ステップS1で取得したデータセットを用いて、スケール部2の回動角度θを検出する。
2.2.2. Detection of rotation angle In step S2 shown in FIG. 8, the rotation angle θ of the
ステップS2は、図8に示すように、ステップS201〜S205を含んでいる。以下、各ステップについて説明する。 Step S2 includes steps S201-S205, as shown in FIG. Hereinafter, each step will be described.
このステップS2では、まず、ステップS201として、スケール部2が未知の回動角度θ(計測角)にあるとき、第1撮像素子31aにマーク21を撮像させる。これにより、測角画像1(第1測角画像)を生成する。生成した測角画像1は、記憶部6に記憶させる。
In step S2, first, in step S201, when the
次に、ステップS202として、スケール部2がステップS201と同じ回動角度θ(計測角)にあるとき、第2撮像素子31bにマーク21を撮像させる。これにより、測角画像2(第2測角画像)を生成する。生成した測角画像2は、記憶部6に記憶させる。
Next, in step S202, when the
なお、ステップS1と同様、測角画像1および測角画像2は、スケール部2が同じ回動軸の回動角度θ(計測角)にあるときに撮像された画像とされ、好ましくは同時に撮像された画像とされる。また、回動角度θは、校正角θ[i]と校正角θ[i2]との間にあるものとする。
As in step S1, the
次のステップS203では、記憶部6から測角画像1およびステップS1で取得したテンプレート画像1[i]を読み出し、測角画像1に対してテンプレートマッチングを行う。なお、テンプレートマッチングの際には、必要に応じて、サブピクセル推定を行う。テンプレートマッチングを行うことにより、測角画像1において、テンプレート画像1[i]と合致するユニークパターンUP(第1マーク)が捉えられるので、捉えたユニークパターンUPの左上端の座標を、測角合致座標1とする。求めた測角合致座標1は、記憶部6に記憶させる。
In the next step S203, the
次のステップS204では、記憶部6から測角画像2およびステップS1で取得したテンプレート画像2[i]を読み出し、測角画像2に対してテンプレートマッチングを行う。なお、テンプレートマッチングの際には、必要に応じて、サブピクセル推定を行う。テンプレートマッチングを行うことにより、測角画像2において、テンプレート画像2[i]と合致するユニークパターンUP(第2マーク)が捉えられるので、捉えたユニークパターンUPの左上端の座標を、測角合致座標2とする。求めた測角合致座標2は、記憶部6に記憶させる。
In the next step S204, the
次のステップS205では、記憶部6から測角合致座標1および測角合致座標2を読み出す。また、ステップS1で取得した、テンプレート画像1[i]に対応する基準座標1[i]およびテンプレート画像2[i]に対応する基準座標2[i]を読み出す。そして、次の計算式に基づいて、移動量1(第1測角移動量)および移動量2(第2測角移動量)を算出する。
In the next step S205, the angle-measurement matching coordinates 1 and the angle-measurement matching coordinates 2 are read out from the
移動量1=測角合致座標1−基準座標1[i]
移動量2=測角合致座標2−基準座標2[i]
この移動量1および移動量2は、スケール部2が校正角θ[i]から回動角度θへと回動したときの、測角画像1および測角画像2におけるユニークパターンUPの各移動量に相当する。
The
ここで、移動量1を算出するのに用いた測角画像1、および、移動量2を算出するのに用いた測角画像2は、前述したように、スケール部2が互いに同じ回動角度θ(計測角)にあるタイミングで生成された画像である。したがって、測角画像1および測角画像2は、スケール部2が軸振れを伴っていたとしても、並進方向が互いに逆で、かつ、並進長さが互いに等しい、という軸並進成分を含んだものとなる。したがって、移動量1および移動量2を用いて、後述する手順で回動角度θを算出することにより、軸並進成分の影響が低減または除去され、誤差の少ない回動角度θを算出することができる。つまり、より短時間で精度の高い回動角度θを求めることができる。また、それに伴い、検出する回動角度θの分解能を高めることも容易になる。
Here, in the
続いて、ステップS205では、記憶部6から係数[i]を読み出す。そして、以下の式により、回動角度θを算出する。
回動角度θ=校正角θ[i]+(移動量1+移動量2)×係数[i]
Subsequently, in step S205, the coefficient [i] is read from the
Rotation angle θ = Calibration angle θ [i] + (
以上のようにして、回動角度θを算出することができる。算出した回動角度θは、回路部4から出力され、例えばロボット100の制御装置においてアームの駆動制御に用いられる。なお、本実施形態では、ステップS2において生成した測角画像を記憶部6に記憶させた後、テンプレートマッチングを用いて測角合致座標を取得する例を示したが、処理部5に複数の処理装置を設け、各撮像素子から処理部5に測角画素が転送される度に処理部5がテンプレートマッチング処理を行い、測角画像の生成と測角合致座標の取得を並列処理させることが好ましい。
As described above, the rotation angle θ can be calculated. The calculated rotation angle θ is output from the
以上のように、本実施形態に係る角度検出方法は、スケール部2と第1撮像素子31aと第2撮像素子31bとを有するエンコーダー1を用いて、回動軸の回動角度を検出する方法である。このうち、スケール部2は、回動軸である第1軸J1まわりに環状に並ぶ第1マークおよび第2マークを含む複数のマーク21を有する。また、第1撮像素子31aは、第1マークを撮像する素子であり、第2撮像素子31bは、第1軸J1に対して第1撮像素子31aと対称の位置に配置され、第2マークを撮像する素子である。そして、エンコーダー1は、第1撮像素子31aおよび第2撮像素子31bに対してスケール部2が回動軸まわりに相対的に回動するように構成されている。
As described above, the angle detection method according to the present embodiment is a method of detecting the rotation angle of the rotation shaft by using the
このような角度検出方法は、前述したステップS101〜S118を含むステップS1と、前述したステップS201〜S205を含むステップS2と、を有する。
このうち、ステップS104、S105、S111〜S113は、スケール部2が校正角θ[i](第[i]校正角)にあるとき、第1撮像素子31aに第1マークを撮像させて撮像画像1[i](第1[i]基準画像)を生成し、テンプレート画像1[i](第1[i]テンプレート画像)および撮像画像1[i]における第1マークの基準座標1[i](第1[i]基準座標)を取得するステップである。
Such an angle detection method includes a step S1 including the above-mentioned steps S101 to S118 and a step S2 including the above-mentioned steps S201 to S205.
Of these, in steps S104, S105, and S111 to S113, when the
ステップS104、S105、S114〜S116は、スケール部2が校正角θ[i](第[i]校正角)にあるとき、第2撮像素子31bに第2マークを撮像させて撮像画像2[i](第2[i]基準画像)を生成し、テンプレート画像2[i](第2[i]テンプレート画像)および撮像画像2[i]における第2マークの基準座標2[i](第2[i]基準座標)を取得するステップである。
In steps S104, S105, and S114 to S116, when the
ステップS104〜S109、S118は、スケール部2の回動角度と撮像画像内の距離との相関関係として、校正角θ[i2−1]を校正角θ[i2]に変化させたとき、その変化量(校正角θ[i2]と校正角θ[i2−1]との差)と、第1マークの移動量(移動量1[i2−1])と、第2マークの移動量(移動量2[i2−1])と、の間に成り立つ相関関係を求めるステップである。
Steps S104 to S109 and S118 change the calibration angle θ [i2-1] to the calibration angle θ [i2] as a correlation between the rotation angle of the
ステップS201、S203、S205は、スケール部2が回動角度θ(計測角)にあるとき、第1撮像素子31aに第1マークを撮像させて測角画像1(第1測角画像)を生成する。そして、テンプレート画像1[i](第1[i]テンプレート画像)に基づくテンプレートマッチングにより、測角画像1における第1マークの、基準座標1[i](第1[i]基準座標)からの移動量である第1測角移動量を求めるステップである。
In steps S201, S203, and S205, when the
ステップS202、S204、S205は、スケール部2が回動角度θ(計測角)にあるとき、第2撮像素子31bに第2マークを撮像させて測角画像2(第2測角画像)を生成する。そして、テンプレート画像2[i](第2[i]テンプレート画像)に基づくテンプレートマッチングにより、測角画像2における第2マーク、の基準座標2[i](第2[i]基準座標)からの移動量である第2測角移動量を求めるステップである。
In steps S202, S204, and S205, when the
そして、ステップS205は、校正角θ[i](第[i]校正角)、第1測角移動量、第2測角移動量、および前述した相関関係に基づいて、回動角度θを求めるステップである。 Then, in step S205, the rotation angle θ is obtained based on the calibration angle θ [i] (the [i] calibration angle), the first angle measurement movement amount, the second angle measurement movement amount, and the above-mentioned correlation. It's a step.
このような角度検出方法では、スケール部2が互いに同じ校正角にあるときに撮像された画像に基づいて第1マークの移動量および第2マークの移動量を算出し、これらの移動量と校正角の変化との相関関係を利用して、回動角度θを求めている。また、この画像を撮像するのに用いた第1撮像素子31aおよび第2撮像素子31bは、回動軸である第1軸J1に対して互いに対称の位置に配置されている。このため、第1マークの移動量および第2マークの移動量は、並進方向が互いに逆で、かつ、並進長さが互いに等しい、という軸並進成分を含んだものとなる。したがって、これらの移動量と校正角との間の相関関係をあらかじめ導いておくことにより、回動角度θの計測時には、軸並進成分の影響を低減または除去した、精度の高い回動角度θを求めることができる。
In such an angle detection method, the movement amount of the first mark and the movement amount of the second mark are calculated based on the images captured when the
また、この方法では、従来のように、あらかじめ求めた偏心因子を用いて角度誤差を取り除く方法ではないため、例えば減速機112として動的な偏心が生じる減速機を使用したとしても、軸並進成分の影響を低減または除去することができ、精度の高い回動角度θを求めることができる。つまり、あらかじめ決めた偏心因子を用いて算出する方法ではないため、動的に偏心量が変化する減速機を使用した場合でも、回動角度θを精度よく求めることができる。
Further, since this method is not a method of removing the angle error by using an eccentricity factor obtained in advance as in the conventional method, for example, even if a speed reducer in which dynamic eccentricity is generated is used as the
さらに、この方法では、テンプレート画像1[i]の取得に際し、ユニークパターンUPよりもサイズが大きい撮像画像1[i]から、ユニークパターンUPが欠けることなく含まれる領域を切り出し位置として選択し、そこから切り出した画像をテンプレート画像1[i]として採用するという方法を用いている。これにより、ユニークパターンUPの形成精度を必要以上に高めることなく、テンプレート画像1[i]を取得することができる。このため、スケール部2の形成が容易になるとともに、形成コストの低減を図ることができる。換言すれば、形成精度が低いスケール部2を用いた場合でも、テンプレート画像1[i]の取得に際して、低い形成精度を不問にすることができる。テンプレート画像2[i]の取得に際しても、これと同様の効果が得られる。
Further, in this method, when acquiring the template image 1 [i], a region including the unique pattern UP without being missing is selected as a cutout position from the captured image 1 [i] having a size larger than that of the unique pattern UP. The method of adopting the image cut out from the above as the template image 1 [i] is used. As a result, the template image 1 [i] can be acquired without increasing the formation accuracy of the unique pattern UP more than necessary. Therefore, the
また、本実施形態に係るエンコーダーユニット10は、エンコーダー1と処理部5と記憶部6とを有する。このうち、エンコーダー1は、スケール部2と第1撮像素子31aと第2撮像素子31bとを有しており、第1撮像素子31aおよび第2撮像素子31bに対してスケール部2が回動軸まわりに相対的に回動するように構成されている。スケール部2は、回動軸である第1軸J1まわりに環状に並ぶ第1マークおよび第2マークを含む複数のマーク21を有する。第1撮像素子31aは、第1マークを撮像する素子であり、第2撮像素子31bは、第1軸J1に対して第1撮像素子31aと対称の位置に配置され、第2マークを撮像する素子である。処理部5は、第1撮像素子31aの撮像結果および第2撮像素子31bの撮像結果に基づいて、エンコーダー1の回動軸の回動角度を求める処理を実行する。記憶部6は、処理部5で読み取り可能な指示を記憶する。
Further, the
このようなエンコーダーユニット10では、スケール部2が校正角θ[i](第[i]校正角)にあるとき、第1撮像素子31aに第1マークを撮像させて撮像画像1[i](第1[i]基準画像)を生成し、テンプレート画像1[i](第1[i]テンプレート画像)および撮像画像1[i]における第1マークの基準座標1[i](第1[i]基準座標)を取得する。
In such an
また、エンコーダーユニット10は、スケール部2が校正角θ[i](第[i]校正角)にあるとき、第2撮像素子31bに第2マークを撮像させて撮像画像2[i](第2[i]基準画像)を生成し、テンプレート画像2[i](第2[i]テンプレート画像)および撮像画像2[i]における第2マークの基準座標2[i](第2[i]基準座標)を取得する。
Further, in the
さらに、エンコーダーユニット10は、スケール部2の回動角度と撮像画像内の距離との相関関係として、校正角θ[i2−1]を校正角θ[i2]に変化させたとき、その変化量(校正角θ[i2]と校正角θ[i2−1]との差)と、第1マークの移動量(移動量1[i2−1])と、第2マークの移動量(移動量2[i2−1])と、の間に成り立つ相関関係を求める。
Further, the
また、エンコーダーユニット10は、スケール部2が回動角度θ(計測角)にあるとき、第1撮像素子31aに第1マークを撮像させて測角画像1(第1測角画像)を生成する。そして、テンプレート画像1[i](第1[i]テンプレート画像)に基づくテンプレートマッチングにより、測角画像1における第1マークの、基準座標1[i](第1[i]基準座標)からの移動量である第1測角移動量を求める。
Further, when the
さらに、エンコーダーユニット10は、スケール部2が回動角度θ(計測角)にあるとき、第2撮像素子31bに第2マークを撮像させて測角画像2(第2測角画像)を生成する。そして、テンプレート画像2[i](第2[i]テンプレート画像)に基づくテンプレートマッチングにより、測角画像2における第2マーク、の基準座標2[i](第2[i]基準座標)からの移動量である第2測角移動量を求める。
Further, when the
また、エンコーダーユニット10は、校正角θ[i]、第1測角移動量、第2測角移動量、および前述した相関関係に基づいて、回動角度θを求める。
Further, the
このようなエンコーダーユニット10では、スケール部2が互いに同じ校正角にあるときに撮像された画像に基づいて第1マークの移動量および第2マークの移動量を算出し、これらの移動量と校正角の変化との相関関係を利用して、回動角度θを求めている。また、この画像を撮像するのに用いた第1撮像素子31aおよび第2撮像素子31bは、回動軸である第1軸J1に対して互いに対称の位置に配置されている。このため、第1マークの移動量および第2マークの移動量は、並進方向が互いに逆で、かつ、並進長さが互いに等しい、という軸並進成分を含んだものとなる。したがって、これらの移動量と校正角との間の相関関係をあらかじめ導いておくことにより、回動角度θの計測時には、軸並進成分の影響を低減または除去した、精度の高い回動角度θを求めることができる。
In such an
また、本実施形態に係るロボット100は、第1部材である基台110と、基台110に対して回動する第2部材である第1アーム120と、エンコーダーユニット10と、を備えている。そして、スケール部2が第1アーム120に設けられ、第1撮像素子31aおよび第2撮像素子31bが基台110に設けられている。
Further, the
このようなロボット100によれば、エンコーダーユニット10において検出される第1アーム120の回動角度の精度が高いため、第1アーム120を高精度に制御することができる。これにより、より正確で繊細な作業を行い得る信頼性の高いロボット100を実現することができる。
According to such a
3.第2実施形態
次に、第2実施形態に係る角度検出方法について説明する。
3. 3. Second Embodiment Next, the angle detection method according to the second embodiment will be described.
図12は、第2実施形態に係る角度検出方法のうち、ステップS1を詳細に示すフローチャートである。図13は、図12に示す角度検出方法で取得される、校正角、テンプレート画像、基準座標、および、係数を示す一覧表である。 FIG. 12 is a flowchart showing step S1 in detail in the angle detection method according to the second embodiment. FIG. 13 is a list showing the calibration angle, the template image, the reference coordinates, and the coefficients acquired by the angle detection method shown in FIG.
以下、第2実施形態について説明するが、以下の説明では、第1実施形態との相違点を中心に説明し、同様の事項についてはその説明を省略する。また、図12および図13において、前記第1実施形態と同様の構成については、同一の符号を付している。 Hereinafter, the second embodiment will be described, but in the following description, the differences from the first embodiment will be mainly described, and the same matters will be omitted. Further, in FIGS. 12 and 13, the same reference numerals are given to the same configurations as those in the first embodiment.
第2実施形態は、校正角とマークの移動量との相関関係を示す係数が異なる以外、第1実施形態と同様である。具体的には、前述した第1実施形態では、校正角ごとに係数を算出し、回動角度θの算出に用いている。これに対し、第2実施形態では、複数の校正角で平均の係数を算出し、いずれの校正角の近傍にあっても、この平均の係数を回動角度θの算出に用いている。 The second embodiment is the same as the first embodiment except that the coefficient indicating the correlation between the calibration angle and the movement amount of the mark is different. Specifically, in the first embodiment described above, a coefficient is calculated for each calibration angle and used for calculating the rotation angle θ. On the other hand, in the second embodiment, the average coefficient is calculated at a plurality of calibration angles, and the average coefficient is used for calculating the rotation angle θ regardless of the vicinity of any calibration angle.
3.1.テンプレート画像等の取得
図12に示す位置検出方法は、図9に示すステップS109に代えて、ステップS109Aを有している。
3.1. Acquisition of template image and the like The position detection method shown in FIG. 12 includes step S109A instead of step S109 shown in FIG.
ステップS109Aでは、第1実施形態に係るステップS109と同様、まず、全てのマーク21、つまり、校正角θ[i]のi=0からi=nまでの全てについて、それぞれ、
移動量1[i]=合致座標1[i]−基準座標1[i]
移動量2[i]=合致座標2[i]−基準座標2[i]
で定義される移動量1[i]および移動量2[i]を算出する。
In step S109A, as in step S109 according to the first embodiment, first, all the
Movement amount 1 [i] = Match coordinates 1 [i] -Reference coordinates 1 [i]
Movement amount 2 [i] = Match coordinates 2 [i] -Reference coordinates 2 [i]
The movement amount 1 [i] and the movement amount 2 [i] defined in are calculated.
そして、次の式により、これらの移動量1[i]および移動量2[i]を合算して、移動量和[i]を求める。
移動量和[i]=移動量1[i]+移動量2[i]
Then, the movement amount 1 [i] and the movement amount 2 [i] are added up to obtain the movement amount sum [i] by the following equation.
Total amount of movement [i] = amount of movement 1 [i] + amount of movement 2 [i]
ここで、本実施形態に係る位置検出方法のステップフローについて、図12を参照しつつ説明する。 Here, the step flow of the position detection method according to the present embodiment will be described with reference to FIG.
まず、ステップS103では、変数iを0とするほか、累積移動量和も0にリセットする。 First, in step S103, the variable i is set to 0, and the cumulative movement amount sum is also reset to 0.
1回目のステップS109Aでは、変数iから変数i2への更新を経ているので、校正角θ[i2−1](第1位置)と、校正角θ[i2](第2位置)と、移動量和[i2−1]と、を求める。そして、以下の式により、累積移動量和を更新する。
更新後の累積移動量和=更新前の累積移動量和+移動量和[i2−1]
In the first step S109A, since the variable i is updated to the variable i2, the calibration angle θ [i2-1] (first position), the calibration angle θ [i2] (second position), and the movement amount The sum [i2-1] is obtained. Then, the cumulative movement amount sum is updated by the following formula.
Cumulative movement sum after update = Cumulative movement sum before update + movement sum [i2-1]
ここでは、変数i2として1を設定し、更新前の累積移動量和は、それぞれ0としていることから、更新後の累積移動量和は、移動量和[0]となる。 Here, since 1 is set as the variable i2 and the cumulative movement amount sum before the update is 0, the cumulative movement amount sum after the update is the movement amount sum [0].
2回目のステップS109Aでは、変数i2から変数i3への更新を経ているので、校正角θ[i3−1](第2位置)と、校正角θ[i3](第3位置)と、移動量和[i3−1]と、を求める。そして、以下の式により、累積移動量和を更新する。
更新後の累積移動量和=更新前の累積移動量和+移動量和[i3−1]
In the second step S109A, since the variable i2 has been updated to the variable i3, the calibration angle θ [i3-1] (second position), the calibration angle θ [i3] (third position), and the amount of movement The sum [i3-1] is obtained. Then, the cumulative movement amount sum is updated by the following formula.
Cumulative movement sum after update = Cumulative movement sum before update + movement sum [i3-1]
ここでは、変数i3として2を設定していることから、更新後の累積移動量和は、移動量和[0](更新前の累積移動量和)+移動量和[1]となる。 Here, since 2 is set as the variable i3, the cumulative movement amount sum after the update is the movement amount sum [0] (cumulative movement amount sum before the update) + the movement amount sum [1].
そして、変数を更新するたびに、以上のようなステップS109Aを繰り返すことにより、累積移動量和を随時更新することができる。そして、最終的に得られる累積移動量和から後述する平均係数Aを求めることができる。 Then, each time the variable is updated, the cumulative movement amount sum can be updated at any time by repeating step S109A as described above. Then, the average coefficient A, which will be described later, can be obtained from the finally obtained cumulative movement amount sum.
具体的には、第1実施形態において、最後のステップS110の後には、ステップフローを終了させるが、本実施形態では、最後のステップS110の後に、ステップS119を追加している。 Specifically, in the first embodiment, the step flow is terminated after the final step S110, but in the present embodiment, step S119 is added after the final step S110.
ステップS119では、まず、テンプレート画像を取得するときの最初の校正角θ[0]から最後の校正角θ[m+1]までの合計変化量を、校正角θ[m+1]−校正角θ[0]により求める。そして、下記式により、平均係数Aを算出する。 In step S119, first, the total amount of change from the first calibration angle θ [0] to the last calibration angle θ [m + 1] when the template image is acquired is set to the calibration angle θ [m + 1] − calibration angle θ [0]. Obtained by. Then, the average coefficient A is calculated by the following formula.
上式において、mは、m≦nの任意の整数である。
このようにして求めた平均係数Aは、第1実施形態において校正角θ[i]ごとに設定されていた係数を、図13に示すように、全ての校正角θ[i]に共通して置き換えることができる。これにより、校正角θ[i]ごとに個別の係数を算出して記憶部6に記憶させておく必要がなく、1つの平均係数Aのみを記憶させておけばよいことになる。その結果、計算の省力化と、記憶部6の使用量の削減と、を図ることができる。このとき、校正用エンコーダーは不要となるため、ステップS119の後、校正用エンコーダーを取り外す(ステップS120)。
なお、前述した累積移動量を算出する際の整数mは、n未満であってもよい。
In the above equation, m is an arbitrary integer of m ≦ n.
The average coefficient A thus obtained is a coefficient set for each calibration angle θ [i] in the first embodiment, and is common to all calibration angles θ [i] as shown in FIG. Can be replaced. As a result, it is not necessary to calculate individual coefficients for each calibration angle θ [i] and store them in the
The integer m when calculating the cumulative movement amount described above may be less than n.
3.2.回動角度の検出
前述した第1実施形態では、校正角θ[i]に固有の係数[i]と、移動量1および移動量2と、を用いて回動角度θを算出する。一方、各係数[i]の算出には、第1撮像素子31aおよび第2撮像素子31bが撮像した基準画像や測角画像が用いられるが、これらの画像には、不可避的に発生するランダムノイズが含まれている。このため、各係数[i]には、ランダムノイズに起因する測定誤差が含まれている。
3.2. Detection of Rotation Angle In the first embodiment described above, the rotation angle θ is calculated using the coefficient [i] peculiar to the calibration angle θ [i], the
一方、本実施形態では、累積の移動量から平均係数Aを求め、これを用いて回動角度θを算出する。具体的には、以下の式により、回動角度θを算出する。
回動角度θ=校正角θ[i]+(測角合致座標−基準座標[i])×平均係数A
On the other hand, in the present embodiment, the average coefficient A is obtained from the cumulative amount of movement, and the rotation angle θ is calculated using this. Specifically, the rotation angle θ is calculated by the following formula.
Rotation angle θ = Calibration angle θ [i] + (angle measurement matching coordinates-reference coordinates [i]) × average coefficient A
ここで、前述したランダムノイズは、正規分布に従うことが知られている。このため、ステップS1において累積の移動量を求めるという平均係数Aの算出過程は、正規分布に従うランダムノイズに起因した測定誤差を、その平均値であるゼロに収斂させるという効果を有する。このため、上記式により算出された回動角度θでは、ランダムノイズに起因した測定誤差の発生が抑えられている。したがって、本実施形態によれば、第1実施形態に比べて、測定誤差が少なく、より高精度な回動角度θを検出することができる。
なお、以上のような第2実施形態においても、第1実施形態と同様の効果が得られる。
Here, it is known that the above-mentioned random noise follows a normal distribution. Therefore, the process of calculating the average coefficient A, which is to obtain the cumulative movement amount in step S1, has the effect of converging the measurement error due to the random noise following the normal distribution to the average value of zero. Therefore, in the rotation angle θ calculated by the above formula, the occurrence of measurement error due to random noise is suppressed. Therefore, according to the present embodiment, the measurement error is smaller than that of the first embodiment, and the rotation angle θ can be detected with higher accuracy.
In the second embodiment as described above, the same effect as that of the first embodiment can be obtained.
4.第3実施形態
次に、第3実施形態に係る角度検出方法について説明する。
4. Third Embodiment Next, the angle detection method according to the third embodiment will be described.
図14は、第3実施形態に係る角度検出方法のうち、ステップS1を詳細に示すフローチャートである。図15は、図14に示す角度検出方法で取得される、校正角、テンプレート画像、基準座標、および、係数を示す一覧表である。 FIG. 14 is a flowchart showing step S1 in detail in the angle detection method according to the third embodiment. FIG. 15 is a list showing calibration angles, template images, reference coordinates, and coefficients acquired by the angle detection method shown in FIG.
以下、第3実施形態について説明するが、以下の説明では、第1実施形態との相違点を中心に説明し、同様の事項についてはその説明を省略する。また、図14および図15において、前記第1実施形態と同様の構成については、同一の符号を付している。 Hereinafter, the third embodiment will be described, but in the following description, the differences from the first embodiment will be mainly described, and the same matters will be omitted. Further, in FIGS. 14 and 15, the same reference numerals are given to the same configurations as those in the first embodiment.
第3実施形態は、校正角とマークの移動量との相関関係を示す係数が異なる以外、第1実施形態と同様である。具体的には、前述した第1実施形態では、移動量1[i2−1]と移動量2[i2−1]との和を含む係数[i2−1]を用いて回動角度θを算出している。これに対し、第3実施形態では、移動量1[i2−1]から第1係数を算出し、移動量2[i2−1]から第2係数を算出した後、これらを用いて演算角θ1および演算角θ2を算出し、その後、回動角度θを算出する。 The third embodiment is the same as the first embodiment except that the coefficient indicating the correlation between the calibration angle and the movement amount of the mark is different. Specifically, in the first embodiment described above, the rotation angle θ is calculated using the coefficient [i2-1] including the sum of the movement amount 1 [i2-1] and the movement amount 2 [i2-1]. doing. On the other hand, in the third embodiment, the first coefficient is calculated from the movement amount 1 [i2-1], the second coefficient is calculated from the movement amount 2 [i2-1], and then the calculation angle θ1 is used. And the calculation angle θ2 is calculated, and then the rotation angle θ is calculated.
4.1.テンプレート画像等の取得
図14に示す角度検出方法は、図9に示すステップS1のステップS109に代えて、ステップS109C、S109Dを有している。
4.1. Acquisition of template image and the like The angle detection method shown in FIG. 14 includes steps S109C and S109D instead of step S109 of step S1 shown in FIG.
ステップS109Cでは、校正角θ[i2−1](第[i2−1]校正角)、校正角θ[i2](第[i2]校正角)、および、移動量1[i2−1](第1[i2−1]基準移動量)、の間に成り立つ第1相関関係を求める。 In step S109C, the calibration angle θ [i2-1] (the [i2-1] calibration angle), the calibration angle θ [i2] (the [i2] calibration angle), and the movement amount 1 [i2-1] (the first). The first correlation that holds between 1 [i2-1] reference movement amount) is obtained.
ステップS109Dでは、校正角θ[i2−1](第i2−1校正角)、校正角θ[i2](第[i2]校正角)、および、移動量2[i2−1](第2[i2−1]基準移動量)、の間に成り立つ第2相関関係を求める。 In step S109D, the calibration angle θ [i2-1] (the second i2-1 calibration angle), the calibration angle θ [i2] (the [i2] calibration angle), and the movement amount 2 [i2-1] (the second [i2-1]). The second correlation that holds between i2-1] reference movement amount) is obtained.
上記のように、本実施形態では、後述するステップS2で回動角度θを算出する際に用いる相関関係が、校正角θ[i2]と校正角θ[i2−1]との差、および、移動量1[i2−1]、の間に成り立つ第1相関関係と、校正角θ[i2]と校正角θ[i2−1]との差、および、移動量2[i2−1]、の間に成り立つ第2相関関係と、を含む。このような第1相関関係および第2相関関係をあらかじめ求めた後、これらを回動角度θの算出に反映させる方法によっても、回動角度θを精度よく検出することができる。 As described above, in the present embodiment, the correlation used when calculating the rotation angle θ in step S2 described later is the difference between the calibration angle θ [i2] and the calibration angle θ [i2-1], and The first correlation established between the movement amount 1 [i2-1], the difference between the calibration angle θ [i2] and the calibration angle θ [i2-1], and the movement amount 2 [i2-1]. Includes a second correlation that holds between them. The rotation angle θ can also be detected accurately by a method in which such a first correlation and a second correlation are obtained in advance and then reflected in the calculation of the rotation angle θ.
また、第1相関関係の具体的な形態としては、移動量1[i2−1](第1[i2−1]基準移動量)に対する、校正角θ[i2]と校正角θ[i2−1]との差、の比として求められる係数1[i2−1](第1係数)が挙げられる。さらに、第2相関関係の具体的な形態としては、移動量2[i2−1](第2[i2−1]基準移動量)に対する、校正角θ[i2]と校正角θ[i2−1]との差、の比として求められる係数2[i2−1](第2係数)が挙げられる。このような係数をあらかじめ求めた後、これらを回動角度θの算出に反映させる方法によっても、回動角度θを精度よく求めることができる。また、あらかじめ係数を算出しておくことにより、回動角度θを算出する際の演算負荷を軽減し、高速化を図ることができる。求めた係数1[i2−1]および係数2[i2−1]は、記憶部6に記憶させる。
Further, as a specific form of the first correlation, the calibration angle θ [i2] and the calibration angle θ [i2-1] with respect to the movement amount 1 [i2-1] (the first [i2-1] reference movement amount). ] And the coefficient 1 [i2-1] (first coefficient) obtained as a ratio of the difference. Further, as a specific form of the second correlation, the calibration angle θ [i2] and the calibration angle θ [i2-1] with respect to the movement amount 2 [i2-1] (the second [i2-1] reference movement amount) ] And the coefficient 2 [i2-1] (second coefficient) obtained as a ratio of the difference. The rotation angle θ can also be obtained with high accuracy by a method in which such coefficients are obtained in advance and then reflected in the calculation of the rotation angle θ. Further, by calculating the coefficient in advance, the calculation load when calculating the rotation angle θ can be reduced and the speed can be increased. The obtained coefficient 1 [i2-1] and the coefficient 2 [i2-1] are stored in the
なお、例えば、変数i2として1を設定した場合、係数1[0]および係数2[0]は、それぞれ図15に示す式で求められる。 For example, when 1 is set as the variable i2, the coefficient 1 [0] and the coefficient 2 [0] are obtained by the equations shown in FIG. 15, respectively.
4.2.回動角度の検出
本実施形態に係るステップS2は、係数1[i](第1係数)および係数2[i](第2係数)を用いて回動角度θを求めること以外、第1実施形態に係るステップS2と同様である。
4.2. Detection of Rotation Angle In step S2 according to the present embodiment, the first embodiment is performed except that the rotation angle θ is obtained by using the coefficient 1 [i] (first coefficient) and the coefficient 2 [i] (second coefficient). This is the same as step S2 according to the embodiment.
本実施形態に係るステップS205では、記憶部6から係数1[i]および係数2[i]を読み出す。そして、以下の式により、演算角θ1および演算角θ2を算出する。
In step S205 according to the present embodiment, the coefficient 1 [i] and the coefficient 2 [i] are read out from the
演算角θ1=校正角θ[i]+移動量1×係数1[i]
演算角θ2=校正角θ[i]+移動量2×係数2[i]
Calculation angle θ1 = Calibration angle θ [i] + Movement amount 1 x Coefficient 1 [i]
Calculation angle θ2 = Calibration angle θ [i] + Movement amount 2 x Coefficient 2 [i]
求められた演算角θ1および演算角θ2は、移動量1および移動量2がそれぞれ含む軸並進成分の影響に伴う角度誤差を含んでいる。一方、移動量1および移動量2が含む軸並進成分の影響は、並進方向が互いに逆で、かつ、並進長さが互いに等しい、というものである。このため、演算角θ1および演算角θ2が含む角度誤差も、互いに逆向きで、かつ、互いに等しい大きさ、となる。
The calculated calculation angle θ1 and the calculation angle θ2 include an angle error due to the influence of the axial translation component included in the
したがって、以下の式により、演算角θ1と演算角θ2の和を求めることにより、軸並進による誤差を打ち消すことができる。そして、和の半分を算出することにより、回動角度θが算出される。
回動角度θ=(演算角θ1+演算角θ2)÷2
Therefore, the error due to the axis translation can be canceled by obtaining the sum of the calculation angle θ1 and the calculation angle θ2 by the following equation. Then, the rotation angle θ is calculated by calculating half of the sum.
Rotation angle θ = (calculation angle θ1 + calculation angle θ2) ÷ 2
以上のようにして、回動角度θを算出することができる。
なお、このような第3実施形態においても、第1実施形態と同様の効果が得られる。
As described above, the rotation angle θ can be calculated.
In addition, even in such a third embodiment, the same effect as that of the first embodiment can be obtained.
5.第4実施形態
次に、第4実施形態に係る角度検出方法について説明する。
5. Fourth Embodiment Next, the angle detection method according to the fourth embodiment will be described.
図16は、第4実施形態に係る角度検出方法のうち、ステップS1を詳細に示すフローチャートである。図17は、図16に示す角度検出方法で取得される、校正角、テンプレート画像、基準座標、および、係数を示す一覧表である。 FIG. 16 is a flowchart showing step S1 in detail in the angle detection method according to the fourth embodiment. FIG. 17 is a list showing calibration angles, template images, reference coordinates, and coefficients acquired by the angle detection method shown in FIG.
以下、第4実施形態について説明するが、以下の説明では、第3実施形態との相違点を中心に説明し、同様の事項についてはその説明を省略する。また、図16および図17において、前記第3実施形態と同様の構成については、同一の符号を付している。 Hereinafter, the fourth embodiment will be described, but in the following description, the differences from the third embodiment will be mainly described, and the description of the same matters will be omitted. Further, in FIGS. 16 and 17, the same reference numerals are given to the same configurations as those in the third embodiment.
第4実施形態は、校正角とマークの移動量との相関関係を示す係数が異なる以外、第3実施形態と同様である。具体的には、前述した第3実施形態では、校正角ごとに係数1[i]および係数2[i]を算出し、回動角度θの算出に用いている。これに対し、第4実施形態では、複数の校正角で第1平均係数および第2平均係数を算出し、校正角によらず、回動角度θの算出に用いている。 The fourth embodiment is the same as the third embodiment except that the coefficient indicating the correlation between the calibration angle and the movement amount of the mark is different. Specifically, in the third embodiment described above, the coefficient 1 [i] and the coefficient 2 [i] are calculated for each calibration angle and used for calculating the rotation angle θ. On the other hand, in the fourth embodiment, the first average coefficient and the second average coefficient are calculated at a plurality of calibration angles and used for calculating the rotation angle θ regardless of the calibration angle.
5.1.テンプレート画像等の取得
図16に示す位置検出方法は、図9に示すステップS109に代えて、ステップS109E、S109Fを有している。
5.1. Acquisition of template image and the like The position detection method shown in FIG. 16 includes steps S109E and S109F instead of step S109 shown in FIG.
ステップS109E、S109Fでは、第1実施形態に係るステップS109と同様、まず、全てのマーク21、つまり、校正角θ[i]のi=0からi=nまでの全てについて、それぞれ、
移動量1[i]=合致座標1[i]−基準座標1[i]
移動量2[i]=合致座標2[i]−基準座標2[i]
で定義される移動量1[i]および移動量2[i]を算出する。
In steps S109E and S109F, as in step S109 according to the first embodiment, first, all the
Movement amount 1 [i] = Match coordinates 1 [i] -Reference coordinates 1 [i]
Movement amount 2 [i] = Match coordinates 2 [i] -Reference coordinates 2 [i]
The movement amount 1 [i] and the movement amount 2 [i] defined in are calculated.
そして、次の式により、これらの移動量1[i]および移動量2[i]を合算して、累積移動量1および累積移動量2を求める。
Then, the cumulative movement amount 1 [i] and the movement amount 2 [i] are added up to obtain the
上式において、mは、m≦nの任意の整数である。
ここで、本実施形態に係る位置検出方法のステップフローについて、図16を参照しつつ説明する。
In the above equation, m is an arbitrary integer of m ≦ n.
Here, the step flow of the position detection method according to the present embodiment will be described with reference to FIG.
まず、ステップS103では、変数iを0とするほか、累積移動量1および累積移動量2もそれぞれ0にリセットする。
First, in step S103, in addition to setting the variable i to 0, the
1回目のステップS109E、S109Fでは、変数iから変数i2への更新を経ているので、校正角θ[i2−1](第1位置)と、校正角θ[i2](第2位置)と、移動量1[i2−1](第1[i2−1]基準移動量)と、移動量2[i2−1](第2[i2−1]基準移動量)と、を求める。そして、以下の式により、累積移動量1および累積移動量2を更新する。
In the first steps S109E and S109F, since the variable i is updated to the variable i2, the calibration angle θ [i2-1] (first position), the calibration angle θ [i2] (second position), and the calibration angle θ [i2] (second position). The movement amount 1 [i2-1] (first [i2-1] reference movement amount) and the movement amount 2 [i2-1] (second [i2-1] reference movement amount) are obtained. Then, the
更新後の累積移動量1=更新前の累積移動量1+移動量1[i2−1]
更新後の累積移動量2=更新前の累積移動量2+移動量2[i2−1]
ここでは、変数i2として1を設定し、更新前の累積移動量1および更新前の累積移動量2は、それぞれ0としていることから、更新後の累積移動量1は、移動量1[0]であり、更新後の累積移動量2は、移動量2[0]となる。
Here, 1 is set as the variable i2, and the
2回目のステップS109E、S109Fでは、変数i2から変数i3への更新を経ているので、校正角θ[i3−1](第2位置)と、校正角θ[i3](第3位置)と、移動量1[i3−1](第1[i3−1]基準移動量)と、移動量2[i3−1](第2[i3−1]基準移動量)と、を求める。そして、以下の式により、累積移動量1および累積移動量2を更新する。
In the second steps S109E and S109F, since the variable i2 has been updated to the variable i3, the calibration angle θ [i3-1] (second position), the calibration angle θ [i3] (third position), and the calibration angle θ [i3] (third position). The movement amount 1 [i3-1] (first [i3-1] reference movement amount) and the movement amount 2 [i3-1] (second [i3-1] reference movement amount) are obtained. Then, the
更新後の累積移動量1=更新前の累積移動量1+移動量1[i3−1]
更新後の累積移動量2=更新前の累積移動量2+移動量2[i3−1]
ここでは、変数i3として2を設定していることから、更新後の累積移動量1は、移動量1[0](更新前の累積移動量1)+移動量1[1]であり、更新後の累積移動量2は、移動量2[0](更新前の累積移動量2)+移動量2[1]となる。
Here, since 2 is set as the variable i3, the
そして、変数を更新するたびに、以上のようなステップS109E、S109Fを繰り返すことにより、累積移動量1および累積移動量2を随時更新することができる。そして、最終的に得られる更新後の累積移動量1および更新後の累積移動量2から前述した平均係数1および平均係数2を求めることができる。
Then, by repeating the above steps S109E and S109F each time the variable is updated, the
具体的には、第3実施形態において、最後のステップS110の後には、ステップフローを終了させるが、本実施形態では、最後のステップS110の後に、ステップS119Aを追加している。 Specifically, in the third embodiment, the step flow is terminated after the final step S110, but in the present embodiment, step S119A is added after the final step S110.
ステップS119Aでは、まず、テンプレート画像を取得するときの最初の校正角θ[0]から最後の校正角θ[m+1]までの合計変化量を、校正角θ[m+1]−校正角θ[0]により求める。そして、下記式により、平均係数1および平均係数2を算出する。
In step S119A, first, the total amount of change from the first calibration angle θ [0] to the last calibration angle θ [m + 1] when acquiring the template image is calculated by the calibration angle θ [m + 1] − calibration angle θ [0]. Obtained by. Then, the
このようにして求めた平均係数1および平均係数2は、第3実施形態において校正角θ[i]ごとに設定されていた第1係数および第2係数を、図17に示すように、全ての校正角θ[i]に共通して平均係数1および平均係数2に置き換えることができる。これにより、校正角θ[i]ごとに個別の第1係数および第2係数を算出し、記憶部6に記憶させておく必要がなく、2つの平均係数1および平均係数2のみを記憶させておけばよいことになる。その結果、計算の省力化と、記憶部6の使用量の削減と、を図ることができる。このとき、校正用エンコーダーは不要となるため、ステップS119Aの後、校正用エンコーダーを取り外す(ステップS120)。
The
なお、整数mは、n未満であってもよい。 The integer m may be less than n.
5.2.回動角度の検出
本実施形態に係るステップS2は、平均係数1および平均係数2を用いて回動角度θを求めること以外、第3実施形態に係るステップS2と同様である。
5.2. Detection of Rotation Angle Step S2 according to the present embodiment is the same as step S2 according to the third embodiment except that the rotation angle θ is obtained by using the
ステップS2では、前述した平均係数1および平均係数2を用いて回動角度θを算出する。具体的には、以下の式により、まず、演算角θ1および演算角θ2を算出する。
In step S2, the rotation angle θ is calculated using the above-mentioned
演算角θ1=校正角θ[i]+移動量1×平均係数1
演算角θ2=校正角θ[i]+移動量2×平均係数2
Calculation angle θ1 = Calibration angle θ [i] + Movement amount 1 x
Calculation angle θ2 = Calibration angle θ [i] + Movement amount 2 x
求められた演算角θ1および演算角θ2は、移動量1および移動量2がそれぞれ含む軸並進成分の影響に伴う角度誤差を含んでいる。一方、移動量1および移動量2が含む軸並進成分の影響は、並進方向が互いに逆で、かつ、並進長さが互いに等しい、というものである。このため、演算角θ1および演算角θ2が含む角度誤差も、互いに逆向きで、かつ、互いに等しい大きさ、となる。
The calculated calculation angle θ1 and the calculation angle θ2 include an angle error due to the influence of the axial translation component included in the
したがって、以下の式により、演算角θ1と演算角θ2の和を求めることにより、軸並進による誤差を打ち消すことができる。そして、和の半分を算出することにより、回動角度θが算出される。
回動角度θ=(演算角θ1+演算角θ2)÷2
Therefore, the error due to the axis translation can be canceled by obtaining the sum of the calculation angle θ1 and the calculation angle θ2 by the following equation. Then, the rotation angle θ is calculated by calculating half of the sum.
Rotation angle θ = (calculation angle θ1 + calculation angle θ2) ÷ 2
以上のようにして、回動角度θを算出することができる。
そして、このような第4実施形態においても、第3実施形態と同様の効果が得られる。
As described above, the rotation angle θ can be calculated.
Then, even in such a fourth embodiment, the same effect as that of the third embodiment can be obtained.
なお、前述した第3実施形態では、校正角θ[i]に固有の係数1[i]および係数2[i]と、移動量1および移動量2と、を用いて回動角度θを算出する。一方、各係数1[i]および各係数2[i]の算出には、第1撮像素子31aおよび第2撮像素子31bが撮像した基準画像や測角画像が用いられるが、これらの画像には、不可避的に発生するランダムノイズが含まれている。このため、各係数1[i]および各係数2[i]には、ランダムノイズに起因する測定誤差が含まれている。
In the third embodiment described above, the rotation angle θ is calculated using the coefficients 1 [i] and the coefficients 2 [i] peculiar to the calibration angle θ [i], and the
これに対し、本実施形態では、ランダムノイズに起因した測定誤差を抑えることができる。具体的には、ステップS1において累積移動量1および累積移動量2を求めるという平均係数1および平均係数2の算出過程は、正規分布に従うランダムノイズに起因した測定誤差を、その平均値であるゼロに収斂させるという効果を有する。このため、上記式により算出された回動角度θでは、ランダムノイズに起因した測定誤差の発生が抑えられている。したがって、本実施形態では、第3実施形態に比べて、測定誤差が少なく、より高精度な回動角度θを検出することができる。
On the other hand, in the present embodiment, the measurement error caused by the random noise can be suppressed. Specifically, in the calculation process of the
以上、本発明の角度検出方法、エンコーダーユニットおよびロボットを図示の好適な実施形態に基づいて説明したが、本発明はこれに限定されるものではなく、各部の構成は、同様の機能を有する任意の構成のものに置換することができる。また、他の任意の構成物が付加されていてもよい。また、前述した2つ以上の実施形態の構成を組み合わせてもよい。 Although the angle detection method, the encoder unit, and the robot of the present invention have been described above based on the preferred embodiments shown in the drawings, the present invention is not limited thereto, and the configuration of each part is arbitrary having the same function. Can be replaced with the one of the configuration of. Moreover, other arbitrary components may be added. Further, the configurations of the two or more embodiments described above may be combined.
また、本発明のエンコーダーユニットは、アブソリュート型およびインクリメンタル型のいずれの形式にも適用可能である。 Further, the encoder unit of the present invention can be applied to both absolute type and incremental type.
さらに、前述した実施形態では、ロボットの基台を「第1部材」とし、第1アームを「第2部材」とした場合を例に説明したが、これに限定されず、相対的に回動する任意の2つの部材の一方を「第1部材」とし、他方を「第2部材」とすることができる。すなわち、エンコーダーの設置箇所は、基台と第1アームとの関節部に限定されず、相対的に回動する任意の2つのアームの関節部であってもよい。また、エンコーダーの設置箇所は、ロボットが有する関節部に限定されない。 Further, in the above-described embodiment, the case where the base of the robot is the “first member” and the first arm is the “second member” has been described as an example, but the present invention is not limited to this, and the robot rotates relatively. One of any two members can be referred to as a "first member" and the other can be referred to as a "second member". That is, the location where the encoder is installed is not limited to the joint between the base and the first arm, and may be the joint of any two arms that rotate relative to each other. Further, the installation location of the encoder is not limited to the joint portion of the robot.
また、前述した実施形態では、ロボットアームの数は1つであるが、ロボットアームの数は2つ以上でもよい。すなわち、本発明のロボットは、例えば、双腕ロボット等の複数腕ロボットであってもよい。 Further, in the above-described embodiment, the number of robot arms is one, but the number of robot arms may be two or more. That is, the robot of the present invention may be a multi-arm robot such as a dual-arm robot, for example.
さらに、前述した実施形態では、ロボットアームが有するアームの数は、6つであったが、アームの数は、これに限定されず、1つでもよいし、2つ以上5つ以下または7つ以上でもよい。 Further, in the above-described embodiment, the number of arms possessed by the robot arm is six, but the number of arms is not limited to this, and may be one, or two or more and five or less or seven. The above may be sufficient.
また、ロボットの設置箇所は、床面に限定されず、例えば、天井面や側壁面等でもよいし、AGV(Automatic Guided Vehicle)等の移動体でもよい。 Further, the installation location of the robot is not limited to the floor surface, and may be, for example, a ceiling surface, a side wall surface, or a moving body such as an AGV (Automatic Guided Vehicle).
1…エンコーダー、2…スケール部、3a…第1検出部、3b…第2検出部、4…回路部、5…処理部、6…記憶部、10…エンコーダーユニット、20…ドット、21…マーク、31a…第1撮像素子、31b…第2撮像素子、32a…第1光学系、32b…第2光学系、100…ロボット、110…基台、111…モーター、112…減速機、114…支持部材、115…軸受、120…第1アーム、121…アーム本体部、122…軸部、130…第2アーム、140…作業ヘッド、141…スプラインシャフト、150…エンドエフェクター、160…配線引き回し部、1111…回動軸、DC…周方向、DR…半径方向、J1…第1軸、J2…第2軸、J3…第3軸、RI1…撮像領域、RI2…撮像領域、S1…ステップ、S101…ステップ、S102…ステップ、S103…ステップ、S104…ステップ、S105…ステップ、S106…ステップ、S107…ステップ、S108…ステップ、S109…ステップ、S109A…ステップ、S109C…ステップ、S109D…ステップ、S109E…ステップ、S109F…ステップ、S110…ステップ、S111…ステップ、S112…ステップ、S113…ステップ、S114…ステップ、S115…ステップ、S116…ステップ、S117…ステップ、S118…ステップ、S119…ステップ、S119A…ステップ、S120…ステップ、S2…ステップ、S201…ステップ、S202…ステップ、S203…ステップ、S204…ステップ、S205…ステップ、UP…ユニークパターン 1 ... Encoder, 2 ... Scale unit, 3a ... 1st detection unit, 3b ... 2nd detection unit, 4 ... Circuit unit, 5 ... Processing unit, 6 ... Storage unit, 10 ... Encoder unit, 20 ... Dot, 21 ... Mark , 31a ... 1st imaging element, 31b ... 2nd imaging element, 32a ... 1st optical system, 32b ... 2nd optical system, 100 ... robot, 110 ... base, 111 ... motor, 112 ... reducer, 114 ... support Member, 115 ... Bearing, 120 ... First arm, 121 ... Arm body, 122 ... Shaft, 130 ... Second arm, 140 ... Work head, 141 ... Spline shaft, 150 ... End effector, 160 ... Wiring route, 1111 ... Rotation axis, DC ... Circumferential direction, DR ... Radial direction, J1 ... 1st axis, J2 ... 2nd axis, J3 ... 3rd axis, RI1 ... Imaging area, RI2 ... Imaging area, S1 ... Step, S101 ... Step, S102 ... Step, S103 ... Step, S104 ... Step, S105 ... Step, S106 ... Step, S107 ... Step, S108 ... Step, S109 ... Step, S109A ... Step, S109C ... Step, S109D ... Step, S109E ... Step, S109F ... step, S110 ... step, S111 ... step, S112 ... step, S113 ... step, S114 ... step, S115 ... step, S116 ... step, S117 ... step, S118 ... step, S119 ... step, S119A ... step, S120 ... Step, S2 ... Step, S201 ... Step, S202 ... Step, S203 ... Step, S204 ... Step, S205 ... Step, UP ... Unique pattern
Claims (7)
前記スケール部が第[i]校正角にあるとき、前記第1撮像素子により前記第1マークを撮像して第1[i]基準画像を生成し、第1[i]テンプレート画像および前記第1[i]基準画像における前記第1マークの第1[i]基準座標を取得するステップと、
前記スケール部が前記第[i]校正角にあるとき、前記第2撮像素子により前記第2マークを撮像して第2[i]基準画像を生成し、第2[i]テンプレート画像および前記第2[i]基準画像における前記第2マークの第2[i]基準座標を取得するステップと、
前記第[i]校正角を変化させたとき、その変化量と、前記第1マークの移動量と、前記第2マークの移動量と、の間に成り立つ相関関係を求めるステップと、
前記スケール部が計測角にあるとき、前記第1撮像素子により前記第1マークを撮像して第1測角画像を生成し、前記第1[i]テンプレート画像に基づくテンプレートマッチングにより、前記第1測角画像における前記第1マークの前記第1[i]基準座標からの第1測角移動量を求めるステップと、
前記スケール部が前記計測角にあるとき、前記第2撮像素子により前記第2マークを撮像して第2測角画像を生成し、前記第2[i]テンプレート画像に基づくテンプレートマッチングにより、前記第2測角画像における前記第2マークの前記第2[i]基準座標からの第2測角移動量を求めるステップと、
前記第[i]校正角、前記第1測角移動量、前記第2測角移動量、および前記相関関係に基づいて、前記計測角を求めるステップと、
を有することを特徴とする角度検出方法。 A scale unit having a plurality of marks including the first mark and the second mark arranged in an annular shape around the rotation axis, a first image sensor that images the first mark, and the first image pickup with respect to the rotation axis. It has a second image sensor that is arranged at a position symmetrical to the element and images the second mark, and the scale portion is around the rotation axis with respect to the first image sensor and the second image sensor. An angle detection method for detecting the rotation angle of the rotation shaft using a relatively rotating encoder.
When the scale unit is at the first [i] calibration angle, the first mark is imaged by the first image sensor to generate a first [i] reference image, and the first [i] template image and the first [I] A step of acquiring the first [i] reference coordinates of the first mark in the reference image, and
When the scale unit is at the [i] calibration angle, the second mark is imaged by the second image sensor to generate a second [i] reference image, and the second [i] template image and the first 2 [i] A step of acquiring the second [i] reference coordinates of the second mark in the reference image, and
[I] When the calibration angle is changed, the step of obtaining the correlation established between the amount of change, the amount of movement of the first mark, and the amount of movement of the second mark.
When the scale unit is at the measurement angle, the first mark is imaged by the first image sensor to generate a first angle measurement image, and the first is performed by template matching based on the first [i] template image. The step of obtaining the first angle-measurement movement amount from the first [i] reference coordinate of the first mark in the angle-measurement image, and
When the scale unit is at the measurement angle, the second mark is imaged by the second image sensor to generate a second angle measurement image, and template matching based on the second [i] template image is performed to obtain the second mark. 2. A step of obtaining the second angle movement amount of the second mark from the second [i] reference coordinate in the angle measurement image, and
The step of obtaining the measurement angle based on the first [i] calibration angle, the first angle movement amount, the second angle measurement movement amount, and the correlation.
An angle detection method characterized by having.
前記スケール部が第[i2]校正角にあるとき、前記第1撮像素子により前記第1マークを撮像して第1[i2]基準画像を生成し、第1[i2−1]テンプレート画像に基づくテンプレートマッチングにより、前記第1[i2]基準画像における前記第1マークの第1[i2−1]基準座標からの第1[i2−1]基準移動量を求めるステップと、
前記スケール部が前記第[i2]校正角にあるとき、前記第2撮像素子により前記第2マークを撮像して第2[i2]基準画像を生成し、第2[i2−1]テンプレート画像に基づくテンプレートマッチングにより、前記第2[i2]基準画像における前記第2マークの第2[i2−1]基準座標からの第2[i2−1]基準移動量を求めるステップと、
を含み、
前記相関関係は、前記第[i2]校正角と第[i2−1]校正角との差、および、前記第1[i2−1]基準移動量と前記第2[i2−1]基準移動量との和、の間に成り立つ関係である請求項1に記載の角度検出方法。 The step of finding the correlation is
When the scale unit is at the first [i2] calibration angle, the first mark is imaged by the first image sensor to generate a first [i2] reference image, which is based on the first [i2-1] template image. A step of obtaining the first [i2-1] reference movement amount from the first [i2-1] reference coordinates of the first mark in the first [i2] reference image by template matching, and
When the scale unit is at the [i2] calibration angle, the second mark is imaged by the second image sensor to generate a second [i2] reference image, which is used as a second [i2-1] template image. A step of obtaining the second [i2-1] reference movement amount from the second [i2-1] reference coordinates of the second mark in the second [i2] reference image by template matching based on the above.
Including
The correlation includes the difference between the [i2] calibration angle and the [i2-1] calibration angle, and the first [i2-1] reference movement amount and the second [i2-1] reference movement amount. The angle detection method according to claim 1, which is a relationship that holds between the sum and the sum.
前記スケール部が第[i2]校正角にあるとき、前記第1撮像素子により前記第1マークを撮像して第1[i2]基準画像を生成し、第1[i2−1]テンプレート画像に基づくテンプレートマッチングにより、前記第1[i2]基準画像における前記第1マークの第1[i2−1]基準座標からの第1[i2−1]基準移動量を求めるステップと、
前記スケール部が前記第[i2]校正角にあるとき、前記第2撮像素子により前記第2マークを撮像して第2[i2]基準画像を生成し、第2[i2−1]テンプレート画像に基づくテンプレートマッチングにより、前記第2[i2]基準画像における前記第2マークの第2[i2−1]基準座標からの第2[i2−1]基準移動量を求めるステップと、
を含み、
前記相関関係は、
前記第[i2]校正角と第[i2−1]校正角との差、および、前記第1[i2−1]基準移動量、の間に成り立つ第1相関関係と、
前記第[i2]校正角と第[i2−1]校正角との差、および、前記第2[i2−1]基準移動量、の間に成り立つ第2相関関係と、
を含む請求項1に記載の角度検出方法。 The step of finding the correlation is
When the scale unit is at the first [i2] calibration angle, the first mark is imaged by the first image sensor to generate a first [i2] reference image, which is based on the first [i2-1] template image. A step of obtaining the first [i2-1] reference movement amount from the first [i2-1] reference coordinates of the first mark in the first [i2] reference image by template matching, and
When the scale unit is at the [i2] calibration angle, the second mark is imaged by the second image sensor to generate a second [i2] reference image, which is used as a second [i2-1] template image. A step of obtaining the second [i2-1] reference movement amount from the second [i2-1] reference coordinates of the second mark in the second [i2] reference image by template matching based on the above.
Including
The correlation is
The first correlation established between the difference between the first [i2] calibration angle and the first [i2-1] calibration angle and the first [i2-1] reference movement amount,
The second correlation established between the difference between the second [i2] calibration angle and the [i2-1] calibration angle and the second [i2-1] reference movement amount,
The angle detection method according to claim 1.
前記第2相関関係は、前記第2[i2−1]基準移動量に対する前記差の比として求められる第2係数である請求項4に記載の角度検出方法。 The first correlation is a first coefficient obtained as a ratio of the difference to the first [i2-1] reference movement amount.
The angle detection method according to claim 4, wherein the second correlation is a second coefficient obtained as a ratio of the difference to the second [i2-1] reference movement amount.
前記第1撮像素子の撮像結果および前記第2撮像素子の撮像結果に基づいて、前記エンコーダーの前記回動軸の回動角度を求める処理を実行する処理部と、
前記処理部で読み取り可能な指示を記憶する記憶部と、
を有し、
前記処理部は、前記記憶部に記憶されている前記指示に基づき、
前記スケール部が第[i]校正角にあるとき、前記第1撮像素子に前記第1マークを撮像させて第1[i]基準画像を生成し、第1[i]テンプレート画像および前記第1[i]基準画像における前記第1マークの第1[i]基準座標を取得し、
前記スケール部が前記第[i]校正角にあるとき、前記第2撮像素子に前記第2マークを撮像させて第2[i]基準画像を生成し、第2[i]テンプレート画像および前記第2[i]基準画像における前記第2マークの第2[i]基準座標を取得し、
前記第[i]校正角を変化させたとき、その変化量と、前記第1マークの移動量と、前記第2マークの移動量と、の間に成り立つ相関関係を求め、
前記スケール部が計測角にあるとき、前記第1撮像素子に前記第1マークを撮像させて第1測角画像を生成し、前記第1[i]テンプレート画像に基づくテンプレートマッチングにより、前記第1測角画像における前記第1マークの前記第1[i]基準座標からの第1測角移動量を求め、
前記スケール部が前記計測角にあるとき、前記第2撮像素子に前記第2マークを撮像させて第2測角画像を生成し、前記第2[i]テンプレート画像に基づくテンプレートマッチングにより、前記第2測角画像における前記第2マークの前記第2[i]基準座標からの第2測角移動量を求め、
前記第[i]校正角、前記第1測角移動量、前記第2測角移動量、および前記相関関係に基づいて、前記計測角を求める処理を実行することを特徴とするエンコーダーユニット。 A scale unit having a plurality of marks including the first mark and the second mark arranged in an annular shape around the rotation axis, a first image sensor that images the first mark, and the first image pickup with respect to the rotation axis. It has a second image sensor that is arranged symmetrically with the element and images the second mark, and the scale unit is around the rotation axis with respect to the first image sensor and the second image sensor. With a relatively rotating encoder,
A processing unit that executes a process of obtaining the rotation angle of the rotation axis of the encoder based on the image pickup result of the first image pickup element and the image pickup result of the second image pickup element.
A storage unit that stores instructions that can be read by the processing unit,
Have,
The processing unit is based on the instruction stored in the storage unit.
When the scale unit is at the first [i] calibration angle, the first image sensor is made to image the first mark to generate a first [i] reference image, and the first [i] template image and the first [I] Acquire the first [i] reference coordinates of the first mark in the reference image, and obtain the first [i] reference coordinates.
When the scale unit is at the [i] calibration angle, the second image sensor is made to image the second mark to generate a second [i] reference image, and the second [i] template image and the first 2 [i] Acquire the second [i] reference coordinates of the second mark in the reference image, and obtain the second [i] reference coordinates.
When the first [i] calibration angle is changed, the correlation established between the amount of change, the amount of movement of the first mark, and the amount of movement of the second mark is obtained.
When the scale unit is at the measurement angle, the first image sensor is made to image the first mark to generate a first angle measurement image, and the first is performed by template matching based on the first [i] template image. The amount of movement of the first angle measurement from the first [i] reference coordinate of the first mark in the angle measurement image is obtained.
When the scale unit is at the measurement angle, the second image sensor is made to image the second mark to generate a second angle measurement image, and template matching based on the second [i] template image is performed to obtain the second mark. The second angle movement amount of the second mark from the second [i] reference coordinate in the two angle measurement image is obtained.
[I] An encoder unit characterized by executing a process of obtaining the measurement angle based on the calibration angle, the first angle measurement movement amount, the second angle measurement movement amount, and the correlation.
前記第1部材に対して回動する第2部材と、
請求項6に記載のエンコーダーユニットと、
を備え、
前記スケール部が前記第2部材に設けられ、前記第1撮像素子および前記第2撮像素子が前記第1部材に設けられていることを特徴とするロボット。 The first member and
A second member that rotates with respect to the first member,
The encoder unit according to claim 6 and
With
A robot characterized in that the scale portion is provided on the second member, and the first image pickup element and the second image pickup element are provided on the first member.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019219697A JP2021089206A (en) | 2019-12-04 | 2019-12-04 | Angle detection method, encoder unit, and robot |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019219697A JP2021089206A (en) | 2019-12-04 | 2019-12-04 | Angle detection method, encoder unit, and robot |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2021089206A true JP2021089206A (en) | 2021-06-10 |
Family
ID=76220074
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2019219697A Pending JP2021089206A (en) | 2019-12-04 | 2019-12-04 | Angle detection method, encoder unit, and robot |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2021089206A (en) |
-
2019
- 2019-12-04 JP JP2019219697A patent/JP2021089206A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10775204B2 (en) | Encoder unit, angle measuring method, and robot | |
CN103453848B (en) | Device and method for measuring shape, position and dimension features of machine elements | |
CN1067932C (en) | Device and method for calibrating robot | |
KR101234798B1 (en) | Method and apparatus for measuring position of the mobile robot | |
JP6180087B2 (en) | Information processing apparatus and information processing method | |
US9886029B2 (en) | Workpiece processing apparatus and workpiece transfer system | |
CN102782721B (en) | System and method for runtime determination of camera calibration errors | |
CN100335860C (en) | Workpiece inspection method | |
JP6809245B2 (en) | robot | |
US20070051884A1 (en) | Positional sensing system and method | |
JP5176975B2 (en) | Stator coil shape inspection method and shape inspection jig | |
KR20020049039A (en) | Alignment apparatus | |
CN107121060B (en) | Inner wall measuring instrument and offset calculating method | |
JP3754402B2 (en) | Industrial robot control method and control apparatus | |
JP2002168617A (en) | Device and system for measuring tubular object such as tunnel | |
US20150109626A1 (en) | Tire Digitizer | |
JP2009220247A (en) | Robot apparatus and control method of robot apparatus | |
JP2003035517A (en) | Lead pin pitch/levelness testing device using two- dimensional laser displacement sensor | |
JP2021089206A (en) | Angle detection method, encoder unit, and robot | |
JP2009008483A (en) | Measuring method of surface to be measured | |
JP4284765B2 (en) | Robot hand position measuring device | |
JP2021089224A (en) | Position detection method, encoder unit, and robot | |
JP5173629B2 (en) | Shape measuring device | |
JP2008294065A (en) | Mounting method and mounting device for electronic component | |
JP5516974B2 (en) | Vision sensor mounting apparatus and method |