Method, storage medium and equipment for controlling constant deceleration displacement of stepping motor

文档序号:651751 发布日期:2021-04-23 浏览:17次 中文

阅读说明:本技术 一种控制步进电机减速位移恒定的方法、存储介质及设备 (Method, storage medium and equipment for controlling constant deceleration displacement of stepping motor ) 是由 沈坤 张婉 曹桂平 于 2020-12-14 设计创作,主要内容包括:本发明的一种控制步进电机减速位移恒定的方法、存储介质及设备,计算步进电机每一步的脉冲频率,并向步进电机驱动器发送脉冲,使电机从任意速度减速到停止都能保持同样的位移。其中所发送的脉冲频率确定方法为由于在不同的速度下通过控制减速度就可以控制最终的位移,对于步进电机,向驱动器发送一个脉冲步进电机就会转动一个固定的角度,转动一个固定的角度就会使传送带前进固定的距离,所以机械结构和配套的步进电机及驱动器会确定脉冲当量,由于控制步进电机最终是通过发送脉冲来实现,所以再进行一个单位转换即可。本发明涉及的算法效率高,对处理器性能没有高要求。同时可降低机械结构设计难度且可以节省成本。(The invention discloses a method, a storage medium and equipment for controlling the constant deceleration displacement of a stepping motor. The transmitted pulse frequency determining method is that the final displacement can be controlled by controlling the deceleration under different speeds, for a stepping motor, a pulse stepping motor is transmitted to a driver to rotate by a fixed angle, and the transmission belt can advance by a fixed distance by rotating by the fixed angle, so that the mechanical structure, the matched stepping motor and the driver can determine the pulse equivalent, and as the control of the stepping motor is finally realized by transmitting pulses, one unit conversion can be carried out. The algorithm related by the invention has high efficiency and has no high requirement on the performance of the processor. Meanwhile, the design difficulty of a mechanical structure can be reduced, and the cost can be saved.)

1. A method for controlling the speed reduction displacement of a stepping motor to be constant is characterized in that:

the method comprises the following steps:

calculating the pulse frequency of each step of the stepping motor and sending pulses to a driver of the stepping motor;

the pulse frequency calculation method comprises the following steps:

assuming that the distance between the sensor and the stop pin is l mm, the speed of the PCB passing through the sensor is v mm/s, the time delay from the detection of the sensor to the start of the deceleration action of the motor by the PCB is delta t, and the actual distance for the deceleration process is (l-v.delta t) mm;

obtaining deceleration according to the rule of uniform deceleration linear motion:

the pulse equivalent k pulse/mm determined by the mechanical structure and the matched stepping motor and driver is known, and the following is provided:

the deceleration distance is converted into the pulse number of the stepping motor, which is k (l-v.delta t) pulses;

deceleration is expressed as ka pulses/s in units of stepper motor pulse numbers2

The initial speed at which deceleration begins is expressed in kv pulses/s, i.e., pulse frequency, in units of the number of pulses of the stepping motor;

then for each step of the stepping motor the pulse frequency is as follows:

tn=0。

2. a computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, causes the processor to carry out the steps of the method as claimed in claim 1.

3. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method of claim 1.

Technical Field

The invention relates to the technical field of motor control, in particular to a method, a storage medium and equipment for controlling the constant deceleration displacement of a stepping motor.

Background

In a chip mounter, there is a transfer module which functions to transfer a PCB board to be mounted and transfer the PCB board having been mounted, so that the module is divided into three parts: the system comprises a board inlet area, a chip mounting area and a board outlet area. As the name suggests, the PCB board stays at the designated position of the chip mounting area to wait for completing the chip mounting action. In the current transfer module, the positioning control of the PCB is accomplished in the manner shown in fig. 1: the PCB which is not mounted keeps the original high-speed uniform motion (300mm/s) after entering the mounting area, once the PCB passes through the position of the stop sensor, the PCB is triggered to decelerate and the stop pin is triggered to rise, and finally the PCB impacts the stop pin at the original speed of 5% and stops at the stop pin.

Obviously, if the speed can be reduced to 0 while stopping to a specified position within an error allowance range precisely, the stopper pin can be removed. Thus, the cost and the difficulty of the structural design are reduced. Moreover, the unilateral stop pin still has a hidden danger, when the PCB board size is great, because there is the clearance in transfer track and flange, striking stop pin can be difficult to avoid and will produce the rotation with striking point as the center, and the dress precision under this condition is difficult to guarantee. In order to improve the situation, the invention provides a method for ensuring the displacement of the stepping motor to be constant, so that the PCB can be accurately stopped at a specified position at any speed by a sensor.

Disclosure of Invention

The method, the storage medium and the equipment for controlling the speed reduction displacement of the stepping motor to be constant can solve the technical problems and enable the PCB to accurately stop at the designated position through the sensor at any speed.

In order to achieve the purpose, the invention adopts the following technical scheme:

a method for controlling the deceleration displacement of a stepping motor to be constant comprises the following steps:

calculating the pulse frequency of each step of the stepping motor and sending pulses to a driver of the stepping motor;

the pulse frequency calculation method comprises the following steps:

assuming that the distance between the sensor and the stop pin is l mm, the speed of the PCB passing through the sensor is v mm/s, the time delay from the detection of the sensor to the start of the deceleration action of the motor by the PCB is delta t, and the actual distance for the deceleration process is (l-v.delta t) mm;

obtaining deceleration according to the rule of uniform deceleration linear motion:

the pulse equivalent k pulse/mm determined by the mechanical structure and the matched stepping motor and driver is known, and the following is provided:

the deceleration distance is converted into the pulse number of the stepping motor, which is k (l-v.delta t) pulses;

deceleration is expressed as kapulses/s in units of number of stepper motor pulses2

The initial speed at which deceleration begins is expressed in units of the number of pulses of the stepping motor as kvpulses/s, i.e., pulse frequency;

then for each step of the stepping motor the pulse frequency is as follows:

in another aspect, the present invention also discloses a computer readable storage medium storing a computer program, which when executed by a processor causes the processor to perform the steps of the method as described above.

In a third aspect, the present invention also discloses a computer device comprising a memory and a processor, the memory storing a computer program, the computer program, when executed by the processor, causing the processor to perform the steps of the above method.

According to the technical scheme, the method for controlling the speed reduction displacement of the stepping motor to be constant can keep the same displacement from any speed reduction to stop by calculating the pulse frequency of each step of the stepping motor and sending pulses to the driver of the stepping motor. The transmitted pulse frequency determining step is that the final displacement can be controlled by controlling the deceleration under different speeds, for the stepping motor, a pulse stepping motor is transmitted to the driver to rotate by a fixed angle, and the conveyor belt can advance by a fixed distance by rotating by the fixed angle, so that the mechanical structure, the matched stepping motor and the driver can determine the pulse equivalent, and finally, the pulse frequency determining step is realized by transmitting pulses and finally performing unit conversion. The algorithm related by the invention has high efficiency and has no high requirement on the performance of the processor. Meanwhile, the design difficulty of a mechanical structure can be reduced, and the cost can be saved.

Drawings

Fig. 1 is a front and top schematic view of a transport structure of a chip mounter;

fig. 2 is a block diagram of the architecture of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention.

The method for controlling the speed reduction displacement of the stepping motor to be constant comprises the following steps:

calculating the pulse frequency of each step of the stepping motor and sending pulses to a driver of the stepping motor;

the pulse frequency calculation method comprises the following steps:

assuming that the distance between the sensor and the stop pin is l mm, the speed of the PCB passing through the sensor is v mm/s, and the time delay from the detection of the PCB by the sensor to the start of the deceleration action of the motor is delta t, the distance really used for the deceleration process is (l-v delta t) mm. The deceleration is easily obtained according to the law of uniform deceleration linear motion:

the pulse equivalent k pulse/mm determined by the mechanical structure and the matched stepping motor and driver is known, and the following is provided:

the deceleration distance is converted into the pulse number of the stepping motor, which is k (l-v.delta t) pulses;

deceleration is expressed as kapulses/s in units of number of stepper motor pulses2

The initial speed at which deceleration begins is expressed in units of the number of pulses of the stepping motor as kvpulses/s, i.e., pulse frequency;

then for the pulse frequency of each step of the stepper motor, the following recursion relationship exists:

so far, a theoretical main body for ensuring the displacement of the stepping motor to be constant is obtained, and a hardware scheme for realizing the method is mainly thought as follows: the main control part is realized by an MCU and an FPGA (or a single MCU with enough performance), and the MCU and the FPGA are connected through an SPI (or other communication buses). The MCU is responsible for calculating the pulse frequency of each step, the result is sent to the FPGA, and the FPGA is responsible for sending pulses to the stepping motor driver according to the given frequency.

The above-mentioned pulse frequency calculation steps can be further explained as:

the known conditions are that the distance between the sensor and the stop pin is l mm, the speed of the PCB passing through the sensor is v mm/s, the time delay from the detection of the PCB by the sensor to the start of the deceleration action of the motor is delta t, and the pulse equivalent k pulse/mm is determined by a mechanical structure, a matched stepping motor and a matched driver. Control of the stepper motor is accomplished by pulsing its associated driver, the faster the pulse frequency, the faster the speed, the first to ensure constant deceleration displacement is a deceleration process, so that the stepper motor driver needs to be pulsed at lower and lower frequencies until no pulse (frequency 0) is sent, how is the lower and lower frequencies determined? How to ensure constant displacement?

The real deceleration distance under the above condition is (l-v · Δ t) mm, and since the time delay from the detection of the PCB by the sensor to the start of the motor performing the deceleration action is Δ t, the motor passes v · Δ t mm at a speed of v mm/s before the real deceleration.

As known from physics knowledge, for uniform deceleration linear motion, an equivalent relation v exists among initial velocity v, acceleration a and displacement x2By substituting the known conditions, i.e., the velocity v mm/s of the PCB passing the sensor and the first derived condition, i.e., the real deceleration distance (l-v · Δ t) mm, into the equation, 2ax, the second condition, i.e., the acceleration (deceleration) of the deceleration process, can be derived:

to this position, the second question above is answered and the resulting displacement can be controlled by controlling deceleration at different speeds. For a stepper motor, sending a pulse to the driver will rotate a fixed angle, which will advance the belt a fixed distance, so the mechanical structure and the associated stepper motor and driver will determine the pulse equivalent k pulse/mm. Since controlling the stepper motor is ultimately accomplished by sending pulses, a unit transition is made:

the deceleration distance is converted into the pulse number of the stepping motor, which is k (l-v.delta t) pulses;

deceleration is expressed as ka pulses/s in units of stepper motor pulse numbers2

The initial speed at which deceleration begins is expressed in kv pulses/s, i.e., pulse frequency, in units of the number of pulses of the stepping motor;

the knowledge of physics shows that the velocity v of the uniform deceleration linear motion at any time ttHaving an equivalence relation v to the starting velocity vtBy performing a unit conversion to obtain ft=kvtConsider the first pulse of the deceleration phaseFrequency (let the frequency kv ═ f corresponding to the initial velocity v be noted0),The frequency and time interval of the pulse have an equivalence relation f.t equal to 1, so that

The combination is the above recursion relation.

An example is given below, the MCU is STM32F103ZEH6, the FPGA is EP4C55F484, the two are connected through the SPI, the MCU passes through the RS485 serial port and connects host computer or upper control panel, the FPGA outputs differential pulse signal for step driver. Since the control board is 3.3V level and the motor driver requires a minimum of 5V signal, a level shift IC exists. If a master IC of 5V logic is selected, no level shifting IC is required. Since the driver requires differential signal input, there is a single-ended to differential IC, and if the driver does not require differential signal control, there is no need for a single-ended to differential IC.

As shown in fig. 2, the complete workflow is as follows:

when the PCB is transmitted to the position of the sensor, the sensor is activated, and the upper plate receives a signal sent by the sensor (of course, the signal of the sensor can also be directly connected to the control board) and then sends a command of deceleration stop to the control board through the RS485 serial port. The control panel MCU receives the command and then analyzes and executes the command, calculates the deceleration according to the deceleration distance (known parameters which are directly solidified in a program) and the current speed (known parameters which are set on an upper computer or an upper layer board), then calculates the speed of each step in a recursion manner, namely the pulse frequency to be sent by the FPGA, calculates the frequency division number of the FPGA according to the counter frequency (known parameters which are set by the FPGA program) of the FPGA, and sends the calculation result to the FPGA through the SPI in each calculation step. On the FPGA side, a buffer needs to be established for buffering the frequency division number transmitted by the MCU, so as to prevent the MCU from transmitting data faster than the FPGA generates pulses. The FPGA immediately enters a pulse generation program after receiving the first data, the received numbers are stored in a buffer area in the process of generating the pulses, then the pulses are sequentially generated according to the numbers in the buffer area until all the numbers are processed, and finally the pulses are not generated any more, so that the control purposes of uniformly decelerating the motor to stop and keeping the displacement constant are achieved.

In another aspect, the present invention also discloses a computer readable storage medium storing a computer program, which when executed by a processor causes the processor to perform the steps of the method as described above.

In a third aspect, the present invention also discloses a computer device comprising a memory and a processor, the memory storing a computer program, the computer program, when executed by the processor, causing the processor to perform the steps of the above method.

As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种电动汽车永磁轮毂电机能量复合控制器的构造方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!