201230665 六、發明說明:201230665 VI. Description of invention:
【明戶斤屬系奸々貝J 發明領域 本發明係有關於一種步進馬達之驅動裝置。 C先前技術I 發明背景 一般之步進馬達已知有藉2個線圈在相互不同之激磁 時間被激磁而驅動之2相步進馬達。 習知之雙極型2相步進馬達1係按各線圈設有對2個線 圈分別切換通電方向之正反而驅動之驅動裝置1〇〇(第1〇 圖)。 驅動裝置100包含有輸出為步進馬達11〇之動作指令之 電流值指令的CPU101、輸出按照電流值指令之指令電流值 之D/A轉換部102、以流至步進馬達之線圈之電流值對指令 電流值之差分’輸出偏差之電流偏差生成部103、輸出規則 之鑛齒狀之二角波的二角波產生電路104。按照比較值之尸 號與三角波之信號的比較,生成為〇N-〇FF之連續传號之 PWM信號的PWM產生電路105、進行分別流至步進馬達ιι〇 之2個線圈之電流的正反方向及0N-0FF之切換的橋接電路 106、檢測流至各線圈之電流之電流檢測部1 〇7。 又,根據上述結構’在驅動裳置1 〇〇,對步進馬達11 〇 進行了所謂之比例控制(P控制)(例如參照專利文獻丨)。 先行技術文獻 專利文獻 201230665 文獻1日本專利公開公報2〇〇9-〇95148號 【潑^明内溶^】 發明概要 發明欲解決之課題 、在習知又極型2相步進馬達之驅動裝置中進行之 2控制)有輸出產生穩定偏差或易受雜訊之影響之 。、有使用比例+積分控制(PI控制)之方法作為立 因應。但是,在雙極型2相步進馬達之控制中,需週期性地 切換流至各線圈之電流之正負極性。於馬達之高速旋轉時 t電流切換為正負其中—者時,有因在此之前所累計之電 流偏差之累計值而造成電流追縱慢之問題。 更故 依據第11圖來說明,在積分控制中,藉使電流偏差之 累計值Iei反映於流至線圈之電流值,可減低穩定偏差或雜 Λ之影響。然而,在指令電流值:r從正轉變成負之時間點⑽ 中之點C1),因電流偏差之累計值lie仍為正,故將應使負電 流值(反方向之電流)流至線圈之處積分控制之成份反應累 a十值lei ’而進行正之補正,而使追蹤性降低。 又,在指令電流值Ir從負轉變成正之時間點(圖中之點 C2),亦產生了同樣之現象。 又,亦使用比例+積分控制+微分控制(pID控制)之方 法’當使用微分控制時’控制系統複雜,而因增益設定, 有控制發散之問題。又,由於為PID控制時,亦包含積分控 制’故上述追跟蹤性之問題無法根本解決。 201230665 本發明之目的在於對雙極型2相步進馬達之驅動裝 置,在不使控制系統複雜化下’使追蹤性提高。 用以欲解決課題之手段 申請專利範圍第1項記載之發明特徵在於包含有電流 檢測部及控制部,該電流檢測部係檢測流至雙極型2相步進 馬達之線圈之電流值者;該控制部係依據指令電流值與前 述電流檢測部之檢測電流值的電流偏差進行流至前述線圈 之電流之反饋控制者,前述指令電流值係依據對前述雙極 型2相步進馬達之動作指令之對前述線圈的指令電流值; 又,前述控制部求出前述電流偏差之累計值,藉由該累計 值與前述電流偏差之值,決定流至前述線圈之電流值;當 前述指令電流值之正負極性轉換時’重設前述電流偏差之 累計值後,繼續累計。 申請專利範圍第2項記載之發明具有與申請專利範圍 第1項記載之發明相同之結構,並且’前述控制部從該指令 電流值與電流偏差之累計值的相乘值,判定前述指令電流 值之正負極性之轉換。 申請專利範圍第3項記載之發明具有與申請專利範圍 第1或2項記載之發明相同之結構,並且,前述控制部由 DSP(Digital Signal Processor)構成。 因申請專利範圍第1項記載之發明於指令電流值週期 性轉換時,檢測該轉換,進行重設電流偏差累計值之處理, 故排除緊接在指令電流值之極性轉換之後,因電流偏差累 計值之極性與指令電流值不一致而引起之電流追蹤性之降 201230665 低的影響。因此’可在不產生微分控制之施行等控制系統 之複雜化下,謀求反饋控制之追蹤性之提高。 由於申請專利範圍第2項記載之發明:從該指令電流 值與電流偏差之累計值的相乘值來判定指令電流值之正負 極性,故相較於例如記憶前—指令㈣值且藉由與新指令 電流值之對比來進行極性轉換之判定的㈣,不需記㈣ -指令電流值之處理或手段,而可謀求控❹統之簡易化。 由於申請專利範圍第3項記載之發明使用適合週期且 連續之處理之DSP作為控制部’故可謀求處理之高速化, 而可谋求追縱性之進一步提高。 圖式簡單說明 第1圖係顯示連接有本發明步進馬達之驅動裝置之雙 極型2相式步進馬達之結構的說明圖。 第2圖係顯示步進馬達之驅動裝置之結構的塊圖。 第3圖係橋接電路之電路圖。 第4圖係DSP之功能塊圖。 第5圖係顯示以橫軸為時間,以縱軸為電流值,指令電 流值Ir、檢測電流值Id、電流偏差Ie、及電流偏差累計值W 之變化的線圖。第5㈧圖係顯示以橫轴為時間,以縱軸為 電流值,來自CPU之指令電流值Ir與檢測電流㈣之變化的 線圖’第圖係顯示以橫軸為時間,以縱轴為電流值, 電流之偏仏與電流偏差累計值Iei之變化的線圖。 ,係顯示㈣所作之對步進馬達之線圈之通電控 制的流程圖。 201230665 第7圖係顯示隨著馬達之低速驅動時之時間經過的指 令電流值Ir、進行重設電流偏差累計值lei之控制時的檢測 電流值Id、進行不重設電流偏差累計值lei之控制時的檢測 電流值Idm之變化之線圖。 第8圖係顯示隨著馬達之中速驅動時之時間經過的指 令電流值Ir、進行重設電流偏差累計值lei之控制時的檢測 電流值Id、進行不重設電流偏差累計值lei之控制時的檢測 電流值Idm之變化之線圖。 第9圖係顯示隨著馬達之高速驅動時之時間經過的指 令電流值Ir、進行重設電流偏差累計值lei之控制時的檢測 電流值Id、進行不重設電流偏差累計值lei之控制時的檢測 電流值Idm之變化之線圖。 第10圖係顯示習知雙極型2相步進馬達之驅動裝置之 一結構例的塊圖。 弟11圖係顯不以橫轴為時間,以縱轴為電流值,指令 電流值Ir、實際流至線圈之電流值Id、該等之電流偏差Ie及 電流偏差之累計值lei之變化的線圖。 I:實施方式3 用以實施發明之形態 (發明之實施型態之整體構成) 以下,依據第1圖至第9圖,詳細地說明本發明之實施 形態。 本發明實施形態之步進馬達1之驅動裝置7係按步進馬 達1之A相及B相的各線圈4、5而設,各驅動裝置7連接於用 201230665 以輸出按照為步進馬達i之目的之動作而訂定之電流值指 令的CPU8。 (步進馬達) 步進馬達1具有與該步進馬達i之旋轉轴構成—體而設 成可旋轉之®柱狀轉子2、設於㈣2之周圍之圓筒狀定子 3、在定子3之内周部,捲繞於朝靠近轉子2之方向突出而設 之芯部3a、3b,而藉後述驅動裝置7所作之電流控制,以變 更綠持轉子2之旋轉角度的線圈4、5。此外,將各線圈4、 5簡略化而顯示,實際上由複數線圈構成,該等以串聯且均 —間隔交互地配置於轉子2之周圍。 轉子2係永久磁财之磁,_,連結於圖巾未示之步進 馬達1之旋轉軸,而找成可旋轉。定子3係設於轉子2之周 圍之圓筒狀磁性材料(例如鐵),並於其内周部設有朝靠近轉 子2之方向突出而設之芯部3a〜3b。 線圈4、5健繞於芯部3a、此繞線,藉錢述之驅 動裝置7,使電流流動而激磁,而具有作為電磁鐵之功能。 此時,線圈4、5透過各驅動裝置7,以cpu8進行錯開相位, 而使電流值週期性地變化之電流控制。又,以微步進行步 進馬達1之旋轉驅動,該微步係藉將2個線圈4、5之電流比 率細微地變化,而可獲得更細微之步進角度。 (步進馬達之驅動裝置) 接著,就步進馬達之驅動裝置7,詳細地說明。 步進馬達之驅動裝置7控制步進馬達丨之驅動/停止及 方疋轉角度。如第1圖所示,步進馬達之驅動裝置7設於各步 201230665 進馬達1之線圈4、5 ’以進行流至線圈4、5之電流之控制。 此外’在以下之說明,就連接於線圈4之驅動裝置7進 行說明’而省略為相同之結構之線圈5之驅動裝置7的說明。 如第2圖所示’步進馬達之驅動裝置7具有檢測流至步 進馬達1之線圈4之電流值的電流檢測部44、進行連接之切 換,以對線圈4分別於預定方向(正方向)及其反方向進行通 電的橋接電路20、及作為控制部之DSp(Digital Signal Processor)30,該控制部係依據指令電流值與電流檢測部U 之檢測電流值之電流偏差,進行流至線圈4之電流之反饋控 制’以透過橋接電路20,使按照來自cpu8之指令電流值之 電流流至線圈4。 (驅動裝置:電流檢測部) 電流檢測部11係串聯於線圈4之分路電阻,可獲得按照 流至線圈4之電流值之檢測信號。 (驅動裝置:橋接電路) 如第3圖所示’橋接電路20構成以FET21〜24及二極體 25~28構成之Η橋接電路,藉由此橋接電路2〇,將線圈4連接 於電源裝置6。 此外,電源裝置6為線圈4、5所共用。亦即,對“固電 源裝置6連接2個驅動裝置7之橋接電路2〇,以使電流流至線 圈 4、5 〇 FET21〜24係所謂3端子之場效電晶體,FET21、22其中 一電極與線圈4之一端連接,FET23、24其中一電極與線圈4 之另一端連接。又,FET21、23之另一電極與電源裝置6連 201230665 接,FET22、24之另一電極與接地9連接。 又,FET21〜24之閘極與DSP30連接,當以該DSP30對 閘極施加電壓時,具有使按照該電壓之值之電流從電源裝 置6流至線圈4之「開關元件」的功能。此外,FET21〜24可 進行雙方向之通電。 又,DSP30進行切換成將FET21與24同時ON,將FET22 與23同時OFF之連接狀態及將FET21與24同時OFF,將 FET22與23同時ON之連接狀態。又,為前者之連接狀態時, 在線圈4,電流往第3圖之右方向流動(第3圖實線箭號),為 後者之連接狀態時,在線圈4,電流往第3圖之左方向流動 (第3圖虛線箭號)。 二極體25〜28分別與FET21〜24並聯。又,各二極體 25〜28之正極(陽極)連接於接地9側,負極(陰極)連接於電源 裝置6側。亦即,來自電源裝置6之電流不流至二極體 25〜28,與電流源裝置6之電流之方向相反的方向之電流流 動時,該相反方向之電流在二極體25〜28流動。藉此,藉該 相反之方向之電流流至FET21〜24,防止FET21〜24破損。 即,二極體25〜28具有作為FET21〜24之保護電路之功能。 (驅動裝置:DSP) 在第4圖中,DSP30主要構造成實現作為比較部31、比 例處理部32、積分處理部33、及pWM信號生成部%之功 旎,s亥比較部係求出電流檢測部u之檢測電流值id對依據 來自CPU8之步進馬達1之線圈4的指令電流值lr之偏差Ie 者,該比例處理部係於偏差Ie乘上比例增益Kp者,該積分 10 201230665 ,理部係依據偏处’進行積分處理者,該PWM信號生成 係依據比例處理部32與積分處理部33之處理結果,生成 對橋接電路20之PWM信號,以於線圈4進行預定電流之通 電者。 此外,在上述各部31、32、33、36之連續之—連串處 里以—疋之週期反覆執行。 在第5圖中,上段(A)之線圖顯示以橫軸為時間,以縱 轴為電流值,來自CPU之指令電流值Ir與檢測電流值以之變 化,下段(B)之線圖係顯示以橫軸為時間,以縱軸為電= 值’電流之偏差Ie與電流偏差累計值Iei之變化。 對線圈4及線圈5進行通電,以反覆進行以π/2之相位 差,形成為正弦波形之週期之電流值的變化。然後, 進行構成階段性變化’以標繪上述正弦波形之指令電流之 數值輸出,而執行微步驅動。 比較部31將來自上述CPU8之指令電流值卜與來自電流 檢測部11之檢測電流值Id相減,而算出電流偏差Ie。[Field of the Invention] The present invention relates to a driving device for a stepping motor. C. Prior Art I Background of the Invention A general stepping motor is known as a 2-phase stepping motor which is driven by excitation of two coils at mutually different excitation times. The conventional bipolar two-phase stepping motor 1 is provided with a driving device 1 驱动 (first drawing) in which each coil is driven to switch between the energizing directions of the two coils. The driving device 100 includes a CPU 101 that outputs a current value command for an operation command of the stepping motor 11 , a D/A conversion unit 102 that outputs a command current value according to a current value command, and a current value that flows to a coil of the stepping motor. The current deviation generating unit 103 that outputs the difference between the command current values and the binary wave generating circuit 104 that outputs the regular tooth-shaped two-dimensional wave. According to the comparison between the corpus of the comparison value and the signal of the triangular wave, the PWM generating circuit 105 which generates the PWM signal of the continuous number of 〇N-〇FF, and the current flowing to the two coils of the stepping motor ιι〇 respectively The bridge circuit 106 that switches in the reverse direction and 0N-0FF, and the current detecting unit 1 〇7 that detects the current flowing to each coil. Further, according to the above configuration, the stepping motor 11 进行 is subjected to so-called proportional control (P control) when the drive is set to 1 (see, for example, Patent Document). PRIOR ART DOCUMENT PATENT DOCUMENT Patent Document 201230665 Document 1 Japanese Patent Laid-Open Publication No. Hei 9-〇95148 No. 9-〇 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 148 The control performed in 2) has a stable deviation or is susceptible to noise. There is a method of using proportional + integral control (PI control) as a countermeasure. However, in the control of the bipolar 2-phase stepping motor, it is necessary to periodically switch the positive and negative polarities of the current flowing to the respective coils. When the motor is switched to positive or negative at the high speed of the motor, there is a problem that the current is chased slowly due to the accumulated value of the current deviation accumulated before this. Further, according to Fig. 11, in the integral control, by the current value Iei of the current deviation reflected in the current value flowing to the coil, the influence of the stability deviation or the noise can be reduced. However, at the point C1 in the command current value: r from the positive to the negative time point (10), since the accumulated value lie of the current deviation is still positive, the negative current value (current in the opposite direction) should be made to flow to the coil. At the point where the integral control component reacts to the a ten value lei' and corrects it positively, the traceability is reduced. Also, the same phenomenon occurs when the command current value Ir changes from negative to positive (point C2 in the figure). Also, the method of proportional + integral control + differential control (pID control) is used. 'When differential control is used', the control system is complicated, and due to the gain setting, there is a problem of controlling divergence. Moreover, since the integral control is included in the case of PID control, the above-mentioned problem of traceability cannot be fundamentally solved. 201230665 The object of the present invention is to improve the tracking performance of a driving device for a bipolar two-phase stepping motor without complicating the control system. Means for Solving the Problem Patent Application No. 1 is characterized in that the current detecting unit detects a current value flowing to a coil of a bipolar two-phase stepping motor, and a control unit that detects a current value flowing to a coil of a bipolar two-phase stepping motor; The control unit is a feedback controller that flows current to the coil according to a current deviation between the command current value and the detected current value of the current detecting unit, and the command current value is based on the action of the bipolar 2-phase stepping motor. Commanding a command current value to the coil; wherein the control unit obtains an integrated value of the current deviation, and determines a current value flowing to the coil by a value of the integrated value and the current deviation; and when the command current value When the positive and negative polarity conversions are performed, the cumulative value of the current deviation is reset and the accumulation continues. The invention described in claim 2 has the same configuration as the invention described in claim 1, and the control unit determines the command current value from the multiplied value of the integrated value of the command current value and the current deviation. The conversion of positive and negative polarity. The invention described in claim 3 has the same configuration as the invention described in claim 1 or 2, and the control unit is constituted by a DSP (Digital Signal Processor). When the invention described in the first application of the patent application periodically detects the conversion of the command current value, the conversion is detected, and the process of resetting the current deviation cumulative value is performed, so that the current deviation is accumulated after the polarity conversion of the command current value is excluded. The polarity of the value is inconsistent with the command current value and the current traceability is reduced by 201230665. Therefore, it is possible to improve the traceability of the feedback control without complicating the control system such as the implementation of the differential control. According to the invention described in claim 2, the positive and negative polarities of the command current value are determined from the multiplied value of the integrated value of the command current value and the current deviation, and thus compared with, for example, the pre-memory-instruction (four) value and by The comparison of the new command current value to determine the polarity conversion (4), without the need to remember (4) - the processing or means of the command current value, can be simplified. Since the invention described in the third paragraph of the patent application uses a DSP suitable for periodic processing and continuous processing as the control unit, it is possible to speed up the processing and further improve the tracking performance. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is an explanatory view showing the configuration of a bipolar 2-phase stepping motor to which a driving device for a stepping motor of the present invention is connected. Fig. 2 is a block diagram showing the structure of a driving device for a stepping motor. Figure 3 is a circuit diagram of the bridge circuit. Figure 4 is a functional block diagram of the DSP. Fig. 5 is a graph showing changes in the command current value Ir, the detected current value Id, the current deviation Ie, and the current deviation integrated value W with the horizontal axis as the time and the vertical axis as the current value. The fifth (eight) diagram shows the line graph with the horizontal axis as the time and the vertical axis as the current value, and the change of the command current value Ir from the CPU and the detected current (4). The graph shows the horizontal axis as the time and the vertical axis as the current. A graph of the change in the value, the bias of the current, and the cumulative value of the current deviation Iei. The system displays (iv) a flow chart of the energization control of the coil of the stepper motor. 201230665 Fig. 7 shows the command current value Ir when the motor is driven at a low speed, the detected current value Id when the reset current deviation integrated value lei is controlled, and the control of the unreset current deviation integrated value lei A line graph of the change in the detected current value Idm. Fig. 8 is a view showing the command current value Ir when the motor is driven at the intermediate speed, the detected current value Id when the reset current deviation integrated value lei is controlled, and the control of the unreset current deviation integrated value lei. A line graph of the change in the detected current value Idm. Fig. 9 is a view showing a command current value Ir when the time when the motor is driven at a high speed, a detected current value Id when the reset current deviation integrated value lei is controlled, and a control for not resetting the current deviation integrated value lei A line graph of the change in the detected current value Idm. Fig. 10 is a block diagram showing a configuration example of a driving device of a conventional bipolar 2-phase stepping motor. The 11th line shows the line with the horizontal axis as the time, the vertical axis as the current value, the command current value Ir, the actual current value to the coil Id, the current deviation Ie, and the current value lei. Figure. I. Embodiment 3 Mode for Carrying Out the Invention (Entire Configuration of Embodiment Mode of Invention) Hereinafter, an embodiment of the present invention will be described in detail based on Figs. 1 to 9 . The driving device 7 of the stepping motor 1 according to the embodiment of the present invention is provided for each of the A-phase and B-phase coils 4 and 5 of the stepping motor 1, and each of the driving devices 7 is connected to the 201230665 for output as a stepping motor i. The CPU 8 of the current value command set by the purpose of the action. (Stepping Motor) The stepping motor 1 has a columnar rotor 2 that is rotatable with the rotating shaft of the stepping motor i, a cylindrical stator 3 that is provided around (4) 2, and a stator 3 in the stator 3. The inner peripheral portion is wound around the core portions 3a and 3b which are provided to protrude toward the rotor 2, and the coils 4 and 5 which are rotated by the rotation angle of the green rotor 2 are controlled by current control by the driving device 7 to be described later. Further, the coils 4 and 5 are simplified and displayed, and are actually constituted by a plurality of coils which are alternately arranged around the rotor 2 in series and at intervals. The rotor 2 is a permanent magnet, _, which is connected to the rotating shaft of the stepping motor 1 not shown in the figure, and is found to be rotatable. The stator 3 is provided with a cylindrical magnetic material (e.g., iron) around the rotor 2, and has core portions 3a to 3b projecting toward the rotor 2 in the inner peripheral portion thereof. The coils 4, 5 are wound around the core portion 3a and the winding, and the driving device 7 is used to cause current to flow and be excited, and has a function as an electromagnet. At this time, the coils 4 and 5 are transmitted through the respective driving devices 7, and the phases are shifted by the cpu 8, and the current whose current value is periodically changed is controlled. Further, the rotational driving of the stepping motor 1 is performed in a microstep, and the microsteps are minutely changed by the current ratio of the two coils 4, 5 to obtain a finer step angle. (Driver of Stepping Motor) Next, the drive device 7 of the stepping motor will be described in detail. The driving device 7 of the stepping motor controls the driving/stopping and the turning angle of the stepping motor. As shown in Fig. 1, the driving device 7 of the stepping motor is provided at each step 201230665 to the coils 4, 5' of the motor 1 to control the current flowing to the coils 4, 5. Further, in the following description, the drive unit 7 connected to the coil 4 will be described, and the description of the drive unit 7 of the coil 5 having the same configuration will be omitted. As shown in Fig. 2, the driving device 7 of the stepping motor has a current detecting unit 44 that detects the current value of the coil 4 flowing to the stepping motor 1, and performs switching of the connection so that the coils 4 are respectively in a predetermined direction (positive direction). And a bridge circuit 20 that energizes in the opposite direction, and a DSp (Digital Signal Processor) 30 as a control unit that flows to the coil according to a current deviation between the command current value and the detected current value of the current detecting unit U. The feedback control of the current of 4 flows through the bridge circuit 20 to cause a current according to the command current value from the cpu 8 to flow to the coil 4. (Drive device: current detecting unit) The current detecting unit 11 is connected in series with the shunt resistor of the coil 4 to obtain a detection signal in accordance with the current value flowing to the coil 4. (Drive device: bridge circuit) As shown in Fig. 3, the bridge circuit 20 constitutes a bridge circuit composed of FETs 21 to 24 and diodes 25 to 28, by which the coil 4 is connected to the power supply device. 6. Further, the power supply device 6 is shared by the coils 4, 5. That is, the "solid-state power supply device 6 is connected to the bridge circuit 2 of the two drive devices 7 so that current flows to the coils 4, 5, FETs 21 to 24, which are so-called 3-terminal field effect transistors, and one of the FETs 21, 22 One end of the coil 4 is connected, and one of the FETs 23, 24 is connected to the other end of the coil 4. Further, the other electrode of the FETs 21, 23 is connected to the power supply unit 6 201230665, and the other electrode of the FETs 22, 24 is connected to the ground 9. Further, the gates of the FETs 21 to 24 are connected to the DSP 30, and when the DSP 30 applies a voltage to the gate, it has a function of causing a current according to the value of the voltage to flow from the power supply device 6 to the "switching element" of the coil 4. Further, the FETs 21 to 24 can be energized in both directions. Further, the DSP 30 switches to a state in which the FETs 21 and 24 are simultaneously turned ON, the FETs 22 and 23 are simultaneously turned off, and the FETs 21 and 24 are simultaneously turned off, and the FETs 22 and 23 are simultaneously turned on. When the former is in the connected state, the current flows in the right direction of the third figure in the coil 4 (the solid arrow in Fig. 3), and when the latter is in the connected state, the current flows to the coil 4, and the current flows to the left of the third figure. Directional flow (dotted arrow in Figure 3). The diodes 25 to 28 are connected in parallel with the FETs 21 to 24, respectively. Further, the positive electrode (anode) of each of the diodes 25 to 28 is connected to the ground 9 side, and the negative electrode (cathode) is connected to the power supply device 6 side. That is, when the current from the power supply unit 6 does not flow to the diodes 25 to 28, and the current in the direction opposite to the direction of the current of the current source unit 6 flows, the current in the opposite direction flows in the diodes 25 to 28. Thereby, the current in the opposite direction flows to the FETs 21 to 24 to prevent the FETs 21 to 24 from being damaged. That is, the diodes 25 to 28 have functions as protection circuits for the FETs 21 to 24. (Drive device: DSP) In Fig. 4, the DSP 30 is mainly configured to realize the operation of the comparison unit 31, the proportional processing unit 32, the integration processing unit 33, and the pWM signal generation unit %, and the shai comparison unit determines the current. The detected current value id of the detecting unit u is based on the deviation Ie of the command current value lr from the coil 4 of the stepping motor 1 of the CPU 8, and the proportional processing unit is multiplied by the proportional gain Kp by the deviation Ie, the integral 10 201230665, The management unit performs the integration process based on the deviation, and the PWM signal generation system generates a PWM signal to the bridge circuit 20 based on the processing result of the proportional processing unit 32 and the integration processing unit 33 to perform the current of the predetermined current on the coil 4. . Further, in the continuous - series of the above-mentioned respective sections 31, 32, 33, 36, the cycle is repeated in the period of -. In Fig. 5, the line graph of the upper section (A) shows the horizontal axis as the time and the vertical axis as the current value. The command current value Ir from the CPU and the detected current value change, and the line graph of the lower section (B) The display shows the change in the horizontal axis as the time and the vertical axis as the electric value = the current deviation Ie and the current deviation integrated value Iei. The coil 4 and the coil 5 are energized to repeatedly change the phase value of π/2 to form a change in the current value of the period of the sinusoidal waveform. Then, a stepwise change is made to plot the numerical output of the command current of the above sinusoidal waveform, and microstep driving is performed. The comparing unit 31 subtracts the command current value from the CPU 8 and the detected current value Id from the current detecting unit 11 to calculate the current deviation Ie.
Ir —Id = Ie 然後,將所算出之電流偏差le輸出至比例處理部32及 積分處理部33。 比例處理部32於從比較部31所輸入之電流偏差&乘上 預定之比例增益Kp後,將之輸出至pWM信號生成部%。 積分處理部33具有累計從比較部31輸入之每次之電流 偏差Ie之累計部34、判定是否重設累計部34所累計之電流 偏差累計值lei之判定部35。此外,〇卯3〇内藏有記憶體, 201230665 電机偏差累計值I e i記憶保持於此記憶體内。 ph I纟進行之反饋之積分控制巾,從步進馬達1之驅動 °至卜止為止’連續進行電流偏差^之累計。結果,如 ^型2相步進馬達1般,指令電流值Ir之極性週期性地轉換 宣▲緊接於才曰々電流值^之極性轉換後,會與在此之前所 你計之電流偏差累計值Iei產生純不—致,積分控制成份 為妨礙對^日7電流仙之追蹤,而產生了線圈之通電性 之追蹤性降低的問題。 是故’積分處理部33之判定部35讀取來自CPU8之指令 電机值Ιι·’判疋相對於前_指令電流值其極性是否已轉換。 具體S之’根據將指令電流值Ir與電流偏差累計值lei相乘 之相乘蚊否為負極性來判定。亦即,指令電流仙之極性 未I化時’由於在此之前之電極偏差累計值lei與極性-致’故相乘時’必定形成為正,而由於在緊接於指令電流 值Ir之極性轉換後,會與電流偏差累計值W不—致,故相 乘時’其相乘值必定為負,故可檢測指令電流值卜之極性之 轉換。 又’判定部35於判斷為非在緊接於指令電流值卜之極性 轉換後時,與以往之控制同樣地,於電流偏差累計值W乘 上積分增益,將之輸出至PWM信號生成部36。又,於判定 為在緊接於指令電流值Ϊ r之極性轉換後時,判定部3 5令電流 偏差累計值lei為〇,將之輸出至pwM信號生成部%。 即,如第5圖所示,在指令電流值卜之極性轉換之點 P1〜P3中,將電流偏差累計值Iei重設為〇,之後,重新進行 12 201230665 累計。 PWM# ϊ虎生成部36將比例處理部32之輸出Kpxle盘積 分處理部33之輸出Kixlei(重設時,Iei=〇)相加,算出其總 和值Ret。Ir - Id = Ie Then, the calculated current deviation le is output to the proportional processing unit 32 and the integration processing unit 33. The proportional processing unit 32 multiplies the current deviation & input from the comparison unit 31 by a predetermined proportional gain Kp, and outputs it to the pWM signal generating unit %. The integration processing unit 33 has an integration unit 34 that integrates the current deviation Ie input from the comparison unit 31, and a determination unit 35 that determines whether or not to reset the current deviation integration value lei accumulated by the integration unit 34. In addition, the memory is stored in 〇卯3〇, and the motor deviation integrated value I e i memory is kept in this memory. The integral control towel for feedback by ph I , continuously accumulates the current deviation ^ from the drive of the stepping motor 1 to the stop. As a result, as in the case of the 2-phase stepping motor 1, the polarity of the command current value Ir is periodically converted, and the current deviation from the current value before the polarity is converted. The accumulated value Iei is purely non-induced, and the integral control component is a problem that hinders the tracking of the current, and the traceability of the coil is reduced. Therefore, the determination unit 35 of the integration processing unit 33 reads the command motor value Ιι·' from the CPU 8 to determine whether or not the polarity has been converted with respect to the previous _ command current value. The specific S is determined based on the fact that the multiplied mosquitoes multiplied by the command current value Ir and the current deviation integrated value lei are negative polarity. That is, when the polarity of the command current is not I, 'because the electrode deviation cumulative value lei and the polarity-to-multiply before this are multiplied, the positive polarity must be formed, and the polarity is immediately adjacent to the command current value Ir. After the conversion, it will not be related to the current deviation integrated value W, so when multiplied, the multiplication value must be negative, so the polarity of the command current value can be detected. In the same manner as the conventional control, the determination unit 35 multiplies the current deviation integrated value W by the integral gain, and outputs it to the PWM signal generation unit 36, as in the case of the determination of the polarity of the command current value. . When it is determined that the polarity is immediately after the switching of the command current value Ϊ r, the determining unit 35 causes the current deviation integrated value lei to be 〇 and outputs it to the pwM signal generating unit %. That is, as shown in Fig. 5, in the points P1 to P3 at which the polarity of the command current value is switched, the current deviation integrated value Iei is reset to 〇, and then 12 201230665 is re-integrated. The PWM # ϊ 生成 generator 36 adds the output Kixlei (Iei = 重 at the time of reset) of the output Kpxle disk integration processing unit 33 of the proportional processing unit 32, and calculates the total value Ret.
Ret = KpxIe + Kixlei 又,以按照上述總和值Ret之數值之負載比,生成為〇N 與OFF之反覆之信號的PWM信號,並將之輸出至橋接電 路。負載比設定成按照Ret之數值,成比例地增大。即,若 Ret之值為正’絕對值大時,〇N之比率為〇5以上,而按照 絕對值,將負載比訂定為更接近1.〇,若Ret之值為負,絕對 值大時,OFF之比率為〇.5以上’而按照絕對值,將負載比 訂定為更接近1.0。 此外’總和值Ret與PWM信號之負載比亦可於DSp3〇 内準備訂定相互對應關係之表,參照此表,進行界定按照 總和值Ret之負載比之處理。 藉此,對線圈4修正成預定電流往正或反方向流動,通 電量追蹤指令電流值。 即’ DSP3〇(控制部)求出電流偏差之累計值w(電流偏 差累計值lei),藉由該累計值Iei與電流偏差u之值決定流 至線圈4之電流值,並且,當指令電流值Id之正負極性轉換 時,重設電流偏差之累計值(Iei = 0)後’繼續累計。 (驅動裝置所作之步進馬達之控制) 依據第6圖之流程圖,就上述驅動裝置7所作之步進馬 達1之控制,特別說明DSP30(控制部)所作之對步進馬達丄之 13 201230665 線圈4的通電控制。 首先’於開始步進馬達1之驅動之際,重設電流偏差累 計值1ei之值([lei二0]:步驟S1)。 然後’ DSP30從CPU8讀取指令電流值〗!·,並且,從電 流檢測部11讀取檢測電流值Id(步驟S3),比較部31從指令電 流值1^咸掉檢測電流值Id,而算出電流偏差le([Ir-Id = Ie]: 步驟S5)。 接著’在積分處理部33之累計部34,將電流偏差Ie加 至記憶體内之電流偏差累計值lei之值(步驟S7)。 進—步,判定部35將指令電流值lr與電流偏差累計值 Iei相乘,判定該相乘值是否不到0(負)[lrxlei<0]:步驟S9)。 此時,若IrxIei<〇(步驟S9 : YES),由於緊接於指令電 流值Ir之極性轉換後’電流偏差累計值Id為極性尚未轉換 之狀態’故進行重設記憶體内之電流偏差累計值Iei之處理 ([lei = 0]):步驟S11)。 另一方面’若IrxIeigO時(步驟S9 : NO),在比例處理 部32 ’於電流偏差Ie乘上比例增益Kp,在積分處理部33, 於電流偏差累計值lei乘上積分增益Ki,而算出該等之值之 總和值Ret([Ret = KpxIe + kixIei]:步驟S13)。 然後’在PWM信號生成部36,依據總合值Ret,界定負 載比,將按照此之PWM信號輸出至橋接電路2〇(步驟S15)。 橋接電路20按照PWM信號,交互進行FET21、24之ON 與FET22、23之ON ’使正反電流流至線圈4,總而言之,使 按照負載比之電流通電。 14 201230665 之後’使處理返回步驟S3,進行下個指令電流值&與檢 測電流值Id之讀入。此外,步驟幻至如之處理在步進馬達 1之驅動中,以一定之週期反覆執行。 又,在上述流程圖中,僅顯示對步進馬達i中之其中一 線圈4之電流控制’關於另-線圈5,在使指令電流仙之相 位延遲π/2之狀態下’進行與上述相同之電流控制。 (步進馬達之驅動裝置之控制之效果) 上述步進馬達之驅動裝置7所作之電流控制在下述點 具有特徵,前述點係檢測指令電流值Ir之極性之轉換,而重 設電流偏差累計值lei。 就此之效果,依據第7圖〜第9圖作說明。 因電流偏差累計值Iei較指令電流值,極性轉換慢而引 起的對指令電流值之追蹤性之降低當步進馬達丨之驅動越 尚速,便越顯著。 可知於第7圖所示之步進馬達1之低速驅動時,上述驅 動裝置7之檢測電流值順f純控制之檢測電流值Idm差 小’於第8圖所不之中速驅動時’驅動裝置7之檢測電流值 Id可以比起習知PI控帝j之檢測電流值咖較接近指令電流 仙之值追蹤’於第9圖之高速驅動日夺,驅動裝置7之檢測電 机值Id可以比起習知p!控制之檢測電流值咖較接近指令 電流值Ir之值且接近指令電流之相位追縱。 如此’因雙極型2相步進馬達丄之驅動裝置7當檢測指令 電机值Ir之極性之轉換時,進行重設電流偏差累計值w之 值的處理’故在*增加微分控制之控織統下,可對以高 15 201230665 追蹤性流至步進馬達丨之線圈之 是於馬達之高速轉時,可纟〜’進行反饋控制。特別 (其他) 了㈣追峨之緩慢。 此外,在上❹進料之 之 之 指令電流低進行按照微步之裝置7 ’例不了咖8 全步進驅動或半步進驅動時,:的情形,於步進數較少$ 仍具效果。 使進行同樣之電流控制, 又,在驅動裝置7使用了 dspm 之讀入處理之CPU、使用程序^可使用可進行電流 此。 $之娬電腦、類比電路取代 【圖簡單_說^明】 第1圖係顯示連接有本發明步進馬達之 極型2相式步進馬達之結構的說明圖。 之雙 第2圖係顯示步進馬達之驅動裝置之結構的塊圖。 第3圖係橋接電路之電路圖。 第4圖係DSP之功能塊圖。 第5圖係顯示以橫軸為時間,以縱軸為電流值, 流值Ir、檢測電流值ld、電流偏差Ie、 " 之變化的線圖。第5(A)_示以橫二== 電流值,來自⑽之指令電流㈣與檢測電流值Η之變2 線圖’第5(B)®係齡以橫料相 乂縱軸為電流值, 電k之偏差le與電流偏差累計值Iei之 第6圖係顯示所作之對步進馬達之線: 制的流程圖。 〈逋電控 201230665 第7圖係顯示隨著馬達之低速驅動時之時間經過的指 令電流值Ir、進行重設電流偏差累計值lei之控制時的檢測 電流值Id、進行不重設電流偏差累計值lei之控制時的檢測 電流值Idm之變化之線圖。 第8圖係顯示隨著馬達之中速驅動時之時間經過的指 令電流值Ir、進行重設電流偏差累計值lei之控制時的檢測 電流值Id、進行不重設電流偏差累計值lei之控制時的檢測 電流值Idm之變化之線圖。 第9圖係顯示隨著馬達之高速驅動時之時間經過的指 令電流值Ir、進行重設電流偏差累計值lei之控制時的檢測 電流值Id、進行不重設電流偏差累計值lei之控制時的檢測 電流值Idm之變化之線圖。 第10圖係顯示習知雙極型2相步進馬達之驅動裝置之 一結構例的塊圖。 第11圖係顯示以橫軸為時間,以縱軸為電流值,指令 電流值Ir、實際流至線圈之電流值Id、該等之電流偏差Ie及 電流偏差之累計值lei之變化的線圖。 【主要元件符號說明】 1,110...步進馬達 7,100…驅動裝置 2.. .轉子 3.. .定子 3a,3b...ii部 4,5...線圈 6.. .電源裝置 8 > 101...CPU 9...接地Ret = KpxIe + Kixlei Further, a PWM signal which is a signal of 〇N and OFF is generated in accordance with the duty ratio of the value of the above-mentioned total value Ret, and is output to the bridge circuit. The duty ratio is set to increase proportionally according to the value of Ret. That is, if the value of Ret is positive 'the absolute value is large, the ratio of 〇N is 〇5 or more, and according to the absolute value, the load ratio is set to be closer to 1. 〇, if the value of Ret is negative, the absolute value is large. In the case of OFF, the ratio of OFF is 〇.5 or more', and the absolute ratio is set to be closer to 1.0. Further, the load ratio of the sum value Ret and the PWM signal can also be prepared in the DSp3 订 to define a correspondence relationship, and with reference to this table, the processing for defining the duty ratio according to the total value Ret is performed. Thereby, the coil 4 is corrected to flow in a forward or reverse direction with a predetermined current, and the command current value is tracked by the amount of electric power. That is, 'DSP3〇 (control unit) obtains the integrated value w (current deviation integrated value lei) of the current deviation, and determines the current value flowing to the coil 4 by the value of the integrated value Iei and the current deviation u, and when the command current When the positive and negative polarity of the value Id is changed, the accumulated value of the current deviation (Iei = 0) is reset and 'continues to accumulate. (Control of the stepping motor by the driving device) According to the flowchart of FIG. 6, the control of the stepping motor 1 by the above-mentioned driving device 7 is specifically described by the DSP 30 (control unit) for the stepping motor 13 201230665 The energization control of the coil 4. First, when the driving of the stepping motor 1 is started, the value of the current deviation accumulated value 1ei is reset ([lei 2:]: step S1). Then, the DSP 30 reads the command current value from the CPU 8 and reads the detected current value Id from the current detecting unit 11 (step S3), and the comparing unit 31 calculates the detected current value Id from the command current value 1 Current deviation le ([Ir-Id = Ie]: step S5). Then, in the integrating unit 34 of the integration processing unit 33, the current deviation Ie is added to the value of the current deviation integrated value lei in the memory (step S7). Further, the determining unit 35 multiplies the command current value lr by the current deviation integrated value Iei, and determines whether or not the multiplied value is less than 0 (negative) [lrxlei < 0]: step S9). At this time, if IrxIei < 〇 (step S9: YES), the current deviation accumulated in the reset memory is performed because the current deviation integrated value Id is the state in which the polarity has not been converted immediately after the polarity conversion of the command current value Ir. Processing of the value Iei ([lei = 0]): step S11). On the other hand, when IrxIeigO (step S9: NO), the proportional processing unit 32' multiplies the current deviation Ie by the proportional gain Kp, and the integral processing unit 33 multiplies the current deviation integrated value lei by the integral gain Ki to calculate The sum value of these values is Ret ([Ret = KpxIe + kixIei]: step S13). Then, the PWM signal generating unit 36 defines the load ratio based on the total value Ret, and outputs the PWM signal according to this to the bridge circuit 2 (step S15). The bridge circuit 20 alternately turns ON of the FETs 21 and 24 and ONs of the FETs 22 and 23 in accordance with the PWM signal to cause the forward and reverse currents to flow to the coil 4, and in other words, energizes the current according to the duty ratio. 14 201230665 After the processing is returned to step S3, the next command current value & and the detected current value Id are read. Further, the steps are magically processed as in the driving of the stepping motor 1, and are repeatedly executed in a certain period. Further, in the above-described flowchart, only the current control of one of the coils 4 of the stepping motor i is displayed, and the state of the command coil current is delayed by π/2 with respect to the other coil 5 is performed in the same manner as described above. Current control. (Effect of Control of Driving Device of Stepping Motor) The current control by the driving device 7 of the stepping motor described above is characterized in that the point detects the polarity of the command current value Ir and resets the current deviation cumulative value. Lei. The effect of this will be explained based on Fig. 7 to Fig. 9. Since the current deviation cumulative value Iei is lower than the command current value, the tracking of the command current value caused by the slow polarity conversion is reduced, and the more rapid the driving of the stepping motor is, the more significant it is. It can be seen that when the stepping motor 1 shown in FIG. 7 is driven at a low speed, the detected current value of the driving device 7 is small, and the difference between the detected current values Idm of the pure control unit is small, 'when the medium speed is not driven in FIG. 8' The detection current value Id of the device 7 can be compared with the value of the detection current value of the conventional PI controller, which is closer to the value of the command current, and the high-speed driving day of the driving device 7 can be used. Compared with the detection current value of the conventional p! control, it is closer to the value of the command current value Ir and is close to the phase of the command current. In this way, when the polarity of the motor value Ir is detected by the driving device 7 of the bipolar two-phase stepping motor, the process of resetting the value of the current deviation cumulative value w is performed, so that the control of the differential control is increased in * Under the weaving system, the coil that can be traced to the stepper motor with the high 15 201230665 is the high-speed rotation of the motor, and the feedback control can be performed. Special (other) (4) Slow tracking. In addition, when the command current of the upper feed is low, the device according to the microstep 7' can not be used for the full step drive or the half step drive, the case of the step is less than the number of steps is still effective. . The same current control is performed, and the CPU is used in the drive device 7 using the reading process of dspm, and the program can be used to perform current.娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬 娬Double Fig. 2 is a block diagram showing the structure of a driving device for a stepping motor. Figure 3 is a circuit diagram of the bridge circuit. Figure 4 is a functional block diagram of the DSP. Fig. 5 is a line graph showing changes in the current value, the current value Ir, the detected current value ld, and the current deviations Ie, " with the horizontal axis as the time and the vertical axis as the current value. 5(A)_ shows the current value of the horizontal ===, the command current (4) from (10) and the change of the detected current value 2 2 line diagram '5th (B)® system age is the current value of the horizontal axis The sixth figure of the deviation k of the electric k and the current deviation cumulative value Iei shows the line of the stepping motor: the flow chart of the system. <逋电控201230665 Fig. 7 shows the command current value Ir when the motor is driven at a low speed, the detected current value Id when the reset current deviation integrated value lei is controlled, and the unreset current deviation is accumulated. A line graph showing the change in the detected current value Idm at the time of the control of the value lei. Fig. 8 is a view showing the command current value Ir when the motor is driven at the intermediate speed, the detected current value Id when the reset current deviation integrated value lei is controlled, and the control of the unreset current deviation integrated value lei. A line graph of the change in the detected current value Idm. Fig. 9 is a view showing a command current value Ir when the time when the motor is driven at a high speed, a detected current value Id when the reset current deviation integrated value lei is controlled, and a control for not resetting the current deviation integrated value lei A line graph of the change in the detected current value Idm. Fig. 10 is a block diagram showing a configuration example of a driving device of a conventional bipolar 2-phase stepping motor. Fig. 11 is a line graph showing changes in the horizontal axis as the time, the vertical axis as the current value, the command current value Ir, the actual current value to the coil Id, the current deviation Ie, and the current value lei. . [Description of main component symbols] 1,110...stepping motor 7,100...drive unit 2.. rotor 3.. stator 3a, 3b...ii part 4,5...coil 6.. Power supply unit 8 > 101...CPU 9...ground
11,107...電流檢測部 20,106...橋接電路 21-24...FET 17 201230665 25-28...二極體 105...PWM產生電路 30...DSP Id...檢測電流值 31...比較部 Ie...偏差 32…比例處理部 lei...電流偏差之累計值 33...積分處理部 Ir...指令電流值 34...累計部 Kp...比例增益 35...判定部 Ret...總和值 36...PWM信號生成部 α,P1-P3···點 102...D/A轉換部 S1,S3,S5,S7,S9··.步驟 103.. .電流偏差生成部 104.. .三角波產生電路 Sll,S13,S15,S17...步驟 1811,107...current detecting unit 20,106...bridge circuit 21-24...FET 17 201230665 25-28...diode 105...PWM generating circuit 30...DSP Id.. Detecting current value 31...comparing portion Ie...variation 32...proportional processing unit lei...current value integrated value 33...integral processing unit Ir...command current value 34...accumulation unit Kp ...proportional gain 35...determination unit Ret...sum total value 36...PWM signal generation unit α, P1-P3···point 102...D/A conversion unit S1, S3, S5, S7 , S9··. Step 103.. Current deviation generation unit 104.. Triangle wave generation circuit S11, S13, S15, S17... Step 18