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 PDFInfo
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 239000013598 vector Substances 0.000 claims abstract description 143
- 239000011159 matrix material Substances 0.000 claims description 21
- 238000006073 displacement reaction Methods 0.000 claims description 4
- 238000003384 imaging method Methods 0.000 description 23
- 230000009466 transformation Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000009825 accumulation Methods 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
Images
Landscapes
- Manipulator (AREA)
Abstract
Description
本揭示有關於一種加工技術,特別是有關於一種基於影像處理的機械手臂校正方法以及系統。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
再者,攝影裝置12設置於機械手臂11的機械手臂末端111(即,法蘭面(flange))的位置。機械手臂11驅動攝影裝置12移動至至少三拍攝位置,攝影裝置12在至少三拍攝位置上拍攝校正板13以分別產生至少一影像。換言之,在每個拍攝位置上,攝影裝置12都會對校正板13拍攝一個影像。進一步而言,攝影裝置12主要取得實際空間的二維空間中的影像,並基於影像進行判斷分析。換言之,攝影裝置12整體的視野範圍可為一個二維空間。Furthermore, the
在一些實施例中,攝影裝置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
再者,機械手臂11包括多個連桿(link)以及這些連桿之間的多個參考點。在一些實施例中,機械手臂11可例如是但不限於六軸型機械手臂或四軸SCARA機械手臂等。在一些實施例中,多個參考點可包括機械手臂11上的多個關節(joint)以及機械手臂末端111。在一些實施例中,多個關節之間的多個連桿的長度也會被預先設定好以儲存於控制器14或其他遠端儲存裝置中。在一些實施例中,多個關節中的各者可具有感測器(未繪示)以多個關節中的各者所轉動的軸角。在一些實施例中,當機械手臂11為六軸型機械手臂時,多個關節中的各者可以三軸方向(在真實場域中的X、Y、Z方向)為中心旋轉。在一些實施例中,當機械手臂11為四軸SCARA機械手臂時,多個關節中的各者可以垂直單軸方向(在真實場域中的Z方向)為中心旋轉。Furthermore, the
再者,校正板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
值得注意的是,機械手臂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
再者,控制器14連接機械手臂11,並控制以驅動機械手臂11移動攝影裝置12。在一些實施例中,控制器14可根據機械手臂11的多個連桿各自的長度以及這些連桿之間的多個參考點各自的軸角控制以驅動機械手臂11移動攝影裝置12到拍攝位置。在一些實施例中,控制器14可以由處理電路或專用邏輯電路實現,例如,處理器、現場可程式閘陣列(field programmable gate array, FPGA)或應用特定積體電路(application specific integrated circuit, ASIC)。Furthermore, the
以下將進一步對基於影像處理的機械手臂校正系統1的運作進行描述。一併參照第2A圖,第2A圖繪示本揭示一些實施例中的基於影像處理的機械手臂校正方法的流程圖。第1圖的基於影像處理的機械手臂校正系統1中的元件用以執行基於影像處理的機械手臂校正方法中的步驟S210~S240。The operation of the robot
如第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
在一些實施例中,拜訪順序可指示:由至少一校正點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
以下以實際例子說明在至少三拍攝位置上對校正板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
接著,可將攝影裝置12移動至第2個拍攝位置。此時,校正點q在攝影裝置12的拍攝範圍VSq中,且攝影裝置12會在第2個拍攝位置拍攝校正板13。此外,在第2個拍攝位置拍攝完成之後,可將攝影裝置12移動回初始位置。最後,可將攝影裝置12移動至第3個拍攝位置。此時,校正點r在攝影裝置12的拍攝範圍VSr中,且攝影裝置12會在第3個拍攝位置拍攝校正板13。此外,在第3個拍攝位置拍攝完成之後,可將攝影裝置12移動回初始位置。Then, the photographing
以下將進一步對第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
再者,於步驟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
再者,以下實施例將進一步說明向量資訊的產生以及第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
以下以實際例子說明第一向量。一併參照第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
以下以實際例子說明第二向量。如第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
在一些實施例中,控制器14可利用順向運動學(inverse kinematics)產生機械手臂11的預測函數,並根據多個軸角以及預測函數計算當攝影裝置12移動至至少三拍攝位置時的多個預測位置,其中預測函數以多個連桿的多個長度以及多個參考點的多個軸角為變數。接著,控制器14可根據多個向量差、多個第二向量以及多個預測位置利用預測函數計算長度偏移量向量以及旋轉偏移量向量。In some embodiments, the
以下以實際例子說明預測函數。一併參照第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
詳細而言,由於第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
其中
為底座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
其中 為四軸表示式, 為機械手臂座標系與手臂末端座標系之間的位移矩陣,也是上述預測函數,其為上述位移矩陣 、 、 、 、 的乘積, 、 、 分別為機械手臂座標系的原點與手臂末端座標系的原點之間的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
在理想狀態下,當控制器14根據所設定的拍攝位置而控制以驅動機械手臂11上的攝影裝置12移動至2個或2個以上的拍攝位時,則攝影裝置12在每2個拍攝位置上的實際位置的差值減去攝影裝置12在每2個拍攝位置上所計算出的預測位置之間的差值將等於0。In an ideal state, when the
以下以第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
其中
為上述獲得的預測函數(即,上述公式(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
接著,由上述公式(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
以下以實際的例子說明長度偏移量向量以及旋轉偏移量向量的計算。如以下公式(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
藉此,由公式(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
在一些實施例中,控制器14可判斷攝影裝置12在其中每二個拍攝位置上的實際位置的差值減去攝影裝置12在其中每二拍攝位置上所計算出的預測位置之間的差值是否小於一個收斂值,其中此收斂值可以為使用者預先設定的。接著,當不小於收斂值時,會繼續利用上述聯立方程式計算出長度偏移量向量以及旋轉偏移量向量以校正機械手臂11。反之,則不會計算長度偏移量向量以及旋轉偏移量向量以結束本揭示的基於影像處理的機械手臂校正方法。In some embodiments, the
藉由上述步驟,可利用非接觸的影像拍攝方法計算出長度偏移量向量以及旋轉偏移量向量。此外,當一直不小於收斂值時,可不斷計算出新的長度偏移量向量以及新的旋轉偏移量向量以校正機械手臂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
綜上所述,本揭示提供一種基於影像處理的機械手臂校正方法,其係利用拍攝校正板上的校正點以計算出校正點之間的距離,並利用這些距離計算出機械手臂的多個連桿各自的長度偏移量,以及機械手臂的多個參考點各自的軸角偏移量,並利用多個連桿各自的長度偏移量以及多個參考點各自的軸角偏移量實現對機械手臂的原點校正。因此,於機械手臂的運作過程中,若不確定機械手臂的原點是否已產生偏移,則可在機械手臂的工作環境中即時對機械手臂進行校正,且在校正完成後無需重新教點。藉此,可節省校正所需的時間及成本,並大幅提升機械手臂的工作效率。此外,由於僅僅是利用機械手臂末端的攝影裝置拍攝校正板,當機械手臂進行校正時,無需在校正前裝設任何額外的工具,從而可節省校正工序及耗費時間,間接提升機械手臂的工作效率。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)
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)
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 |
-
2023
- 2023-05-31 TW TW112120261A patent/TWI832770B/en active
Patent Citations (4)
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 |