CN112701972B - Method for controlling constant deceleration displacement of stepping motor, storage medium and equipment - Google Patents

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

Info

Publication number
CN112701972B
CN112701972B CN202011466866.3A CN202011466866A CN112701972B CN 112701972 B CN112701972 B CN 112701972B CN 202011466866 A CN202011466866 A CN 202011466866A CN 112701972 B CN112701972 B CN 112701972B
Authority
CN
China
Prior art keywords
stepping motor
deceleration
pulses
pulse
processor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011466866.3A
Other languages
Chinese (zh)
Other versions
CN112701972A (en
Inventor
沈坤
张婉
曹桂平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Anxin Precision Technology Co Ltd
Original Assignee
Hefei Anxin Precision Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Anxin Precision Technology Co Ltd filed Critical Hefei Anxin Precision Technology Co Ltd
Priority to CN202011466866.3A priority Critical patent/CN112701972B/en
Publication of CN112701972A publication Critical patent/CN112701972A/en
Application granted granted Critical
Publication of CN112701972B publication Critical patent/CN112701972B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P8/00Arrangements for controlling dynamo-electric motors rotating step by step
    • H02P8/24Arrangements for stopping
    • H02P8/30Holding position when stopped

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Control Of Stepping Motors (AREA)

Abstract

The application relates to a method for controlling the constant deceleration displacement of a stepping motor, a storage medium and equipment, which are used for calculating the pulse frequency of each step of the stepping motor and sending pulses to a stepping motor driver so that the motor can keep the same displacement from any speed to stop. The transmitted pulse frequency determining method is that the final displacement can be controlled by controlling deceleration at different speeds, for a stepping motor, a pulse stepping motor is transmitted to a driver to rotate a fixed angle, and the transmission belt is advanced by a fixed distance by rotating the fixed angle, so that the mechanical structure and the matched stepping motor and the driver can determine pulse equivalent, and the control of the stepping motor is finally realized by transmitting pulses, so that the unit conversion is performed. The algorithm related by the application has high efficiency and has no high requirement on the performance of the processor. Meanwhile, the design difficulty of the mechanical structure can be reduced, and the cost can be saved.

Description

Method for controlling constant deceleration displacement of stepping motor, storage medium and equipment
Technical Field
The application relates to the technical field of motor control, in particular to a method, a storage medium and equipment for controlling constant deceleration displacement of a stepping motor.
Background
In the chip mounter, there is a transfer module, which functions to transfer in the PCB to be chip mounted and transfer out the PCB to which the chip mounting has been completed, so the module is divided into three parts: the device comprises a board inlet area, a patch area and a board outlet area. As the name suggests, the PCB board will stay in the designated position of the patch area waiting for the patch action to be completed. In the current transfer module, the in-place control of the PCB board is completed in the manner shown in fig. 1: after the non-mounted PCB enters the mounting area, the original high-speed uniform motion (300 mm/s) is kept, the speed reduction and the lifting of the stop pin are triggered once the position of the stop sensor is passed, and finally the stop pin is impacted at the original speed of 5% and stopped at the stop pin.
Obviously, if the speed can be reduced to 0 and stopped precisely to the specified position within the tolerance, the stop pin can be removed. In this way, the cost and the difficulty of structural design are reduced. In addition, the single-side stop pin has a hidden trouble, when the size of the PCB is large, the impact stop pin is inevitably rotated by taking the impact point as the center due to the clearance between the conveying track and the edge of the PCB, and the mounting precision under the condition is difficult to ensure. In order to improve the situation, the application provides a method for ensuring the displacement of the stepping motor to be constant, so that the PCB can be accurately stopped at a designated position at any speed through the sensor.
Disclosure of Invention
The method, the storage medium and the equipment for controlling the constant deceleration displacement of the stepping motor can solve the technical problems, and the PCB can be accurately stopped at the designated position at any speed through the sensor.
In order to achieve the above purpose, the present application adopts the following technical scheme:
a method for controlling constant deceleration displacement of a stepper motor, comprising the steps of:
calculating the pulse frequency of each step of the stepping motor and sending pulses to a stepping motor driver;
the pulse frequency calculation steps are as follows:
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 sensor to the motor for starting to execute the deceleration action is deltat, the distance actually used in the deceleration process is (l-v.deltat) mm;
the deceleration is obtained according to the law of uniform deceleration linear motion:
the pulse equivalent k pulse/mm determined by the mechanical structure and the associated stepper motor and driver is known and derived as follows:
the deceleration distance is converted into pulses with the pulse number of k (l-v.delta.t) of the stepping motor;
deceleration is expressed in units of the number of pulses of the stepper motor as kapulses/s 2
The initial speed at which the deceleration starts is expressed in units of the number of pulses of the stepping motor as kvpulses/s, i.e., pulse frequency;
the pulse frequency for each step of the stepper motor is as follows:
in another aspect, the application 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 application also discloses a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the above method.
According to the technical scheme, the method for controlling the constant deceleration displacement of the stepping motor can enable the motor to maintain the same displacement from any speed deceleration to stop by calculating the pulse frequency of each step of the stepping motor and sending the pulse to the stepping motor driver. The step of determining the pulse frequency is to control the final displacement by controlling the deceleration at different speeds, and for the stepper motor, the step motor is rotated by a fixed angle, the rotation by a fixed angle advances the conveyor belt by a fixed distance, so the mechanical structure and the matched stepper motor and driver can determine the pulse equivalent, and the step motor is controlled by sending the pulse, and finally, the unit conversion is performed. The algorithm related by the application has high efficiency and has no high requirement on the performance of the processor. Meanwhile, the design difficulty of the mechanical structure can be reduced, and the cost can be saved.
Drawings
Fig. 1 is a schematic front view and a schematic top view of a conveying structure of a chip mounter;
fig. 2 is a block diagram of the structure of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application.
The method for controlling the constant deceleration displacement of the stepping motor according to the embodiment comprises the following steps:
calculating the pulse frequency of each step of the stepping motor and sending pulses to a stepping motor driver;
the pulse frequency calculation steps are as follows:
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 sensor to the motor for starting to execute the deceleration action is deltat, the distance actually used for the deceleration process is (l-v.deltat) 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 associated stepper motor and driver is known and derived as follows:
the deceleration distance is converted into pulses with the pulse number of k (l-v.delta.t) of the stepping motor;
deceleration is expressed in units of the number of pulses of the stepper motor as kapulses/s 2
The initial speed at which the deceleration starts 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 stepper motor the pulse frequency has the following recurrence relation:
so far, a theoretical main body for ensuring the displacement of the stepping motor to be constant is obtained, and the hardware scheme for realizing the method has the following general thought: the main control part is realized by MCU plus FPGA (or a single MCU with enough performance), and the MCU are connected through SPI (or other communication buses). The MCU is responsible for calculating the pulse frequency of each step, giving the result to the FPGA, and the FPGA is responsible for sending pulses to the stepping motor driver according to the given frequency.
The above-described pulse frequency calculation step can be further explained as:
the known condition is 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 sensor to the motor to start to execute the deceleration action is deltat, and the pulse equivalent k pulse/mm is determined by the mechanical structure and the matched stepping motor and driver. The control of the stepper motor is accomplished by sending pulses to its associated driver, the faster the pulse frequency, the faster the rotational speed, ensuring that the deceleration displacement is constant is first a deceleration process, so it is necessary to send pulses of lower and lower frequency to the stepper motor driver until no pulse is sent (frequency 0), how is it determined what is the lower and lower frequency? How does it guarantee constant displacement?
Under the above conditions, the real deceleration distance is (l-v.DELTA.t) mm, and the sensor detects that the delay from the PCB board to the start of the motor to execute the deceleration action is DELTA.t, so that the motor also passes v.DELTA.t mm at the speed of v mm/s before actually decelerating.
From the physical knowledge, for uniform deceleration linear motion, there is an equivalent relationship v between the initial velocity v, acceleration a and displacement x 2 =2ax, substituting the known condition, the speed v mm/s of the PCB passing the sensor and the first derived condition, the actual deceleration distance (l-v·Δt) mm, into the equation, the second condition, the acceleration (deceleration) of the deceleration process, can be derived:
at this point the second question above is answered and the final displacement is controlled by controlling the deceleration at different speeds. For stepper motors, sending a pulse to the drive will turn a fixed angle, which will advance the belt a fixed distance, so the mechanical structure and associated stepper motor and drive will determine the pulse equivalent of k pulses/mm. Since the control of the stepper motor is finally achieved by sending pulses, one unit conversion is performed:
the deceleration distance is converted into pulses with the pulse number of k (l-v.delta.t) of the stepping motor;
deceleration is expressed in units of the number of pulses of the stepper motor as ka pulses/s 2
The initial speed at which deceleration begins is expressed in units of the number of pulses of the stepping motor as kv pulses/s, i.e., pulse frequency;
from the physical knowledge, the velocity v at any time t for uniform deceleration linear motion t There is an equivalent relation v to the initial velocity v t =v-at, and one unit conversion can be performed to obtain f t =kv t Let us examine the first pulse frequency of the deceleration phase (let us note that the frequency kv=f corresponding to the initial velocity v 0 ),The frequency and time interval of the pulses have an equal relationship f·t=1, and therefore
The combination is the recurrence relation above.
An example is given below, the MCU is STM32F103ZEH6, the FPGA is EP4C55F484, the MCU is connected with the upper computer or the upper control board through the SPI, and the FPGA outputs differential pulse signals to the step driver. Since the control board is at 3.3V level and the motor driver requires a minimum of 5V signal, there is a level shift IC. If a master IC with 5V logic is selected, no level shifting IC is needed. Since the driver requires differential signal inputs, there is a single-to-differential IC that is not required if the driver does not require differential signal control.
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 layer plate receives a signal sent by the sensor (of course, the sensor signal can be directly connected to the control board) and then sends a command of stopping the speed reduction to the control board through the RS485 serial port. The control board MCU receives the command and then analyzes and executes the command, calculates the deceleration according to the deceleration distance (known parameters, directly solidified in a program) and the current speed (known parameters, set on an upper computer or an upper layer plate), then recursively calculates the speed of each step, 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, set by an FPGA program) of the FPGA, and sends the calculation result to the FPGA through the SPI in each calculation step. The FPGA needs to establish a buffer zone for buffering the frequency division number sent by the MCU so as to avoid that the speed of the MCU for sending data is faster than the speed of the FPGA for generating 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, so that the control purposes of uniformly decelerating the motor to stop and keeping the displacement constant are achieved.
In another aspect, the application 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 application also discloses a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the above method.
It will be appreciated by those skilled in the art that 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the application 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 scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (3)

1. A method for controlling constant deceleration displacement of a stepping motor, which 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 stepping motor driver;
the pulse frequency calculation steps are as follows:
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 sensor to the motor for starting to execute the deceleration action is deltat, the distance actually used in the deceleration process is (l-v.deltat) mm;
the deceleration is obtained according to the law of uniform deceleration linear motion:
the pulse equivalent k pulse/mm determined by the mechanical structure and the associated stepper motor and driver is known and derived as follows:
the deceleration distance is converted into pulses with the pulse number of k (l-v.delta.t) of the stepping motor;
deceleration is expressed in units of the number of pulses of the stepper motor as ka pulses/s 2
The initial speed at which deceleration begins is expressed in units of the number of pulses of the stepping motor as kv pulses/s, i.e., pulse frequency;
the pulse frequency for each step of the stepper motor is as follows:
the process of sending pulses to the stepper motor driver is as follows:
the MCU receives a command of stopping deceleration, then analyzes and executes the command, calculates the pulse frequency of each step of the stepping motor according to the known deceleration distance and the current speed, calculates the frequency division number of the FPGA according to the counter frequency of the FPGA, and sends a calculation result to the FPGA after each step of calculation;
the FPGA immediately enters a pulse generation program after receiving the first data, the received frequency division numbers are sequentially stored in a buffer area in the process of generating the pulses, the pulses are sequentially generated according to the frequency division numbers in the buffer area, and meanwhile, the generated pulse signals are sent to a motor driver until all the data are processed.
2. 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 of 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.
CN202011466866.3A 2020-12-14 2020-12-14 Method for controlling constant deceleration displacement of stepping motor, storage medium and equipment Active CN112701972B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011466866.3A CN112701972B (en) 2020-12-14 2020-12-14 Method for controlling constant deceleration displacement of stepping motor, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011466866.3A CN112701972B (en) 2020-12-14 2020-12-14 Method for controlling constant deceleration displacement of stepping motor, storage medium and equipment

Publications (2)

Publication Number Publication Date
CN112701972A CN112701972A (en) 2021-04-23
CN112701972B true CN112701972B (en) 2023-08-15

Family

ID=75507820

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011466866.3A Active CN112701972B (en) 2020-12-14 2020-12-14 Method for controlling constant deceleration displacement of stepping motor, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN112701972B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202127391U (en) * 2011-02-14 2012-01-25 浙江中茂科技有限公司 Transmission control system of surface mounted device (SMD) part counter
CN110465422A (en) * 2019-08-29 2019-11-19 内蒙古大学 A kind of flush coater kinetic control system and its motion control method based on FPGA
CN111262483A (en) * 2020-02-04 2020-06-09 迈克医疗电子有限公司 Motor motion control method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202127391U (en) * 2011-02-14 2012-01-25 浙江中茂科技有限公司 Transmission control system of surface mounted device (SMD) part counter
CN110465422A (en) * 2019-08-29 2019-11-19 内蒙古大学 A kind of flush coater kinetic control system and its motion control method based on FPGA
CN111262483A (en) * 2020-02-04 2020-06-09 迈克医疗电子有限公司 Motor motion control method

Also Published As

Publication number Publication date
CN112701972A (en) 2021-04-23

Similar Documents

Publication Publication Date Title
CN102047195B (en) Acceleration/deceleration control device
JP2011501292A (en) Jerk limited trajectory planning system and method for path planner
US4815007A (en) Apparatus for controlling a robot
CN104483906A (en) S-curve acceleration and deceleration control method and device of discrete sampling
EP3222510A1 (en) Synchronization in an electric propulsion system
CN112701972B (en) Method for controlling constant deceleration displacement of stepping motor, storage medium and equipment
JP2003202908A (en) Device and method for synchronizing a plurality of electric driving units
CN101893869A (en) The servo motor control unit of control cycle reciprocating action
CN101581927A (en) Computerized numerical control machine tool and acceleration-deceleration method thereof
CN106414204B (en) Determine critical vehicle state and vehicle minimum spacing
CN106404032B (en) Method for controlling speed synchronization of main shaft of encoder
CN110855213B (en) Compensation method for high-speed pulse output interference of programmable logic controller
CN201830194U (en) Drive control device of stepping motor
CN106301119A (en) For flat bed scanner and the method for controlling stepping motor of automatic paper feed scanner
CN104865900B (en) A kind of NURBS interpolators pulse uniform output device and equipment
WO1991003009A1 (en) Acceleration/deceleration control method of numeric controller
CN102495344B (en) Method and system of grain detecting
CN100553843C (en) The device and method that adds work gear with the indexing of simplifying index time
US20130253668A1 (en) Positioning apparatus and plc system using same
CN203109342U (en) Position control device for steel rolling finishing shear line
CN103259471A (en) Method for driving stepping motor based on smooth self-adaptation
US4661754A (en) Control circuit for a stepping motor
EP1197821B1 (en) Acceleration/deceleration method
US4890048A (en) Low torque ripple stepping motor controller circuit
CN108170102B (en) Motion control system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant