JP2013202210A - Sewing machine - Google Patents

Sewing machine Download PDF

Info

Publication number
JP2013202210A
JP2013202210A JP2012074793A JP2012074793A JP2013202210A JP 2013202210 A JP2013202210 A JP 2013202210A JP 2012074793 A JP2012074793 A JP 2012074793A JP 2012074793 A JP2012074793 A JP 2012074793A JP 2013202210 A JP2013202210 A JP 2013202210A
Authority
JP
Japan
Prior art keywords
holding body
cpu
sewing
sewing machine
moving
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012074793A
Other languages
Japanese (ja)
Inventor
Yoshihide Sugihara
良英 杉原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Brother Industries Ltd
Original Assignee
Brother Industries Ltd
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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP2012074793A priority Critical patent/JP2013202210A/en
Priority to CN201310103603.XA priority patent/CN103451856B/en
Publication of JP2013202210A publication Critical patent/JP2013202210A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Sewing Machines And Sewing (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a sewing machine that can surely prevent the interference between an obstacle and a sewing needle in accordance with the obstacle installed in a holding body.SOLUTION: A sewing machine feeds and moves a holding body holding a sewing object below a needle bar having a sewing needle installed therein to an absolute original position or a sewing starting position. During the feed movement, a CPU of the sewing machine identifies an obstacle in an image of a predetermined region below the needle bar, captured by an image sensor, every time driving an X-axis motor and a Y-axis motor by one pulse to move the holding body, and confirms whether or not the obstacle is within a predetermined distance from a restricted region corresponding to the needle bar (S250). The CPU changes the moving direction of the holding body to a different direction, when the obstacle comes into the predetermined distance from the restricted region (S350). When the holding body reaches an end of the movable region after the change in moving direction, the CPU allows the holding body to be inverted in moving direction (S401: YES, S402: YES, S403), and then when the holding body reaches the end of the movable region again, notices of error occurrence (S405).

Description

本発明は、上下動する針棒に対して、縫製対象物を保持する保持体を相対的に移動しながら縫製を行うミシンに関する。   The present invention relates to a sewing machine that performs sewing while moving a holding body that holds a sewing object relative to a needle bar that moves up and down.

縫製データに従って、下端に縫針を装着した針棒を上下動し、縫製対象物を保持する保持体を針棒に対して相対的に水平移動しながら模様を縫製するミシンがある。該ミシンは、最初に縫針が上昇位置にある状態で、所定の移動法則に従った経路に沿って絶対原点に保持体を移動する。該ミシンは縫製データに従って絶対原点から縫製開始位置まで保持体を更に移動した後、縫目を形成する縫製動作を開始する。   There is a sewing machine that sews a pattern while moving a holding body holding a sewing object horizontally relative to the needle bar by vertically moving a needle bar with a sewing needle attached to the lower end in accordance with sewing data. The sewing machine first moves the holding body to the absolute origin along a path in accordance with a predetermined movement law with the sewing needle in the raised position. The sewing machine further moves the holding body from the absolute origin to the sewing start position according to the sewing data, and then starts a sewing operation for forming a seam.

作業者は、縫製対象物に応じて保持体に補助押え部材を装着する時がある。該補助押え部材が上昇位置にある縫針と干渉する高さを有する場合、補助押え部材は移動経路上で縫針と干渉する障害物となる場合がある。故に、ミシンは、障害物と縫針との干渉を回避する為に、必要に応じて該移動経路を変更する。例えば特許文献1に記載のミシンは、接触式のセンサを用いて障害物を検出した時、移動経路を変更する。特許文献2に記載の縫製データ編集装置は、予め設定した排除エリアに応じて縫製データ中の針位置を修正することで、予め移動経路を変更する。   The operator sometimes attaches the auxiliary presser member to the holding body according to the sewing object. When the auxiliary presser member has a height that interferes with the sewing needle in the raised position, the auxiliary presser member may become an obstacle that interferes with the sewing needle on the movement path. Therefore, the sewing machine changes the movement path as necessary in order to avoid interference between the obstacle and the sewing needle. For example, the sewing machine described in Patent Document 1 changes the movement path when an obstacle is detected using a contact sensor. The sewing data editing apparatus described in Patent Literature 2 changes the movement path in advance by correcting the needle position in the sewing data in accordance with a preset exclusion area.

特開平6−210082号公報JP-A-6-210082 特開2011−115373号公報JP 2011-115373 A

特許文献1のミシンは接触式のセンサで障害物を検出するので、使用に伴いセンサの検出精度が低下する可能性がある。ミシンが特許文献2に記載の方法で移動経路を変更した縫製データに従って縫製を行う時、作業者は設定済みの排除エリアに対応しない障害物を保持体に装着する場合がある。該場合、ミシンは障害物が縫針と干渉することを防止できない。更に、縫製データは保持体が絶対原点に移動した後の移動量を示すので、特許文献2に記載の方法は、保持体が絶対原点に到達する前に障害物が縫針と干渉する可能性は排除できない。   Since the sewing machine of Patent Document 1 detects an obstacle with a contact-type sensor, the detection accuracy of the sensor may decrease with use. When the sewing machine performs sewing according to the sewing data whose movement path is changed by the method described in Patent Document 2, the operator may attach an obstacle that does not correspond to the set exclusion area to the holding body. In this case, the sewing machine cannot prevent the obstacle from interfering with the sewing needle. Furthermore, since the sewing data indicates the amount of movement after the holding body has moved to the absolute origin, the method described in Patent Document 2 has the possibility that the obstacle will interfere with the sewing needle before the holding body reaches the absolute origin. It cannot be excluded.

本発明の目的は、保持体に装着した障害物に応じて、障害物が縫針と干渉することを確実に回避可能なミシンを提供することである。   An object of the present invention is to provide a sewing machine that can reliably prevent an obstacle from interfering with a sewing needle in accordance with an obstacle attached to a holding body.

請求項1のミシンは、縫針を下端に装着可能且つ上下動可能な針棒と、前記針棒の下方に設け且つ縫製対象物を保持する保持体を水平移動可能な移動機構とを備えたミシンにおいて、前記針棒の下方を含む領域である第一領域を撮影可能な撮影手段と、前記撮影手段が撮影した前記第一領域の画像中で、予め設定した前記保持体と共に移動する部材の特徴部分を識別する識別手段と、前記移動機構を制御することで、前記識別手段が識別した前記特徴部分が、前記第一領域の前記画像中の前記針棒に対応する範囲である第二領域と重ならないように前記保持体を移動する移動制御手段とを備えたことを特徴とする。   The sewing machine according to claim 1 is provided with a needle bar capable of attaching a sewing needle to a lower end and capable of moving up and down, and a moving mechanism provided below the needle bar and capable of horizontally moving a holding body for holding a sewing object. And a member that moves with the holding body set in advance in an image of the first region that is photographed by the photographing means. An identification means for identifying a part; and a second area in which the characteristic part identified by the identification means by controlling the moving mechanism is a range corresponding to the needle bar in the image of the first area; And a movement control means for moving the holding body so as not to overlap.

前記ミシンは、撮影手段が撮影した第一領域の画像中の、保持体と共に移動する部材の特徴部分を識別する識別手段を備え、該特徴部分が針棒に対応する第二領域と重ならないように保持体の移動を制御する。故に、作業者が縫製対象物に応じた部材を保持体に装着する場合、作業者は障害物となる該部材の特徴部分を予め特徴部分として設定すればよい。ミシンは、撮影手段が撮影した画像に基づき、該部材に応じて適切に保持体の移動を制御することができる。即ち、ミシンは縫製データに従った移動経路に沿って障害物を回避するのではなく、撮影手段が撮影した画像に基づき、障害物を回避することができる。更に、ミシンは、保持体が絶対原点に到達する前でも、障害物が針棒に装着した縫針と干渉することを回避することができる。ミシンは非接触で障害物を識別できるので、接触式のセンサを用いるミシンに比べ、使用に伴って障害物の検出精度が低下するのを防止できる。上記の通り、ミシンは保持体に装着した障害物に応じて、障害物が縫針と干渉することを確実に回避することができる。   The sewing machine includes identification means for identifying a characteristic portion of a member that moves together with the holding body in the image of the first area photographed by the photographing means so that the characteristic portion does not overlap with the second area corresponding to the needle bar. To control the movement of the holder. Therefore, when the worker mounts a member corresponding to the sewing object on the holding body, the worker may set the characteristic portion of the member that becomes an obstacle as the characteristic portion in advance. The sewing machine can appropriately control the movement of the holding body according to the member based on the image photographed by the photographing means. That is, the sewing machine can avoid the obstacle based on the image photographed by the photographing means, instead of avoiding the obstacle along the movement route according to the sewing data. Further, the sewing machine can avoid the obstacle from interfering with the sewing needle attached to the needle bar even before the holding body reaches the absolute origin. Since the sewing machine can identify obstacles in a non-contact manner, it is possible to prevent the obstacle detection accuracy from being lowered with use as compared with a sewing machine using a contact type sensor. As described above, the sewing machine can reliably avoid the obstacle from interfering with the sewing needle in accordance with the obstacle attached to the holding body.

請求項2のミシンにおいて、前記移動制御手段は、前記識別手段が、前記画像中で、前記第二領域から前記保持体の移動方向の反対方向に第一距離内で前記特徴部分を識別した場合、前記移動方向を異なる方向に変更して、前記保持体を移動することを特徴とする。該ミシンは特徴部分が針棒に対応する第二領域から第一距離内に近づいた時点で移動方向を変更するので、障害物が針棒に装着した縫針に干渉することをより確実に回避することができる。   3. The sewing machine according to claim 2, wherein the movement control unit identifies the characteristic portion within a first distance from the second region in a direction opposite to a movement direction of the holding body in the image. The moving body is moved by changing the moving direction to a different direction. Since the sewing machine changes the moving direction when the characteristic portion approaches within the first distance from the second region corresponding to the needle bar, it is more reliably avoided that the obstacle interferes with the sewing needle attached to the needle bar. be able to.

請求項3のミシンにおいて、前記移動制御手段は、前記移動方向を、優先する方向として予め設定した優先方向に変更して、前記保持体を移動することを特徴とする。該ミシンにおいて、作業者が保持体に装着した部材の配置方向に応じて優先方向を予め設定した場合、ミシンは作業者が適切と判断した方向に移動方向を変更できる。該部材の通常の配置方向に応じた方向を優先方向として予め一律に設定すれば、ミシンは作業者の設定作業を要することなく効率的に移動方向を変更できる。   4. The sewing machine according to claim 3, wherein the movement control means moves the holding body by changing the moving direction to a priority direction set in advance as a priority direction. In the sewing machine, when the priority direction is set in advance according to the arrangement direction of the member attached to the holding body by the operator, the sewing machine can change the moving direction to the direction determined by the operator as appropriate. If the direction corresponding to the normal arrangement direction of the member is uniformly set in advance as the priority direction, the sewing machine can efficiently change the moving direction without requiring the operator's setting work.

請求項4のミシンにおいて、前記移動制御手段は、前記特徴部分の境界線の延びる方向に応じて前記移動方向を変更して、前記保持体を移動することを特徴とする。該ミシンは、特徴部分の境界線の延びる方向に応じて保持体の移動方向を変更することで、効率的且つ確実に障害物が針棒に干渉することを回避することができる。   5. The sewing machine according to claim 4, wherein the movement control means moves the holding body by changing the movement direction according to a direction in which a boundary line of the characteristic portion extends. The sewing machine can avoid the obstacle from interfering with the needle bar efficiently and reliably by changing the moving direction of the holding body in accordance with the extending direction of the boundary line of the characteristic portion.

請求項5のミシンにおいて、前記移動制御手段は、前記保持体が移動可能範囲の一端に到達した場合、前記移動方向を、前記移動方向の反対方向に変更して、前記保持体を移動することを特徴とする。即ち、該ミシンは、移動方向を自動的に反転する。故に、縫製対象物が切り替わり、障害物の位置や形状が変わったとしても、作業者は優先回避方向を設定し直さなくてもよい。   6. The sewing machine according to claim 5, wherein when the holding body reaches one end of the movable range, the movement control means changes the moving direction to a direction opposite to the moving direction and moves the holding body. It is characterized by. That is, the sewing machine automatically reverses the moving direction. Therefore, even if the sewing object is switched and the position or shape of the obstacle is changed, the operator does not have to reset the priority avoidance direction.

請求項6のミシンは、前記移動制御手段が前記移動方向を前記反対方向に変更した後、前記保持体が前記移動可能範囲の他端に到達した場合、エラー発生を報知する報知手段を更に備えたことを特徴とする。該ミシンは、何らかの不具合で障害物の位置がずれてしまい、回避不能な状態になったことを作業者に報知できる。故に、作業者は報知後に適切な措置を取ることができる。   The sewing machine according to claim 6, further comprising notification means for notifying occurrence of an error when the holding body reaches the other end of the movable range after the movement control means has changed the movement direction to the opposite direction. It is characterized by that. The sewing machine can notify the operator that the position of the obstacle has shifted due to some trouble and is in an unavoidable state. Therefore, the operator can take appropriate measures after the notification.

請求項7のミシンは、前記移動制御手段による前記保持体の移動速度に応じて前記第一距離を設定する距離設定手段を更に備えたことを特徴とする。移動速度が速くなるほど、保持体が単位時間内に移動する距離は長くなる。移動速度が遅くなるほど、保持体が単位時間内に移動する距離は短くなる。故に、移動速度に応じて第一距離を長く設定することで、障害物が針棒に装着した縫針に干渉することを更に確実に回避することができる。   The sewing machine according to claim 7 further includes distance setting means for setting the first distance according to a moving speed of the holding body by the movement control means. The faster the moving speed, the longer the distance that the holder moves within the unit time. The slower the moving speed, the shorter the distance that the holder moves within the unit time. Therefore, by setting the first distance longer according to the moving speed, it is possible to more reliably avoid the obstacle from interfering with the sewing needle attached to the needle bar.

請求項8のミシンにおいて、前記移動制御手段は、前記識別手段が識別した前記特徴部分が、前記第一領域の画像中の前記第二領域の周囲に予め設定した第三領域から前記保持体の移動方向の反対方向に第二距離内で前記特徴部分を識別した場合、前記移動機構を制御して、前記保持体の移動速度を減速することを特徴とする。該ミシンは、特徴部分が第二領域からの周囲に設定した第三領域に重なると減速するので、減速後に保持体の移動を制御できる。故に、ミシンは、障害物が針棒に装着した縫針に干渉することを更に確実に回避することができる。   9. The sewing machine according to claim 8, wherein the movement control unit is configured such that the characteristic portion identified by the identification unit is moved from a third region preset around the second region in the image of the first region. When the characteristic portion is identified within the second distance in the direction opposite to the moving direction, the moving mechanism is controlled to reduce the moving speed of the holding body. Since the sewing machine decelerates when the characteristic portion overlaps the third area set around the second area, the movement of the holding body can be controlled after decelerating. Therefore, the sewing machine can more reliably avoid the obstacle from interfering with the sewing needle attached to the needle bar.

請求項9のミシンにおいて、前記特徴部分は、予め設定した色を含む領域であり、前記識別手段は、前記色を含み且つ所定の大きさよりも大きい領域を、前記特徴部分として識別することを特徴とする。該ミシンは、画像中のノイズを、特徴部分と誤って識別することを防止できる。   10. The sewing machine according to claim 9, wherein the characteristic part is an area including a preset color, and the identification unit identifies an area including the color and larger than a predetermined size as the characteristic part. And The sewing machine can prevent the noise in the image from being mistakenly identified as the characteristic part.

ミシン1の斜視図である。1 is a perspective view of a sewing machine 1. FIG. ミシン1の前端部7の右側面図である。2 is a right side view of a front end portion 7 of the sewing machine 1. FIG. ミシン1の電気的構成を示すブロック図である。2 is a block diagram showing an electrical configuration of the sewing machine 1. FIG. 座標系601、縫製可能範囲611、所定領域53の説明図である。6 is an explanatory diagram of a coordinate system 601, a sewing range 611, and a predetermined region 53. イメージセンサ50が出力する画像データのうちR値データの一例の説明図である。It is explanatory drawing of an example of R value data among the image data which the image sensor 50 outputs. LCD32が表示する撮影画像の一例を示す図である。It is a figure which shows an example of the picked-up image which LCD32 displays. 縫製処理のフローチャートである。It is a flowchart of a sewing process. 領域マップの一例の説明図である。It is explanatory drawing of an example of an area | region map. 送り移動処理のフローチャートである。It is a flowchart of a feed movement process. 移動処理のフローチャートである。It is a flowchart of a movement process. 画像監視処理のフローチャートである。It is a flowchart of an image monitoring process. 移動方向変更と中継位置設定の説明図である。It is explanatory drawing of a moving direction change and relay position setting. 移動方向変更処理のフローチャートである。It is a flowchart of a moving direction change process. 移動方向変更と中継位置設定の別の説明図である。It is another explanatory drawing of a moving direction change and relay position setting.

以下、図面を参照して、本発明の実施形態のミシン1について説明する。図1の上側、下側、左斜め下側、右斜め上側、左斜め上側、右斜め下側は夫々ミシン1の上側、下側、前側、後側、左側、右側である。   Hereinafter, a sewing machine 1 according to an embodiment of the present invention will be described with reference to the drawings. The upper side, the lower side, the left diagonally lower side, the right diagonal upper side, the left diagonal upper side, and the right diagonally lower side in FIG. 1 are the upper side, lower side, front side, rear side, left side, and right side of the sewing machine 1, respectively.

図1を参照し、ミシン1の全体構造について説明する。図1に示す如く、ミシン1は、ベッド部2、脚柱部3、アーム部4を備える。ベッド部2はテーブル95に載置する。ベッド部2は前後方向に延び、内部に垂直釜(図示略)等を備える。脚柱部3はベッド部2後側から鉛直上方に延びる。脚柱部3は内部にミシンモータ112(図3参照)等を備える。アーム部4は脚柱部3上端からベッド部2の上面に対向して前方に延び、前端に前端部7を備える。アーム部4は内部に主軸、針棒駆動機構(図示略)等を備える。針棒10は、前端部7の下端から下方へ延びる。縫針11は針棒10の下端に着脱可能である。   The overall structure of the sewing machine 1 will be described with reference to FIG. As shown in FIG. 1, the sewing machine 1 includes a bed portion 2, a pedestal column portion 3, and an arm portion 4. The bed unit 2 is placed on the table 95. The bed portion 2 extends in the front-rear direction and includes a vertical hook (not shown) and the like inside. The pedestal part 3 extends vertically upward from the rear side of the bed part 2. The pedestal 3 includes a sewing machine motor 112 (see FIG. 3) and the like. The arm portion 4 extends forward from the upper end of the pillar portion 3 so as to face the upper surface of the bed portion 2 and includes a front end portion 7 at the front end. The arm unit 4 includes a main shaft, a needle bar drive mechanism (not shown), and the like. The needle bar 10 extends downward from the lower end of the front end portion 7. The sewing needle 11 can be attached to and detached from the lower end of the needle bar 10.

ミシン1は、ベッド部2の上方に作業台5と移送装置6を備える。作業台5は、針板501を備える。針板501は、針棒10に装着した縫針11の直下の位置に、縫針11が挿通可能な針穴502を有する。移送装置6は、移送板61、昇降部62、押え板63、移送板保持部64、X軸移動機構(図示略)、腕部65、Y軸移動機構(図示略)を備える。   The sewing machine 1 includes a work table 5 and a transfer device 6 above the bed portion 2. The work table 5 includes a needle plate 501. The needle plate 501 has a needle hole 502 through which the sewing needle 11 can be inserted at a position immediately below the sewing needle 11 attached to the needle bar 10. The transfer device 6 includes a transfer plate 61, an elevating unit 62, a presser plate 63, a transfer plate holding unit 64, an X-axis moving mechanism (not shown), an arm unit 65, and a Y-axis moving mechanism (not shown).

移送板61は水平方向に配置した板部材であり、平面視矩形状の開口を有する。移送板保持部64は左右方向に延び、移送板61をX軸方向(左右方向)に移動可能に支持する。X軸移動機構は、ベッド部2の内部に設けてある。X軸移動機構は、X軸モータ114(図3参照)を駆動源として、移送板61をX軸方向(左右方向)へ移動する。移送板保持部64に連結する腕部65は、脚柱部3内に設けたY軸移動機構に接続する。Y軸移動機構は、Y軸モータ116(図3参照)を駆動源として、腕部65をY軸方向(前後方向)へ移動する。移送板保持部64は、腕部65の移動に伴ってY軸方向(前後方向)へ移動する。   The transfer plate 61 is a plate member arranged in the horizontal direction, and has an opening having a rectangular shape in plan view. The transfer plate holding part 64 extends in the left-right direction, and supports the transfer plate 61 so as to be movable in the X-axis direction (left-right direction). The X-axis moving mechanism is provided inside the bed portion 2. The X-axis moving mechanism moves the transfer plate 61 in the X-axis direction (left-right direction) using the X-axis motor 114 (see FIG. 3) as a drive source. The arm portion 65 connected to the transfer plate holding portion 64 is connected to a Y-axis moving mechanism provided in the pedestal column portion 3. The Y-axis moving mechanism moves the arm portion 65 in the Y-axis direction (front-rear direction) using the Y-axis motor 116 (see FIG. 3) as a drive source. The transfer plate holding part 64 moves in the Y-axis direction (front-rear direction) as the arm part 65 moves.

移送板保持部64が支持する移送板61は、移送板保持部64と共に移動する。移送板保持部64は、昇降部62を昇降可能に支持する。押え板63は昇降部62下端に連結する矩形枠状の板部材である。押え板63の開口は、移送板61の開口と略同一形状である。作業者は縫製対象物(例えば加工布)を移送板61上に載置する。昇降部62が下方に移動すると、押え板63は下降する。押え板63と移送板61は、縫製対象物を上下から挟んで保持する。以下、移送板61と押え板63を総称して保持体60という。   The transfer plate 61 supported by the transfer plate holding unit 64 moves together with the transfer plate holding unit 64. The transfer plate holding part 64 supports the elevating part 62 so that it can be elevated. The presser plate 63 is a rectangular frame-shaped plate member connected to the lower end of the elevating part 62. The opening of the presser plate 63 has substantially the same shape as the opening of the transfer plate 61. The operator places a sewing object (for example, a work cloth) on the transfer plate 61. When the elevating part 62 moves downward, the presser plate 63 descends. The presser plate 63 and the transfer plate 61 hold the sewing object from above and below. Hereinafter, the transfer plate 61 and the presser plate 63 are collectively referred to as a holding body 60.

作業者は、縫製対象物に応じて保持体60に補助押え部材を装着する時がある。例えば、バッグの持ち手部分等、縫製対象物に先に縫い付けられたパーツを縫製の妨げにならないように固定する必要がある場合がある。該場合、作業者は、押え板63の他に、縫製対象物を上から押える補助押え部材を使用する。例えば、図1は、保持体60に補助押え部材510を2個装着した例である。補助押え部材510は、押え板63よりも厚みがある板材である。即ち、補助押え部材510の上端は、常に押え板63の上面よりも上方にある。補助押え部材510は、平面視で矩形の短辺のうち一方の中央部が外側へ向けて矩形状に突出した形状を呈する。本実施形態の補助押え部材510の少なくとも上面は、縫製対象物とは異なる色で着色する。以下では、縫製対象物が赤色以外であり、補助押え部材510の上面は赤色である例を説明する。   The operator sometimes attaches the auxiliary presser member to the holding body 60 according to the sewing object. For example, it may be necessary to fix parts previously sewn to the sewing object such as the handle portion of the bag so as not to hinder the sewing. In this case, in addition to the presser plate 63, the operator uses an auxiliary presser member that presses the sewing object from above. For example, FIG. 1 is an example in which two auxiliary pressing members 510 are mounted on the holding body 60. The auxiliary presser member 510 is a plate material that is thicker than the presser plate 63. That is, the upper end of the auxiliary pressing member 510 is always above the upper surface of the pressing plate 63. The auxiliary presser member 510 has a shape in which one central portion of the rectangular short sides protrudes outward in a rectangular shape in plan view. At least the upper surface of the auxiliary presser member 510 of the present embodiment is colored with a color different from that of the sewing object. Hereinafter, an example in which the sewing object is other than red and the upper surface of the auxiliary pressing member 510 is red will be described.

ミシン1はテーブル95上に設けた操作パネル8と、操作パネル8に接続した操作箱30を備える。操作パネル8、操作箱30は夫々、各種情報、各種指示を入力する為のキー群と、情報表示用のディスプレイを備える。作業者は情報又は指示を入力する場合、操作パネル8又は操作箱30を使用する。ミシン1は、テーブル95下方に制御装置100(図3参照)を格納する制御箱(図示略)を備える。操作パネル8はコード(図示略)を介して制御箱に接続する。操作箱30はケーブル9を介して操作パネル8に接続可能である。   The sewing machine 1 includes an operation panel 8 provided on a table 95 and an operation box 30 connected to the operation panel 8. The operation panel 8 and the operation box 30 each include a key group for inputting various information and various instructions, and a display for displaying information. The operator uses the operation panel 8 or the operation box 30 when inputting information or instructions. The sewing machine 1 includes a control box (not shown) that stores the control device 100 (see FIG. 3) below the table 95. The operation panel 8 is connected to the control box via a cord (not shown). The operation box 30 can be connected to the operation panel 8 via the cable 9.

図2を参照し、アーム部4の前端部7周辺の構成について説明する。前端部7は、上糸55を案内する為の構成、縫針11を装着した針棒10、押え足13を装着した押え棒12、イメージセンサ50等を備える。上糸55を案内する為の構成は、前端部7の右側面に設けた副糸調子器15、糸調子器16、糸案内17、18、天秤19、糸案内20を含む。上糸55は、テーブル95(図1参照)に設けた糸駒立て(図示略)に載置した糸駒から、副糸調子器15、糸調子器16、糸案内17、糸案内18、天秤19、糸案内20を経由し、縫針11の針孔111に挿通する。前述したように、針棒10は、前端部7下端から下方へ延びる。ミシンモータ112(図3参照)は主軸(図示略)を回転駆動する。針棒駆動機構(図示略)は、主軸の回転駆動に伴って針棒10を上下動する。   With reference to FIG. 2, the configuration around the front end 7 of the arm 4 will be described. The front end portion 7 includes a configuration for guiding the upper thread 55, a needle bar 10 to which a sewing needle 11 is attached, a presser bar 12 to which a presser foot 13 is attached, an image sensor 50, and the like. The configuration for guiding the upper thread 55 includes a secondary thread tensioner 15, a thread tensioner 16, thread guides 17 and 18, a balance 19, and a thread guide 20 provided on the right side surface of the front end portion 7. The upper thread 55 includes a secondary thread tensioner 15, a thread tensioner 16, a thread guide 17, a thread guide 18, and a balance from a thread spool placed on a thread spool stand (not shown) provided on a table 95 (see FIG. 1). 19, through the thread guide 20, is inserted into the needle hole 111 of the sewing needle 11. As described above, the needle bar 10 extends downward from the lower end of the front end portion 7. The sewing machine motor 112 (see FIG. 3) rotates a main shaft (not shown). A needle bar drive mechanism (not shown) moves the needle bar 10 up and down as the main shaft rotates.

押え棒12は、針棒10の左方(図2の背面側)で前端部7の下端から下方へ延びる。押え足13は押え棒12下端部に装着する。押え足駆動機構(図示略)は、主軸の回転駆動に伴う針棒10の上下動に同期して、押え棒12を上下動する。押え足13は、縫針11が縫製対象物から抜ける時に上方から縫製対象物を押えることで、縫製対象物が上方へ浮き上がるのを防止する。押え足13の先端部は円筒状の筒部131である。縫針11は、筒部131の貫通穴を通って縫製対象物に刺さる。縫針11は筒部131下方の針穴502を通って上下動する。   The presser bar 12 extends downward from the lower end of the front end 7 on the left side (the back side in FIG. 2) of the needle bar 10. The presser foot 13 is attached to the lower end of the presser bar 12. The presser foot drive mechanism (not shown) moves the presser bar 12 up and down in synchronization with the vertical movement of the needle bar 10 accompanying the rotation of the main shaft. The presser foot 13 prevents the sewing target from being lifted upward by pressing the sewing target from above when the sewing needle 11 is removed from the sewing target. The distal end portion of the presser foot 13 is a cylindrical tube portion 131. The sewing needle 11 is inserted into the sewing object through the through hole of the cylindrical portion 131. The sewing needle 11 moves up and down through a needle hole 502 below the cylinder portion 131.

イメージセンサ50は、ミシン1のフレーム(図示略)に設けた支持部51に固定する。イメージセンサ50は、例えば周知のCMOS(Complementary Metal Oxide Semiconductor)であり、撮影した画像の画像データを出力する。イメージセンサ50のレンズ(図示略)は、縫針11の下方を含む所定領域を撮影可能な方向に向いている。イメージセンサ50の撮影範囲について後で詳述する。   The image sensor 50 is fixed to a support portion 51 provided on a frame (not shown) of the sewing machine 1. The image sensor 50 is, for example, a well-known CMOS (Complementary Metal Oxide Semiconductor), and outputs image data of a captured image. A lens (not shown) of the image sensor 50 faces a direction in which a predetermined area including the lower part of the sewing needle 11 can be photographed. The imaging range of the image sensor 50 will be described in detail later.

図3を参照し、ミシン1の電気的構成について説明する。図3に示す如く、ミシン1の制御装置100は、CPU101、ROM102、RAM103、不揮発性メモリ104、入出力インターフェース(I/F)106、駆動回路113、115、117、通信I/F127を備える。CPU101、ROM102、RAM103、不揮発性メモリ104は、バス105を介して入出力I/F106に電気的に接続する。CPU101は、ミシン1の制御を司り、ROM102が記憶する各種プログラムに従って、縫製に関わる各種演算及び処理を実行する。ROM102は、各種プログラム、各種初期設定パラメータ、複数の模様(縫目線、縫目模様、刺繍模様等)の縫製データ等を記憶する。縫製データについては後述する。RAM103は、CPU101の演算結果、ポインタ、カウンタ等を一時的に記憶する。不揮発性メモリ104は、ミシン1で作成した縫製データ、作業者が入力した各種設定情報等を記憶する。   The electrical configuration of the sewing machine 1 will be described with reference to FIG. As shown in FIG. 3, the control device 100 of the sewing machine 1 includes a CPU 101, a ROM 102, a RAM 103, a nonvolatile memory 104, an input / output interface (I / F) 106, drive circuits 113, 115, 117, and a communication I / F 127. The CPU 101, ROM 102, RAM 103, and nonvolatile memory 104 are electrically connected to the input / output I / F 106 via the bus 105. The CPU 101 controls the sewing machine 1 and executes various calculations and processes related to sewing according to various programs stored in the ROM 102. The ROM 102 stores various programs, various initial setting parameters, sewing data of a plurality of patterns (stitch lines, stitch patterns, embroidery patterns, etc.) and the like. Sewing data will be described later. The RAM 103 temporarily stores calculation results of the CPU 101, pointers, counters, and the like. The nonvolatile memory 104 stores sewing data created by the sewing machine 1, various setting information input by the operator, and the like.

駆動回路113、115、117は、入出力I/F106に電気的に接続する。駆動回路113はミシンモータ112に電気的に接続する。CPU101は、駆動回路113を介してミシンモータ112を制御する。ミシンモータ112は主軸を回転駆動する。駆動回路115はX軸モータ114に電気的に接続する。駆動回路117はY軸モータ116に電気的に接続する。CPU101は、駆動回路115、117を介してX軸モータ114、Y軸モータ116を夫々制御する。X軸モータ114、Y軸モータ116は何れもパルスモータである。X軸モータ114、Y軸モータ116は夫々、X軸移動機構、Y軸移動機構を駆動することで、保持体60をX軸方向、Y軸方向に移動する。   The drive circuits 113, 115, and 117 are electrically connected to the input / output I / F 106. The drive circuit 113 is electrically connected to the sewing machine motor 112. The CPU 101 controls the sewing machine motor 112 via the drive circuit 113. The sewing machine motor 112 rotates the main shaft. The drive circuit 115 is electrically connected to the X-axis motor 114. The drive circuit 117 is electrically connected to the Y-axis motor 116. The CPU 101 controls the X-axis motor 114 and the Y-axis motor 116 via the drive circuits 115 and 117, respectively. Both the X-axis motor 114 and the Y-axis motor 116 are pulse motors. The X-axis motor 114 and the Y-axis motor 116 move the holding body 60 in the X-axis direction and the Y-axis direction by driving the X-axis movement mechanism and the Y-axis movement mechanism, respectively.

CPU101は、縫製時に、ミシンモータ112を駆動して主軸を回転駆動することで、針棒10、押え棒12の上下動と垂直釜の回転を制御する。CPU101は、ミシンモータ112の駆動と同時に、縫製データに基づきX軸モータ114、Y軸モータ116を駆動して、保持体60の位置を制御する。ミシン1は該動作で縫製対象物上に縫製を行う。   The CPU 101 controls the vertical movement of the needle bar 10 and the presser bar 12 and the rotation of the vertical hook by driving the sewing machine motor 112 and rotating the main shaft during sewing. The CPU 101 controls the position of the holding body 60 by driving the X-axis motor 114 and the Y-axis motor 116 based on the sewing data simultaneously with the driving of the sewing machine motor 112. The sewing machine 1 performs sewing on the sewing object by this operation.

通信I/F127は入出力I/F106に電気的に接続する。通信I/F127は、例えばシリアル通信用のインターフェースである。ミシン1は、通信I/F127を介して外部機器に接続可能である。本実施形態では、操作箱30はミシン1に接続する。尚、図3に示す如く、操作箱30は、ケーブル9で接続した操作パネル8を介して、通信I/F127に接続してある。   The communication I / F 127 is electrically connected to the input / output I / F 106. The communication I / F 127 is an interface for serial communication, for example. The sewing machine 1 can be connected to an external device via the communication I / F 127. In the present embodiment, the operation box 30 is connected to the sewing machine 1. As shown in FIG. 3, the operation box 30 is connected to the communication I / F 127 via the operation panel 8 connected by the cable 9.

X方向原点センサ118、Y方向原点センサ119、起動スイッチ121、操作パネル8、イメージセンサ50は夫々、制御装置100の入出力I/F106に電気的に接続する。X方向原点センサ118は、X軸移動機構(図示略)に設けた原点設定用の周知の構成のセンサである。Y方向原点センサ119は、Y軸移動機構(図示略)に設けた原点設定用の周知の構成のセンサである。起動スイッチ121は、テーブル95下方に設置し、制御装置100にコードで接続するペダル式のスイッチである。作業者は、ミシン1の各種動作(例えば縫製処理)を開始する時に起動スイッチ121を踏み込む。操作パネル8、イメージセンサ50については前述の通りである。   The X-direction origin sensor 118, the Y-direction origin sensor 119, the start switch 121, the operation panel 8, and the image sensor 50 are electrically connected to the input / output I / F 106 of the control device 100, respectively. The X-direction origin sensor 118 is a sensor having a known configuration for origin setting provided in an X-axis movement mechanism (not shown). The Y-direction origin sensor 119 is a sensor having a known configuration for origin setting provided in a Y-axis movement mechanism (not shown). The start switch 121 is a pedal-type switch that is installed below the table 95 and connected to the control device 100 with a cord. The operator depresses the activation switch 121 when starting various operations (for example, sewing processing) of the sewing machine 1. The operation panel 8 and the image sensor 50 are as described above.

図3に示す如く、操作箱30は、制御装置300、液晶ディスプレイ(以下、LCDという)32、キー群33を備える。制御装置300は、CPU301、ROM302、RAM303、入出力I/F306、通信I/F307、駆動回路308を備える。CPU301、ROM302、RAM303は、バス305を介して入出力I/F306に電気的に接続する。駆動回路308は、入出力I/F306に電気的に接続する。駆動回路308はLCD32に電気的に接続する。キー群33は、入出力I/F306に電気的に接続する。   As shown in FIG. 3, the operation box 30 includes a control device 300, a liquid crystal display (hereinafter referred to as LCD) 32, and a key group 33. The control device 300 includes a CPU 301, ROM 302, RAM 303, input / output I / F 306, communication I / F 307, and drive circuit 308. The CPU 301, ROM 302, and RAM 303 are electrically connected to the input / output I / F 306 via the bus 305. The drive circuit 308 is electrically connected to the input / output I / F 306. The drive circuit 308 is electrically connected to the LCD 32. The key group 33 is electrically connected to the input / output I / F 306.

CPU301は、操作箱30の制御を司り、ROM302が記憶する各種プログラムとミシン1が送信したデータに従って、LCD32への画像表示、キー群33からの入力受付等の処理を実行する。RAM303は、CPU301の演算結果、ポインタ、カウンタ等を一時的に記憶する。通信I/F307は入出力I/F306に電気的に接続する。通信I/F307は、例えばシリアル通信用のインターフェースである。操作箱30は、通信I/F307を介してミシン1に接続する。LCD32は、各種情報を画像表示する。本実施形態では、LCD32は、イメージセンサ50が撮影した画像を表示可能である。キー群33は、作業者が各種情報、指示を入力する為のものである。キー群33は、四方向矢印キー、数字キー、機能キー等を含む。   The CPU 301 controls the operation box 30 and executes processing such as image display on the LCD 32 and input reception from the key group 33 in accordance with various programs stored in the ROM 302 and data transmitted by the sewing machine 1. The RAM 303 temporarily stores calculation results of the CPU 301, pointers, counters, and the like. The communication I / F 307 is electrically connected to the input / output I / F 306. The communication I / F 307 is an interface for serial communication, for example. The operation box 30 is connected to the sewing machine 1 via the communication I / F 307. The LCD 32 displays various information as images. In the present embodiment, the LCD 32 can display an image taken by the image sensor 50. The key group 33 is for an operator to input various information and instructions. The key group 33 includes four-way arrow keys, numeric keys, function keys, and the like.

図4を参照し、本実施形態における縫製データ、ミシン1の縫製可能範囲(保持体60の可動範囲)、イメージセンサ50の撮影範囲について説明する。   With reference to FIG. 4, the sewing data, the sewing possible range of the sewing machine 1 (the movable range of the holding body 60), and the photographing range of the image sensor 50 will be described with reference to FIG.

縫製データは、模様を縫製する為の複数の針落ち点の位置を、縫針11の位置と保持体60の位置との相対位置で示す。針落ち点は、針棒10と共に縫針11が下方に移動した時、縫針11が刺さる縫製対象物上の予定位置である。本実施形態では、針落ち点の位置は、保持体60に対して設定する座標系601の座標データで示す。座標系601は、X軸モータ114、Y軸モータ116(図3参照)の座標系である。本実施形態では、座標系601はワールド座標系と予め対応付ける。ワールド座標系は空間全体を示す座標系であり、撮影対象物の重心等の影響を受けることのない座標系である。   The sewing data indicates the positions of a plurality of needle drop points for sewing the pattern as a relative position between the position of the sewing needle 11 and the position of the holding body 60. The needle drop point is a predetermined position on the sewing target object that the sewing needle 11 sticks when the sewing needle 11 moves downward together with the needle bar 10. In the present embodiment, the position of the needle drop point is indicated by coordinate data of the coordinate system 601 set for the holding body 60. A coordinate system 601 is a coordinate system of the X-axis motor 114 and the Y-axis motor 116 (see FIG. 3). In this embodiment, the coordinate system 601 is associated with the world coordinate system in advance. The world coordinate system is a coordinate system that indicates the entire space, and is a coordinate system that is not affected by the center of gravity of the object to be imaged.

座標系601では、X軸プラス方向はミシン1の左から右に向かう方向であり、Y軸プラス方向はミシン1の前から後に向かう方向である。本実施形態では、座標系601の原点O(X,Y,Z)=(0,0,0)は、保持体60(より詳細には押え板63の開口内側の領域)の中心点が縫針11(図3参照)の直下にある位置と定める。保持体60の該位置を絶対原点位置という。該位置は、保持体60の中心点が針穴502の真上にある位置と言い換えることもできる。本実施形態の移送装置6は、縫製中に保持体60をZ方向(ミシン1の上下方向)に移動しないので、針落ち点の座標データのZ座標は常にゼロである。   In the coordinate system 601, the X-axis plus direction is a direction from the left to the right of the sewing machine 1, and the Y-axis plus direction is a direction from the front to the back of the sewing machine 1. In the present embodiment, the origin O (X, Y, Z) = (0, 0, 0) of the coordinate system 601 is set so that the center point of the holding body 60 (more specifically, the region inside the opening of the presser plate 63) is the sewing needle. 11 (see FIG. 3). The position of the holding body 60 is referred to as an absolute origin position. This position can also be referred to as a position where the center point of the holding body 60 is directly above the needle hole 502. Since the transfer device 6 of the present embodiment does not move the holding body 60 in the Z direction (up and down direction of the sewing machine 1) during sewing, the Z coordinate of the coordinate data of the needle drop point is always zero.

縫製データは、座標データの示す針落ち点が順に縫針11(図3参照)の直下に位置するように保持体60を移動しながら縫製を行う為のデータである。詳細には、本実施形態の縫製データは、X軸モータ114、Y軸モータ116の夫々の駆動パルス数(回転方向を含む)と、「縫製」か「送り」かを示す種別を対応付けて順に並べたデータである。「縫製」は、保持体60を移動し且つ縫針11を針落ち点で縫製対象物に刺して縫目を形成する動作である。「送り」は、縫目を形成せず保持体60の移動のみ行う動作である。詳細は後述するが、CPU101は、縫製データを順に読み出して処理を行う。尚、縫製データは上記の形式に限らず、針落ち点の座標データと種別を対応付けたデータでもよい。CPU101は、保持体60の移動の都度、該データ中の座標データに基づき、X軸モータ114、Y軸モータ116の夫々の回転方向と駆動パルス数を算出してもよい。   The sewing data is data for performing sewing while moving the holding body 60 so that the needle drop points indicated by the coordinate data are sequentially located immediately below the sewing needle 11 (see FIG. 3). Specifically, the sewing data of the present embodiment associates the number of drive pulses (including the rotation direction) of the X-axis motor 114 and the Y-axis motor 116 with the type indicating “sewing” or “feed”. It is data arranged in order. “Sewing” is an operation in which the holding body 60 is moved and the sewing needle 11 is pierced into the sewing object at the needle drop point to form a stitch. “Feeding” is an operation in which no movement is formed and only the holding body 60 is moved. Although details will be described later, the CPU 101 sequentially reads out the sewing data and performs processing. The sewing data is not limited to the above format, and may be data in which the coordinate data of the needle drop point is associated with the type. The CPU 101 may calculate the rotation direction and the number of drive pulses of the X-axis motor 114 and the Y-axis motor 116 based on the coordinate data in the data each time the holding body 60 moves.

保持体60の内側の領域のうち、ミシン1が縫製を行うことができる範囲を縫製可能範囲611という。縫針11と保持体60の干渉を防止する為、縫製可能範囲611は、保持体60の内側の領域よりも小さく設定する。縫製可能範囲611は、例えば座標系601の原点Oを中心としてX軸方向、Y軸方向に対称な領域である。本実施形態では、縫製可能範囲611は保持体60の移動可能範囲と等しい。ミシン1は、保持体60が移動可能範囲の端(以下、可動域端という)に到達したことを検出する構成を備える。   A range in which the sewing machine 1 can perform sewing in an area inside the holding body 60 is referred to as a sewing range 611. In order to prevent interference between the sewing needle 11 and the holding body 60, the sewing range 611 is set to be smaller than the area inside the holding body 60. The sewing range 611 is, for example, a region that is symmetric in the X-axis direction and the Y-axis direction with the origin O of the coordinate system 601 as the center. In the present embodiment, the sewing range 611 is equal to the movable range of the holding body 60. The sewing machine 1 has a configuration for detecting that the holding body 60 has reached the end of the movable range (hereinafter referred to as the movable range end).

図示しないが、該構成は、例えば、X方向ストッパ、Xエンコーダ、Y方向ストッパ、Yエンコーダを含む。X方向ストッパは、移送板保持部64の左右二箇所に設ける。Y方向ストッパは、腕部65の前後二箇所に設ける。Xエンコーダ、Yエンコーダは、夫々、X軸モータ114、Y軸モータ116の回転量を検出して信号を出力するロータリーエンコーダである。   Although not shown, the configuration includes, for example, an X direction stopper, an X encoder, a Y direction stopper, and a Y encoder. X direction stoppers are provided at two locations on the left and right of the transfer plate holding portion 64. The Y-direction stopper is provided at two places on the front and rear of the arm portion 65. The X encoder and the Y encoder are rotary encoders that detect rotation amounts of the X axis motor 114 and the Y axis motor 116 and output signals, respectively.

保持体60(移送板61)がX方向(左右方向)に移動して何れかのX方向ストッパに接触すると、X方向ストッパは保持体60の移動を阻止する。故に、Xエンコーダは信号を出力しないので、CPU101は、保持体60がX方向における可動域端に到達したことを認識できる。CPU101は、Y方向ストッパとYエンコーダを用いて、同様に、保持体60がY方向における可動域端に到達したことも認識できる。尚、保持体60が可動域端に到達したことを検出する構成は、移送板保持部64の左右二箇所、腕部65の前後二箇所に設けた接触式センサ等、他の構成でもよい。   When the holding body 60 (transfer plate 61) moves in the X direction (left-right direction) and contacts any X direction stopper, the X direction stopper prevents the holding body 60 from moving. Therefore, since the X encoder does not output a signal, the CPU 101 can recognize that the holding body 60 has reached the movable range end in the X direction. Similarly, the CPU 101 can also recognize that the holding body 60 has reached the movable range end in the Y direction using the Y direction stopper and the Y encoder. The configuration for detecting that the holding body 60 has reached the end of the movable range may be another configuration such as contact sensors provided at two locations on the left and right of the transfer plate holding portion 64 and at two locations on the front and rear of the arm portion 65.

本実施形態のイメージセンサ50は、縫針11の下方を含む所定領域、より詳細には縫針11の直下にある針穴502(図1参照)を中心とした矩形状の所定領域53を撮影可能である。図4に示す如く、保持体60が絶対原点位置にある時の所定領域53は、座標系601の原点Oを中心とする矩形領域である。本実施形態では、イメージセンサ50は、縦480画素、横640画素で構成する所定領域53の画像(以下、撮影画像という)の画像データを定期的に出力する。詳細には、イメージセンサ50は、RGB形式の256階調の階調値(RGB値)を示すデータを、R値データ、G値データ、B値データの3種類に分けて定期的に出力する。イメージセンサ50が出力した最新の画像データは、RAM103の所定の記憶エリアに格納する。図5は、R値データの一例を示している。R値データは、縦480画素、横640画素の各画素が1バイト(byte)に対応し、1バイトのデータが0〜255の何れかのR値を示す。図示しないが、G値データ、B値データも同様のデータである。   The image sensor 50 according to the present embodiment can photograph a predetermined area including the lower side of the sewing needle 11, more specifically, a rectangular predetermined area 53 centered on a needle hole 502 (see FIG. 1) immediately below the sewing needle 11. is there. As shown in FIG. 4, the predetermined area 53 when the holding body 60 is at the absolute origin position is a rectangular area centered on the origin O of the coordinate system 601. In the present embodiment, the image sensor 50 periodically outputs image data of an image (hereinafter referred to as a photographed image) in a predetermined area 53 configured by 480 pixels vertically and 640 pixels horizontally. More specifically, the image sensor 50 periodically outputs data indicating 256 gradation values (RGB values) in RGB format, divided into three types of R value data, G value data, and B value data. . The latest image data output from the image sensor 50 is stored in a predetermined storage area of the RAM 103. FIG. 5 shows an example of R value data. In the R value data, each of 480 pixels in the vertical direction and 640 pixels in the horizontal direction corresponds to 1 byte (byte), and 1 byte of data indicates an R value of 0 to 255. Although not shown, G value data and B value data are similar data.

ミシン1は、最新の画像データに基づき、操作箱30のLCD32(図1参照)に撮影画像をリアルタイムで表示可能である。イメージセンサ50は縫製対象物の表面に対して斜め上方から縫製対象物を撮影するので、針棒10等は撮影画像中に斜めに写りこむ。故に、CPU101は、例えば図6に示す如く、撮影画像を真上から見た画像に視点変換した上で表示するのが好ましい。尚、図6の例と以下の説明では、撮影画像が針棒10のみを含む例を挙げるが、撮影画像が押え足13等を含む場合も同様である。画像の視点変換方法は周知なので説明を省略するが、例えば特開2009−172122号公報に記載の方法を採用することができる。但し、CPU101は、視点変換は行わずに撮影画像をそのまま表示してもよい。何れの場合も、作業者は、LCD32が表示する撮影画像で所定領域53の状態を確認することができる。   The sewing machine 1 can display captured images in real time on the LCD 32 (see FIG. 1) of the operation box 30 based on the latest image data. Since the image sensor 50 photographs the sewing object from obliquely above the surface of the sewing object, the needle bar 10 and the like are obliquely reflected in the photographed image. Therefore, for example, as shown in FIG. 6, the CPU 101 preferably displays the captured image after converting the viewpoint to an image viewed from directly above. In the example of FIG. 6 and the following description, an example in which the captured image includes only the needle bar 10 is given, but the same applies to the case where the captured image includes the presser foot 13 and the like. Since the viewpoint conversion method of an image is well known, description thereof will be omitted, but for example, a method described in Japanese Patent Application Laid-Open No. 2009-172122 can be employed. However, the CPU 101 may display the captured image as it is without performing viewpoint conversion. In either case, the operator can check the state of the predetermined area 53 with the captured image displayed on the LCD 32.

図7〜図14を参照し、ミシン1の縫製処理について説明する。図7の縫製処理は、CPU101が縫製処理の実行指示の入力を検知した時に開始する。CPU101は、ROM102から縫製処理用のプログラムを読み出して実行する。作業者は、まず、操作パネル8または操作箱30のキーを操作して、縫製対象の模様の識別番号を選択する。CPU101は、作業者が選択した模様(以下、選択模様という)の識別番号の入力を受け付け、該識別番号に対応する縫製データをROM102又は不揮発性メモリ104からRAM103の所定の記憶エリアに読み出す(S1)。   The sewing process of the sewing machine 1 will be described with reference to FIGS. The sewing process in FIG. 7 starts when the CPU 101 detects an input of an instruction to execute the sewing process. The CPU 101 reads out a sewing processing program from the ROM 102 and executes it. First, the operator operates the keys on the operation panel 8 or the operation box 30 to select the identification number of the pattern to be sewn. The CPU 101 receives an input of an identification number of a pattern selected by the operator (hereinafter referred to as a selected pattern), and reads sewing data corresponding to the identification number from the ROM 102 or the nonvolatile memory 104 to a predetermined storage area of the RAM 103 (S1). ).

CPU101は、制限領域と減速領域を設定し、領域マップを作成してRAM103に記憶する(S2)。制限領域は、所定領域53の撮影画像中の少なくとも針棒10に対応する範囲である。CPU101は、後述する送り移動処理において、補助押え部材510が針棒10に装着した縫針11と干渉することを回避する為に、補助押え部材510(図1参照)が撮影画像中で該制限領域に重ならないように保持体60の移動を制御する。減速領域は、所定領域53の制限領域の周囲に予め設定する領域である。CPU101は、後述する送り移動処理において、補助押え部材510が撮影画像中で減速領域に重なった場合、保持体60の移動速度を減速する。   The CPU 101 sets a limited area and a deceleration area, creates an area map, and stores it in the RAM 103 (S2). The restricted area is a range corresponding to at least the needle bar 10 in the captured image of the predetermined area 53. In order to prevent the auxiliary presser member 510 from interfering with the sewing needle 11 attached to the needle bar 10 in the feed movement process described later, the CPU 101 detects that the auxiliary presser member 510 (see FIG. 1) The movement of the holding body 60 is controlled so as not to overlap. The deceleration area is an area set in advance around the restriction area of the predetermined area 53. In the feed movement process described later, the CPU 101 decelerates the moving speed of the holding body 60 when the auxiliary pressing member 510 overlaps the deceleration area in the captured image.

CPU101は、制限領域と減速領域の設定方法として、次に例示する方法を使用可能である。例えば、CPU101は、所定領域53の撮影画像中の針穴502(図6参照)を識別し、針穴502を中心とする半径Xミリの円形領域を制限領域56として設定する。尚、図6は真上から見た画像に視点変換した画像の例なので針穴502は隠れているが、撮影画像では識別可能である。CPU101は更に制限領域56の周囲に半径Yミリ(但しY>X)の円形領域を減速領域57として設定する。X、Yは、予め設定して不揮発性メモリ104に記憶した値でもよいし、作業者が操作パネル8又は操作箱30のキーを操作して入力した値でもよい。Xは、針棒10の半径以上であることが好ましい。   The CPU 101 can use the following method as a method for setting the restriction area and the deceleration area. For example, the CPU 101 identifies a needle hole 502 (see FIG. 6) in the captured image of the predetermined area 53 and sets a circular area having a radius of X millimeters around the needle hole 502 as the restricted area 56. Since FIG. 6 is an example of an image obtained by converting the viewpoint to an image viewed from directly above, the needle hole 502 is hidden, but can be identified in the captured image. Further, the CPU 101 sets a circular area having a radius of Y millimeter (provided that Y> X) around the restricted area 56 as the deceleration area 57. X and Y may be values set in advance and stored in the non-volatile memory 104, or may be values input by the operator operating the keys of the operation panel 8 or the operation box 30. X is preferably equal to or greater than the radius of the needle bar 10.

他の制限領域、減速領域の設定方法では、CPU101は、針穴502を含む撮影画像を操作箱30のLCD32に表示する。作業者は、操作箱30のキー群33を操作して、撮影画像中で針穴502の周囲の領域を制限領域として指定し、更にその周囲の領域を減速領域として指定する。操作箱30がLCD32の表面にタッチパネルを備える場合、作業者はスタイラスペン等を使用してタッチパネル上で領域を指定してもよい。CPU101は、作業者が指定した領域を制限領域、減速領域として設定できる。更に他の方法では、所定領域53内に針穴502以外の特徴点がある場合、不揮発性メモリ104は、該特徴点と針棒10との位置関係を記憶しておく。CPU101は撮像画像中の特徴点を識別し、該特徴点を基準として、針棒10に対応する制限領域、減速領域を設定してもよい。尚、CPU101は、周知の任意の画像認識技術を用いて撮影画像中の針穴502、その他の特徴点を識別すればよい。   In another restriction area / deceleration area setting method, the CPU 101 displays a captured image including the needle hole 502 on the LCD 32 of the operation box 30. The operator operates the key group 33 of the operation box 30 to designate an area around the needle hole 502 as a restricted area in the photographed image, and further designates an area around the area as a deceleration area. When the operation box 30 includes a touch panel on the surface of the LCD 32, the operator may designate an area on the touch panel using a stylus pen or the like. The CPU 101 can set the areas designated by the worker as the restriction area and the deceleration area. In another method, when there is a feature point other than the needle hole 502 in the predetermined area 53, the nonvolatile memory 104 stores the positional relationship between the feature point and the needle bar 10. The CPU 101 may identify a feature point in the captured image, and set a restriction region and a deceleration region corresponding to the needle bar 10 based on the feature point. Note that the CPU 101 may identify the needle hole 502 and other feature points in the captured image using any known image recognition technique.

説明の簡単化の為、針棒10に対応する範囲のみを制限領域として設定する方法を説明した。しかし、針棒10の他、押え足13等も前端部7の下端から下方に突出している。故に、制限領域は、針棒10に加え、押え足13等に対応する範囲も含む領域として設定してもよい。該場合も、CPU101は、所定領域53の撮影画像の針穴502、その他の特徴点を基準として、予め定めた法則に従って、又は作業者の指定に応じて、制限領域、減速領域を設定すればよい。   In order to simplify the description, the method of setting only the range corresponding to the needle bar 10 as the limited region has been described. However, in addition to the needle bar 10, the presser foot 13 and the like protrude downward from the lower end of the front end portion 7. Therefore, the restricted area may be set as an area including a range corresponding to the presser foot 13 in addition to the needle bar 10. In this case as well, the CPU 101 sets the restriction region and the deceleration region according to a predetermined rule or according to the operator's designation with reference to the needle hole 502 of the photographed image in the predetermined region 53 and other feature points. Good.

領域マップは、所定領域53の撮影画像中の制限領域、減速領域の位置を示すマップである。前述の通り、所定領域53の撮影画像の大きさは、縦480画素、横640画素である。領域マップは、撮影画像の全画素の各々に1バイト(byte)を割り当てた縦480バイト、横640バイトのデータである。領域マップ中の各画素に対応する位置のデータは、該画素が制限領域内にあれば1を示し、減速領域内にあれば2を示し、その他の領域(制限領域でも減速領域でもない領域)内にあれば0を示す。例えば、CPU101は、図6に示す制限領域56、減速領域57の例に対応して、図8に示すような領域マップを作成する。制限領域56である中心部の画素に対応する位置のデータは1を示し、減速領域57である周囲の画素に対応する位置のデータは2を示し、その他のデータは0を示している。以下の説明では、CPU101は、S2で図6に示す制限領域56、減速領域57を設定したものとする。   The area map is a map showing the positions of the restriction area and the deceleration area in the captured image of the predetermined area 53. As described above, the size of the captured image in the predetermined area 53 is 480 pixels vertically and 640 pixels horizontally. The area map is data of 480 bytes in length and 640 bytes in width in which 1 byte is assigned to each of all pixels of the captured image. The data of the position corresponding to each pixel in the area map indicates 1 if the pixel is in the limited area, 2 if it is in the deceleration area, and other areas (areas that are neither the limited area nor the deceleration area) If it is within, 0 is indicated. For example, the CPU 101 creates an area map as shown in FIG. 8 corresponding to the example of the restriction area 56 and the deceleration area 57 shown in FIG. The data of the position corresponding to the central pixel that is the restriction area 56 indicates 1, the data of the position corresponding to the surrounding pixels that are the deceleration area 57 indicates 2, and the other data indicates 0. In the following description, it is assumed that the CPU 101 sets the limited area 56 and the deceleration area 57 shown in FIG. 6 in S2.

CPU101は、領域マップの作成後、障害物情報を設定する(S3)。障害物情報は、縫針11と干渉する可能性のある障害物を画像認識で識別する為の障害物の特徴部分に関する情報である。障害物情報は、例えば、障害物の色、形状、障害物に付した模様等に関する情報である。本実施形態では、補助押え部材510が障害物の例である。CPU101は、補助押え部材510の上面に付した色(赤色)を識別する。作業者は、操作パネル8又は操作箱30のキーを操作して、赤色を示す情報を入力する。赤色を示す情報は、例えば、RGB値で示すことができる(R値=255、G値=0、B値=0)。CPU101は、LCD32に予め設定した主要な色(赤、青、黄、黒等)を選択可能に表示し、作業者が選択した色に応じたRGB値を障害物情報として設定してもよい。障害物情報が障害物の形状、模様に関する情報の場合、作業者は操作パネル8又は操作箱30のキーを操作して、形状、模様を示す情報を入力してもよい。CPU101は設定した障害物情報をRAM103に記憶する。本実施形態では、S3で設定した障害物の色を、対象色という。   After creating the area map, the CPU 101 sets obstacle information (S3). The obstacle information is information regarding the characteristic part of the obstacle for identifying an obstacle that may interfere with the sewing needle 11 by image recognition. The obstacle information is, for example, information regarding the color and shape of the obstacle, the pattern attached to the obstacle, and the like. In the present embodiment, the auxiliary presser member 510 is an example of an obstacle. The CPU 101 identifies the color (red) given to the upper surface of the auxiliary pressing member 510. The operator operates the keys on the operation panel 8 or the operation box 30 to input information indicating red. Information indicating red can be represented by, for example, RGB values (R value = 255, G value = 0, B value = 0). The CPU 101 may display selectable main colors (red, blue, yellow, black, etc.) on the LCD 32 in advance, and may set RGB values according to the color selected by the operator as obstacle information. When the obstacle information is information related to the shape and pattern of the obstacle, the operator may input information indicating the shape and pattern by operating the keys of the operation panel 8 or the operation box 30. The CPU 101 stores the set obstacle information in the RAM 103. In the present embodiment, the color of the obstacle set in S3 is referred to as a target color.

CPU101は、起動スイッチ121(図3参照)がONとなったか否かを判断する(S6)。作業者が起動スイッチ121を踏み込まず、起動スイッチ121がOFFの場合(S6:NO)、CPU101は選択模様の変更操作があったか否かを判断する(S12)。選択模様の変更操作があった場合(S12:YES)、CPU101は処理をS1に戻す。選択模様の変更操作がない場合(S12:NO)、CPU101は処理をS6に戻す。作業者が起動スイッチ121を踏み込むと、起動スイッチ121がONとなる(S6:YES)。CPU101は、原点設定が必要か否かを判断する(S7)。原点設定とは、保持体60を前述の絶対原点位置に移動する動作である。ミシン1は、縫製データに基づいて保持体60を移動する前に、まず絶対原点位置に保持体60を移動する。故に、CPU101は、起動スイッチ121がONとなった時、S1で読み出した縫製データが未処理であれば、原点設定が必要と判断し(S7:YES)、後述の送り移動処理を行う(S20)。CPU101は、送り移動処理の後、S6に処理を戻す。   The CPU 101 determines whether or not the start switch 121 (see FIG. 3) is turned on (S6). When the operator does not depress the start switch 121 and the start switch 121 is OFF (S6: NO), the CPU 101 determines whether or not a selection pattern changing operation has been performed (S12). When there is an operation for changing the selected pattern (S12: YES), the CPU 101 returns the process to S1. When there is no selection pattern changing operation (S12: NO), the CPU 101 returns the process to S6. When the operator steps on the start switch 121, the start switch 121 is turned on (S6: YES). The CPU 101 determines whether or not the origin setting is necessary (S7). The origin setting is an operation for moving the holding body 60 to the absolute origin position described above. The sewing machine 1 first moves the holding body 60 to the absolute origin position before moving the holding body 60 based on the sewing data. Therefore, when the start switch 121 is turned on, if the sewing data read in S1 is unprocessed, the CPU 101 determines that the origin setting is necessary (S7: YES), and performs a feed movement process described later (S20). ). After the feed movement process, the CPU 101 returns the process to S6.

CPU101は、既に原点設定を行っており、縫製データに基づいて保持体60を移動する場合、原点設定は不要と判断する(S7:NO)。CPU101は、S1でRAM103に読み出した選択模様の縫製データのうち、最初の未処理データを取得し、処理対象データとしてRAM103の作業メモリにコピーする(S8)。CPU101は、処理対象データの種別が「送り」であるか否か判断する(S9)。縫製データの最初のデータは、最初の針落ち点が縫針11の直下にある位置(以下、縫製開始位置という)に保持体60を移動させる為のデータであり、種別は「送り」である(S9:YES)。CPU101は、後述の送り移動処理を行う(S20)。CPU101は、送り移動処理の後、S6に処理を戻す。尚、起動スイッチ121の操作回数を減らす為に、原点設定から縫製開始位置への移動を一連の処理として行ってもよい。   The CPU 101 has already set the origin, and determines that the origin setting is unnecessary when the holder 60 is moved based on the sewing data (S7: NO). The CPU 101 acquires first unprocessed data among the sewing data of the selected pattern read to the RAM 103 in S1, and copies it to the work memory of the RAM 103 as processing target data (S8). The CPU 101 determines whether or not the type of data to be processed is “send” (S9). The first data of the sewing data is data for moving the holding body 60 to a position where the first needle drop point is directly below the sewing needle 11 (hereinafter referred to as a sewing start position), and the type is “feed” ( S9: YES). The CPU 101 performs a feed movement process described later (S20). After the feed movement process, the CPU 101 returns the process to S6. In order to reduce the number of operations of the start switch 121, the movement from the origin setting to the sewing start position may be performed as a series of processes.

縫製開始点まで保持体60が移動した後、処理対象データの種別は「送り」でなく「縫製」となる(S9:NO)。CPU101は、保持体60を移動し且つ縫針11を針落ち点で縫製対象物に刺すことで縫目を形成する縫目形成処理を行う(S11)。詳細には、CPU101は、作業者が設定した回転速度でミシンモータ112を駆動して主軸を回転駆動することで、針棒10の上下動と垂直釜の回転を制御する。CPU101は、主軸の回転駆動と同期した速度で、処理対象データが示す回転方向で、処理対象データが示す駆動パルス数をX軸モータ114、Y軸モータ116に与えることで、保持体60を移動する。ミシン1は該動作で縫製データに従って順に縫製対象物に縫目を形成することで、選択模様を縫製する。   After the holding body 60 moves to the sewing start point, the type of the processing target data is not “feed” but “sewing” (S9: NO). The CPU 101 performs a stitch formation process for forming a stitch by moving the holding body 60 and inserting the sewing needle 11 into the sewing object at the needle drop point (S11). More specifically, the CPU 101 controls the vertical movement of the needle bar 10 and the rotation of the vertical shuttle by driving the sewing machine motor 112 at a rotational speed set by the operator to rotationally drive the main shaft. The CPU 101 moves the holding body 60 by giving the number of drive pulses indicated by the processing target data to the X-axis motor 114 and the Y-axis motor 116 in the rotational direction indicated by the processing target data at a speed synchronized with the rotational driving of the spindle. To do. The sewing machine 1 sews the selected pattern by forming stitches in the sewing object in order according to the sewing data by the operation.

CPU101は、縫目形成処理(選択模様の縫製)の後、選択模様の変更操作があったか否か判断する(S12)。選択模様の変更操作があった場合(S12:YES)、CPU101は処理をS1に戻す。選択模様の変更操作がない場合(S12:NO)、CPU101は処理をS6に戻す。縫製処理はミシン1の電源がOFFとなると終了する。   After the stitch formation process (sewing the selected pattern), the CPU 101 determines whether or not the selected pattern has been changed (S12). When there is an operation for changing the selected pattern (S12: YES), the CPU 101 returns the process to S1. When there is no selection pattern changing operation (S12: NO), the CPU 101 returns the process to S6. The sewing process ends when the power of the sewing machine 1 is turned off.

以下、図9〜図14を参照し、送り移動処理について説明する。送り移動処理は、縫針11を縫製対象物に刺すことなく、目標位置(絶対原点位置または縫製開始位置)まで保持体60を移動する処理である。CPU101はまず回避中フラグを0に設定してRAM103に記憶する(S201)。回避中フラグは、CPU101が通常の移動方向とは異なる方向に保持体60を移動中であるか否か(回避動作中であるか否か)、及び回避動作中の場合の移動方向を、0、1、2の何れかで示す値である。詳細は後述するが、CPU101は、回避中フラグを0、1、2の順に設定する。   Hereinafter, the feed movement process will be described with reference to FIGS. The feed movement process is a process of moving the holding body 60 to the target position (absolute origin position or sewing start position) without piercing the sewing needle 11 into the sewing object. First, the CPU 101 sets the avoidance flag to 0 and stores it in the RAM 103 (S201). The avoiding flag indicates whether the CPU 101 is moving the holding body 60 in a direction different from the normal moving direction (whether the avoiding operation is being performed) and the moving direction when the avoiding operation is being performed. , 1 or 2. Although details will be described later, the CPU 101 sets the avoidance flag in the order of 0, 1, and 2.

CPU101は、目標位置に応じてX正負カウンタ(Cx)とY正負カウンタ(Cy)をセットする(S202)。CPU101が絶対原点位置に保持体60を移動する場合、目標位置は原点Oであるが、保持体60の位置は座標系601(図4参照)の座標で特定できていない。故に、CPU101は、X方向原点センサ118とY方向原点センサ119(図3参照)を用いて原点設定を行う為に、CxとCyに十分大きな値をセットする。CPU101が縫製開始位置を目標位置として保持体60を移動する場合、保持体60は既に絶対原点位置にあるので、CPU101は、処理対象データが示す値をCxとCyにセットする。CPU101は、RAM103に用意したタイマカウンタをリセットし、経過時間のカウントを開始する(S203)。   The CPU 101 sets an X positive / negative counter (Cx) and a Y positive / negative counter (Cy) according to the target position (S202). When the CPU 101 moves the holding body 60 to the absolute origin position, the target position is the origin O, but the position of the holding body 60 cannot be specified by the coordinates of the coordinate system 601 (see FIG. 4). Therefore, the CPU 101 sets sufficiently large values for Cx and Cy in order to set the origin using the X-direction origin sensor 118 and the Y-direction origin sensor 119 (see FIG. 3). When the CPU 101 moves the holding body 60 with the sewing start position as the target position, since the holding body 60 is already at the absolute origin position, the CPU 101 sets the values indicated by the processing target data to Cx and Cy. The CPU 101 resets the timer counter prepared in the RAM 103 and starts counting elapsed time (S203).

CPU101は、移動処理を行う(S210)。移動処理は、目標位置または後述する中継位置に向けてX方向、Y方向の少なくとも一方に1パルス分保持体60を移動する処理である。図10に示す如く、移動処理では、CPU101は、所定の時間間隔(例えば、1/100秒毎)でX軸モータ114、Y軸モータ116にパルスを与えて保持体60を移動する為に、所定時間が経過したか否かを判断する(S212)。CPU101は、所定時間が経過しない間待機する(S212:NO→S212)。尚、ミシン1は、作業者の入力した指示に応じて送り移動処理時の保持体60の移動速度を予め設定可能であってもよい。この場合、所定時間は移動速度に応じて変動する。   The CPU 101 performs a movement process (S210). The movement process is a process of moving the holding body 60 by one pulse in at least one of the X direction and the Y direction toward the target position or a relay position described later. As shown in FIG. 10, in the moving process, the CPU 101 applies pulses to the X-axis motor 114 and the Y-axis motor 116 at predetermined time intervals (for example, every 1/100 seconds) to move the holding body 60. It is determined whether or not a predetermined time has passed (S212). The CPU 101 waits until a predetermined time has not elapsed (S212: NO → S212). The sewing machine 1 may be able to set in advance the moving speed of the holding body 60 during the feed movement process in accordance with an instruction input by the operator. In this case, the predetermined time varies depending on the moving speed.

CPU101は、所定時間が経過すると(S212:YES)、Cxの値が0より大きいか否か判断する(S213)。Cxの値が0より大きい場合(S213:YES)、CPU101は、X軸モータ114にX正方向駆動パルスを1パルス出力する指示を駆動回路115(図3参照)に与える(S214)。保持体60は、X正方向へ1パルス分移動する。CPU101は、Cxの値から1を減算し(S215)、処理をS221に進める。   When the predetermined time has elapsed (S212: YES), the CPU 101 determines whether the value of Cx is greater than 0 (S213). When the value of Cx is larger than 0 (S213: YES), the CPU 101 gives an instruction to output one X positive direction driving pulse to the X-axis motor 114 to the driving circuit 115 (see FIG. 3) (S214). The holding body 60 moves by one pulse in the X positive direction. The CPU 101 subtracts 1 from the value of Cx (S215) and advances the process to S221.

Cxの値が0より小さい場合(S213:NO、S217:YES)、CPU101は、X軸モータ114にX負方向駆動パルスを1パルス出力する指示を駆動回路115に与える(S218)。保持体60は、X負方向へ1パルス分移動する。CPU101は、Cxの値に1を加算し(S219)、処理をS221に進める。Cxの値が0の場合(S213:NO、S217:NO)、保持体60は既にX軸方向において目標位置または中継位置に到達している。故に、CPU101は、X軸方向に保持体60を動かさずに処理をS221に進める。   When the value of Cx is smaller than 0 (S213: NO, S217: YES), the CPU 101 gives an instruction to the X-axis motor 114 to output one X negative direction drive pulse to the drive circuit 115 (S218). The holding body 60 moves by one pulse in the X negative direction. The CPU 101 adds 1 to the value of Cx (S219) and advances the process to S221. When the value of Cx is 0 (S213: NO, S217: NO), the holding body 60 has already reached the target position or the relay position in the X-axis direction. Therefore, the CPU 101 advances the process to S221 without moving the holding body 60 in the X-axis direction.

Cyの値が0より大きい場合(S221:YES)、CPU101は、Y軸モータ116にY正方向駆動パルスを1パルス出力する指示を駆動回路117(図3参照)に与える(S222)。保持体60は、Y正方向へ1パルス分移動する。CPU101は、Cyの値から1を減算し(S223)、次の移動までの経過時間をカウントする為にタイマカウンタをリセットする(S230)。CPU101は、移動処理を終了し、図9の送り移動処理に戻る。   When the value of Cy is larger than 0 (S221: YES), the CPU 101 gives an instruction to output one Y-direction drive pulse to the Y-axis motor 116 to the drive circuit 117 (see FIG. 3) (S222). The holding body 60 moves by one pulse in the Y positive direction. The CPU 101 subtracts 1 from the value of Cy (S223), and resets the timer counter to count the elapsed time until the next movement (S230). The CPU 101 ends the movement process and returns to the feed movement process of FIG.

Cyの値が0より小さい場合(S221:NO、S226:YES)、CPU101は、Y軸モータ116にY負方向駆動パルスを1パルス出力する指示を駆動回路117に与える(S227)。保持体60は、Y負方向へ1パルス分移動する。CPU101は、Cyの値に1を加算し(S228)、タイマカウンタをリセットする(S230)。CPU101は、移動処理を終了し、図9の送り移動処理に戻る。Cyの値が0の場合(S221:NO、S226:NO)、保持体60は既にY軸方向において目標位置または中継位置に到達している。ただし、保持体60がX軸方向において目標位置または中継位置に到達していない場合があるので、CPU101は、次の移動までの経過時間をカウントする為にタイマカウンタをリセットする(S230)。CPU101は、Y軸方向に保持体60を動かさずに移動処理を終了し、図9の送り移動処理に戻る。   When the value of Cy is smaller than 0 (S221: NO, S226: YES), the CPU 101 gives an instruction to the Y-axis motor 116 to output one Y negative direction drive pulse to the drive circuit 117 (S227). The holding body 60 moves by one pulse in the Y negative direction. The CPU 101 adds 1 to the value of Cy (S228), and resets the timer counter (S230). The CPU 101 ends the movement process and returns to the feed movement process of FIG. When the value of Cy is 0 (S221: NO, S226: NO), the holding body 60 has already reached the target position or the relay position in the Y-axis direction. However, since the holder 60 may not reach the target position or the relay position in the X-axis direction, the CPU 101 resets the timer counter in order to count the elapsed time until the next movement (S230). The CPU 101 ends the movement process without moving the holding body 60 in the Y-axis direction, and returns to the feed movement process in FIG.

図9に示す如く、CPU101は、移動処理の後、画像監視処理を行う(S250)。画像監視処理は、所定領域53(図6参照)の撮影画像を監視し、障害物(本実施形態では補助押え部材510)が制限領域56に重ならないようにフラグをセットする処理である。図11に示す如く、画像監視処理では、CPU101はまず、重なりフラグと減速フラグを0に設定してRAM103に記憶する(S251)。重なりフラグは、制限領域56から保持体60の移動方向と反対方向の所定距離内に障害物が存在する否かを、1、0の何れかで示す値である。減速フラグは、減速領域57から保持体60の移動方向と反対方向の所定距離内に障害物が存在するか否かを、1、0の何れかで示す値である。   As shown in FIG. 9, the CPU 101 performs an image monitoring process after the movement process (S250). The image monitoring process is a process of monitoring a photographed image in a predetermined area 53 (see FIG. 6) and setting a flag so that an obstacle (in this embodiment, the auxiliary presser member 510) does not overlap the restriction area 56. As shown in FIG. 11, in the image monitoring process, the CPU 101 first sets the overlap flag and the deceleration flag to 0 and stores them in the RAM 103 (S251). The overlap flag is a value indicating whether an obstacle is present within a predetermined distance from the restriction region 56 in the direction opposite to the moving direction of the holding body 60 by one of 1 and 0. The deceleration flag is a value indicating by 1 or 0 whether or not there is an obstacle within a predetermined distance from the deceleration region 57 in the direction opposite to the moving direction of the holding body 60.

CPU101は、保持体60の移動方向に応じて、制限領域56、減速領域57をX軸方向、Y軸方向に夫々オフセットするオフセット量であるOFx、OFyを設定する(S252)。障害物が制限領域56に重なってしまうと、障害物が縫針11と干渉する可能性が高まる。故に、本実施形態では、制限領域56から保持体60の移動方向と反対方向の所定距離内に障害物が進入すると、CPU101は保持体60の移動方向を変更する。該所定距離がオフセット量である。オフセット量は、本実施形態では、処理の簡単化の為に画素数(例えば、10画素)で設定するが、距離(例えば、5ミリ)で設定し、CPU101が処理の都度距離を画素数に換算して使用してもよい。   The CPU 101 sets OFx and OFy, which are offset amounts for offsetting the restriction area 56 and the deceleration area 57 in the X-axis direction and the Y-axis direction, respectively, according to the moving direction of the holding body 60 (S252). If the obstacle overlaps the restricted area 56, the possibility that the obstacle interferes with the sewing needle 11 increases. Therefore, in this embodiment, when an obstacle enters within a predetermined distance from the restriction region 56 in the direction opposite to the moving direction of the holding body 60, the CPU 101 changes the moving direction of the holding body 60. The predetermined distance is an offset amount. In this embodiment, the offset amount is set by the number of pixels (for example, 10 pixels) for simplification of processing, but is set by the distance (for example, 5 mm), and the CPU 101 sets the distance to the number of pixels for each processing. You may convert and use.

保持体60の移動方向は、X正方向、X正方向Y負方向、Y負方向、X負方向Y負方向、X負方向、X負方向Y正方向、Y正方向、X正方向Y正方向の8種類ある。X正負カウンタ(Cx)の示す値が正の値の場合、保持体60はX正方向に移動するので、CPU101は、制限領域56からX負方向にオフセット量を設ける。即ち、OFxは負の値である。逆に、Cxの示す値が負の値の場合、保持体60はX負方向に移動するので、CPU101は、制限領域56からX正方向にオフセット量を設ける。即ち、OFxは正の値である。Cxの示す値が0の場合、保持体60はX軸方向には移動しないので、OFxは0である。Y正負カウンタ(Cy)も同様である。即ち、Cyが示す値が正の値の場合、OFyは負の値である。Cyが示す値が負の値の場合、OFyは正の値である。Cyの示す値が0の場合、OFyは0である。   The moving direction of the holding body 60 is X positive direction, X positive direction Y negative direction, Y negative direction, X negative direction Y negative direction, X negative direction, X negative direction Y positive direction, Y positive direction, X positive direction Y positive. There are 8 types of directions. When the value indicated by the X positive / negative counter (Cx) is a positive value, the holding body 60 moves in the X positive direction, so the CPU 101 provides an offset amount in the X negative direction from the restriction region 56. That is, OFx is a negative value. Conversely, when the value indicated by Cx is a negative value, the holding body 60 moves in the X negative direction, and thus the CPU 101 provides an offset amount in the X positive direction from the restriction region 56. That is, OFx is a positive value. When the value indicated by Cx is 0, since the holding body 60 does not move in the X-axis direction, OFx is 0. The same applies to the Y positive / negative counter (Cy). That is, when the value indicated by Cy is a positive value, OFy is a negative value. If the value indicated by Cy is a negative value, OFy is a positive value. When the value indicated by Cy is 0, OFy is 0.

作業者は、送り移動処理中の保持体60の移動速度の初期設定値を設定可能である。オフセット量は、該移動速度にかかわらず一定の値に設定してもよいが、移動速度が速くなるほど大きい値に設定すると好ましい。移動速度が速くなるほど、保持体60が単位時間内に移動する距離は長くなる。移動速度が遅くなるほど、保持体60が単位時間内に移動する距離は短くなる。故に、移動速度の初期設定値に応じてオフセット量を設定することで、障害物が針棒10に装着した縫針11に干渉することを更に確実に回避することができる。   The operator can set an initial setting value of the moving speed of the holding body 60 during the feed movement process. The offset amount may be set to a constant value regardless of the moving speed, but is preferably set to a larger value as the moving speed becomes faster. The faster the moving speed, the longer the distance that the holding body 60 moves within the unit time. The slower the moving speed, the shorter the distance that the holding body 60 moves within the unit time. Therefore, by setting the offset amount according to the initial set value of the moving speed, it is possible to more reliably avoid the obstacle from interfering with the sewing needle 11 attached to the needle bar 10.

CPU101は、RAM103に用意した縦ポインタ(Pv)、横ポインタ(Ph)の値を夫々0に設定する(S253)。Pv、Phは、夫々、領域マップ(図8参照)から処理対象として読み出すデータを特定するポインタである。Pv=0は、領域マップの1行目を指し、Ph=0は、領域マップの1列目を指す。CPU101は、Pvの値が480より小さく(S261:YES)、且つPhの値が640よりも小さい場合(S262:YES)、領域マップでPvとPhが示す位置のデータが、0であるか否か判断する(S271)。図8に示す如く、最初の処理対象の1行目1列目のデータは0なので(S271:YES)、対応する位置は、制限領域56内でも減速領域57内でもない。CPU101は、Phの値に1を加算して、1行目2列目の位置のデータを処理対象とし(S276)、処理をS262に戻す。   The CPU 101 sets the values of the vertical pointer (Pv) and horizontal pointer (Ph) prepared in the RAM 103 to 0 (S253). Pv and Ph are pointers that specify data to be read out as processing targets from the area map (see FIG. 8). Pv = 0 indicates the first row of the area map, and Ph = 0 indicates the first column of the area map. When the value of Pv is smaller than 480 (S261: YES) and the value of Ph is smaller than 640 (S262: YES), the CPU 101 determines whether the data at the positions indicated by Pv and Ph in the area map is 0. It is judged (S271). As shown in FIG. 8, since the data in the first row and the first column to be processed first is 0 (S271: YES), the corresponding position is neither in the limited area 56 nor in the deceleration area 57. The CPU 101 adds 1 to the value of Ph, sets the data at the position of the first row and second column as the processing target (S276), and returns the processing to S262.

Phの値は640より小さく(S262:YES)、1行目2列目の位置のデータも0なので(S271)、CPU101は、Phの値に1を加算し(S276)、処理を再びS262に戻す。CPU101は同様にして処理を繰り返し、順に1行目のデータを右方向へ処理していく。CPU101が640列目のデータを処理すると、Phの値が640に達し(S262:NO)、1行目のデータの処理が終了する。CPU101は、次の行のデータを処理するためにPvの値に1を加算する(S263)と共にPhの値を0に戻し(S264)、処理をS261に戻す。   The value of Ph is smaller than 640 (S262: YES), and the data at the position of the first row and second column is also 0 (S271). Therefore, the CPU 101 adds 1 to the value of Ph (S276), and the process returns to S262. return. The CPU 101 repeats the process in the same manner, and sequentially processes the data in the first row in the right direction. When the CPU 101 processes the data in the 640th column, the value of Ph reaches 640 (S262: NO), and the processing of the data in the first row ends. The CPU 101 adds 1 to the value of Pv to process the next row of data (S263), returns the value of Ph to 0 (S264), and returns the process to S261.

CPU101は同様に処理を繰り返す。領域マップでPvとPhが示す位置が制限領域56内又は減速領域57内となると、該位置のデータは、0ではなくなる(S271:NO)。Phの値にX軸方向のオフセット量OFxを加算した値(Ph+OFx)が0以上且つ640未満でない場合(S272:NO)、処理対象の位置はオフセット後に所定領域53の撮影画像中にない。故に、CPU101は次の処理対象を設定し(S276)、処理をS262に戻す。   The CPU 101 repeats the process in the same manner. When the position indicated by Pv and Ph in the area map is within the restriction area 56 or the deceleration area 57, the data at the position is not 0 (S271: NO). When the value (Ph + OFx) obtained by adding the offset amount OFx in the X-axis direction to the value of Ph is not less than 0 and less than 640 (S272: NO), the position to be processed is not in the captured image of the predetermined area 53 after the offset. Therefore, the CPU 101 sets the next process target (S276) and returns the process to S262.

Ph+OFxは0以上且つ640未満であるが(S272:YES)、Pvの値にY軸方向のオフセット量OFyを加算した値(Pv+OFy)は0以上且つ480未満でない場合も(S273:NO)、処理対象の位置はオフセット後に所定領域53の撮影画像中にない。故に、CPU101は次の処理対象を設定し(S276)、処理をS262に戻す。   Although Ph + OFx is not less than 0 and less than 640 (S272: YES), the value obtained by adding the offset amount OFy in the Y-axis direction to the value of Pv (Pv + OFy) is not less than 0 and less than 480 (S273: NO). The target position is not in the captured image of the predetermined area 53 after the offset. Therefore, the CPU 101 sets the next process target (S276) and returns the process to S262.

Pv+OFyも0以上且つ480未満である場合(S273:YES)、CPU101は、RAM103が記憶する最新の画像データ(R値データ(図3参照)、G値データ、B値データ)において、Ph+OFxとPv+OFyが示す位置の画素の色が対象色か否かを判断する(S274)。詳細には、最新の画像データのRGB値と、図7のメイン処理のS3でCPU101が設定し、RAM103に記憶した対象色のRGB値とが同じであれば、CPU101は、該画素の色は対象色であると判断する。尚、多少の誤差を許容する為に、RGB値が完全に一致しない場合でも、CPU101は、RGB色空間で所定距離内にある2色を同じ色と判断してもよい。   When Pv + OFy is also not less than 0 and less than 480 (S273: YES), the CPU 101 determines that Ph + OFx and Pv + OFy in the latest image data (R value data (see FIG. 3), G value data, B value data) stored in the RAM 103. It is determined whether the color of the pixel at the position indicated by is the target color (S274). Specifically, if the RGB value of the latest image data and the RGB value of the target color set by the CPU 101 in S3 of the main process in FIG. 7 and stored in the RAM 103 are the same, the CPU 101 determines that the color of the pixel is Judged to be the target color. In order to allow some errors, the CPU 101 may determine that two colors within a predetermined distance in the RGB color space are the same color even when the RGB values do not completely match.

Ph+OFxとPv+OFyが示す位置の画素の色が対象色でない場合(S274:NO)、領域マップの処理対象の位置をOFx、OFyだけオフセットした位置は、所定領域53の撮影画像中の障害物と重ならない。即ち、CPU101は、制限領域56内又は減速領域57内の処理対象の位置から保持体60の移動方向と反対方向の所定距離内で、障害物を識別していない。故に、CPU101は次の処理対象を設定し(S276)、処理をS262に戻す。   If the pixel color at the position indicated by Ph + OFx and Pv + OFy is not the target color (S274: NO), the position where the processing target position of the area map is offset by OFx and OFy is overlapped with the obstacle in the captured image of the predetermined area 53. Don't be. That is, the CPU 101 has not identified an obstacle within a predetermined distance in the direction opposite to the moving direction of the holding body 60 from the position to be processed in the restriction area 56 or the deceleration area 57. Therefore, the CPU 101 sets the next process target (S276) and returns the process to S262.

図12に示す如く、Ph+OFxとPv+OFyが示す位置P2(PhとPvが示す位置P1をオフセットした位置)の画素の色が対象色である場合(S274:YES)、CPU101は、該画素の周辺画素(例えば、該画素を取り巻く8画素)の色も対象色であるか否かを判断する(S275)。周辺画素の色が対象色でなければ(S275:NO)、Ph+OFxとPv+OFyが示す位置の画素の色は画像中のノイズの可能性が高い。故に、CPU101は移動方向を変更せずに次の処理対象を設定し(S276)、処理をS262に戻す。尚、CPU101はS275の処理は行わなくてもよい。   As shown in FIG. 12, when the color of the pixel at the position P2 indicated by Ph + OFx and Pv + OFy (the position offset by the position P1 indicated by Ph and Pv) is the target color (S274: YES), the CPU 101 determines the peripheral pixels of the pixel. It is determined whether the color of (for example, 8 pixels surrounding the pixel) is also the target color (S275). If the color of the peripheral pixel is not the target color (S275: NO), the color of the pixel at the position indicated by Ph + OFx and Pv + OFy is highly likely to be noise in the image. Therefore, the CPU 101 sets the next process target without changing the moving direction (S276), and returns the process to S262. Note that the CPU 101 does not have to perform the process of S275.

周辺画素の色が対象色である場合(S275:YES)、領域マップの処理対象の位置をOFx、OFyだけオフセットした位置は、所定領域53の撮影画像中の障害物と重なる。即ち、CPU101は、制限領域56内又は減速領域57内の処理対象の位置から保持体60の移動方向と反対方向の所定距離内で、障害物を識別したことになる。   When the color of the peripheral pixel is the target color (S275: YES), the position where the position of the processing target of the area map is offset by OFx and OFy overlaps the obstacle in the captured image of the predetermined area 53. That is, the CPU 101 has identified the obstacle within a predetermined distance in the direction opposite to the moving direction of the holding body 60 from the position to be processed in the restriction area 56 or the deceleration area 57.

領域マップで処理対象の位置のデータが1ではなく、2である場合(S281:NO)、処理対象の位置は減速領域57内にある。故に、CPU101は、減速フラグを1にセットし(S282)、処理をS262に戻す。CPU101は、減速フラグが1の場合、X軸モータ114、Y軸モータ116(図3参照)の回転速度を初期の設定値よりも遅くすることで、保持体60移動速度を減速する。   When the data of the position to be processed is 2 instead of 1 in the area map (S281: NO), the position of the process target is in the deceleration area 57. Therefore, the CPU 101 sets the deceleration flag to 1 (S282), and returns the process to S262. When the deceleration flag is 1, the CPU 101 decelerates the moving speed of the holding body 60 by making the rotational speeds of the X-axis motor 114 and the Y-axis motor 116 (see FIG. 3) slower than the initial set values.

領域マップで処理対象の位置のデータが1である場合(S281:YES)、処理対象の位置は制限領域56内にある。故に、CPU101は、重なりフラグを1に設定し、減速フラグを0に設定する(S291)。CPU101は、この時のPhとPvの値をRAM103に記憶しておく。CPU101は、画像監視処理を終了し、図9の送り移動処理に戻る。尚、本実施形態では、減速領域57は制限領域56の周囲にある。故に、CPU101は処理過程で重なりフラグを1に設定するより前に減速フラグを1に設定する。しかし、制限領域56から保持体60の移動方向と反対方向の所定距離内に、障害物が存在することが判明した場合、CPU101は、減速フラグより重なりフラグを優先する。   When the data of the processing target position is 1 in the area map (S281: YES), the processing target position is in the restricted area 56. Therefore, the CPU 101 sets the overlap flag to 1 and sets the deceleration flag to 0 (S291). The CPU 101 stores the values of Ph and Pv at this time in the RAM 103. The CPU 101 ends the image monitoring process and returns to the feed movement process of FIG. In the present embodiment, the deceleration area 57 is around the restriction area 56. Therefore, the CPU 101 sets the deceleration flag to 1 before setting the overlap flag to 1 in the process. However, when it is determined that an obstacle exists within a predetermined distance from the restriction area 56 in the direction opposite to the moving direction of the holding body 60, the CPU 101 prioritizes the overlap flag over the deceleration flag.

以上に説明したように、画像監視処理で、制限領域56から保持体60の移動方向と反対方向の所定距離内に障害物が存在することが判明した場合、CPU101は、重なりフラグを1に設定してその時点で画像監視処理を終了する。CPU101が減速領域57から保持体60の移動方向と反対方向の所定距離内で障害物を識別し、且つ制限領域56から保持体60の移動方向と反対方向の所定距離内で障害物を識別できないまま、前述のS261〜S282の処理を繰り返し、領域マップの480行目640列目まで処理が終了したとする(S261:NO)。該場合、CPU101がS282で減速フラグを1に設定した状態で、画像監視処理は終了する。CPU101が減速領域57から保持体60の移動方向と反対方向の所定距離内でも障害物を識別できないまま、前述のS261〜S282の処理を繰り返し、領域マップの480行目640列目まで処理が終了したとする(S261:NO)。該場合、重なりフラグと減速フラグは両方とも0のまま、画像監視処理は終了する。   As described above, in the image monitoring process, when it is determined that an obstacle exists within a predetermined distance from the restriction area 56 in the direction opposite to the moving direction of the holding body 60, the CPU 101 sets the overlap flag to 1. At that time, the image monitoring process is terminated. The CPU 101 cannot identify an obstacle within a predetermined distance in the direction opposite to the moving direction of the holding body 60 from the deceleration area 57, and cannot identify an obstacle within a predetermined distance in the direction opposite to the moving direction of the holding body 60 from the restriction area 56. As it is, it is assumed that the processing of S261 to S282 is repeated and the processing is completed up to the 480th row and the 640th column of the region map (S261: NO). In this case, the image monitoring process ends with the CPU 101 setting the deceleration flag to 1 in S282. The CPU 101 repeats the above-described processing of S261 to S282 without identifying an obstacle even within a predetermined distance in the direction opposite to the moving direction of the holding body 60 from the deceleration region 57, and the processing is completed up to the 480th row and the 640th column of the region map. (S261: NO). In this case, both the overlap flag and the deceleration flag remain 0, and the image monitoring process ends.

図9に示す如く、送り移動処理では、画像監視処理(S250)の後、CPU101は、RAM103が記憶する重なりフラグが1であるか否かを判断すする(S301)。重なりフラグが0である場合(S301:NO)、現在、制限領域56から保持体60の移動方向と反対方向の所定距離内に障害物は存在しない。CPU101は回避中フラグが0か否か判断する(S304)。0に設定した回避中フラグは、保持体60が回避動作中ではないことを示す。回避中フラグが0の場合(S304:YES)、CPU101はそのまま処理をS210へ戻す。CPU101は前述の移動処理(S210)、画像監視処理(S250)を繰り返す。   As shown in FIG. 9, in the feed movement process, after the image monitoring process (S250), the CPU 101 determines whether or not the overlap flag stored in the RAM 103 is 1 (S301). When the overlap flag is 0 (S301: NO), there is currently no obstacle within a predetermined distance from the restricted area 56 in the direction opposite to the moving direction of the holding body 60. The CPU 101 determines whether the avoidance flag is 0 (S304). The avoidance flag set to 0 indicates that the holding body 60 is not in the avoidance operation. When the avoiding flag is 0 (S304: YES), the CPU 101 returns the process to S210 as it is. The CPU 101 repeats the above movement process (S210) and image monitoring process (S250).

回避中フラグが0でなければ(S304:NO)、既に保持体60は回避動作中である。CPU101は、回避動作中に更に移動方向を変更するか否かを確認する為に、後述の移動方向変更処理(S350)で中継位置を設定する。CPU101は、中継位置に到達したか否かを判断する(S305)。具体的には、CPU101は、CxとCyの値が何れも0であれば、中継位置に到達したと判断し(S305:YES)、後述の移動方向変更処理(S350)に進む。   If the avoiding flag is not 0 (S304: NO), the holding body 60 is already in the avoiding operation. The CPU 101 sets a relay position in a later-described movement direction change process (S350) in order to confirm whether or not to change the movement direction during the avoidance operation. The CPU 101 determines whether or not the relay position has been reached (S305). Specifically, if the values of Cx and Cy are both 0, the CPU 101 determines that the relay position has been reached (S305: YES), and proceeds to a moving direction change process (S350) described later.

CPU101は、中継位置に到達していないと判断した場合(S305:NO)、中継位置に向けてX方向、Y方向の少なくとも一方に1パルス分保持体60を移動する移動処理を行う(S310)。S310の移動処理の内容は、前述の図9のS210の処理と同じなので、説明は省略する。CPU101は、S310の移動処理の後、処理を後述するS401に進める。   When the CPU 101 determines that the relay position has not been reached (S305: NO), the CPU 101 performs a movement process for moving the holding body 60 by one pulse in at least one of the X direction and the Y direction toward the relay position (S310). . Since the content of the movement process of S310 is the same as the process of S210 of the above-mentioned FIG. 9, description is abbreviate | omitted. After the movement process of S310, the CPU 101 advances the process to S401 described later.

重なりフラグが1の場合(S301:YES)、制限領域56から保持体60の移動方向と反対方向の所定距離内に障害物が存在する。故に、CPU101は、回避中フラグが0であれば(S302:YES)、回避動作を開始する為に回避中フラグを1に設定する(S303)。1に設定した回避中フラグは、後述する優先方向に近い方向に保持体60を移動することを示す。CPU101は、後述する移動方向変更処理を行う(S350)。   When the overlap flag is 1 (S301: YES), an obstacle exists within a predetermined distance from the restricted area 56 in the direction opposite to the moving direction of the holding body 60. Therefore, if the avoidance flag is 0 (S302: YES), the CPU 101 sets the avoidance flag to 1 to start the avoidance operation (S303). The avoidance flag set to 1 indicates that the holding body 60 is moved in a direction close to a priority direction described later. The CPU 101 performs a movement direction changing process described later (S350).

回避中フラグが0でなければ(S302:NO)、既に保持体60は回避動作中であるが、続く移動方向変更処理(S350)で更に移動方向を変更する。
If the avoiding flag is not 0 (S302: NO), the holding body 60 is already in the avoiding operation, but the moving direction is further changed in the subsequent moving direction changing process (S350).

図13を参照し、移動方向変更処理(図9のS350)について説明する。移動方向変更処理では、CPU101は、画像監視処理(図11参照)のS291でRAM103に記憶したPhとPvの値に基づき、撮影画像中でPhとPvが示す位置の画素(以下、注目画素という)を特定する。図12の例では、CPU101は、点P1の位置にある画素を注目画素とする。CPU101は、注目画素を中心に周辺の画素を順に走査し、対象色の境界線を特定する(S351)。CPU101は、対象色の境界線を、対象色の画素のうち他の色の画素に隣接する画素を繋ぐ線として特定すればよい。   The moving direction changing process (S350 in FIG. 9) will be described with reference to FIG. In the moving direction changing process, the CPU 101 determines a pixel at a position indicated by Ph and Pv in the captured image (hereinafter referred to as a target pixel) based on the values of Ph and Pv stored in the RAM 103 in S291 of the image monitoring process (see FIG. 11). ). In the example of FIG. 12, the CPU 101 sets the pixel at the position of the point P1 as the target pixel. The CPU 101 sequentially scans surrounding pixels around the target pixel, and specifies a boundary line of the target color (S351). The CPU 101 may specify the boundary line of the target color as a line connecting pixels adjacent to the other color pixels among the target color pixels.

CPU101は、注目画素(点P1)から見て保持体60の移動方向と反対方向(以下、注目方向という)に対象色の境界線があるか否かを判断する(S352)。図12の例では、保持体60の移動方向は矢印Aで示すX正方向Y負方向である。CPU101は、注目画素(点P1)を通り且つ注目方向に延びる直線Lが境界線と交差するか否かを判断すればよい。尚、CPU101は、X正負カウンタ(Cx)とY正負カウンタ(Cy)の値から、移動方向を特定する。   The CPU 101 determines whether or not there is a boundary line of the target color in the direction opposite to the movement direction of the holding body 60 (hereinafter referred to as the attention direction) when viewed from the attention pixel (point P1) (S352). In the example of FIG. 12, the moving direction of the holding body 60 is the X positive direction Y negative direction indicated by the arrow A. The CPU 101 may determine whether or not the straight line L that passes through the target pixel (point P1) and extends in the target direction intersects the boundary line. The CPU 101 identifies the moving direction from the values of the X positive / negative counter (Cx) and the Y positive / negative counter (Cy).

注目画素から見て注目方向に対象色の境界線がある場合(S352:YES)、保持体60は、障害物が制限領域56に近づく方向に移動中である。故に、CPU101は、回避中フラグの値に応じて保持体60の移動方向を変更する。CPU101は、回避中フラグが2か否かを判断する(S371)。詳細は後述するが、2に設定した回避中フラグは、優先方向の反対方向に近い方向に保持体60を移動することを示す。回避中フラグが2ではない場合(S371:NO)、回避中フラグが1であるので、CPU101は、移動方向を、境界線の傾きに沿い且つ優先方向に近い方向に変更し(S372)、処理をS375に進める。回避中フラグが2の場合(S371:YES)、CPU101は、移動方向を、境界線の傾きに沿い且つ優先方向の反対方向に近い方向に変更し(S373)、処理をS375に進める。   When there is a boundary line of the target color in the direction of interest as viewed from the pixel of interest (S352: YES), the holding body 60 is moving in the direction in which the obstacle approaches the restricted area 56. Therefore, the CPU 101 changes the moving direction of the holding body 60 according to the value of the avoidance flag. The CPU 101 determines whether or not the avoidance flag is 2 (S371). Although the details will be described later, the avoidance flag set to 2 indicates that the holding body 60 is moved in a direction close to the direction opposite to the priority direction. If the avoiding flag is not 2 (S371: NO), since the avoiding flag is 1, the CPU 101 changes the moving direction to a direction close to the priority direction along the inclination of the boundary line (S372). To S375. If the avoiding flag is 2 (S371: YES), the CPU 101 changes the moving direction to a direction along the inclination of the boundary line and close to the opposite direction of the priority direction (S373), and advances the process to S375.

優先方向は、例えば、ミシン1の製造者が予め設定しROM102又は不揮発性メモリ104に記憶した一定方向である。障害物となる補助押え部材は、一般的に、ミシン1の後側から前側に向けて延びる場合が多い。該場合、保持体60をミシン1の後側へ向けて移動することで、障害物を回避できる可能性は高くなる。故に、ミシン1の製造者は、保持体60をミシン1の前側から後側へ向かう方向、即ち、Y正方向を優先方向として設定すればよい。該場合、CPU101は、作業者の設定作業を要することなく効率的に移動方向を変更できる。但し、優先方向は、ミシン1の製造者が予め設定した一定方向に限らない。例えば、CPU101は、図7の縫製処理のS3の後、作業者が入力した方向を優先方向として設定してもよい。作業者は、使用する補助押え部材の取付け方向に応じて、適切な方向を入力する。該場合、CPU101は、該取付け方向に応じた適切な方向を優先方向に設定できる。   The priority direction is, for example, a certain direction preset by the manufacturer of the sewing machine 1 and stored in the ROM 102 or the nonvolatile memory 104. In general, the auxiliary presser member serving as an obstacle often extends from the rear side to the front side of the sewing machine 1. In this case, the possibility that an obstacle can be avoided increases by moving the holding body 60 toward the rear side of the sewing machine 1. Therefore, the manufacturer of the sewing machine 1 may set the holding body 60 in the direction from the front side to the rear side of the sewing machine 1, that is, the Y positive direction as the priority direction. In this case, the CPU 101 can efficiently change the moving direction without requiring the operator's setting work. However, the priority direction is not limited to a certain direction preset by the manufacturer of the sewing machine 1. For example, the CPU 101 may set the direction input by the operator as the priority direction after S3 of the sewing process of FIG. The worker inputs an appropriate direction according to the mounting direction of the auxiliary pressing member to be used. In this case, the CPU 101 can set an appropriate direction according to the mounting direction as the priority direction.

境界線の傾きは、例えば、X軸に対して反時計周り方向の角度で特定することができる。図14に示す如く、障害物500の境界線が曲線の場合、CPU101は、例えば、前述の直線Lと境界線の交点P5における接線T1を求め、該接線T1の傾きを使用すればよい。対象色の境界線、即ち、障害物の外縁に沿った方向に保持体60の移動方向を変更することで、効率的且つ確実に障害物が針棒10に装着した縫針11に干渉することを回避することができる。   The inclination of the boundary line can be specified by, for example, an angle in the counterclockwise direction with respect to the X axis. As shown in FIG. 14, when the boundary line of the obstacle 500 is a curve, the CPU 101 may obtain the tangent line T1 at the intersection point P5 between the straight line L and the boundary line and use the slope of the tangent line T1, for example. By changing the moving direction of the holding body 60 in the direction along the boundary line of the target color, that is, the outer edge of the obstacle, the obstacle can interfere with the sewing needle 11 attached to the needle bar 10 efficiently and reliably. It can be avoided.

例えば、図12の例において、保持体60の元の移動方向は矢印Aの示すX正方向Y負方向であるとする。障害物である補助押え部材510の境界線の傾きは、X軸に対して90度である。該例において優先方向がY正方向の場合、変更後の移動方向は、矢印Bで示すY正方向である。図14の例において、優先方向がY正方向の場合、変更後の移動方向は、矢印Cで示す、接線T1に沿って図中右上に向かう方向である。   For example, in the example of FIG. 12, it is assumed that the original moving direction of the holding body 60 is the X positive direction and the Y negative direction indicated by the arrow A. The inclination of the boundary line of the auxiliary pressing member 510 that is an obstacle is 90 degrees with respect to the X axis. In this example, when the priority direction is the Y positive direction, the changed moving direction is the Y positive direction indicated by the arrow B. In the example of FIG. 14, when the priority direction is the Y positive direction, the changed moving direction is a direction toward the upper right in the figure along the tangent line T <b> 1 indicated by the arrow C.

S375において、CPU101は、注目画素を通り且つ注目方向に延びる直線と境界線との交点から、境界線が変更後の移動方向に所定距離以上延びているか否かを判断する。該所定距離は、予め設定した一定距離でもよいし、作業者が縫製処理前に設定し不揮発性メモリ104に記憶した値でもよい。境界線が所定距離以上延びている場合(S375:YES)、CPU101は、現在位置(現在縫針11の直下にある点)から、変更後の移動方向の反対方向に所定距離離れた位置にある1点を中継位置として設定し(S376)、中継位置をCx、Cyにセットする(S379)。   In S375, the CPU 101 determines whether or not the boundary line extends a predetermined distance or more in the changed moving direction from the intersection of the straight line that passes through the target pixel and extends in the target direction. The predetermined distance may be a predetermined distance set in advance, or may be a value set by an operator before sewing processing and stored in the nonvolatile memory 104. When the boundary line extends more than a predetermined distance (S375: YES), the CPU 101 is located at a position that is a predetermined distance away from the current position (a point immediately below the sewing needle 11) in the direction opposite to the changed moving direction. The point is set as the relay position (S376), and the relay position is set to Cx and Cy (S379).

中継位置は、現在位置から目標位置に保持体60を移動する時、少なくとも現在位置から移動方向を変えずに障害物を回避した状態で移動可能な位置である。ミシン1は、中継位置を設定することで可能な限り最短距離で保持体60を目標位置に向けて移動できる。   The relay position is a position at which when the holding body 60 is moved from the current position to the target position, it can move at least from the current position while avoiding an obstacle without changing the moving direction. The sewing machine 1 can move the holding body 60 toward the target position at the shortest possible distance by setting the relay position.

図12の例では、CPU101は、現在縫針11の直下にある点P0から、矢印Bで示す変更後の移動方向の反対方向に所定距離D1離れた点P3を中継位置とする。変更後の移動方向はY正方向なので、点P3は、点P0からY負方向に所定距離D1離れた位置にある。CPU101は、LCD32の画面上での点P0と点P3の位置関係を、座標系601(図4参照)での位置関係に変換する。詳細には、CPU101は、LCD32の画面上の点P0と点P3の座標を座標系601における点の座標に変換する。二次元座標をワールド座標系の三次元座標に変換する方法は周知なので説明を省略するが、例えば特開2009−172122号公報に記載の方法を採用することができる。   In the example of FIG. 12, the CPU 101 sets a point P3 that is a predetermined distance D1 away from the point P0 immediately below the sewing needle 11 in the direction opposite to the changed moving direction indicated by the arrow B as a relay position. Since the movement direction after the change is the Y positive direction, the point P3 is at a position away from the point P0 by a predetermined distance D1 in the Y negative direction. The CPU 101 converts the positional relationship between the points P0 and P3 on the screen of the LCD 32 into a positional relationship in the coordinate system 601 (see FIG. 4). Specifically, the CPU 101 converts the coordinates of the points P0 and P3 on the screen of the LCD 32 into the coordinates of the points in the coordinate system 601. A method for converting two-dimensional coordinates to three-dimensional coordinates in the world coordinate system is well known and will not be described. For example, a method described in Japanese Patent Application Laid-Open No. 2009-172122 can be employed.

CPU101は、変換後の現在位置と中継位置の位置関係に基づき、中継位置が縫針11の直下に位置するように保持体60を移動する為のX軸モータ114、Y軸モータ116(図3参照)の夫々の駆動パルス数を算出する。CPU101は、算出した駆動パルス数に基づき、Cx、Cyをセットする。即ち、Cx、Cyの値は、中継位置まで保持体60を移動する為の値となる。CPU101は、処理をS380に進める。   Based on the positional relationship between the current position after conversion and the relay position, the CPU 101 moves the holding body 60 so that the relay position is located directly below the sewing needle 11, and the Y-axis motor 116 (see FIG. 3). ) Is calculated. The CPU 101 sets Cx and Cy based on the calculated drive pulse number. That is, the values of Cx and Cy are values for moving the holding body 60 to the relay position. The CPU 101 advances the process to S380.

図14の例の如く、直線Lと障害物500の境界線の交点P5から、境界線が変更後の移動方向(矢印C)に所定距離以上延びていない場合(S375:NO)、CPU101は、境界線の傾きに基づいて中継位置を設定する(S377)。具体的には、CPU101は、例えば次の方法で中継位置を設定する。CPU101はまず、変更後の移動方向と反対方向に沿って順に境界線の接線を求める。CPU101は、接線T1の傾きから所定量以上傾きが変化した時点の接線T2を特定する。該所定量は、予め設定した一定量でもよいし、作業者が縫製処理前に設定し不揮発性メモリ104に記憶した値でもよい。境界線の傾きの特定方法は前述の通りである。CPU101は、直線Lと障害物500の境界線の交点P5から、接線T1と接線T2の交点P6までの距離D2を特定する。CPU101は、現在縫針11の直下にある点P0から、矢印Cで示す変更後の移動方向の反対方向に距離D2離れた点P7を中継位置とする。CPU101は、上述した如く中継位置をCx、Cyにセットする(S379)。CPU101は、処理をS380に進める。   As in the example of FIG. 14, when the boundary line does not extend more than a predetermined distance in the changed moving direction (arrow C) from the intersection P5 of the boundary line between the straight line L and the obstacle 500 (S375: NO), the CPU 101 A relay position is set based on the inclination of the boundary line (S377). Specifically, the CPU 101 sets the relay position by the following method, for example. First, the CPU 101 obtains the tangent of the boundary line in order along the direction opposite to the changed moving direction. The CPU 101 specifies the tangent line T2 when the inclination changes by a predetermined amount or more from the inclination of the tangent line T1. The predetermined amount may be a predetermined amount set in advance or may be a value set by an operator before sewing processing and stored in the nonvolatile memory 104. The method for specifying the inclination of the boundary line is as described above. The CPU 101 specifies a distance D2 from the intersection point P5 of the boundary line between the straight line L and the obstacle 500 to the intersection point P6 of the tangent line T1 and the tangent line T2. The CPU 101 sets a point P7 that is a distance D2 away from the point P0 immediately below the sewing needle 11 in the direction opposite to the changed moving direction indicated by the arrow C as a relay position. The CPU 101 sets the relay position to Cx and Cy as described above (S379). The CPU 101 advances the process to S380.

注目画素から見て注目方向に対象色の境界線がない場合(S352:NO)、目標位置に向けて保持体60を移動できるので、CPU101は回避中フラグを0に変更し(S356)、目標位置をCx、Cyにセットして(S357)、処理をS380に進める。   When there is no target color boundary line in the direction of interest as viewed from the pixel of interest (S352: NO), the holding body 60 can be moved toward the target position, so the CPU 101 changes the avoidance flag to 0 (S356), and the target The position is set to Cx, Cy (S357), and the process proceeds to S380.

CPU101がS376又はS377で中継位置を設定した場合、CPU101は、S380では中継位置に向けてX方向、Y方向の少なくとも一方に1パルス分保持体60を移動する。CPU101がS356で回避フラグを0に変更した場合、CPU101は、S380では目標位置に向けてX方向、Y方向の少なくとも一方に1パルス分保持体60を移動する。S380の移動処理の内容は、前述の図9のS210の処理と同じなので、説明は省略する。CPU101は、移動処理の後、移動方向変更処理を終了し、図9の送り移動処理に戻る。   When the CPU 101 sets the relay position in S376 or S377, the CPU 101 moves the holding body 60 by one pulse in at least one of the X direction and the Y direction toward the relay position in S380. When the CPU 101 changes the avoidance flag to 0 in S356, the CPU 101 moves the holding body 60 by one pulse in at least one of the X direction and the Y direction toward the target position in S380. The contents of the movement process of S380 are the same as the process of S210 of FIG. After the movement process, the CPU 101 ends the movement direction change process and returns to the feed movement process of FIG.

図9に示す如く、移動方向変更処理(S350)の後、又は移動処理(S310)の後、CPU101は、保持体60が可動域端に到達したか否かを判断する(S401)。前述の通り、ミシン1は、保持体60が可動域端に到達したことを検出する構成(図示略)を備える。CPU101は、保持体60が可動域端に到達していないと判断した場合(S401:NO)、目標位置に到達したか否を判断する(S410)。   As shown in FIG. 9, after the moving direction changing process (S350) or after the moving process (S310), the CPU 101 determines whether or not the holding body 60 has reached the end of the movable range (S401). As described above, the sewing machine 1 includes a configuration (not shown) that detects that the holding body 60 has reached the end of the movable range. When the CPU 101 determines that the holder 60 has not reached the end of the movable range (S401: NO), the CPU 101 determines whether the target position has been reached (S410).

目標位置が絶対原点位置の場合、CPU101は、次のように判断を行う。X方向原点センサ118とY方向原点センサ119(図3参照)は、保持体60が絶対原点位置に到達した時、検出信号を出力する。故に、CPU101は、前述の移動処理(S210、S310、S380)で保持体60が移動した結果、X方向原点センサ118とY方向原点センサ119からの検出信号を認識した場合、保持体60の絶対原点位置(目標位置)への移動が完了したと判断する。目標位置が縫製開始位置の場合、CPU101は、X正負カウンタ(Cx)、Y正負カウンタ(Cy)の値が何れも0になった場合、保持体60の縫製開始位置(目標位置)への移動が完了したと判断する。CPU101は、保持体60がまだ目標位置に到達していない場合(S410)、処理をS250に戻す。   When the target position is the absolute origin position, the CPU 101 makes a determination as follows. The X-direction origin sensor 118 and the Y-direction origin sensor 119 (see FIG. 3) output a detection signal when the holding body 60 reaches the absolute origin position. Therefore, when the CPU 101 recognizes the detection signals from the X-direction origin sensor 118 and the Y-direction origin sensor 119 as a result of the movement of the holding body 60 in the above-described movement processing (S210, S310, S380), the absolute value of the holding body 60 It is determined that the movement to the home position (target position) has been completed. When the target position is the sewing start position, the CPU 101 moves the holding body 60 to the sewing start position (target position) when both the X positive / negative counter (Cx) and the Y positive / negative counter (Cy) are zero. Is determined to be complete. If the holder 60 has not yet reached the target position (S410), the CPU 101 returns the process to S250.

尚、CPU101が上述の如く移動方向変更処理(S350)で中継位置を設定した後に画像監視処理(S250)に戻る場合、CPU101は、変更後の移動方向に応じてオフセット量を設定する(図11のS252)。図12の例の如く、変更後の移動方向が矢印Bの示す方向である場合、CPU101はS252で制限領域56からY負方向のオフセット量(−OFy)を設ける。CPU101は、制限領域56内の位置から−OFyの位置で障害物を識別しない。故に、重なりフラグは0の状態のまま、画像監視処理は終了する。該場合、重なりフラグは0であり且つ回避中フラグは1なので(図9のS301:NO、S304:NO)、CPU101は、上述の如く中継位置に到達したか否かの判断処理に進む(S305)。   When the CPU 101 returns to the image monitoring process (S250) after setting the relay position in the moving direction change process (S350) as described above, the CPU 101 sets an offset amount according to the changed moving direction (FIG. 11). S252). When the changed moving direction is the direction indicated by the arrow B as in the example of FIG. 12, the CPU 101 provides an offset amount (−OFy) in the Y negative direction from the restricted area 56 in S252. The CPU 101 does not identify an obstacle at a position −OFy from a position in the restricted area 56. Therefore, the image monitoring process ends with the overlap flag remaining at 0. In this case, since the overlap flag is 0 and the avoidance flag is 1 (S301: NO, S304: NO in FIG. 9), the CPU 101 proceeds to the determination process as to whether or not the relay position has been reached as described above (S305). ).

CPU101は、保持体60が可動域端に到達したと判断した場合(S401:YES)、回避中フラグが1であるか否かを判断する(S402)。回避中フラグが1の場合、前述の移動方向変更処理(S350)において、保持体60の移動方向は、境界線の傾きに沿い且つ優先方向に近い方向に変わっている。即ち、保持体60は、該方向に移動した結果、可動域端まで到達してしまったことを意味する。故に、CPU101は、移動方向を更に変更する為に、回避中フラグを2に変更し(S403)、処理をS250に戻す。   When determining that the holding body 60 has reached the end of the movable range (S401: YES), the CPU 101 determines whether or not the avoidance flag is 1 (S402). When the avoidance flag is 1, the moving direction of the holding body 60 is changed along the boundary line and close to the priority direction in the moving direction changing process (S350) described above. That is, it means that the holding body 60 has reached the end of the movable range as a result of moving in this direction. Therefore, the CPU 101 changes the avoidance flag to 2 in order to further change the moving direction (S403), and returns the process to S250.

回避中フラグが2の状態で処理が移動方向変更処理(S350)に進んだ場合、前述したように、CPU101は、保持体60の移動方向を、境界線の傾きに沿い且つ優先方向の反対方向に近い方向に変更することになる。このように、CPU101は、保持体60の移動方向を自動的に反転する。故に、縫製対象物が切り替わり、障害物の位置や形状が変わったとしても、作業者は既に設定した優先方向を設定し直さなくてもよい。   When the avoidance flag is 2 and the process proceeds to the movement direction change process (S350), as described above, the CPU 101 sets the movement direction of the holding body 60 along the inclination of the boundary line and opposite to the priority direction. Will be changed in the direction close to. As described above, the CPU 101 automatically reverses the moving direction of the holding body 60. Therefore, even if the sewing object is switched and the position or shape of the obstacle is changed, the operator does not have to reset the already set priority direction.

回避中フラグが1でなく2の場合(S402:NO)、CPU101は保持体60の移動方向を反転したにもかかわらず、保持体60は目標位置に到達できず、再度可動域端まで到達してしまった状態である。故に、CPU101は、例えば、操作箱30のLCD32にエラー発生を示すメッセージを表示することで、作業者にエラー発生を報知し(S405)、作業者が電源スイッチ(図示略)をOFFするのを待つ。CPU101は、該方法で、何らかの不具合で障害物の位置がずれてしまい、回避不能な状態になったことを作業者に報知できる。故に、作業者は報知後に適切な措置を取ることができる。   When the avoiding flag is 2 instead of 1 (S402: NO), the CPU 101 cannot reach the target position and reaches the end of the movable range again, even though the movement direction of the holding body 60 is reversed. It is a state that has been. Therefore, for example, the CPU 101 displays a message indicating the occurrence of an error on the LCD 32 of the operation box 30 to notify the operator of the occurrence of the error (S405), and the operator turns off the power switch (not shown). wait. With this method, the CPU 101 can notify the operator that the position of the obstacle has shifted due to some trouble and has become an unavoidable state. Therefore, the operator can take appropriate measures after the notification.

以上に説明したように、本実施形態のミシン1のCPU101は、所定時間毎に、目標位置または中継位置に向けてX方向、Y方向の少なくとも一方に1パルス分保持体60を移動し(S210、S310、S380)、イメージセンサ50の撮影画像を用いて、針棒10に対応する制限領域56から所定距離内に障害物が近づいていないか否かを監視する(S250)。CPU101は、制限領域56から保持体60の移動方向と反対方向の所定距離内で障害物を識別した場合、保持体60の移動方向を変更して、障害物が制限領域56に重ならないように保持体60を移動する。   As described above, the CPU 101 of the sewing machine 1 according to the present embodiment moves the holding body 60 by one pulse in at least one of the X direction and the Y direction toward the target position or the relay position every predetermined time (S210). , S310, S380), and using the captured image of the image sensor 50, it is monitored whether or not an obstacle is approaching within a predetermined distance from the restricted area 56 corresponding to the needle bar 10 (S250). When the CPU 101 identifies an obstacle within a predetermined distance in the direction opposite to the movement direction of the holding body 60 from the restriction area 56, the CPU 101 changes the movement direction of the holding body 60 so that the obstacle does not overlap the restriction area 56. The holding body 60 is moved.

故に、作業者が縫製対象物に応じた補助押え部材を保持体60に装着する場合、作業者は障害物となる該補助押え部材の特徴部分(本実施形態では色)を予め特徴部分として設定すればよい。ミシン1は、撮影画像に基づき、該補助押え部材に応じて適切に保持体60の移動を制御することができる。即ち、ミシン1は縫製データに従った移動経路に沿って障害物を回避するのではなく、イメージセンサ50の撮影画像に基づき、障害物を回避することができる。更に、ミシン1は、保持体60が絶対原点位置に到達する前でも、障害物が針棒10に装着した縫針11と干渉することを回避することができる。ミシンは非接触で障害物を識別できるので、接触式のセンサを用いるミシンに比べ、使用に伴って障害物の検出精度が低下するのを防止できる。上記の通り、ミシン1は保持体60に装着した障害物に応じて、障害物が縫針11と干渉することを確実に回避することができる。   Therefore, when the worker attaches the auxiliary presser member corresponding to the sewing object to the holding body 60, the worker sets the characteristic part (color in this embodiment) of the auxiliary presser member that becomes an obstacle as the characteristic part in advance. do it. The sewing machine 1 can appropriately control the movement of the holding body 60 according to the auxiliary pressing member based on the photographed image. In other words, the sewing machine 1 can avoid an obstacle based on a photographed image of the image sensor 50, instead of avoiding an obstacle along the movement route according to the sewing data. Further, the sewing machine 1 can avoid the obstacle from interfering with the sewing needle 11 attached to the needle bar 10 even before the holding body 60 reaches the absolute origin position. Since the sewing machine can identify obstacles in a non-contact manner, it is possible to prevent the obstacle detection accuracy from being lowered with use as compared with a sewing machine using a contact type sensor. As described above, the sewing machine 1 can reliably avoid the obstacle from interfering with the sewing needle 11 according to the obstacle attached to the holding body 60.

CPU101は、制限領域56の周囲に予め設定した減速領域57から保持体60の移動方向と反対方向の所定距離内で障害物を識別した場合、減速フラグを1に変更することで、保持体60の移動速度を減速する。即ち、CPU101は、減速後に保持体60が制限領域56に重ならないように、保持体60の移動を制御できる。故に、ミシン1は、障害物が針棒10に装着した縫針に干渉することを更に確実に回避することができる。   When the CPU 101 identifies an obstacle within a predetermined distance in the direction opposite to the moving direction of the holding body 60 from the deceleration area 57 set in advance around the restriction area 56, the CPU 101 changes the deceleration flag to 1 to change the holding body 60. Decrease the moving speed. That is, the CPU 101 can control the movement of the holding body 60 so that the holding body 60 does not overlap the restriction area 56 after deceleration. Therefore, the sewing machine 1 can more reliably avoid the obstacle from interfering with the sewing needle attached to the needle bar 10.

本実施形態では、移送装置6は、本発明の「移動機構」に相当する。イメージセンサ50は、「撮影手段」に相当する。図9のS250の画像監視処理を行うCPU101は、「識別手段」に相当する。所定領域53(図4参照)は、「第一領域」に相当する。制限領域56、減速領域57(図6参照)は、夫々、「第二領域」、「第三領域」に相当する。図9のS350の移動方向変更処理、S310の移動処理、S401〜S403の処理を行うCPU101は、「移動制御手段」に相当する。S405のエラー報知の処理を行うCPU101は、「報知手段」に相当する。図11のS252で移動速度に応じてオフセット量を設定する処理を行うCPU101は、「距離設定手段」に相当する。   In the present embodiment, the transfer device 6 corresponds to the “movement mechanism” of the present invention. The image sensor 50 corresponds to “photographing means”. The CPU 101 that performs the image monitoring process in S250 of FIG. 9 corresponds to “identification means”. The predetermined area 53 (see FIG. 4) corresponds to a “first area”. The restriction area 56 and the deceleration area 57 (see FIG. 6) correspond to a “second area” and a “third area”, respectively. The CPU 101 that performs the moving direction changing process in S350, the moving process in S310, and the processes in S401 to S403 in FIG. 9 corresponds to a “movement control unit”. The CPU 101 that performs the error notification processing in S405 corresponds to “notification means”. The CPU 101 that performs the process of setting the offset amount according to the moving speed in S252 of FIG. 11 corresponds to “distance setting means”.

本発明は、前述の実施形態の他に種々の変更が可能である。例えば、領域マップ(図8参照)は予め設定して不揮発性メモリ104等に記憶してあってもよい。該場合、CPU101は、図7の縫製処理のS2では、記憶した領域マップをRAM103に読み出す処理を行う。制限領域の周囲の減速領域はなくてもよい。即ち、領域マップは、制限領域のみを示してもよい。針棒10に対応する制限領域が針棒10の直径に比較して十分大きければ、制限領域に対するオフセット量は設けなくてもよい。制限領域と減速領域を設ける場合、制限領域と減速領域のオフセット量は、互いに異なってもよい。   The present invention can be variously modified in addition to the above-described embodiment. For example, the area map (see FIG. 8) may be set in advance and stored in the nonvolatile memory 104 or the like. In this case, the CPU 101 performs a process of reading the stored area map to the RAM 103 in S2 of the sewing process of FIG. There may be no deceleration area around the restricted area. That is, the area map may indicate only the restricted area. If the limited area corresponding to the needle bar 10 is sufficiently larger than the diameter of the needle bar 10, an offset amount for the limited area may not be provided. When the restriction area and the deceleration area are provided, the offset amounts of the restriction area and the deceleration area may be different from each other.

CPU101は、移動方向変更処理(図13参照)のS372で境界線の傾き(境界線の延びる方向)を考慮せず、移動方向を優先方向に変更すると決定してもよい。CPU101は、S373で境界線の傾きを考慮せず、移動方向の反対方向を優先方向に変更すると決定してもよい。反対に、CPU101は、優先方向を考慮せず、境界線の延びる方向のみに応じて移動方向を変更してもよい。   The CPU 101 may determine to change the moving direction to the priority direction without considering the inclination of the boundary line (direction in which the boundary line extends) in S372 of the movement direction changing process (see FIG. 13). In step S373, the CPU 101 may determine that the direction opposite to the moving direction is changed to the priority direction without considering the inclination of the boundary line. On the contrary, the CPU 101 may change the moving direction according to only the direction in which the boundary line extends without considering the priority direction.

保持体60が可動域端に到達した場合に移動方向を反対方向に変更する処理(図9のS401〜S403、図13のS371、S373)、移動方向を反対方向に変更した後、保持体60が可動域端に到達した場合にエラー発生を報知する処理(図9のS405)は、省略可能である。CPU101は、エラー発生を報知するメッセージを、LCD32ではなく操作パネル8のディスプレイに表示してもよい。CPU101は、メッセージ表示でなく、ブザーによる警告音発信やランプの発光でエラー発生を報知してもよい。   Processing for changing the moving direction to the opposite direction when the holding body 60 reaches the end of the movable range (S401 to S403 in FIG. 9, S371, S373 in FIG. 13), after changing the moving direction to the opposite direction, the holding body 60 The process of notifying the occurrence of an error when S reaches the end of the movable range (S405 in FIG. 9) can be omitted. The CPU 101 may display a message notifying the occurrence of an error on the display of the operation panel 8 instead of the LCD 32. The CPU 101 may notify the occurrence of an error not by displaying a message but by issuing a warning sound by a buzzer or emitting a lamp.

画像監視処理(図11参照)で領域マップ中の走査開始位置は、必ずしも1行目1列目の位置でなくてもよい。例えば、CPU101は、制限領域内の任意の位置(データが1を示す位置)を特定し、該位置を中心として順に周囲を走査してもよい。CPU101は、作業者が指示した位置から走査を開始してもよい。   In the image monitoring process (see FIG. 11), the scanning start position in the area map is not necessarily the position of the first row and the first column. For example, the CPU 101 may specify an arbitrary position (a position where the data indicates 1) in the restricted area, and scan the periphery in order with the position as the center. The CPU 101 may start scanning from a position designated by the worker.

撮影範囲(所定領域53)、撮影画像の大きさはイメージセンサ50の種類等に応じて異なるので、イメージセンサ50の撮影画像のサイズ、対応する領域マップのサイズは実施形態の例に限らない。その他に実施形態で挙げた数値も単なる例示であり、適宜変更が可能なことは勿論である。   Since the shooting range (predetermined area 53) and the size of the shot image vary depending on the type of the image sensor 50, the size of the shot image of the image sensor 50 and the size of the corresponding area map are not limited to the example of the embodiment. In addition, the numerical values given in the embodiments are merely examples, and it is needless to say that changes can be made as appropriate.

1 ミシン
6 移送装置
10 針棒
11 縫針
50 イメージセンサ
60 保持体
101 CPU
DESCRIPTION OF SYMBOLS 1 Sewing machine 6 Transfer device 10 Needle bar 11 Sewing needle 50 Image sensor 60 Holding body 101 CPU

Claims (9)

縫針を下端に装着可能且つ上下動可能な針棒と、
前記針棒の下方に設け且つ縫製対象物を保持する保持体を水平移動可能な移動機構とを備えたミシンにおいて、
前記針棒の下方を含む領域である第一領域を撮影可能な撮影手段と、
前記撮影手段が撮影した前記第一領域の画像中で、予め設定した前記保持体と共に移動する部材の特徴部分を識別する識別手段と、
前記移動機構を制御することで、前記識別手段が識別した前記特徴部分が、前記第一領域の前記画像中の前記針棒に対応する範囲である第二領域と重ならないように前記保持体を移動する移動制御手段と
を備えたことを特徴とするミシン。
A needle bar capable of attaching a sewing needle to the lower end and moving up and down;
In a sewing machine provided with a moving mechanism capable of horizontally moving a holding body provided below the needle bar and holding a sewing object,
An imaging means capable of imaging a first area that is an area including the lower side of the needle bar;
An identification means for identifying a characteristic portion of a member that moves together with the holding body set in advance in the image of the first region photographed by the photographing means;
By controlling the moving mechanism, the holding body is held so that the characteristic part identified by the identification means does not overlap with the second area which is a range corresponding to the needle bar in the image of the first area. A sewing machine comprising a movement control means for moving.
前記移動制御手段は、前記識別手段が、前記画像中で、前記第二領域から前記保持体の移動方向の反対方向に第一距離内で前記特徴部分を識別した場合、前記移動方向を異なる方向に変更して、前記保持体を移動することを特徴とする請求項1に記載のミシン。   The movement control means, when the identification means identifies the feature portion within a first distance from the second area in the direction opposite to the movement direction of the holding body in the image, the movement direction is different from the second direction. The sewing machine according to claim 1, wherein the holding body is moved to the sewing machine. 前記移動制御手段は、前記移動方向を、優先する方向として予め設定した優先方向に変更して、前記保持体を移動することを特徴とする請求項2に記載のミシン。   The sewing machine according to claim 2, wherein the movement control unit moves the holding body by changing the movement direction to a priority direction set in advance as a priority direction. 前記移動制御手段は、前記特徴部分の境界線の延びる方向に応じて前記移動方向を変更して、前記保持体を移動することを特徴とする請求項2または3に記載のミシン。   4. The sewing machine according to claim 2, wherein the movement control unit moves the holding body by changing the movement direction according to a direction in which a boundary line of the characteristic portion extends. 前記移動制御手段は、前記保持体が移動可能範囲の一端に到達した場合、前記移動方向を、前記移動方向の反対方向に変更して、前記保持体を移動することを特徴とする請求項2〜4の何れか1つに記載のミシン。   The said movement control means changes the said moving direction to the direction opposite to the said moving direction, and moves the said holding body, when the said holding body reaches the end of the movable range. The sewing machine according to any one of -4. 前記移動制御手段が前記移動方向を前記反対方向に変更した後、前記保持体が前記移動可能範囲の他端に到達した場合、エラー発生を報知する報知手段を更に備えたことを特徴とする請求項5に記載のミシン。   2. The apparatus according to claim 1, further comprising an informing unit for informing an error occurrence when the holding body reaches the other end of the movable range after the movement control unit has changed the moving direction to the opposite direction. Item 6. The sewing machine according to Item 5. 前記移動制御手段による前記保持体の移動速度に応じて前記第一距離を設定する距離設定手段を更に備えたことを特徴とする請求項2〜6の何れか1つに記載のミシン。   The sewing machine according to any one of claims 2 to 6, further comprising distance setting means for setting the first distance according to a moving speed of the holding body by the movement control means. 前記移動制御手段は、前記識別手段が識別した前記特徴部分が、前記第一領域の画像中の前記第二領域の周囲に予め設定した第三領域から前記保持体の移動方向の反対方向に第二距離内で前記特徴部分を識別した場合、前記移動機構を制御して、前記保持体の移動速度を減速することを特徴とする請求項1〜7の何れか1つに記載のミシン。   The movement control unit is configured such that the characteristic portion identified by the identification unit is a first region in a direction opposite to the moving direction of the holding body from a third region preset around the second region in the image of the first region. The sewing machine according to claim 1, wherein when the characteristic portion is identified within two distances, the moving mechanism is controlled to reduce the moving speed of the holding body. 前記特徴部分は、予め設定した色を含む領域であり、
前記識別手段は、前記色を含み且つ所定の大きさよりも大きい領域を、前記特徴部分として識別することを特徴とする請求項1〜8の何れか1つに記載のミシン。
The characteristic portion is a region including a preset color,
The sewing machine according to claim 1, wherein the identification unit identifies an area including the color and larger than a predetermined size as the characteristic portion.
JP2012074793A 2012-03-28 2012-03-28 Sewing machine Pending JP2013202210A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2012074793A JP2013202210A (en) 2012-03-28 2012-03-28 Sewing machine
CN201310103603.XA CN103451856B (en) 2012-03-28 2013-03-27 Sewing machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012074793A JP2013202210A (en) 2012-03-28 2012-03-28 Sewing machine

Publications (1)

Publication Number Publication Date
JP2013202210A true JP2013202210A (en) 2013-10-07

Family

ID=49521960

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012074793A Pending JP2013202210A (en) 2012-03-28 2012-03-28 Sewing machine

Country Status (1)

Country Link
JP (1) JP2013202210A (en)

Similar Documents

Publication Publication Date Title
US8738173B2 (en) Sewing machine and non-transitory computer-readable storage medium storing sewing machine control program
US9127383B2 (en) Sewing machine and non-transitory computer-readable medium
JP4862929B2 (en) sewing machine
JP5942389B2 (en) sewing machine
US8594829B2 (en) Sewing machine and computer program product stored on non-transitory computer-readable medium
US8594830B2 (en) Computer controlled embroidery sewing machine with image capturing
US9127385B2 (en) Sewing machine, non-transitory computer-readable medium, and sewing machine system
EP2386673A1 (en) Sewing machine and non-transitory computer-readable medium storing sewing machine control program
US8584607B2 (en) Sewing machine
JP2020005694A (en) sewing machine
JP6604171B2 (en) Embroidery pattern editing program and embroidery pattern editing apparatus
JP2006198188A (en) Sewing machine
JP2009172122A (en) Sewing machine
CN103451856B (en) Sewing machine
US11180879B2 (en) Sewing machine and pattern alignment method
JP2012147985A (en) Sewing machine
JP2013202211A (en) Sewing machine
JP2013202210A (en) Sewing machine
US11680347B2 (en) Sewing machine
JP2012192156A (en) Sewing machine
US9926656B2 (en) Sewing machine, method for determining embroidery frame and program
JP5438482B2 (en) Sewing machine, sewing data editing device for sewing machine and sewing data editing program for sewing machine
JP2013074971A (en) Sewing machine
US20230029765A1 (en) Processing data generation device, embroidery sewing machine, and non-transitory computer-readable storage medium
JP2020156831A (en) Sewing data processing device and sewing machine