TWI832770B - Calibration method and system for mechanical arm based on image processing - Google Patents

Calibration method and system for mechanical arm based on image processing Download PDF

Info

Publication number
TWI832770B
TWI832770B TW112120261A TW112120261A TWI832770B TW I832770 B TWI832770 B TW I832770B TW 112120261 A TW112120261 A TW 112120261A TW 112120261 A TW112120261 A TW 112120261A TW I832770 B TWI832770 B TW I832770B
Authority
TW
Taiwan
Prior art keywords
correction
robotic arm
point
vector
vectors
Prior art date
Application number
TW112120261A
Other languages
Chinese (zh)
Inventor
張啓舜
陳奕錩
陳偉生
Original Assignee
台達電子工業股份有限公司
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 台達電子工業股份有限公司 filed Critical 台達電子工業股份有限公司
Priority to TW112120261A priority Critical patent/TWI832770B/en
Application granted granted Critical
Publication of TWI832770B publication Critical patent/TWI832770B/en

Links

Images

Landscapes

  • Manipulator (AREA)

Abstract

A method for calibrating a mechanical arm, used for calibrating a mechanical arm, comprising: setting a visit sequence of at least one calibration point; moving to at least three shooting positions, and shooting at least one image respectively at least three shooting positions by a photographing device, at least one image has a center point respectively, wherein the step of generating the at least one image respectively at the at least three shooting positions by the photographing device comprises: generating at least one image after identifying that a shooting range of the photography device covers at least one calibration point; and calculating vector information of the at least one calibration point from the at least one image to adjust a mechanical arm.

Description

基於影像處理的機械手臂校正方法以及系統Robotic arm correction method and system based on image processing

本揭示有關於一種加工技術,特別是有關於一種基於影像處理的機械手臂校正方法以及系統。The present disclosure relates to a processing technology, and in particular to a robotic arm correction method and system based on image processing.

隨著工業科技的進步,各式各樣的自動化裝置已廣泛地被研發,以應用於生活及產業中。一般而言,機械手臂係自動化裝置之重要元件。雖然藉由機械手臂進行加工的穩定性遠遠大於人工,但由於機械手臂的關節(joint)太多,導致通過多項誤差(例如,傳動機構或皮帶在調整時所產生的誤差)的累積與傳遞而致使機械手臂精度普遍不高。要怎麼校正這些誤差以提升機械手臂加工的精度,是本領域技術人員急欲解決之問題。With the advancement of industrial technology, various automation devices have been widely developed and used in life and industry. Generally speaking, robotic arms are important components of automation devices. Although the stability of processing by a robotic arm is much greater than that of manual work, because the robotic arm has too many joints, it leads to the accumulation and transmission of multiple errors (for example, errors caused by the adjustment of the transmission mechanism or belt). As a result, the accuracy of robotic arms is generally low. How to correct these errors to improve the accuracy of robotic arm processing is a problem that those skilled in the art are eager to solve.

本揭示提出一種基於影像處理的機械手臂校正方法,用以校正機械手臂,包括:設定校正板上的至少一校正點的拜訪順序;以及根據該拜訪順序驅動該機械手臂使該機械手臂的一機械手臂末端上的一攝影裝置移動至至少三拍攝位置,藉由攝影裝置在至少三拍攝位置以分別拍攝至少一影像,至少一影像分別具有一中心點,其中藉由攝影裝置在至少三拍攝位置以分別產生至少一個影像的步驟包括:在辨識攝影裝置的拍攝範圍涵蓋至少一校正點後即產生至少一影像;以及由至少一影像計算至少一校正點的向量資訊,以調整機械手臂。The present disclosure proposes an image processing-based robotic arm calibration method for calibrating the robotic arm, including: setting an access sequence for at least one calibration point on a calibration board; and driving the robotic arm according to the access sequence to cause a mechanical arm of the robotic arm to A photographing device on the end of the arm moves to at least three photographing positions, and the photographing device captures at least one image respectively at at least three photographing positions, and at least one image respectively has a center point, wherein the photographing device captures at least three photographing positions with The step of generating at least one image respectively includes: generating at least one image after identifying that the shooting range of the photography device covers at least one correction point; and calculating vector information of at least one correction point from the at least one image to adjust the robot arm.

本揭示亦提出一種基於影像處理的機械手臂校正系統,包括校正板、機械手臂、攝影裝置以及控制器。校正板包括至少一校正點。攝影裝置設置於機械手臂的機械手臂末端,用以拍攝校正板。控制器,連接機械手臂,並用以控制機械手臂以執行以下運作:設定校正板上的至少一校正點的拜訪順序;以及根據該拜訪順序驅動該機械手臂使該機械手臂的一機械手臂末端上的一攝影裝置移動至至少三拍攝位置,藉由攝影裝置在至少三拍攝位置以分別拍攝至少一影像,至少一影像分別具有一中心點,其中藉由攝影裝置在至少三拍攝位置以分別產生至少一個影像的步驟包括:在辨識攝影裝置的拍攝範圍涵蓋至少一校正點後即產生至少一影像;以及由至少一影像計算至少一校正點的向量資訊,以調整機械手臂。This disclosure also proposes a robotic arm correction system based on image processing, including a correction plate, a robotic arm, a photography device and a controller. The calibration plate includes at least one calibration point. The photography device is installed at the end of the robot arm to take pictures of the correction plate. The controller is connected to the robot arm and is used to control the robot arm to perform the following operations: set the access sequence of at least one calibration point on the calibration plate; and drive the robot arm according to the access sequence to make the robot arm on one end of the robot arm A photographing device moves to at least three photographing positions, and the photographing device captures at least one image respectively at at least three photographing positions. At least one image has a center point, and the photographing device produces at least one image at at least three photographing positions respectively. The image step includes: generating at least one image after identifying that the shooting range of the photography device covers at least one correction point; and calculating vector information of at least one correction point from the at least one image to adjust the robot arm.

在機械手臂的運作過程中,可能因種種意外狀況導致機械手臂末端的原點產生偏移(例如,組裝或製造產生的偏移、斷電或受外力撞擊產生的偏移、傳動機構或皮帶在調整時產生的偏移等)。有鑑於此,本揭示提出一種非接觸式的基於影像處理的機械手臂校正方法以及系統,其利用拍攝校正板上的校正點以計算出校正點之間的距離,並利用這些距離計算出機械手臂的多個連桿各自的長度偏移量,以及機械手臂的多個參考點各自的軸角偏移量,藉以修正機械手臂末端的原點的偏移。During the operation of the robot arm, the origin of the end of the robot arm may be offset due to various unexpected conditions (for example, offset caused by assembly or manufacturing, offset caused by power outage or external impact, transmission mechanism or belt in the offset caused during adjustment, etc.). In view of this, this disclosure proposes a non-contact method and system for robotic arm correction based on image processing, which uses the correction points on the correction plate to be photographed to calculate the distance between the correction points, and uses these distances to calculate the robot arm. The respective length offsets of the multiple connecting rods and the respective axis angle offsets of the multiple reference points of the robotic arm are used to correct the offset of the origin of the end of the robotic arm.

第1圖繪示本揭示一些實施例的基於影像處理的機械手臂校正系統1的示意圖。如第1圖所示,基於影像處理的機械手臂校正系統1包括機械手臂11、攝影裝置12、校正板13以及控制器14。FIG. 1 is a schematic diagram of a robot arm correction system 1 based on image processing according to some embodiments of the disclosure. As shown in FIG. 1 , the robot arm correction system 1 based on image processing includes a robot arm 11 , a photography device 12 , a correction plate 13 and a controller 14 .

再者,攝影裝置12設置於機械手臂11的機械手臂末端111(即,法蘭面(flange))的位置。機械手臂11驅動攝影裝置12移動至至少三拍攝位置,攝影裝置12在至少三拍攝位置上拍攝校正板13以分別產生至少一影像。換言之,在每個拍攝位置上,攝影裝置12都會對校正板13拍攝一個影像。進一步而言,攝影裝置12主要取得實際空間的二維空間中的影像,並基於影像進行判斷分析。換言之,攝影裝置12整體的視野範圍可為一個二維空間。Furthermore, the imaging device 12 is provided at the position of the robot arm end 111 (that is, the flange) of the robot arm 11 . The robotic arm 11 drives the photographing device 12 to move to at least three photographing positions, and the photographing device 12 photographs the correction plate 13 at at least three photographing positions to generate at least one image respectively. In other words, at each shooting position, the photography device 12 will capture an image of the correction plate 13 . Furthermore, the photography device 12 mainly obtains images in the two-dimensional space of the actual space, and performs judgment and analysis based on the images. In other words, the entire field of view of the photography device 12 may be a two-dimensional space.

在一些實施例中,攝影裝置12所拍攝的影像中的像素距離(即,像素之間的距離)與實際空間中的距離之間的對應關係可預先儲存於控制器14或其他遠端儲存裝置(例如,遠端資料庫或雲端硬碟等)中。換言之,可從攝影裝置12所拍攝的影像中的距離直接根據上述對應關係計算出實際空間中的絕對距離(即,在真實場域中的真實距離)。在一些實施例中,影像的中心點的像素位置(即,影像中的X、Y方向的座標)會鄰近於影像中的其中一個校正點的像素位置。在一些實施例中,攝影裝置12可以由各式的影像擷取器實現,例如照相機或感光裝置等,用以於預設的拍攝範圍(field of view, FoV)內擷取校正板13的影像。In some embodiments, the correspondence between the pixel distance (ie, the distance between pixels) in the image captured by the photography device 12 and the distance in the actual space can be pre-stored in the controller 14 or other remote storage device (For example, remote database or cloud drive, etc.). In other words, the absolute distance in the real space (ie, the real distance in the real field) can be calculated directly from the distance in the image captured by the photography device 12 according to the above-mentioned corresponding relationship. In some embodiments, the pixel position of the center point of the image (ie, the coordinates in the X and Y directions in the image) will be adjacent to the pixel position of one of the correction points in the image. In some embodiments, the photography device 12 can be implemented by various image capture devices, such as cameras or photosensitive devices, etc., for capturing images of the correction plate 13 within a preset shooting range (field of view, FoV). .

再者,機械手臂11包括多個連桿(link)以及這些連桿之間的多個參考點。在一些實施例中,機械手臂11可例如是但不限於六軸型機械手臂或四軸SCARA機械手臂等。在一些實施例中,多個參考點可包括機械手臂11上的多個關節(joint)以及機械手臂末端111。在一些實施例中,多個關節之間的多個連桿的長度也會被預先設定好以儲存於控制器14或其他遠端儲存裝置中。在一些實施例中,多個關節中的各者可具有感測器(未繪示)以多個關節中的各者所轉動的軸角。在一些實施例中,當機械手臂11為六軸型機械手臂時,多個關節中的各者可以三軸方向(在真實場域中的X、Y、Z方向)為中心旋轉。在一些實施例中,當機械手臂11為四軸SCARA機械手臂時,多個關節中的各者可以垂直單軸方向(在真實場域中的Z方向)為中心旋轉。Furthermore, the robot arm 11 includes a plurality of links and a plurality of reference points between the links. In some embodiments, the robotic arm 11 may be, for example, but not limited to, a six-axis robotic arm or a four-axis SCARA robotic arm. In some embodiments, the multiple reference points may include multiple joints on the robotic arm 11 and the robotic arm end 111 . In some embodiments, the lengths of the multiple links between the multiple joints are also preset and stored in the controller 14 or other remote storage device. In some embodiments, each of the plurality of joints may have a sensor (not shown) at an axis angle through which each of the plurality of joints rotates. In some embodiments, when the robotic arm 11 is a six-axis robotic arm, each of the plurality of joints can rotate in three axes (X, Y, Z directions in the real field) as the center. In some embodiments, when the robot arm 11 is a four-axis SCARA robot arm, each of the plurality of joints can rotate centered in a vertical single-axis direction (Z direction in the real field).

再者,校正板13具有至少一校正點p~r。在一些實施例中,校正點p~r分別在攝影裝置12在至少三拍攝位置上的拍攝範圍中。在一些實施例中,可預先設定攝影裝置12可拍攝到校正點p~r的拍攝位置,並將這些拍攝位置在實際空間中的絕對座標(即,在真實場域中的卡式座標(cartesian coordinate))也儲存於控制器14或其他遠端儲存裝置中。在一些實施例中,校正板13的整個平面的法向量N與在真實場域中的Z方向平行。值得注意的是,攝影裝置12在至少三拍攝位置上的拍攝範圍只要涵蓋到校正點p~r就好,不需要將拍攝範圍的中心點對準校正點p~r。這樣的做法將減少機械手臂11在進行微調時所產生的誤差(例如,傳動機構或皮帶在調整時所產生的誤差)以及節省在微調時所耗費的時間。此外,在此雖以3個校正點p~r為例,然而,在實際應用中,校正點的數量也可以是其他任意大於3的正整數。Furthermore, the calibration plate 13 has at least one calibration point p~r. In some embodiments, the correction points p~r are respectively in the shooting range of the photographing device 12 at at least three shooting positions. In some embodiments, the photographing device 12 can be preset to photograph the photographing positions of the correction points p~r, and obtain the absolute coordinates of these photographing positions in the actual space (ie, the cartesian coordinates in the real field). coordinate)) are also stored in the controller 14 or other remote storage devices. In some embodiments, the normal vector N of the entire plane of the correction plate 13 is parallel to the Z direction in the real field. It is worth noting that the shooting range of the photography device 12 at at least three shooting positions only needs to cover the correction points p~r, and there is no need to align the center point of the shooting range with the correction points p~r. This approach will reduce errors generated by the robot arm 11 during fine-tuning (for example, errors generated during the adjustment of the transmission mechanism or belt) and save time spent during fine-tuning. In addition, although three correction points p~r are taken as an example here, in actual applications, the number of correction points can also be any other positive integer greater than 3.

值得注意的是,機械手臂11的底座所使用的機械手臂座標系與實際空間的絕對座標系之間的轉換矩陣(即,齊次轉換矩陣(homogeneous transformation matrix))也是被預先設定好以儲存於控制器14或其他遠端儲存裝置中。在一些實施例中,校正板13可以是任意用於校正機械手臂11的棋盤式或網格式校正板。在一些實施例中,校正點p~r可以是在校正板13上的各種不同圖案的標記(例如,三角形、星形或圓準心的圖案的標記)。在一些實施例中,校正點p~r在實際空間中的絕對座標也可預先儲存於控制器14或其他遠端儲存裝置中。It is worth noting that the transformation matrix between the robot arm coordinate system used by the base of the robot arm 11 and the absolute coordinate system of the actual space (i.e., homogeneous transformation matrix) is also preset and stored in controller 14 or other remote storage device. In some embodiments, the correction plate 13 may be any checkerboard or grid-type correction plate used for calibrating the robot arm 11 . In some embodiments, the correction points p~r may be marks with various different patterns on the correction plate 13 (for example, marks with patterns of triangles, stars, or circular centers). In some embodiments, the absolute coordinates of the calibration points p~r in the actual space can also be stored in the controller 14 or other remote storage devices in advance.

再者,控制器14連接機械手臂11,並控制以驅動機械手臂11移動攝影裝置12。在一些實施例中,控制器14可根據機械手臂11的多個連桿各自的長度以及這些連桿之間的多個參考點各自的軸角控制以驅動機械手臂11移動攝影裝置12到拍攝位置。在一些實施例中,控制器14可以由處理電路或專用邏輯電路實現,例如,處理器、現場可程式閘陣列(field programmable gate array, FPGA)或應用特定積體電路(application specific integrated circuit, ASIC)。Furthermore, the controller 14 is connected to the robotic arm 11 and controls to drive the robotic arm 11 to move the photography device 12 . In some embodiments, the controller 14 can drive the robotic arm 11 to move the photography device 12 to the shooting position according to the respective lengths of the multiple links of the robotic arm 11 and the respective axis angles of multiple reference points between these links. . In some embodiments, the controller 14 may be implemented by processing circuitry or dedicated logic circuitry, such as a processor, a field programmable gate array (FPGA), or an application specific integrated circuit (ASIC). ).

以下將進一步對基於影像處理的機械手臂校正系統1的運作進行描述。一併參照第2A圖,第2A圖繪示本揭示一些實施例中的基於影像處理的機械手臂校正方法的流程圖。第1圖的基於影像處理的機械手臂校正系統1中的元件用以執行基於影像處理的機械手臂校正方法中的步驟S210~S240。The operation of the robot arm correction system 1 based on image processing will be further described below. Referring also to FIG. 2A , FIG. 2A illustrates a flow chart of a robotic arm correction method based on image processing in some embodiments. The components in the image processing-based robot arm correction system 1 in Figure 1 are used to perform steps S210 to S240 in the image processing-based robot arm correction method.

如第2A圖所示,首先,於步驟S210中,控制器14設定校正板13上的至少一校正點p~r的拜訪順序。在一些實施例中,可預先儲存拜訪順序於控制器14中。在一些實施例中,拜訪順序可指示:由機械手臂11的初始位置由近至遠依序拜訪至少一校正點p~r。舉例而言,假設校正點p為相距機械手臂11的初始位置的最近位置,且校正點r為相距機械手臂11的初始位置的最遠位置,機械手臂11可依序移動至鄰近校正點p~r的位置,校正點p~r可分別在攝影裝置12在這3個拍攝位置上的拍攝範圍中。As shown in FIG. 2A , first, in step S210 , the controller 14 sets the access sequence of at least one calibration point p~r on the calibration plate 13 . In some embodiments, the access sequence may be pre-stored in the controller 14 . In some embodiments, the visit sequence may indicate that at least one correction point p~r is visited sequentially from the initial position of the robot arm 11 from near to far. For example, assuming that the calibration point p is the closest position to the initial position of the robot arm 11, and the calibration point r is the farthest position from the initial position of the robot arm 11, the robot arm 11 can move to the adjacent calibration point p~ in sequence. At the position of r, the correction points p~r can be respectively within the shooting range of the photography device 12 at these three shooting positions.

在一些實施例中,拜訪順序可指示:由至少一校正點p~r中任意選擇出第一校正點做為初始位置,並根據最短路徑依序拜訪至少一校正點中的第二校正點以及第三校正點。在一些實施例中,可利用最短路徑演算法(例如,狄克斯特拉演算法(Dijkstra algorithm)或最短路徑快速演算法(shortest path faster algorithm (SPFA))等)產生最短路徑。在一些實施例中,拜訪順序可指示:由至少一校正點p~r中任意選擇出第一校正點做為初始位置,並在拜訪至少一校正點p~r中的第二校正點後回到初始位置,進而拜訪至少一校正點p~r中的第三校正點。In some embodiments, the visit sequence may indicate: arbitrarily selecting a first correction point from at least one correction point p~r as the initial position, and sequentially visiting the second correction point among at least one correction point and according to the shortest path. The third correction point. In some embodiments, the shortest path may be generated using a shortest path algorithm (eg, Dijkstra algorithm (Dijkstra algorithm) or shortest path faster algorithm (SPFA), etc.). In some embodiments, the visit sequence may indicate: arbitrarily selecting a first correction point from at least one correction point p~r as the initial position, and returning after visiting a second correction point among at least one correction point p~r. to the initial position, and then visit the third calibration point among at least one calibration point p~r.

再者,如第2A圖所示,於步驟S220中,根據拜訪順序驅動機械手臂11使機械手臂11的機械手臂末端111上的攝影裝置12移動至至少三拍攝位置,並藉由攝影裝置12在至少三拍攝位置分別拍攝至少一影像。而至少一影像分別具有中心點。在一些實施例中,攝影裝置12移動至至少三拍攝位置的拜訪順序可預先由使用者設定以儲存於控制器14或其他遠端儲存裝置中。Furthermore, as shown in Figure 2A, in step S220, the robot arm 11 is driven according to the access sequence to move the photography device 12 on the robot arm end 111 of the robot arm 11 to at least three shooting positions, and the photography device 12 At least one image is captured in at least three shooting positions. And at least one image respectively has a center point. In some embodiments, the visit sequence in which the photography device 12 moves to at least three shooting positions can be preset by the user and stored in the controller 14 or other remote storage devices.

以下以實際例子說明在至少三拍攝位置上對校正板13進行拍攝。一併參照第3圖,第3圖繪示本揭示一些實施例中的在至少三拍攝位置上對校正板13進行拍攝的示意圖。如第3圖所示,假設可預先將攝影裝置12移動至一個初始位置,與初始位置最近的校正點為校正點q,以及與初始位置最遠的校正點為校正點r。此時,校正點q~r還不在攝影裝置的拍攝範圍VSo中。接著,可將攝影裝置12移動至第1個拍攝位置。此時,校正點p在攝影裝置12的拍攝範圍VSp中,且攝影裝置12會在第1個拍攝位置拍攝校正板13。此外,在第1個拍攝位置拍攝完成之後,可將攝影裝置12移動回初始位置。在另一些實施例中,也直接可將初始位置設定為校正點p的位置,並可依序拜訪校正點r以及校正點q。The following uses practical examples to describe photographing the correction plate 13 at at least three photographing positions. Referring also to FIG. 3 , FIG. 3 illustrates a schematic diagram of photographing the correction plate 13 at at least three photographing positions in some embodiments of the disclosure. As shown in FIG. 3 , assuming that the photography device 12 can be moved to an initial position in advance, the correction point closest to the initial position is the correction point q, and the correction point farthest from the initial position is the correction point r. At this time, the correction points q~r are not yet in the shooting range VSo of the photography device. Then, the photographing device 12 can be moved to the first photographing position. At this time, the correction point p is in the imaging range VSp of the imaging device 12, and the imaging device 12 will photograph the correction plate 13 at the first imaging position. In addition, after the shooting at the first shooting position is completed, the shooting device 12 can be moved back to the initial position. In other embodiments, the initial position can also be directly set to the position of the calibration point p, and the calibration point r and the calibration point q can be visited sequentially.

接著,可將攝影裝置12移動至第2個拍攝位置。此時,校正點q在攝影裝置12的拍攝範圍VSq中,且攝影裝置12會在第2個拍攝位置拍攝校正板13。此外,在第2個拍攝位置拍攝完成之後,可將攝影裝置12移動回初始位置。最後,可將攝影裝置12移動至第3個拍攝位置。此時,校正點r在攝影裝置12的拍攝範圍VSr中,且攝影裝置12會在第3個拍攝位置拍攝校正板13。此外,在第3個拍攝位置拍攝完成之後,可將攝影裝置12移動回初始位置。Then, the photographing device 12 can be moved to the second photographing position. At this time, the correction point q is in the imaging range VSq of the imaging device 12, and the imaging device 12 will photograph the correction plate 13 at the second imaging position. In addition, after the shooting at the second shooting position is completed, the shooting device 12 can be moved back to the initial position. Finally, the photographing device 12 can be moved to the third photographing position. At this time, the correction point r is in the imaging range VSr of the imaging device 12, and the imaging device 12 will photograph the correction plate 13 at the third imaging position. In addition, after the shooting at the third shooting position is completed, the shooting device 12 can be moved back to the initial position.

以下將進一步對第2A圖中的步驟S220的運作進行描述。一併參照第2B圖,第2B圖繪示本揭示一些實施例中的第2A圖的基於影像處理的機械手臂校正方法進一步的步驟的流程圖。第1圖的基於影像處理的機械手臂校正系統1中的元件用以執行第2A圖中的步驟S220進一步的步驟中的步驟S221~S222。如第2B圖所示,首先,如第2B圖所示,於步驟S221中,控制器14在辨識攝影裝置12的拍攝範圍涵蓋至少一校正點p~r後即產生至少一影像。換言之,只要攝影裝置12的拍攝範圍能涵蓋到校正點就會產生影像。The operation of step S220 in Figure 2A will be further described below. Referring also to FIG. 2B , FIG. 2B illustrates a flowchart illustrating further steps of the image processing-based robotic arm correction method of FIG. 2A in some embodiments. The components in the robot arm correction system 1 based on image processing in Figure 1 are used to perform steps S221~S222 in the further steps of step S220 in Figure 2A. As shown in Figure 2B, first, as shown in Figure 2B, in step S221, the controller 14 generates at least one image after identifying that the shooting range of the photography device 12 covers at least one correction point p~r. In other words, as long as the shooting range of the photography device 12 can cover the correction point, an image will be generated.

再者,於步驟S222中,由至少一影像計算至少一校正點p~r的向量資訊,以調整機械手臂11。換言之,可以基於從影像計算出的校正點p~r的向量資訊校正調整機械手臂。在一些實施例中,向量資訊可包括多個第一向量以及多個第二向量。Furthermore, in step S222, vector information of at least one correction point p~r is calculated from at least one image to adjust the robot arm 11. In other words, the robot arm can be corrected and adjusted based on the vector information of the correction points p~r calculated from the image. In some embodiments, the vector information may include a plurality of first vectors and a plurality of second vectors.

再者,以下實施例將進一步說明向量資訊的產生以及第2B圖中的步驟S222的運作進行描述。一併參照第2C圖,第2C圖繪示本揭示一些實施例中的第2B圖的基於影像處理的機械手臂校正方法進一步的步驟的流程圖。第1圖的基於影像處理的機械手臂校正系統1中的元件用以執行第2C圖中的步驟S222進一步的步驟中的步驟S222A~S222C。如第2C圖所示,首先,如第2C圖所示,於步驟S222A中,控制器14計算在至少一影像中的校正點p~r的位置與至少一影像各自的中心點之間的多個第一向量,並計算多個第一向量之間的多個向量差。在一些實施例中,控制器14可辨識在至少一影像中的各者中的校正點的像素位置與至少一影像中的各者的中心點的像素位置之間的二維像素差(例如,影像中的校正點的像素位置與中心點的像素位置之間的二維像素差為X方向的3個像素以及Y方向的2個像素)。接著,控制器14可將從至少一影像所辨識出的多個二維像素差分別轉換為在實際空間中的多個第一向量(例如,影像中的X方向的3個像素以及Y方向的2個像素被轉換為第一向量,第一向量由實際空間中的X方向的3公分、Y方向的2公分以及Z方向為0公分所組成)。Furthermore, the following embodiments will further describe the generation of vector information and the operation of step S222 in Figure 2B. Referring also to FIG. 2C , FIG. 2C illustrates a flowchart illustrating further steps of the image processing-based robotic arm correction method of FIG. 2B in some embodiments. The components in the robot arm correction system 1 based on image processing in Figure 1 are used to perform steps S222A~S222C in the further steps of step S222 in Figure 2C. As shown in Figure 2C, first, as shown in Figure 2C, in step S222A, the controller 14 calculates the multiplicity between the positions of the correction points p~r in the at least one image and the respective center points of the at least one image. first vectors, and calculate multiple vector differences between multiple first vectors. In some embodiments, controller 14 may identify a two-dimensional pixel difference between the pixel location of the correction point in each of the at least one image and the pixel location of the center point of each of the at least one image (e.g., The two-dimensional pixel difference between the pixel position of the correction point and the pixel position of the center point in the image is 3 pixels in the X direction and 2 pixels in the Y direction). Then, the controller 14 may convert the plurality of two-dimensional pixel differences recognized from at least one image into a plurality of first vectors in the real space (for example, 3 pixels in the X direction and 3 pixels in the Y direction in the image). 2 pixels are converted into a first vector, which consists of 3 cm in the X direction, 2 cm in the Y direction, and 0 cm in the Z direction in the actual space).

以下以實際例子說明第一向量。一併參照第4A圖至第4C圖,第4A圖至第4C圖繪示在一些實施例中的至少一影像IMGp、IMGq、IMGr的示意圖。如第第4A圖至第4C圖,影像IMGp、IMGq、IMGr具有多個中心點Op、Oq、Or。藉此,可計算影像IMGp、IMGq、IMGr中的校正點p~r與中心點Op、Oq、Or之間的多個二維像素差 ,其中二維像素差 皆包括像素數的X方向的分量以及Y方向的分量。藉此,可將二維像素差 轉換為在實際空間中的多個第一向量,並計算多個第一向量之間的多個向量差。 The following uses a practical example to illustrate the first vector. Referring to FIGS. 4A to 4C together, FIGS. 4A to 4C illustrate schematic diagrams of at least one image IMGp, IMGq, and IMGr in some embodiments. As shown in Figures 4A to 4C, the images IMGp, IMGq, and IMGr have multiple center points Op, Oq, and Or. Through this, multiple two-dimensional pixel differences between the correction points p~r and the center points Op, Oq, Or in the images IMGp, IMGq, and IMGr can be calculated. , , , where the two-dimensional pixel difference , , Both include the X-direction component and the Y-direction component of the number of pixels. In this way, the two-dimensional pixel difference can be , , Convert to multiple first vectors in real space and calculate multiple vector differences between the multiple first vectors.

再者,如第2C圖所示,於步驟S222B中,控制器14計算校正板13上的校正點p~r之間的多個第二向量,並擷取當攝影裝置12在至少三拍攝位置時的機械手臂11上的多個參考點的多個軸角。在一些實施例中,控制器14可計算校正點p~r在實際空間中的絕對座標之間的多個第二向量。Furthermore, as shown in Figure 2C, in step S222B, the controller 14 calculates a plurality of second vectors between the correction points p~r on the correction plate 13, and captures the images when the photography device 12 is at at least three shooting positions. multiple axis angles of multiple reference points on the robot arm 11 at the time. In some embodiments, the controller 14 may calculate a plurality of second vectors between the absolute coordinates of the correction points p~r in the real space.

以下以實際例子說明第二向量。如第1圖所示,可根據儲存的校正點p~r在實際空間中的絕對座標,計算出校正點p、r之間的三維方向的距離差的第二向量 以及校正點p、q之間的三維方向的距離差的第二向量 ,其中第二向量 皆為3×1的向量,且向量中的元素分別為X、Y、Z方向的距離差。 The following uses a practical example to illustrate the second vector. As shown in Figure 1, the second vector of the distance difference in the three-dimensional direction between the correction points p and r can be calculated based on the stored absolute coordinates of the correction points p~r in the actual space. and the second vector that corrects the distance difference in the three-dimensional direction between points p and q. , where the second vector , They are all 3×1 vectors, and the elements in the vector are distance differences in the X, Y, and Z directions respectively.

再者,如第2C圖所示,於步驟S222C中,控制器14根據多個向量差、多個第二向量以及多個軸角,計算出機械手臂11上的多個連桿的長度偏移量向量,以及機械手臂11上的多個參考點的旋轉偏移量向量,以利用長度偏移量向量以及旋轉偏移量向量對機械手臂11進行校正。在一些實施例中,軸角可以是當攝影裝置12在至少三拍攝位置時的機械手臂11上的多個參考點所轉動的角度。在一些實施例中,長度偏移量向量可包括多個連桿各自的長度偏移量,旋轉偏移量向量可包括多個參考點各自的軸角偏移量。藉此,可利用多個連桿各自的長度偏移量調整各自的長度,以及利用多個參考點各自的軸角偏移量調整各自旋轉的軸角。Furthermore, as shown in FIG. 2C , in step S222C, the controller 14 calculates the length offsets of the multiple links on the robotic arm 11 based on a plurality of vector differences, a plurality of second vectors and a plurality of axis angles. The length vector and the rotation offset vector of multiple reference points on the robot arm 11 are used to correct the robot arm 11 using the length offset vector and the rotation offset vector. In some embodiments, the axis angle may be an angle at which multiple reference points on the robot arm 11 rotate when the photography device 12 is in at least three shooting positions. In some embodiments, the length offset vector may include respective length offsets of multiple links, and the rotational offset vector may include respective axis angle offsets of multiple reference points. Thereby, the respective length offsets of the multiple connecting rods can be used to adjust their respective lengths, and the respective axis angle offsets of the multiple reference points can be used to adjust the axis angles of their respective rotations.

在一些實施例中,控制器14可利用順向運動學(inverse kinematics)產生機械手臂11的預測函數,並根據多個軸角以及預測函數計算當攝影裝置12移動至至少三拍攝位置時的多個預測位置,其中預測函數以多個連桿的多個長度以及多個參考點的多個軸角為變數。接著,控制器14可根據多個向量差、多個第二向量以及多個預測位置利用預測函數計算長度偏移量向量以及旋轉偏移量向量。In some embodiments, the controller 14 may utilize inverse kinematics to generate a prediction function of the robotic arm 11, and calculate multiple angles when the photography device 12 moves to at least three shooting positions based on multiple axis angles and the prediction function. predicted positions, where the prediction function takes as variables multiple lengths of multiple links and multiple axis angles of multiple reference points. Then, the controller 14 may use the prediction function to calculate the length offset vector and the rotation offset vector according to the plurality of vector differences, the plurality of second vectors and the plurality of predicted positions.

以下以實際例子說明預測函數。一併參照第5圖,第5圖繪示本揭示一些實施例中的多個關節J1~J3以及機械手臂末端111的示意圖。如第5圖所示,機械手臂11為四軸SCARA機械手臂,其包括多個關節J1~J3以及機械手臂末端111,其中關節J1連接於機械手臂11的底座B,關節J1~J3各自轉動的軸角分別是q1、q2、q4,關節J1~J2之間的連接部LK1的長度為a1,關節J2~J3之間的連接部LK2的長度為a2,關節J2~J3之間的垂直偏移量為q3(即,連接部LK3的長度),關節J3以及機械手臂末端111由連接部LK4連接,連接部LK4在水平方向的長度為W,關節J3以及機械手臂末端111之間的垂直偏移量為h(即,連接部LK4在垂直方向的長度)。The prediction function is explained below with a practical example. Referring also to FIG. 5 , FIG. 5 illustrates a schematic diagram of a plurality of joints J1 - J3 and a robotic arm end 111 in some embodiments. As shown in Figure 5, the robotic arm 11 is a four-axis SCARA robotic arm, which includes multiple joints J1~J3 and a robotic arm end 111. The joint J1 is connected to the base B of the robotic arm 11, and the joints J1~J3 rotate respectively. The axis angles are q1, q2, and q4 respectively, the length of the connection LK1 between joints J1~J2 is a1, the length of the connection LK2 between joints J2~J3 is a2, and the vertical offset between joints J2~J3 The quantity is q3 (that is, the length of the connecting part LK3), the joint J3 and the robot arm end 111 are connected by the connecting part LK4, the length of the connecting part LK4 in the horizontal direction is W, the vertical offset between the joint J3 and the robot arm end 111 The amount is h (that is, the length of the connecting portion LK4 in the vertical direction).

詳細而言,由於第5圖為向Y方向觀察機械手臂的側視圖,為便於說明,以下可先忽略Y軸(因為所有座標系的Y方向都一樣)以說明上述旋轉的軸角。底座B的機械手臂座標系的原點以及座標軸與關節J1的座標系的原點以及座標軸都重疊(即,原點在關節J1重疊,座標軸 重疊,座標軸 重疊),此時,可以座標軸 為中心,將座標軸 逆時針旋轉軸角q1,並可以關節J2的座標系的座標軸 為中心,將座標軸 逆時針旋轉軸角q2。接著,連接部LK3的末端的座標系的原點以及座標軸與關節J3的座標系的原點以及座標軸都重疊(即,原點在關節J3重疊,座標軸 重疊,座標軸 重疊),此時,可以座標軸 為中心,將座標軸 逆時針旋轉軸角q4。 In detail, since Figure 5 is a side view of the robot arm viewed in the Y direction, for the convenience of explanation, the Y axis can be ignored below (because the Y direction of all coordinate systems is the same) to illustrate the axis angle of the above rotation. The origin and coordinate axes of the robot arm coordinate system of base B overlap with the origin and coordinate axes of the coordinate system of joint J1 (that is, the origin overlaps at joint J1 and the coordinate axes , overlap, axes , overlap), at this time, the coordinate axis can , as the center, move the coordinate axis Rotate the axis angle q1 counterclockwise and joint the coordinate axis of the coordinate system of J2 as the center, move the coordinate axis Rotate the axis angle q2 counterclockwise. Next, the origin and coordinate axes of the coordinate system at the end of the connecting portion LK3 overlap with the origin and coordinate axes of the coordinate system of the joint J3 (that is, the origin overlaps at the joint J3 and the coordinate axes , overlap, axes , overlap), at this time, the coordinate axis can , as the center, move the coordinate axis Rotate the axis angle q4 counterclockwise.

接著,可基於上述機械手臂11的結構以及參數計算出底座B的機械手臂座標系、關節J1~J2的座標系、連接部LK3的末端的座標系、關節J3的座標系以及機械手臂末端111的手臂末端座標系之間的多個轉換矩陣,這些轉換矩陣將以以下公式(1)~(5)表示。 …公式(1) …公式(2) …公式(3) …公式(4) …公式(5) Then, based on the structure and parameters of the robot arm 11 mentioned above, the robot arm coordinate system of the base B, the coordinate system of the joints J1 to J2, the coordinate system of the end of the connecting part LK3, the coordinate system of the joint J3, and the coordinate system of the robot arm end 111 can be calculated. Multiple transformation matrices between the arm end coordinate systems, these transformation matrices will be expressed by the following formulas (1)~(5). …Formula 1) …Formula (2) …Formula (3) …Formula (4) …Formula (5)

其中 為底座B的機械手臂座標系與關節J1的座標系之間的轉換矩陣, 為關節J1的座標系與關節J2的座標系之間的轉換矩陣, 為關節J2的座標系與連接部LK3的末端的座標系之間的轉換矩陣, 為連接部LK3的末端的座標系與關節J3的座標系之間的轉換矩陣, 為關節J3的座標系與機械手臂末端111的手臂末端座標系之間的轉換矩陣, 為這些轉換矩陣中的旋轉矩陣, 為這些轉換矩陣中的位移矩陣。藉此,可從轉換矩陣產生以下公式(6)的函式。 …公式(6) in is the transformation matrix between the robot arm coordinate system of base B and the coordinate system of joint J1, is the transformation matrix between the coordinate system of joint J1 and the coordinate system of joint J2, is the transformation matrix between the coordinate system of joint J2 and the coordinate system of the end of connecting part LK3, is the transformation matrix between the coordinate system of the end of the connecting part LK3 and the coordinate system of the joint J3, is the transformation matrix between the coordinate system of joint J3 and the arm end coordinate system of robot arm end 111, , , , , is the rotation matrix among these transformation matrices, , , , , is the displacement matrix among these transformation matrices. Thereby, the function of the following formula (6) can be generated from the transformation matrix. …Formula (6)

其中 為四軸表示式, 為機械手臂座標系與手臂末端座標系之間的位移矩陣,也是上述預測函數,其為上述位移矩陣 的乘積, 分別為機械手臂座標系的原點與手臂末端座標系的原點之間的X、Y、Z方向的距離差, 為機械手臂座標系的Z軸與手臂末端座標系的Z軸之間的角度差。 in is the four-axis expression, is the displacement matrix between the robot arm coordinate system and the arm end coordinate system, and is also the above prediction function, which is the above displacement matrix , , , , The product of , , are the distance differences in the X, Y, and Z directions between the origin of the robot arm coordinate system and the origin of the arm end coordinate system, respectively. It is the angle difference between the Z axis of the robot arm coordinate system and the Z axis of the arm end coordinate system.

由此可知,預測函數就是以多個連桿(即,上述連接部LK1~LK4)的多個長度以及多個參考點(即,上述關節J1~J3)的多個軸角為變數。一旦帶入檢測出的這些長度以及這些軸角,就能預測出機械手臂末端111在實際空間中的絕對座標(即,上述預測位置)。值得注意的是,此絕對座標是由預測函數所預測出來的,因此,不一定會等同於實際上的機械手臂末端111在實際空間中的絕對座標(可能因為機械手臂11長時間使用之後,而導致機械手臂末端111的連桿以及關節的偏移)。It can be seen from this that the prediction function uses multiple lengths of multiple connecting rods (ie, the above-mentioned connecting portions LK1 ~ LK4 ) and multiple axis angles of multiple reference points (ie, the above-mentioned joints J1 ~ J3 ) as variables. Once the detected lengths and these axis angles are brought in, the absolute coordinates of the robot arm end 111 in the actual space (ie, the above-mentioned predicted position) can be predicted. It is worth noting that this absolute coordinate is predicted by the prediction function, so it may not necessarily be equivalent to the actual absolute coordinate of the end of the robot arm 111 in the actual space (maybe because after the robot arm 11 has been used for a long time, Resulting in the deflection of the links and joints at the end of the robotic arm 111).

在理想狀態下,當控制器14根據所設定的拍攝位置而控制以驅動機械手臂11上的攝影裝置12移動至2個或2個以上的拍攝位時,則攝影裝置12在每2個拍攝位置上的實際位置的差值減去攝影裝置12在每2個拍攝位置上所計算出的預測位置之間的差值將等於0。In an ideal state, when the controller 14 controls to drive the photographing device 12 on the robotic arm 11 to move to 2 or more shooting positions according to the set shooting position, the shooting device 12 will move at every 2 shooting positions. The difference between the actual positions minus the difference between the predicted positions calculated by the camera 12 at every two shooting positions will be equal to 0.

以下以第1圖以及第4A圖至第4B圖做說明,如第1圖以及第4A圖至第4B圖所示,此時存在3個拍攝位置,校正點p、q之間的第二向量以及校正點p、r之間的第二向量分別為 。假設可由影像IMGp、IMGq中的二維像素差 產生在實際空間中的多個向量差 ,可由影像IMGp、IMGr中的二維像素差 產生在實際空間中的多個向量差 ,此時 的和就是攝影裝置12在與校正點p、q對應的拍攝位置上的實際位置的差值,而 的和就是攝影裝置12在與校正點p、r對應的拍攝位置上的實際位置的差值。藉此,上述差值將可以以下公式(7)~公式(8)表示。 …公式(7) …公式(8) The following is explained with Figure 1 and Figures 4A to 4B. As shown in Figure 1 and Figures 4A to 4B, there are three shooting positions at this time. The second vector between the correction points p and q And the second vector between the correction points p and r are respectively , . It is assumed that the two-dimensional pixel difference in the images IMGp and IMGq can be , Generates multiple vector differences in real space , can be determined by the two-dimensional pixel difference in the images IMGp and IMGr , Generates multiple vector differences in real space , at this time , The sum of is the difference between the actual positions of the photographing device 12 at the photographing positions corresponding to the correction points p and q, and , The sum of is the difference between the actual positions of the photographing device 12 at the photographing positions corresponding to the correction points p and r. Thus, the above difference can be expressed by the following formula (7) ~ formula (8). …Formula (7) …Formula (8)

其中 為上述獲得的預測函數(即,上述公式(6)中的 ), 為攝影裝置12在與校正點q對應的拍攝位置時的機械手臂末端111的預測位置, 為攝影裝置12在與校正點q對應的拍攝位置時的多個軸角的總和, 為攝影裝置12在與校正點p對應的拍攝位置時的機械手臂末端111的預測位置, 為攝影裝置12在與校正點p對應的拍攝位置時的多個軸角的總和, 為攝影裝置12在與校正點r對應的拍攝位置時的機械手臂末端111的預測位置, 為攝影裝置12在與校正點r對應的拍攝位置時的多個軸角的總和。 in is the prediction function obtained above (i.e., in the above formula (6) ), is the predicted position of the robot arm end 111 when the imaging device 12 is at the imaging position corresponding to the correction point q, is the sum of multiple axis angles when the imaging device 12 is at the imaging position corresponding to the correction point q, is the predicted position of the robot arm end 111 when the imaging device 12 is at the imaging position corresponding to the correction point p, is the sum of multiple axial angles when the photographing device 12 is at the photographing position corresponding to the correction point p, is the predicted position of the robot arm end 111 when the imaging device 12 is at the imaging position corresponding to the correction point r, is the sum of multiple axis angles when the imaging device 12 is at the imaging position corresponding to the correction point r.

接著,由上述公式(7)以及公式(8)可產生2個3×1的向量,在理想狀態下,這2個向量都應該要是零向量。然而,由於製造或組裝可能造成長度或軸角的誤差,因此,這2個向量將有可能不為0。以下將說明要怎麼計算出製造或組裝所造成的長度或軸角的誤差。Next, two 3×1 vectors can be generated from the above formula (7) and formula (8). Under ideal conditions, these two vectors should be zero vectors. However, due to length or axis angle errors that may occur due to manufacturing or assembly, these two vectors may not be 0. The following explains how to calculate length or axis angle errors caused by manufacturing or assembly.

在一些實施例中,控制器14可計算在該預測函數下的多個長度的偏導數以及多個軸角的偏導數以產生雅可比(Jacobian)矩陣。接著,控制器14可根據多個向量差、多個第二向量、多個預測位置、雅可比矩陣以及多個軸角,計算長度偏移量向量以及旋轉偏移量向量。接著,控制器14可利用長度偏移量向量以及旋轉偏移量向量校正機械手臂11上的多個連桿的多個長度以及多個旋轉軸的多個軸角。In some embodiments, the controller 14 may calculate partial derivatives of multiple lengths and partial derivatives of multiple axis angles under the prediction function to generate a Jacobian matrix. Then, the controller 14 may calculate the length offset vector and the rotation offset vector according to the plurality of vector differences, the plurality of second vectors, the plurality of predicted positions, the Jacobian matrices, and the plurality of axis angles. Then, the controller 14 may use the length offset vector and the rotation offset vector to correct multiple lengths of multiple links and multiple axis angles of multiple rotation axes on the robotic arm 11 .

以下以實際的例子說明長度偏移量向量以及旋轉偏移量向量的計算。如以下公式(9)所示。 …公式(9) The following uses practical examples to illustrate the calculation of the length offset vector and the rotation offset vector. As shown in the following formula (9). …Formula (9)

其中 為由上述 所計算出的雅可比矩陣, 帶入攝影裝置12在與校正點q對應的拍攝位置時的多個長度以及多個軸角時的矩陣, 帶入攝影裝置12在與校正點p對應的拍攝位置時的多個長度以及多個軸角時的矩陣, 帶入攝影裝置12在與校正點r對應的拍攝位置時的多個長度以及多個軸角時的矩陣, 為由機械手臂11上的多個連桿各自的長度偏移量所組成的長度偏移量向量, 為由機械手臂11上的多個參考點各自的軸角偏移量所組成的旋轉偏移量向量。 in for the above reasons The calculated Jacobian matrix, for Bring in the matrix of multiple lengths and multiple axis angles when the photography device 12 is at the shooting position corresponding to the correction point q, for Bring in the matrix of multiple lengths and multiple axis angles when the photography device 12 is at the shooting position corresponding to the correction point p, for Bring in the matrix of multiple lengths and multiple axis angles when the photography device 12 is at the shooting position corresponding to the correction point r, is a length offset vector composed of the respective length offsets of multiple links on the robotic arm 11, is a rotation offset vector composed of the respective axis angle offsets of multiple reference points on the robot arm 11 .

藉此,由公式(9)的聯立方程式便可計算出長度偏移量向量以及旋轉偏移量向量,並利用長度偏移量向量以及旋轉偏移量向量調整機械手臂11上的多個連桿各自的長度以及多個參考點各自的軸角。Thereby, the length offset vector and the rotation offset vector can be calculated from the simultaneous equations of formula (9), and the length offset vector and the rotation offset vector can be used to adjust multiple connections on the robot arm 11 The respective lengths of the rods and the respective axis angles of the multiple reference points.

在一些實施例中,控制器14可判斷攝影裝置12在其中每二個拍攝位置上的實際位置的差值減去攝影裝置12在其中每二拍攝位置上所計算出的預測位置之間的差值是否小於一個收斂值,其中此收斂值可以為使用者預先設定的。接著,當不小於收斂值時,會繼續利用上述聯立方程式計算出長度偏移量向量以及旋轉偏移量向量以校正機械手臂11。反之,則不會計算長度偏移量向量以及旋轉偏移量向量以結束本揭示的基於影像處理的機械手臂校正方法。In some embodiments, the controller 14 may determine the difference between the actual positions of the photography device 12 at every two shooting positions minus the difference between the predicted positions calculated by the camera 12 at every two shooting positions. Whether the value is less than a convergence value, where this convergence value can be preset by the user. Then, when it is not less than the convergence value, the length offset vector and the rotation offset vector will continue to be calculated using the above simultaneous equations to correct the robot arm 11 . On the contrary, the length offset vector and the rotation offset vector will not be calculated to end the robot arm correction method based on image processing of the present disclosure.

藉由上述步驟,可利用非接觸的影像拍攝方法計算出長度偏移量向量以及旋轉偏移量向量。此外,當一直不小於收斂值時,可不斷計算出新的長度偏移量向量以及新的旋轉偏移量向量以校正機械手臂11,直到小於收斂值。藉由這樣不斷校正的方法,可修正校正機械手臂11的機械手臂末端111的原點的偏移。Through the above steps, the length offset vector and the rotation offset vector can be calculated using the non-contact image capturing method. In addition, when it is not less than the convergence value, new length offset vectors and new rotation offset vectors can be continuously calculated to correct the robot arm 11 until it is less than the convergence value. Through this continuous correction method, the offset of the origin of the robot arm end 111 of the robot arm 11 can be corrected.

綜上所述,本揭示提供一種基於影像處理的機械手臂校正方法,其係利用拍攝校正板上的校正點以計算出校正點之間的距離,並利用這些距離計算出機械手臂的多個連桿各自的長度偏移量,以及機械手臂的多個參考點各自的軸角偏移量,並利用多個連桿各自的長度偏移量以及多個參考點各自的軸角偏移量實現對機械手臂的原點校正。因此,於機械手臂的運作過程中,若不確定機械手臂的原點是否已產生偏移,則可在機械手臂的工作環境中即時對機械手臂進行校正,且在校正完成後無需重新教點。藉此,可節省校正所需的時間及成本,並大幅提升機械手臂的工作效率。此外,由於僅僅是利用機械手臂末端的攝影裝置拍攝校正板,當機械手臂進行校正時,無需在校正前裝設任何額外的工具,從而可節省校正工序及耗費時間,間接提升機械手臂的工作效率。In summary, the present disclosure provides a robotic arm correction method based on image processing, which uses photographing the correction points on the correction plate to calculate the distance between the correction points, and uses these distances to calculate multiple connections of the robotic arm. The respective length offsets of the rods and the respective axis angle offsets of the multiple reference points of the robotic arm are used to achieve alignment using the respective length offsets of the multiple connecting rods and the respective axis angle offsets of the multiple reference points. Origin correction of robotic arm. Therefore, during the operation of the robot arm, if it is not sure whether the origin of the robot arm has shifted, the robot arm can be calibrated immediately in the working environment of the robot arm, and there is no need to reteach the points after the correction is completed. In this way, the time and cost required for calibration can be saved, and the work efficiency of the robotic arm can be greatly improved. In addition, since only the camera device at the end of the robotic arm is used to capture the calibration plate, when the robotic arm performs calibration, there is no need to install any additional tools before calibration, thus saving the calibration process and time, and indirectly improving the work efficiency of the robotic arm. .

1:基於影像處理的機械手臂校正系統1: Robotic arm correction system based on image processing

11:機械手臂11: Robotic arm

111:機械手臂末端111: End of robotic arm

12:攝影裝置12: Photography installation

13:校正板13:Calibration plate

14:控制器14:Controller

p~r:校正點p~r: correction point

:第二向量 , :Second vector

S210~S240:步驟S210~S240: steps

VSp、VSq、VSr:拍攝範圍VSp, VSq, VSr: shooting range

IMGp、IMGq、IMGr:影像IMGp, IMGq, IMGr: images

Op、Oq、Or:中心點Op, Oq, Or: center point

:二維像素差 , , : Two-dimensional pixel difference

B:底座B:Base

J1~J3:關節J1~J3: joints

LK1~LK4:連接部LK1~LK4: Connector

a1~a2:長度a1~a2: length

q1、q2、q4:軸角q1, q2, q4: axis angle

w:水平方向的長度w: horizontal length

q3、h:垂直偏移量q3, h: vertical offset

:座標軸 , , , , , , , , , , , :Coordinate axis

第1圖繪示本揭示一些實施例的基於影像處理的機械手臂校正系統的示意圖。 第2A圖繪示本揭示一些實施例中的基於影像處理的機械手臂校正方法的流程圖。 第2B圖繪示本揭示一些實施例中的第2A圖的基於影像處理的機械手臂校正方法進一步的步驟的流程圖。 第2C圖繪示本揭示一些實施例中的第2B圖的基於影像處理的機械手臂校正方法進一步的步驟的流程圖。 第3圖繪示本揭示一些實施例中的在至少三拍攝位置上對校正板進行拍攝的示意圖。 第4A圖至第4C圖繪示在一些實施例中的至少一影像的示意圖。 第5圖繪示本揭示一些實施例中的多個關節以及機械手臂末端的示意圖。 FIG. 1 is a schematic diagram of a robotic arm correction system based on image processing according to some embodiments of the disclosure. FIG. 2A illustrates a flowchart of a robotic arm correction method based on image processing in some embodiments. FIG. 2B is a flowchart illustrating further steps of the image processing-based robotic arm correction method of FIG. 2A in some embodiments. Figure 2C is a flowchart illustrating further steps of the image processing-based robotic arm correction method of Figure 2B in some embodiments. Figure 3 is a schematic diagram of photographing the correction plate at at least three photographing positions in some embodiments of the present disclosure. Figures 4A to 4C illustrate schematic diagrams of at least one image in some embodiments. Figure 5 is a schematic diagram of multiple joints and the end of a robotic arm in some embodiments of the disclosure.

S210~S220:步驟 S210~S220: steps

Claims (18)

一種基於影像處理的機械手臂校正方法,用以校正一機械手臂,包括:設定一校正板上的至少一校正點的一拜訪順序;以及根據該拜訪順序驅動該機械手臂使該機械手臂的一機械手臂末端上的一攝影裝置移動至至少三拍攝位置,藉由該攝影裝置在該至少三拍攝位置以分別拍攝至少一影像,該至少一影像分別具有一中心點,其中藉由該攝影裝置在該至少三拍攝位置以分別產生該至少一個影像的步驟包括:在辨識該攝影裝置的拍攝範圍涵蓋該至少一校正點後即產生該至少一影像;以及由該至少一影像計算該至少一校正點的一向量資訊,以調整該機械手臂。 A method for calibrating a robotic arm based on image processing for calibrating a robotic arm, including: setting an access sequence for at least one calibration point on a calibration plate; and driving the robotic arm according to the access sequence to make a mechanical arm of the robotic arm A photography device on the end of the arm moves to at least three shooting positions, and the photography device captures at least one image respectively at the at least three shooting positions, and the at least one image respectively has a center point, wherein the photography device captures at least one image at the at least three shooting positions. The steps of generating the at least one image from at least three shooting positions include: generating the at least one image after identifying that the shooting range of the photography device covers the at least one correction point; and calculating the at least one correction point from the at least one image. A vector information to adjust the robot arm. 如請求項1所述之基於影像處理的機械手臂校正方法,其中該向量資訊包括多個第一向量以及多個第二向量,其中由該至少一影像計算該至少一校正點的該向量資訊,以調整該機械手臂的步驟包括:計算在該些影像中的該至少一校正點的位置與該些影像各自的中心點之間的多個第一向量,並計算該些第一向量之間的多個向量差;計算該校正板上的該至少一校正點之間的多個第二向量;以及根據該些向量差、該些第二向量以及多個軸角,計算出 該機械手臂上的多個連桿的一長度偏移量向量,以及該機械手臂上的多個參考點的一旋轉偏移量向量,以利用該長度偏移量向量以及該旋轉偏移量向量對該機械手臂進行校正。 The robotic arm correction method based on image processing as described in claim 1, wherein the vector information includes a plurality of first vectors and a plurality of second vectors, wherein the vector information of the at least one correction point is calculated from the at least one image, The step of adjusting the robotic arm includes: calculating a plurality of first vectors between the positions of the at least one correction point in the images and respective center points of the images, and calculating the distance between the first vectors. A plurality of vector differences; calculating a plurality of second vectors between the at least one calibration point on the correction plate; and calculating based on the vector differences, the second vectors and a plurality of axis angles A length offset vector of a plurality of links on the robot arm, and a rotation offset vector of a plurality of reference points on the robot arm, so as to utilize the length offset vector and the rotation offset vector Calibrate the robot arm. 如請求項2所述之基於影像處理的機械手臂校正方法,其中計算在該些影像中的該至少一校正點的位置與該些影像各自的中心點之間的該些第一向量的步驟包括:辨識在該些影像中的各者中的校正點的像素位置與該些影像中的該各者的中心點的像素位置之間的一二維像素差;以及將從該些影像所辨識出的該些二維像素差分別轉換為在一實際空間中的該些第一向量。 The robot arm correction method based on image processing as described in claim 2, wherein the step of calculating the first vectors between the position of the at least one correction point in the images and the respective center points of the images includes : identifying a one-dimensional pixel difference between the pixel position of the correction point in each of the images and the pixel position of the center point of each of the images; and identifying from the images The two-dimensional pixel differences are respectively converted into the first vectors in a real space. 如請求項2所述之基於影像處理的機械手臂校正方法,其中該長度偏移量向量可包括該些連桿各自的長度偏移量,該旋轉偏移量向量可包括該些參考點各自的軸角偏移量,其中計算該至少一校正點之間的該些第二向量的步驟包括:計算該校正板的該至少一校正點在一實際空間中的絕對座標之間的該些第二向量。 The robotic arm correction method based on image processing as described in claim 2, wherein the length offset vector may include the respective length offsets of the links, and the rotation offset vector may include the respective length offsets of the reference points. Axial angle offset, wherein the step of calculating the second vectors between the at least one correction point includes: calculating the second vectors between the absolute coordinates of the at least one correction point of the correction plate in a real space vector. 如請求項2所述之基於影像處理的機械手臂 校正方法,其中根據該些向量差、該些第二向量以及該些軸角,計算出該機械手臂上的該些連桿的該長度偏移量向量,以及該機械手臂上的該些參考點的該旋轉偏移量向量,以利用該長度偏移量向量以及該旋轉偏移量向量對該機械手臂進行校正的步驟包括:利用順向運動學產生該機械手臂的一預測函數,並根據該些軸角以及該預測函數計算當該攝影裝置移動至該些拍攝位置時的多個預測位置,其中該預測函數以該些連桿的多個長度以及該些參考點的該些軸角為變數;以及根據該些向量差、該些第二向量以及該些預測位置利用該預測函數計算該長度偏移量向量以及該旋轉偏移量向量。 Robotic arm based on image processing as described in request 2 Correction method, wherein the length offset vectors of the links on the robotic arm and the reference points on the robotic arm are calculated based on the vector differences, the second vectors and the axis angles The step of using the length offset vector and the rotation offset vector to correct the robotic arm includes: using forward kinematics to generate a prediction function of the robotic arm, and based on the These axis angles and the prediction function calculate a plurality of predicted positions when the photography device moves to the shooting positions, wherein the prediction function uses the lengths of the connecting rods and the axis angles of the reference points as variables. ; And use the prediction function to calculate the length offset vector and the rotation offset vector according to the vector differences, the second vectors and the predicted positions. 如請求項5所述之基於影像處理的機械手臂校正方法,其中根據該些向量差、該些第二向量以及該些軸角,計算出該機械手臂上的該些連桿的該長度偏移量向量,以及該機械手臂上的該些參考點的該旋轉偏移量向量,以利用該長度偏移量向量以及該旋轉偏移量向量對該機械手臂進行校正的步驟包括:計算在該預測函數下的該些長度的偏導數以及該些軸角的偏導數以產生一雅可比矩陣;根據該些向量差、該些第二向量、該些預測位置、該雅可比矩陣以及該些軸角,計算該長度偏移量向量以及該旋轉偏移量向量;以及 利用該長度偏移量向量以及該旋轉偏移量向量校正該機械手臂上的多個連桿的多個長度以及多個旋轉軸的該些軸角。 The robotic arm correction method based on image processing as described in claim 5, wherein the length offset of the links on the robotic arm is calculated based on the vector differences, the second vectors and the axis angles The length vector and the rotation offset vector of the reference points on the robot arm, so that the step of using the length offset vector and the rotation offset vector to correct the robot arm includes: calculating the predicted The partial derivatives of the lengths and the partial derivatives of the axis angles under the function are used to generate a Jacobian matrix; according to the vector differences, the second vectors, the predicted positions, the Jacobian matrix and the axis angles , calculate the length offset vector and the rotation offset vector; and The length offset vector and the rotation offset vector are used to correct the lengths of the links on the robot arm and the axis angles of the rotation axes. 如請求項1所述之基於影像處理的機械手臂校正方法,其中該拜訪順序指示:由該機械手臂的一初始位置由近至遠依序拜訪該至少一校正點。 The robotic arm correction method based on image processing as described in claim 1, wherein the visit sequence indicates: visiting the at least one calibration point sequentially from an initial position of the robotic arm from near to far. 如請求項1所述之基於影像處理的機械手臂校正方法,其中該拜訪順序指示:由該至少一校正點中任意選擇出一第一校正點的位置做為一初始位置,並根據一最短路徑依序拜訪該至少一校正點中的一第二校正點以及一第三校正點。 The robot arm correction method based on image processing as described in claim 1, wherein the access sequence indicates: arbitrarily selecting the position of a first correction point from the at least one correction point as an initial position, and based on a shortest path A second calibration point and a third calibration point of the at least one calibration point are visited sequentially. 如請求項1所述之基於影像處理的機械手臂校正方法,其中該拜訪順序指示:由該至少一校正點中任意選擇出一第一校正點的位置做初始位置,並在拜訪該至少一校正點中的一第二校正點後回到該初始位置,進而拜訪該至少一校正點中的一第三校正點。 The robot arm correction method based on image processing as described in claim 1, wherein the visit sequence indicates: arbitrarily select a first correction point position from the at least one correction point as the initial position, and visit the at least one correction point Point a second correction point among the points and then return to the initial position, and then visit a third correction point among the at least one correction points. 一種基於影像處理的機械手臂校正系統,包括:一校正板,包括至少一校正點;一機械手臂; 一攝影裝置,設置於該機械手臂的一機械手臂末端,用以拍攝該校正板;一控制器,連接該機械手臂,並用以控制該機械手臂以執行以下運作:設定該至少一校正點的一拜訪順序;根據該拜訪順序驅動該機械手臂使該機械手臂末端上的該攝影裝置移動至至少三拍攝位置,藉由該攝影裝置在至少三拍攝位置以分別拍攝至少一影像,該至少一影像分別具有一中心點,其中藉由該攝影裝置在該至少三拍攝位置以分別產生該至少一個影像的步驟包括:在辨識該攝影裝置的拍攝範圍涵蓋該至少一校正點後即產生該至少一影像;以及由該至少一影像計算該至少一校正點的一向量資訊,以調整該機械手臂。 A robotic arm correction system based on image processing, including: a correction plate, including at least one correction point; a robotic arm; A photographic device is provided at the end of a robotic arm of the robotic arm for photographing the correction plate; a controller is connected to the robotic arm and used to control the robotic arm to perform the following operations: setting a calibration point of the at least one calibration point Visit sequence; drive the robot arm according to the visit sequence to move the photography device on the end of the robot arm to at least three shooting positions, and use the photography device to capture at least one image respectively at at least three shooting positions, and the at least one image is respectively There is a center point, wherein the step of generating the at least one image respectively by the photography device at the at least three shooting positions includes: generating the at least one image after identifying that the shooting range of the photography device covers the at least one correction point; and calculating a vector information of the at least one correction point from the at least one image to adjust the robotic arm. 如請求項10所述之基於影像處理的機械手臂校正系統,其中該向量資訊包括多個第一向量以及多個第二向量,其中由該至少一影像計算該至少一校正點的該向量資訊,以調整該機械手臂的運作包括:計算在該些影像中的該至少一校正點的位置與該些影像各自的中心點之間的多個第一向量,並計算該些第一向量之間的多個向量差;計算該校正板上的該至少一校正點之間的多個第二向量; 以及根據該些向量差、該些第二向量以及多個軸角,計算出該機械手臂上的多個連桿的一長度偏移量向量,以及該機械手臂上的多個參考點的一旋轉偏移量向量,以利用該長度偏移量向量以及該旋轉偏移量向量對該機械手臂進行校正。 The robotic arm correction system based on image processing as described in claim 10, wherein the vector information includes a plurality of first vectors and a plurality of second vectors, wherein the vector information of the at least one correction point is calculated from the at least one image, Adjusting the operation of the robotic arm includes: calculating a plurality of first vectors between the positions of the at least one correction point in the images and respective center points of the images, and calculating the distance between the first vectors. A plurality of vector differences; calculating a plurality of second vectors between the at least one calibration point on the calibration plate; and calculating a length offset vector of multiple links on the robotic arm and a rotation of multiple reference points on the robotic arm based on the vector differences, the second vectors and the multiple axis angles The offset vector is used to correct the robotic arm using the length offset vector and the rotation offset vector. 如請求項11所述之基於影像處理的機械手臂校正系統,其中該控制器更執行以下步驟:辨識在該些影像中的各者中的校正點的像素位置與該些影像中的該各者的中心點的像素位置之間的一二維像素差;以及將從該些影像所辨識出的該些二維像素差分別轉換為在一實際空間中的該些第一向量。 The robot arm correction system based on image processing as described in claim 11, wherein the controller further performs the following steps: identifying the pixel position of the correction point in each of the images and the each of the images. a two-dimensional pixel difference between the pixel positions of the center points; and converting the two-dimensional pixel differences recognized from the images into the first vectors in a real space respectively. 如請求項11所述之基於影像處理的機械手臂校正系統,其中該長度偏移量向量可包括該些連桿各自的長度偏移量,該旋轉偏移量向量可包括該些參考點各自的軸角偏移量,其中該控制器更執行以下步驟:計算該校正板的該至少一校正點在一實際空間中的絕對座標之間的該些第二向量。 The robotic arm correction system based on image processing as described in claim 11, wherein the length offset vector may include the respective length offsets of the links, and the rotation offset vector may include the respective length offsets of the reference points. Axial angle offset, wherein the controller further performs the following steps: calculating the second vectors between the absolute coordinates of the at least one calibration point of the calibration plate in a real space. 如請求項11所述之基於影像處理的機械手臂校正系統,其中該控制器更執行以下步驟: 利用順向運動學產生該機械手臂的一預測函數,並根據該些軸角以及該預測函數計算當該攝影裝置移動至該些拍攝位置時的多個預測位置,其中該預測函數以該些連桿的多個長度以及該些參考點的該些軸角為變數;以及根據該些向量差、該些第二向量以及該些預測位置利用該預測函數計算該長度偏移量向量以及該旋轉偏移量向量。 The robot arm correction system based on image processing as described in claim 11, wherein the controller further performs the following steps: Use forward kinematics to generate a prediction function of the robotic arm, and calculate a plurality of predicted positions when the photography device moves to the shooting positions based on the axis angles and the prediction function, wherein the prediction function uses the connections The plurality of lengths of the rod and the axis angles of the reference points are variables; and the length offset vector and the rotation offset are calculated using the prediction function according to the vector differences, the second vectors and the predicted positions. Shift vector. 如請求項14所述之基於影像處理的機械手臂校正系統,其中該控制器更執行以下步驟:計算在該預測函數下的該些長度的偏導數以及該些軸角的偏導數以產生一雅可比矩陣;根據該些向量差、該些第二向量、該些預測位置、該雅可比矩陣以及該些軸角,計算該長度偏移量向量以及該旋轉偏移量向量;以及利用該長度偏移量向量以及該旋轉偏移量向量校正該機械手臂上的多個連桿的多個長度以及多個旋轉軸的該些軸角。 The robotic arm correction system based on image processing as described in claim 14, wherein the controller further performs the following steps: calculating partial derivatives of the lengths and partial derivatives of the axis angles under the prediction function to generate an Comparable matrix; calculate the length offset vector and the rotation offset vector according to the vector differences, the second vectors, the predicted positions, the Jacobian matrix and the axis angles; and use the length offset vector The displacement vector and the rotation offset vector correct the lengths of the links on the robot arm and the axis angles of the rotation axes. 如請求項10所述之基於影像處理的機械手臂校正系統,其中該拜訪順序指示:由該機械手臂的一初始位置由近至遠依序拜訪該至少一校正點。 The robotic arm calibration system based on image processing as described in claim 10, wherein the visit sequence indicates: visiting the at least one calibration point sequentially from an initial position of the robotic arm from near to far. 如請求項10所述之基於影像處理的機械手 臂校正系統,其中該拜訪順序指示:由該至少一校正點中任意選擇出一第一校正點的位置做為一初始位置,並根據一最短路徑依序拜訪該至少一校正點中的一第二校正點以及一第三校正點。 Image processing-based manipulator as claimed in claim 10 Arm calibration system, wherein the visit sequence indicates: arbitrarily select the position of a first calibration point from the at least one calibration point as an initial position, and sequentially visit a first calibration point in the at least one calibration point according to a shortest path two calibration points and a third calibration point. 如請求項10所述之基於影像處理的機械手臂校正系統,其中該拜訪順序指示:由該至少一校正點中任意選擇出一第一校正點的位置做為一初始位置,並在拜訪該至少一校正點中的一第二校正點後回到該初始位置,進而拜訪該至少一校正點中的一第三校正點。The robotic arm calibration system based on image processing as described in claim 10, wherein the access sequence indicates: arbitrarily selecting a position of a first calibration point from the at least one calibration point as an initial position, and visiting the at least one calibration point. A second correction point among the correction points then returns to the initial position, and then visits a third correction point among the at least one correction points.
TW112120261A 2023-05-31 2023-05-31 Calibration method and system for mechanical arm based on image processing TWI832770B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW112120261A TWI832770B (en) 2023-05-31 2023-05-31 Calibration method and system for mechanical arm based on image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW112120261A TWI832770B (en) 2023-05-31 2023-05-31 Calibration method and system for mechanical arm based on image processing

Publications (1)

Publication Number Publication Date
TWI832770B true TWI832770B (en) 2024-02-11

Family

ID=90824989

Family Applications (1)

Application Number Title Priority Date Filing Date
TW112120261A TWI832770B (en) 2023-05-31 2023-05-31 Calibration method and system for mechanical arm based on image processing

Country Status (1)

Country Link
TW (1) TWI832770B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103209809A (en) * 2010-05-14 2013-07-17 康耐视公司 System and method for robust calibration between a machine vision system and a robot
TW201603979A (en) * 2014-07-28 2016-02-01 廣明光電股份有限公司 Calibration device and method for robot arm
CN106003018A (en) * 2015-03-30 2016-10-12 精工爱普生株式会社 Robot, robot control apparatus and robot system
CN106217372A (en) * 2015-06-02 2016-12-14 精工爱普生株式会社 Robot, robot controller and robot system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103209809A (en) * 2010-05-14 2013-07-17 康耐视公司 System and method for robust calibration between a machine vision system and a robot
TW201603979A (en) * 2014-07-28 2016-02-01 廣明光電股份有限公司 Calibration device and method for robot arm
CN106003018A (en) * 2015-03-30 2016-10-12 精工爱普生株式会社 Robot, robot control apparatus and robot system
CN106217372A (en) * 2015-06-02 2016-12-14 精工爱普生株式会社 Robot, robot controller and robot system

Similar Documents

Publication Publication Date Title
TWI408037B (en) A position method and a calibrating method for the robot arm
JP4267005B2 (en) Measuring apparatus and calibration method
JP2020116734A (en) System and method for automatic hand-eye calibration of vision system for robot motion
JP6429473B2 (en) Robot system, robot system calibration method, program, and computer-readable recording medium
US11267142B2 (en) Imaging device including vision sensor capturing image of workpiece
WO2021169855A1 (en) Robot correction method and apparatus, computer device, and storage medium
US10632622B2 (en) Error compensation device and error compensation method
CN111801198A (en) Hand-eye calibration method, system and computer storage medium
JPH0435885A (en) Calibration method for visual sensor
JPWO2018043525A1 (en) Robot system, robot system control apparatus, and robot system control method
US20200262080A1 (en) Comprehensive model-based method for gantry robot calibration via a dual camera vision system
JP2023014351A (en) System and method for three-dimensional calibration of vision system
JP7427370B2 (en) Imaging device, image processing device, image processing method, calibration method for imaging device, robot device, method for manufacturing articles using robot device, control program, and recording medium
JPWO2018043524A1 (en) Robot system, robot system control apparatus, and robot system control method
US20220395981A1 (en) System and method for improving accuracy of 3d eye-to-hand coordination of a robotic system
KR102243694B1 (en) Method for restoring position information of robot
JP2682763B2 (en) Automatic measurement method of operation error of robot body
KR102225139B1 (en) Method for restoring positional information of robot
CN115446847A (en) System and method for improving 3D eye-hand coordination accuracy of a robotic system
JP6668321B2 (en) Error compensation apparatus and method
TWI832770B (en) Calibration method and system for mechanical arm based on image processing
KR20070122271A (en) System for controlling position of robot and method for controlling thereof
US20230123629A1 (en) 3d computer-vision system with variable spatial resolution
CN114750160B (en) Robot control method, apparatus, computer device, and storage medium
CN112971984B (en) Coordinate registration method based on integrated surgical robot