TWI662781B - A motor controlling system and method thereof - Google Patents

A motor controlling system and method thereof Download PDF

Info

Publication number
TWI662781B
TWI662781B TW107111022A TW107111022A TWI662781B TW I662781 B TWI662781 B TW I662781B TW 107111022 A TW107111022 A TW 107111022A TW 107111022 A TW107111022 A TW 107111022A TW I662781 B TWI662781 B TW I662781B
Authority
TW
Taiwan
Prior art keywords
motion
unit
driving signal
motor
motor control
Prior art date
Application number
TW107111022A
Other languages
Chinese (zh)
Other versions
TW201943200A (en
Inventor
林逢傑
林家仁
許世昌
Original Assignee
東元電機股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 東元電機股份有限公司 filed Critical 東元電機股份有限公司
Priority to TW107111022A priority Critical patent/TWI662781B/en
Application granted granted Critical
Publication of TWI662781B publication Critical patent/TWI662781B/en
Publication of TW201943200A publication Critical patent/TW201943200A/en

Links

Landscapes

  • Control Of Position Or Direction (AREA)
  • Control Of Electric Motors In General (AREA)

Abstract

一種馬達控制系統,係用以傳送一驅動信號至一驅動裝置,藉以驅動一馬達,並包含一輸入模組與一運動控制器。輸入模組,係用以設定複數個運動控制參數,且運動控制參數至少包含一目標位置與一目標運動時間。運動控制器,係電性連接輸入模組,用以接收運動控制參數,依據至少一運算規則產生對應於一單位運動時間之一單位運動量,並依據至少一轉換規則產生一對應單位運動量之控制命令,再依據該控制命令產生該驅動信號。其中,單位運動時間係小於目標運動時間。 A motor control system is used to transmit a driving signal to a driving device to drive a motor, and includes an input module and a motion controller. The input module is used to set a plurality of motion control parameters, and the motion control parameters include at least a target position and a target motion time. A motion controller is an electronically connected input module for receiving motion control parameters, generating a unit motion amount corresponding to a unit motion time according to at least one operation rule, and generating a control command corresponding to a unit motion amount according to at least one conversion rule. , And then generate the driving signal according to the control command. The unit exercise time is shorter than the target exercise time.

Description

馬達控制系統及其方法 Motor control system and method

本發明係有關於一種馬達控制系統及其方法,尤其是指一種利用一單位時間之一單位運動量驅動馬達之馬達控制系統及其方法。 The present invention relates to a motor control system and method, and more particularly to a motor control system and method for driving a motor by using a unit of motion per unit time and a unit of motion.

大多數的機械系統需要進行運動軌跡規劃,如CNC工具機、機械手臂、鑽孔機、雕刻機、繪圖機等,上述機具基本上都是多軸運動控制,在控制多軸系統的情況下,多顆馬達的相互移動、運動路徑的產生、移動速度及加減速的規畫等都相當重要。因此,因應上述需求,運動控制器自然而然成為系統的核心控制單元。運動控制器主要是接收了使用者傳來的運動資料,並將這些資料轉換成馬達驅動器的輸入訊號,進而控制馬達以及機械系統的運動軌跡。 Most mechanical systems require motion trajectory planning, such as CNC machine tools, robot arms, drilling machines, engraving machines, plotters, etc. The above-mentioned tools are basically multi-axis motion control. In the case of controlling a multi-axis system, The mutual movement of multiple motors, the generation of motion paths, the speed of movement, and the planning of acceleration and deceleration are all very important. Therefore, in response to the above requirements, the motion controller naturally becomes the core control unit of the system. The motion controller mainly receives the motion data from the user, and converts these data into input signals of the motor driver, and then controls the motion trajectory of the motor and the mechanical system.

一般常見的運動控制器為數位差分分析器(Digital Differential Analyzer;DDA),數位差分分析器是接收一目標位置,並依據一目標時間,運算產生一脈衝驅動信號,藉以驅動一馬達。 A common motion controller is a Digital Differential Analyzer (DDA). The digital differential analyzer receives a target position and calculates a pulse driving signal according to a target time to drive a motor.

然而,先前技術使用數位差分分析器需要較長的運算時間來產生脈衝,而且若在運算時間內有新的目標位置,也需要等待前一次運算時間結束,並再等候一次運算時間依據新的目標位置進行運算,才能產生對應新的目標位置的脈衝驅動信號,容易導致命令切換時,產生的脈衝驅動信號會有所延遲或是誤差。 However, the prior art uses a digital differential analyzer that requires a longer calculation time to generate a pulse, and if there is a new target position within the calculation time, it also needs to wait for the previous calculation time to end and wait for another calculation time according to the new target Only when the position is calculated, the pulse driving signal corresponding to the new target position can be generated. When the command is switched, the pulse driving signal generated will be delayed or error.

有鑒於在先前技術中,數位差分分析器需要較長的運算時間,容易導致命令切換時,造成脈衝驅動信號會有所延遲或誤差。本發明之一主要目的係提供一種馬達控制系統與馬達控制方法,以解決先前技術所衍生出的問題。 In view of the fact that in the prior art, the digital differential analyzer requires a long operation time, which may easily cause a delay or error in the pulse driving signal when the command is switched. One of the main objectives of the present invention is to provide a motor control system and a motor control method to solve the problems derived from the prior art.

本發明為解決先前技術之問題,所採用之必要技術手段為提供一種馬達控制系統,用以傳送一驅動信號至一驅動裝置,藉以驅動一馬達,並包含一輸入模組與一運動控制器。 In order to solve the problems of the prior art, the present invention adopts a necessary technical means to provide a motor control system for transmitting a driving signal to a driving device to drive a motor, and includes an input module and a motion controller.

輸入模組,係用以設定複數個運動控制參數,且運動控制參數至少包含一目標位置與一目標運動時間。 The input module is used to set a plurality of motion control parameters, and the motion control parameters include at least a target position and a target motion time.

運動控制器,係電性連接上述輸入模組,用以接收上述運動控制參數,依據至少一運算規則產生對應於一單位運動時間之一單位運動量,並依據至少一轉換規則產生一對應單位運動量之控制命令,再依據控制命令產生上述驅動信號。 The motion controller is electrically connected to the input module to receive the motion control parameters, generate a unit motion amount corresponding to a unit motion time according to at least one operation rule, and generate a corresponding unit motion amount according to at least one conversion rule. The control command generates the driving signal according to the control command.

其中,上述單位運動時間係小於上述目標運動時間。 The unit exercise time is shorter than the target exercise time.

在上述必要技術手段的基礎下,本發明所衍生之一附屬技術手段為使上述單位運動量,係小於上述目標位置。 On the basis of the above-mentioned necessary technical means, one subsidiary technical means derived from the present invention is to make the above-mentioned unit movement amount smaller than the above-mentioned target position.

在上述必要技術手段的基礎下,本發明所衍生之一附屬技術手段為使上述至少一運算規則,係一加加速度直線運動公式。 Based on the above-mentioned necessary technical means, one of the subsidiary technical means derived from the present invention is to make the above-mentioned at least one operation rule be a jerk linear motion formula.

在上述必要技術手段的基礎下,本發明所衍生之一附屬技術手段為使上述至少一轉換規則,係一對照表,且對照表係顯示上述單位運動量與一脈衝邊緣變化量之對應關係。 Based on the above-mentioned necessary technical means, one of the subsidiary technical means derived from the present invention is to make the above at least one conversion rule a comparison table, and the comparison table shows the correspondence between the unit motion amount and a pulse edge change amount.

在上述必要技術手段的基礎下,本發明所衍生之一附屬技術手段為使上述運動控制器,係依據上述單位運動量所對應之該脈衝邊緣變化量,產生上述控制命令。 Based on the above-mentioned necessary technical means, one of the subsidiary technical means derived from the present invention is to enable the motion controller to generate the control command according to the pulse edge change amount corresponding to the unit motion amount.

在上述必要技術手段的基礎下,本發明所衍生之一附屬技術手段為使馬達控制系統,更包含:一轉換模組,且轉換模組係電性連接上述輸入模組與上述運動控制器,用以接收上述運動控制參數,並將上述運動控制參數轉換成二進位格式。 Based on the above-mentioned necessary technical means, a subsidiary technical means derived from the present invention is to make the motor control system further include: a conversion module, and the conversion module is electrically connected to the input module and the motion controller. It is used to receive the motion control parameters and convert the motion control parameters into a binary format.

在上述必要技術手段的基礎下,本發明所衍生之一附屬技術手段為使馬達控制系統中之運動控制器,更包含:一記憶模組,且記憶模組係用以儲存上述運算規則與上述轉換規則。 Based on the above-mentioned necessary technical means, a subsidiary technical means derived from the present invention is a motion controller in a motor control system, which further includes: a memory module, and the memory module is used to store the above-mentioned calculation rules and the above Conversion rules.

在上述必要技術手段的基礎下,本發明所衍生之一附屬技術手段為使馬達控制系統中之運動控制器,更包含:一脈衝輸出模組,且脈衝輸出模組係用以依據上述控制命令產生上述驅動信號,且上述驅動信號係一脈衝驅動信號。 Based on the above-mentioned necessary technical means, a subsidiary technical means derived from the present invention is to make a motion controller in a motor control system, further including: a pulse output module, and the pulse output module is used to control the above-mentioned control commands. The driving signal is generated, and the driving signal is a pulse driving signal.

本發明並提供一種馬達控制方法,使用一輸入模組與一運動控制器,並包含以下步驟:(a)利用輸入模組,設定複數個運動控制參數,且運動控制參數至少包含一目標位置與一目標運動時間;(b)利用運動控制器,接收運動控制參數,並依據至少一運算規則,產生對應於一單位運動時間之一單位運動量;(c)利用運動控制器,依據至少一轉換規則,產生一對應單位運動量之控制命令;(d)利用運動控制器,依據控制命令產生一驅動信號;以及(e)利用運動控制器,傳送驅動係號至一驅動裝置,藉以驅動一馬達。 The invention also provides a motor control method, which uses an input module and a motion controller and includes the following steps: (a) using the input module to set a plurality of motion control parameters, and the motion control parameters include at least a target position and A target exercise time; (b) using a motion controller to receive motion control parameters and generating a unit amount of motion corresponding to a unit of motion time according to at least one operation rule; (c) using a motion controller according to at least one conversion rule To generate a control command corresponding to the amount of unit motion; (d) use a motion controller to generate a drive signal according to the control command; and (e) use the motion controller to transmit a drive number to a drive device to drive a motor.

在上述必要技術手段的基礎下,本發明所衍生之一附屬技術手段為使馬達控制方法,更包含以下步驟:利用運動控制器判斷驅動信號係一無變化量驅動信號,係產生一基本速度驅動信號,並傳送至驅動裝置。 Based on the above-mentioned necessary technical means, one of the subsidiary technical means derived from the present invention is a method for controlling a motor, which further includes the following steps: using a motion controller to determine that the driving signal is a drive signal without a change amount and generating a basic speed drive The signal is transmitted to the drive.

承上所述,本發明所提供之馬達控制系統及其方法,係利用運動控制器依據運算規則以及轉換規則產生一對應單位運動時間與單位運動量之驅動信號,其中單位運動時間係小於目標運動時間。因此,可以縮短所需的運算時間,若接收到新的目標位置,運動控制器可即時的進行新的目標位置的運算、轉換並產生新的 驅動信號,藉以解決先前技術中,切換新的目標位置可能造成驅動信號的延遲或誤差。 As mentioned above, the motor control system and method provided by the present invention use a motion controller to generate a driving signal corresponding to a unit motion time and a unit motion amount according to an operation rule and a conversion rule. The unit motion time is less than the target motion time . Therefore, the required calculation time can be shortened. If a new target position is received, the motion controller can immediately perform calculations, conversions and generate new target positions. The driving signal is used to solve the problem that in the prior art, switching to a new target position may cause a delay or error in the driving signal.

1、1a‧‧‧馬達控制系統 1.1a‧‧‧motor control system

11‧‧‧輸入模組 11‧‧‧input module

12、12a‧‧‧運動控制器 12, 12a‧‧‧ Motion Controller

121a‧‧‧處理模組 121a‧‧‧Processing Module

122a‧‧‧記憶模組 122a‧‧‧Memory Module

123a‧‧‧脈衝輸出模組 123a‧‧‧Pulse output module

13a‧‧‧轉換模組 13a‧‧‧ Conversion Module

2‧‧‧驅動裝置 2‧‧‧Drive

3‧‧‧馬達 3‧‧‧ Motor

S0‧‧‧初始位置 S 0 ‧‧‧ initial position

S1‧‧‧第一位置 S 1 ‧‧‧ first position

S2‧‧‧第二位置 S 2 ‧‧‧ second position

Sn‧‧‧目標位置 S n ‧‧‧ target position

T0‧‧‧初始時間 T 0 ‧‧‧ initial time

T1‧‧‧第一時間 T 1 ‧‧‧ the first time

T2‧‧‧第二時間 T 2 ‧‧‧ second time

Tn‧‧‧目標運動時間 T n ‧‧‧ target exercise time

△T‧‧‧單位運動時間 △ T‧‧‧Unit exercise time

△Si、△S1、△S2‧‧‧單位運動量 △ S i , △ S 1 , △ S 2 ‧‧‧Unit exercise amount

第一圖係顯示本發明一實施例所提供之馬達控制系統及其方法之系統方塊圖;第二圖係顯示本發明一實施例所提供之馬達控制系統及其方法之位置一時間圖;第三圖係顯示本發明一實施例所提供之馬達控制系統及其方法之方法流程圖;第四圖係顯示本發明另一實施例所提供之馬達控制系統及其方法之系統方塊圖;第五圖係顯示本發明另一實施例所提供之馬達控制系統及其方法之方法流程圖;以及第六A圖與第六B圖係顯示本發明另一實施例所提供之馬達控制系統及其方法之脈衝驅動信號示意圖。 The first diagram is a system block diagram showing a motor control system and method provided by an embodiment of the present invention; the second diagram is a location-time diagram showing a motor control system and method provided by an embodiment of the present invention; The third diagram is a method flowchart of the motor control system and method provided by one embodiment of the present invention; the fourth diagram is a system block diagram of the motor control system and method provided by another embodiment of the present invention; FIG. 6 is a method flowchart showing a motor control system and a method thereof according to another embodiment of the present invention; and FIGS. 6A and 6B are a motor control system and a method thereof according to another embodiment of the present invention Schematic diagram of pulse drive signal.

請參閱第一圖至第三圖,其中,第一圖係顯示本發明一實施例所提供之馬達控制系統及其方法之系統方塊圖;第二圖係顯示本發明一實施例所提供之馬達控制系統及其方法之位置一時間圖;以及,第三圖係顯示本發明一實施例所提供之馬達控制系統及其方法之方法流程圖。如圖所示,一種馬達控制系統1係用以傳送 一驅動信號至一驅動裝置2,並藉由驅動裝置2驅動一馬達3,且馬達控制系統1並包含一輸入模組11與一運動控制器12。 Please refer to the first diagram to the third diagram, wherein the first diagram is a system block diagram showing a motor control system and method provided by an embodiment of the present invention; the second diagram is a motor diagram provided by an embodiment of the present invention A location-time diagram of the control system and its method; and the third diagram is a method flowchart of the motor control system and its method provided by an embodiment of the present invention. As shown, a motor control system 1 is used to transmit A driving signal is sent to a driving device 2, and a motor 3 is driven by the driving device 2. The motor control system 1 includes an input module 11 and a motion controller 12.

輸入模組11,用以設定複數個運動控制參數,而運動控制參數中至少包含一目標位置Sn與一目標運動時間Tn。輸入模組11可為一電腦、一手機、一鍵盤等可輸入運動控制參數的裝置。 An input module 11 for setting a plurality of motion control parameters, and motion control parameters include at least a target position S n and a target movement time T n. The input module 11 may be a computer, a mobile phone, a keyboard and other devices that can input motion control parameters.

運動控制器12,係電性連接輸入模組11,用以接收運動控制參數,並依據至少一運算規則產生對應於一單位運動時間△T之一單位運動量△Si,i=1至n,對應至不同之運動時點,△S1係對應到一第一時間T1與一初始時間T0的單位運動時間△T,並且使馬達3自一初始位置S0移動至一第一位置S1,△S2係對應到一第二時間T2與第一時間T1的單位運動時間△T,並且使馬達3自第一位置S1移動至一第二位置S2。在此需說明的是,實際上每一個單位運動時間△T所對應到的單位運動量不一定會相同,不同的單位運動時間△T所對應到的單位運動量係以△S1、△S2…作為區別,如第二圖所示,單位運動量△Si則是作為一個統稱,以利於理解本發明。 The motion controller 12 is electrically connected to the input module 11 for receiving motion control parameters and generating a unit motion amount ΔS i corresponding to a unit motion time ΔT according to at least one operation rule, i = 1 to n, Corresponding to different time points of movement, ΔS 1 corresponds to a unit movement time ΔT of a first time T 1 and an initial time T 0 , and moves the motor 3 from an initial position S 0 to a first position S 1 ΔS 2 corresponds to a unit movement time ΔT of a second time T 2 and a first time T 1 , and the motor 3 is moved from the first position S 1 to a second position S 2 . It should be noted here that in fact, the unit exercise amount corresponding to each unit exercise time ΔT may not be the same. The unit exercise amount corresponding to different unit exercise time △ T is △ S 1 , △ S 2 … As a difference, as shown in the second figure, the unit movement amount ΔS i is used as a collective term to facilitate understanding of the present invention.

運動控制器12依據至少一轉換規則,產生一對應單位運動量△Si的控制命令,再依據控制命令產生驅動信號,並將驅動信號傳送至驅動裝置2以驅動馬達3。因控制命令通常是一個數位信號,無法直接驅動馬達。因此,本實施例係依據控制命令轉換成驅動裝置2可解讀的驅動信號傳送至驅動裝置2,以驅動馬達3轉 動。就一實施例而言,驅動信號可為一脈衝驅動信號。 The motion controller 12 generates a control command corresponding to the unit motion amount ΔS i according to at least one conversion rule, generates a driving signal according to the control command, and transmits the driving signal to the driving device 2 to drive the motor 3. Because the control command is usually a digital signal, the motor cannot be driven directly. Therefore, in this embodiment, the driving signal that can be interpreted by the driving device 2 is transmitted to the driving device 2 according to the control command to drive the motor 3 to rotate. According to an embodiment, the driving signal may be a pulse driving signal.

在第一實施例中,運動控制器12係一現場可程式閘陣列(Field Programmable Gate Array;FPGA)晶片,但不以此為限。在另一實施例中,運動控制器12可為一數位訊號處理器(Digital Signal Processor;DSP)。前述運算規則與轉換規則可以內建於運動控制器12內,亦可儲存於一記憶單元。 In the first embodiment, the motion controller 12 is a Field Programmable Gate Array (FPGA) chip, but it is not limited thereto. In another embodiment, the motion controller 12 may be a digital signal processor (DSP). The foregoing calculation rules and conversion rules may be built in the motion controller 12 or stored in a memory unit.

如第二圖所示,運動控制器12演算出的每一小段單位運動量△Si(即△S1、△S2…)全部相加,會使馬達在目標運動時間Tn自一初始位置S0移動至目標位置Sn。由於本實施例運算單位運動量△Si所需之單位運動時間△T(可視為運動控制器12的內建運算時間)小於目標運動時間Tn,因此,若在目標運動時間Tn內,有新的目標位置或是接收到新的運動控制參數,本實施例之運動控制器12可即時的進行新的運算產生新的單位運動量△Si,以配合新的目標位置並在目標運動時間Tn到達新的目標位置。而不會像先前技術一樣,需要先在目標運動時間Tn移動到目標位置Sn後,再去產生由目標位置Sn移動到新的目標位置的驅動信號。因此,本實施例有助於避免傳統馬達控制系統及其方法所造成之驅動信號的延遲甚至是誤差等問題。 As shown in the second figure, each small amount of unit motion amount ΔS i calculated by the motion controller 12 (that is, ΔS 1 , ΔS 2 …) is all added up, which will cause the motor to move from an initial position at the target motion time T n S 0 is moved to the target position S n. Since the unit exercise time ΔT (which can be regarded as the built-in calculation time of the motion controller 12) required to calculate the unit exercise amount ΔS i in this embodiment is smaller than the target exercise time T n , if there is within the target exercise time T n , A new target position or a new motion control parameter is received. The motion controller 12 in this embodiment can perform a new calculation in real time to generate a new unit motion amount ΔS i to match the new target position and the target motion time T. n Reach the new target position. And not as the prior art, as the need to move the target movement time T n S n to the target position, again generates a drive signal S n by the target position move to the new target position. Therefore, this embodiment helps to avoid problems such as delays or even errors in driving signals caused by conventional motor control systems and methods.

如第三圖所示,本發明之一實施例提供一種馬達控制方法,此馬達控制方法係利用第一圖之馬達控制系統1,此馬達控制系統1包含包含一輸入模組11與一運動控制器12。此馬達控制方法包含以下步驟S101至 S105。 As shown in the third figure, an embodiment of the present invention provides a motor control method. The motor control method uses the motor control system 1 of the first figure. The motor control system 1 includes an input module 11 and a motion control.器 12。 12. This motor control method includes the following steps S101 to S105.

步驟S101:利用輸入模組11,設定複數個運動控制參數,且該些運動控制參數至少包含一目標位置與一目標運動時間。 Step S101: Use the input module 11 to set a plurality of motion control parameters, and the motion control parameters include at least a target position and a target motion time.

步驟S102:利用運動控制器12,接收該些運動控制參數,並依據至少一運算規則,產生對應於一單位運動時間之一單位運動量。 Step S102: Use the motion controller 12 to receive the motion control parameters, and generate a unit motion amount corresponding to a unit motion time according to at least one operation rule.

步驟S103:利用運動控制器12,依據至少一轉換規則,產生一對應該單位運動量之控制命令。 Step S103: Use the motion controller 12 to generate a pair of control commands corresponding to the unit motion amount according to at least one conversion rule.

步驟S104:利用運動控制器12,依據該控制命令產生一驅動信號。 Step S104: Use the motion controller 12 to generate a driving signal according to the control command.

步驟S105:利用運動控制器12,傳送該驅動信號至一驅動裝置,藉以驅動一馬達。 Step S105: Use the motion controller 12 to transmit the driving signal to a driving device to drive a motor.

步驟S101係利用輸入模組11設定複數個運動控制參數,而運動控制參數至少包含一目標位置(如第二圖中之Sn)與一目標運動時間(如第二圖中之Tn)。 Step S101 is to use the input module 11 to set a plurality of motion control parameters, and the motion control parameters include at least a target position (such as Sn in the second figure) and a target motion time (such as Tn in the second figure).

步驟S102係利用運動控制器12依據運算規則,運算出對應於一單位運動時間(如第二圖中之△T)之一單位運動量(如第二圖中之△Si、△S1、△S2…)。此運動控制器12可以是一FPGA晶片。又,就一較佳實施例而言,運動控制器12係依據加加速度直線運動公式,將運動控制參數演算出單位運動量。 Step S102 is to use the motion controller 12 to calculate a unit motion amount (such as △ S i , △ S 1 , △) corresponding to a unit of exercise time (such as △ T in the second figure) according to the calculation rule. S 2 …). The motion controller 12 may be an FPGA chip. Moreover, in a preferred embodiment, the motion controller 12 calculates a unit motion amount based on the jerk linear motion formula.

步驟S103係利用運動控制器12,依據轉換規則,產生一對應該單位運動量之控制命令,轉換規則可以內建於運動控制器12內,亦可儲存於一記憶單元。 Step S103 is to use the motion controller 12 to generate a pair of control commands corresponding to the unit motion amount according to the conversion rule. The conversion rule may be built in the motion controller 12 or stored in a memory unit.

步驟S104係利用運動控制器12,依據控制命令產生驅動信號,因運動控制器12運算出來的單位運動量△Si與控制命令並無法直接驅動馬達3,所以,運動控制器12需再將控制命令轉換成一可與驅動裝置2溝通的驅動信號。 Step S104 uses the motion controller 12 to generate a driving signal according to the control command. Because the unit motion amount ΔSi and the control command calculated by the motion controller 12 cannot directly drive the motor 3, the motion controller 12 needs to convert the control command again. A driving signal that can be communicated with the driving device 2 is formed.

最後,步驟S105係利用運動控制器12傳送驅動信號至驅動裝置2,以驅動馬達3,進而完成馬達控制。 Finally, in step S105, the motion controller 12 is used to transmit a driving signal to the driving device 2 to drive the motor 3, thereby completing the motor control.

請參閱第四圖至第六B圖,其中,第四圖係顯示本發明另一實施例所提供之馬達控制系統及其方法之系統方塊圖;第五圖係顯示本發明另一實施例所提供之馬達控制系統及其方法之方法流程圖;以及,第六A圖與第六B圖係顯示本發明另一實施例所提供之馬達控制系統及其方法之脈衝驅動信號示意圖。如圖所示,一種馬達控制系統1a係用以傳送一驅動信號至如第一實施例中之驅動裝置2,以驅動如第一實施例中之馬達3,馬達控制系統1a並包含一輸入模組11、一運動控制器12a與一轉換模組13a,其中,輸入模組11與第一實施例中相同,故不多加贅述。 Please refer to FIGS. 4 to 6B, wherein the fourth diagram is a system block diagram showing a motor control system and method provided by another embodiment of the present invention; and the fifth diagram is a diagram showing another embodiment of the present invention. The method flowchart of the provided motor control system and method; and FIG. 6A and FIG. 6B are schematic diagrams showing pulse driving signals of the motor control system and method provided by another embodiment of the present invention. As shown in the figure, a motor control system 1a is used to transmit a driving signal to the driving device 2 as in the first embodiment to drive the motor 3 as in the first embodiment. The motor control system 1a includes an input mode. Group 11, a motion controller 12a, and a conversion module 13a. Among them, the input module 11 is the same as that in the first embodiment, so it will not be described in detail.

轉換模組13a係電性連接輸入模組11與運動控制器12a,用以將輸入模組11設定的運動控制參數轉換成二進位格式,以利運動控制器12a的運算。轉換模組13a可內嵌於輸入模組11,也可內嵌於運動控制器12a,也可如第四圖所示自成一個模組方塊。 The conversion module 13a is electrically connected to the input module 11 and the motion controller 12a, and is used to convert the motion control parameters set by the input module 11 into a binary format to facilitate the calculation of the motion controller 12a. The conversion module 13a may be embedded in the input module 11, or may be embedded in the motion controller 12a, or may be a module block as shown in the fourth figure.

運動控制器12a更包含一處理模組121a、 一記憶模組122a與一脈衝輸出模組123a。記憶模組122a用以儲存至少一運算規則與至少一轉換規則,在本實施例中,運算規則係一加加速度直線運動公式,轉換規則係一對照表顯示單位運動量△Si與脈衝邊緣變化量之對應關係。記憶模組122a可為一記憶晶片。 The motion controller 12a further includes a processing module 121a, a memory module 122a, and a pulse output module 123a. The memory module 122a is used to store at least one operation rule and at least one conversion rule. In this embodiment, the operation rule is a jerk linear motion formula, and the conversion rule is a look-up table showing the unit movement amount ΔS i and the pulse edge change amount. Corresponding relationship. The memory module 122a may be a memory chip.

處理模組121a係接收經由轉換模組13a轉換後的運動控制參數,並依據記憶模組122a中之運算規則,產生對應一單位運動時間△T(標示於第二圖)之一單位運動量△Si(標示於第二圖)。並依據轉換規則,將單位運動量△Si轉換成一數位資料,此數位資料具有一預設位元長度,隨後再依據此數位資料產生一對應單位運動量△Si之控制命令,控制命令係此數位資料所對應到的脈衝邊緣變化量。 The processing module 121a receives the motion control parameters converted by the conversion module 13a, and generates a unit exercise amount △ S corresponding to a unit exercise time △ T (labeled in the second figure) according to the calculation rules in the memory module 122a. i (labeled in the second figure). According to the conversion rule, the unit movement amount △ S i is converted into a digital data, the digital data has a preset bit length, and then a control command corresponding to the unit movement amount △ S i is generated according to the digital data. The amount of pulse edge change corresponding to the data.

最後,再利用脈衝輸出模組123a,依據控制命令產生一驅動信號,此驅動信號與第一實施例不同之處在於是一脈衝驅動信號,並傳送至驅動裝置2,以驅動馬達3。 Finally, the pulse output module 123a is used to generate a driving signal according to the control command. This driving signal is different from the first embodiment in that it is a pulse driving signal and is transmitted to the driving device 2 to drive the motor 3.

如第五圖所示,本發明之另一實施例提供一種馬達控制方法,此馬達控制方法係用於第四圖之馬達控制系統1a,並包含以下步驟S201至S207。步驟S201與第一實施例之步驟S101相同,故不多加說明。 As shown in the fifth figure, another embodiment of the present invention provides a motor control method. The motor control method is used in the motor control system 1a of the fourth figure, and includes the following steps S201 to S207. Step S201 is the same as step S101 of the first embodiment, so it will not be described further.

步驟S202係利用轉換模組13a,接收運動控制參數,並將運動控制參數轉換成利於運動控制器12a進行運算的格式,例如:二進位格式。 Step S202 is to use the conversion module 13a to receive the motion control parameters, and convert the motion control parameters into a format that is convenient for the operation of the motion controller 12a, such as a binary format.

步驟S203至步驟S205與第一實施例中之 步驟S102與S103大致相同,差異在於自第一實施例中的運動控制器12改成由第二實施例中運動控制器12a內部的處理模組121a、記憶模組122a執行步驟。 Steps S203 to S205 are the same as those in the first embodiment. Steps S102 and S103 are substantially the same, except that the motion controller 12 in the first embodiment is changed to the processing module 121a and the memory module 122a inside the motion controller 12a in the second embodiment to perform the steps.

步驟S206係利用脈衝輸出模組123a接收控制命令,並據以產生一驅動信號,此驅動信號與前述實施例中的差異在於,此驅動信號為一脈衝驅動信號。並傳送驅動信號至驅動裝置2以驅動馬達3,完成步驟S207。 Step S206 is to use the pulse output module 123a to receive the control command and generate a driving signal accordingly. The driving signal is different from the foregoing embodiment in that the driving signal is a pulse driving signal. The driving signal is transmitted to the driving device 2 to drive the motor 3, and step S207 is completed.

接著,將以實際數值舉例說明,設定複數個運動控制參數包含加加速度=1、加速度=10、速度=100、目標位置=1000,初始加速度=0、初始速度=0、初始位置=0、單位運動時間=2、QX,Y格式=Q32,24與最多脈衝邊緣變化量=3。QX,Y格式為一種二進位格式,用以決定單位運動量△Si轉換成二進位格式後的位元數,其中X=32表示總位元數為32位元,Y=24表示代表小數的位元數有24位元。請一併參閱第二圖、第四圖至第六B圖。因我們對於十進位格式較為熟悉,但是馬達控制系統實際上運算係利用二進位格式,故以下說明會一併使用十進位格式與二進位格式,二進位格式是為了呈現馬達控制系統的實際運算情況,十進位格式則是為了利於理解本發明。 Next, the actual value will be used as an example to illustrate the setting of multiple motion control parameters including jerk = 1, acceleration = 10, speed = 100, target position = 1000, initial acceleration = 0, initial speed = 0, initial position = 0, unit Movement time = 2, QX, Y format = Q32,24 and maximum pulse edge change = 3. The QX, Y format is a binary format used to determine the number of bits after the unit amount of motion △ S i is converted to a binary format, where X = 32 means the total number of bits is 32 bits, and Y = 24 means the decimal number The number of bits is 24 bits. Please refer to the second picture, the fourth picture to the sixth picture B together. Because we are familiar with the decimal format, but the motor control system actually uses the binary format, so the following description will use the decimal format and the binary format together. The binary format is to show the actual operation of the motor control system. The decimal format is to facilitate understanding of the present invention.

轉換模組13a將上述運動控制參數轉換成二進位格式,除了QX,Y格式與最多脈衝邊緣變化量,處理模組121a依據加加速度直線運動公式,將上述運動控制參數運算出一單位運動量△Si的十進位格式為221.333 循環小數,在Q32,24格式下的值為01101001001010101010101010101011。 The conversion module 13a converts the above-mentioned motion control parameters into a binary format. In addition to the QX, Y format and the maximum pulse edge change amount, the processing module 121a calculates the above-mentioned motion control parameter to a unit amount of motion according to the jerk linear motion formula The decimal format is 221.333 Cyclic decimal. The value in Q32,24 format is 01101001001010101010101010101011.

處理模組121a係依據轉換規則,轉換規則如下:1.最多只能有(2n-1)個脈衝邊緣變化量。2.QX,Y格式中,脈衝邊緣變化的主導位元為第(Y-1)至(Y+(n-1))位元。3.如下表(一)。 The processing module 121a is based on the conversion rules. The conversion rules are as follows: 1. There can be at most (2 n -1) pulse edge changes. 2. In the QX, Y format, the dominant bit of the pulse edge change is the (Y-1) to (Y + (n-1)) bit. 3. The following table (1).

表(一)係一單位運動量△Si主導位元之對應數值與脈衝邊緣變化量的對照表。依據上述轉換規則,可知因為最多脈衝邊緣變化量=3,因此n=2,主導脈衝邊緣變化的位元為第(24-1)至(24+(2-1))位元,即第23至25位元,單位運動量△Si在Q32,24格式中的第23至25位元(即主導位元)為101,對應到十進位格式的 數值為5(即22+1),此數值對應之脈衝邊緣變化量為-3,表示控制命令為控制馬達3沿負方向轉動3格,並依據控制命令產生脈衝驅動信號,使驅動裝置2驅動馬達3負方向轉動3格,即為第六A圖所顯示的脈衝驅動信號。脈衝邊緣變化量表示脈衝的切換次數,如圖所示,脈衝驅動信號係依序自輸出邏輯1切換至0、再從0切換至1、最後從1切換至0,共切換3次,表示脈衝邊緣變化量為3,因為第一次切換係自大(1)切換至小(0),故為負方向。而第六B圖係顯示正方向轉動3格之脈衝驅動信號,因為第一次切換係自小(0)切換至大(1),故為正方向。 Table (1) is a comparison table between the corresponding value of the unit motion amount △ Si dominant bit and the pulse edge change amount. According to the above conversion rule, it can be known that because the maximum pulse edge change amount = 3, so n = 2, the bit that dominates the pulse edge change is the (24-1) to (24+ (2-1)) bit, that is, the 23rd bit To 25 bits, the unit movement amount △ S i in Q32, 24 format is the 23rd to 25th bits (that is, the dominant bit) is 101, and the value corresponding to the decimal format is 5 (that is, 2 2 +1). The value corresponding to the change of the pulse edge is -3, which indicates that the control command is to control the motor 3 to rotate 3 spaces in the negative direction, and generate a pulse driving signal according to the control command, so that the driving device 2 drives the motor 3 to rotate 3 spaces in the negative direction, which is the first Pulse driving signal shown in Figure 6A. The pulse edge change amount indicates the number of pulse switching. As shown in the figure, the pulse driving signal is sequentially switched from the output logic 1 to 0, then from 0 to 1, and finally from 1 to 0. It is switched 3 times in total, indicating the pulse. The amount of edge change is 3, because the first switching is switched from large (1) to small (0), so it is negative. The sixth diagram B shows a pulse driving signal that rotates by 3 divisions in the positive direction. Since the first switching is switched from small (0) to large (1), it is a positive direction.

在此需特別說明的是,表(一)係適用於n=2時,不過,本發明不限於此。基本上,表(一)可分成三個區間,第一個區間的單位運動量△Si主導位元之對應數值係自0、1、2…遞增至(2n-1),對應的脈衝邊緣變化量係自0、+1、+2…遞增至+(2n-1)。第二個區間的單位運動量△Si主導位元之對應數值為2n,此時對應的脈衝邊緣變化量為0。第三個區間的單位運動量△Si主導位元之對應數值係自(2n+1)、(2n+2)…遞增至(2n+2n-1),此時,對應的脈衝邊緣變化量係自-(2n-1)遞增至-1。 It should be particularly noted here that Table (1) is applicable when n = 2, but the present invention is not limited thereto. Basically, table (1) can be divided into three intervals. The corresponding value of the unit motion amount △ S i in the first interval increases from 0, 1, 2 ... to (2 n -1), and the corresponding pulse edge The amount of change is from 0, +1, +2 ... to + (2 n -1). The corresponding value of the unit motion amount ΔS i in the second interval is 2 n , and the corresponding pulse edge change amount is 0 at this time. The corresponding value of the unit motion amount △ S i in the third interval increases from (2 n +1), (2 n +2) ... to (2 n +2 n -1). At this time, the corresponding pulse The amount of edge change increases from-(2 n -1) to -1.

針對第三個區間的對應關係做更詳細的說明,當單位運動量△Si主導位元之對應數值係(2n+1)時,對應到的脈衝邊緣變化量為-(2n-1),在此可將(2n+1)等同於(2n+1-2n+1),再等同於(2n+1-(2n-1))。 因此,脈衝邊緣變化量為-(2n-1)係對應到單位運動量△Si主導位元之對應數值的後半部。其他單位運動量△Si與脈衝邊緣變化量的對應關係依此類推。 The corresponding relationship of the third interval is explained in more detail. When the corresponding numerical system of the unit motion amount △ S i is (2 n +1), the corresponding pulse edge change is-(2 n -1) Here, (2 n +1) can be equated to (2 n + 1 -2 n +1), and then equal to (2 n + 1- (2 n -1)). Therefore, the pulse edge change amount of-(2 n -1) corresponds to the second half of the corresponding value of the dominant bit of the unit motion amount ΔS i . The corresponding relationship between the other unit motion amount ΔS i and the pulse edge change amount can be deduced by analogy.

再以實際數值舉例說明,運動控制參數皆與上述數值相同,運算規則與轉換規則也相同,唯一差異在於單位運動時間=1。依此單位運動時間運算出的單位運動量△Si主導位元為100,對應數值為4,對應表(一)脈衝邊緣變化量為0,表示脈衝驅動信號不會使驅動裝置2驅動馬達3,當運動控制器12a判斷脈衝變化量為0時,係產生一基本速度驅動信號,使驅動裝置2驅動馬達3以一對應基本速度驅動信號之最低速度轉動。 The actual value is used as an example to illustrate that the motion control parameters are the same as the above values, and the calculation rules and conversion rules are also the same. The only difference is that the unit motion time = 1. The unit movement amount ΔS i calculated based on this unit movement time is 100, and the corresponding value is 4, and the corresponding table (1) The pulse edge change is 0, which means that the pulse driving signal will not cause the driving device 2 to drive the motor 3, When the motion controller 12a determines that the pulse change amount is 0, a basic speed driving signal is generated, so that the driving device 2 drives the motor 3 to rotate at a minimum speed corresponding to the basic speed driving signal.

綜上所述,本發明所提供之馬達控制系統及其方法係利用輸入模組設定運動控制參數,以及運動控制器依據運算規則與轉換規則產生驅動信號,並將驅動信號傳送至驅動裝置,以驅動馬達。 In summary, the motor control system and method provided by the present invention use an input module to set motion control parameters, and the motion controller generates driving signals according to calculation rules and conversion rules, and transmits the driving signals to the driving device to Drive motor.

相較於先前技術,本發明所提供之馬達控制系統及其方法,不會因為運動控制參數的改變,而造成驅動信號的延遲或誤差,取而代之的是利用單位運動時間小於目標運動時間的關係,而達到因應新的運動控制參數的即時運算,故不會造成驅動信號的延遲或誤差。 Compared with the prior art, the motor control system and method provided by the present invention will not cause the delay or error of the driving signal due to the change of the motion control parameters, and instead use the relationship that the unit motion time is less than the target motion time. The real-time calculation corresponding to the new motion control parameters is achieved, so there will be no delay or error in the drive signal.

藉由以上較佳具體實施例之詳述,係希望能更加清楚描述本發明之特徵與精神,而並非以上述所揭露的較佳具體實施例來對本發明之範疇加以限制。相反地,其目的是希望能涵蓋各種改變及具相等性的安排於本發明所欲申請之專利範圍的範疇內。 With the above detailed description of the preferred embodiments, it is hoped that the features and spirit of the present invention can be more clearly described, and the scope of the present invention is not limited by the preferred embodiments disclosed above. On the contrary, the intention is to cover various changes and equivalent arrangements within the scope of the patents to be applied for in the present invention.

Claims (9)

一種馬達控制系統,係用以傳送一驅動信號至一驅動裝置,藉以驅動一馬達,並包含:一輸入模組,用以設定複數個運動控制參數,該些運動控制參數至少包含一目標位置與一目標運動時間;以及一運動控制器,係電性連接該輸入模組,用以接收該些運動控制參數,依據一加加速度直線運動公式產生對應於一單位運動時間之一單位運動量,並依據至少一轉換規則產生一對應該單位運動量之控制命令,再依據該控制命令產生該驅動信號;其中,該單位運動時間係小於該目標運動時間。A motor control system is used to transmit a driving signal to a driving device to drive a motor, and includes: an input module for setting a plurality of motion control parameters, the motion control parameters include at least a target position and A target motion time; and a motion controller electrically connected to the input module for receiving the motion control parameters, generating a unit motion amount corresponding to a unit motion time according to a jerk linear motion formula, and based on At least one conversion rule generates a pair of control commands corresponding to the unit motion amount, and then generates the driving signal according to the control command; wherein the unit motion time is shorter than the target motion time. 如申請專利範圍第1項所述之馬達控制系統,其中,該單位運動量係小於該目標位置。The motor control system according to item 1 of the scope of patent application, wherein the unit motion amount is smaller than the target position. 如申請專利範圍第1項所述之馬達控制系統,其中,該至少一轉換規則係一對照表,且該對照表係顯示該單位運動量與一脈衝邊緣變化量之對應關係。The motor control system according to item 1 of the scope of patent application, wherein the at least one conversion rule is a comparison table, and the comparison table shows a correspondence relationship between the unit motion amount and a pulse edge change amount. 如申請專利範圍第3項所述之馬達控制系統,其中,該運動控制器係依據該單位運動量所對應之該脈衝邊緣變化量,產生該控制命令。The motor control system according to item 3 of the scope of patent application, wherein the motion controller generates the control command according to the pulse edge change amount corresponding to the unit motion amount. 如申請專利範圍第1項所述之馬達控制系統,更包含:一轉換模組,且該轉換模組係電性連接該輸入模組與該運動控制器,用以接收該些運動控制參數,並將該些運動控制參數轉換成二進位格式。The motor control system described in item 1 of the scope of patent application, further includes: a conversion module, and the conversion module is electrically connected to the input module and the motion controller to receive the motion control parameters, The motion control parameters are converted into a binary format. 如申請專利範圍第1項所述之馬達控制系統,其中,該運動控制器更包含:一記憶模組,且該記憶模組係用以儲存該至少一運算規則與該至少一轉換規則。The motor control system according to item 1 of the scope of patent application, wherein the motion controller further includes: a memory module, and the memory module is used to store the at least one operation rule and the at least one conversion rule. 如申請專利範圍第1項所述之馬達控制系統,其中,該運動控制器更包含:一脈衝輸出模組,該脈衝輸出模組係用以依據該控制命令產生該驅動信號,且該驅動信號係一脈衝驅動信號。The motor control system according to item 1 of the scope of patent application, wherein the motion controller further includes: a pulse output module, the pulse output module is used to generate the driving signal according to the control command, and the driving signal A pulse drive signal. 一種馬達控制方法,係使用一輸入模組與一運動控制器,並包含以下步驟:利用該輸入模組,設定複數個運動控制參數,且該些運動控制參數至少包含一目標位置與一目標運動時間;利用該運動控制器,接收該些運動控制參數,並依據一加加速度直線運動公式,產生對應於一單位運動時間之一單位運動量;利用該運動控制器,依據至少一轉換規則,產生一對應該單位運動量之控制命令利用該運動控制器,依據該控制命令產生一驅動信號;以及利用該運動控制器,傳送該驅動信號至一驅動裝置,藉以驅動一馬達。A motor control method uses an input module and a motion controller and includes the following steps: using the input module to set a plurality of motion control parameters, and the motion control parameters include at least a target position and a target motion Time; using the motion controller to receive the motion control parameters and generating a unit motion amount corresponding to a unit motion time according to a jerk linear motion formula; using the motion controller to generate a unit motion according to at least one conversion rule A control command corresponding to a unit motion amount uses the motion controller to generate a driving signal according to the control command; and uses the motion controller to transmit the driving signal to a driving device to drive a motor. 如申請專利範圍第8項所述之馬達控制方法,更包含以下步驟:利用該運動控制器判斷該驅動信號係一無變化量驅動信號,係產生一基本速度驅動信號,並傳送至該驅動裝置。According to the motor control method described in item 8 of the scope of patent application, the method further includes the following steps: using the motion controller to determine that the driving signal is a non-changing driving signal, generating a basic speed driving signal, and transmitting the driving signal to the driving device; .
TW107111022A 2018-03-29 2018-03-29 A motor controlling system and method thereof TWI662781B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107111022A TWI662781B (en) 2018-03-29 2018-03-29 A motor controlling system and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107111022A TWI662781B (en) 2018-03-29 2018-03-29 A motor controlling system and method thereof

Publications (2)

Publication Number Publication Date
TWI662781B true TWI662781B (en) 2019-06-11
TW201943200A TW201943200A (en) 2019-11-01

Family

ID=67764180

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107111022A TWI662781B (en) 2018-03-29 2018-03-29 A motor controlling system and method thereof

Country Status (1)

Country Link
TW (1) TWI662781B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103180791A (en) * 2010-10-13 2013-06-26 欧姆龙株式会社 Control device, control system and control method
CN104102226A (en) * 2013-04-08 2014-10-15 欧姆龙株式会社 Control system and control method
US20150061564A1 (en) * 2012-03-01 2015-03-05 Mitsubishi Electric Corporation Motor control device
TW201641233A (en) * 2015-04-30 2016-12-01 生活機器人學股份有限公司 Motion control device for articulated arm mechanism and robot system
CN106680713A (en) * 2017-01-05 2017-05-17 中国科学院上海光学精密机械研究所 Model selection comparison test and motion parameter determination method for electric machine and driver thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103180791A (en) * 2010-10-13 2013-06-26 欧姆龙株式会社 Control device, control system and control method
US20150061564A1 (en) * 2012-03-01 2015-03-05 Mitsubishi Electric Corporation Motor control device
CN104102226A (en) * 2013-04-08 2014-10-15 欧姆龙株式会社 Control system and control method
TW201641233A (en) * 2015-04-30 2016-12-01 生活機器人學股份有限公司 Motion control device for articulated arm mechanism and robot system
CN106680713A (en) * 2017-01-05 2017-05-17 中国科学院上海光学精密机械研究所 Model selection comparison test and motion parameter determination method for electric machine and driver thereof

Also Published As

Publication number Publication date
TW201943200A (en) 2019-11-01

Similar Documents

Publication Publication Date Title
US10611024B2 (en) Method of iterative motion control
WO2020151406A1 (en) Motion control method, apparatus and system, and storage medium
CN104135212A (en) Flexibility motion control IP (Intellectual Property) core and implementation method thereof
US7463003B2 (en) Motor control system for controlling a plurality of motors
US20160091889A1 (en) Numerical control system
CN112207829A (en) Robot control method and device and readable storage medium
US20100185325A1 (en) Apparatus and method for controlling multi-axis robot
CN105892412A (en) Multi-axis motion control hardware configuration based on custom bus
TWI662781B (en) A motor controlling system and method thereof
JP2007267480A (en) Servo control device and servo system using it
TW201725459A (en) Stepper trajectory driver
CN107134956B (en) Control device, control program, and recording medium
JP6922333B2 (en) Information processing equipment, information processing methods, and information processing programs
CN102650862A (en) Electronic cam control system of programmable logic controller and electronic cam control method
JP2006262636A (en) Multi-axial servo driver
CN103552072B (en) A kind of robot control method based on embedded controller and device
CN104007821A (en) Force feedback equipment variable damping control device and control method thereof
US9905264B2 (en) Servo control system having function of switching learning memory
JP6545421B1 (en) Trajectory command generation system, trajectory command generation method and interface
CN108170102B (en) Motion control system
TWI656417B (en) A motor controlling system and method thereof
CN110365280A (en) Motor control system and its method
CN104635625A (en) Movement control method and device based on IP core
JP2020107127A (en) Synchronization control device, synchronization control system, synchronization control method, and simulation device
JP2015159660A (en) Servo motor controller