Search

CN-122026752-A - Brushless direct current motor control method of industrial sewing machine

CN122026752ACN 122026752 ACN122026752 ACN 122026752ACN-122026752-A

Abstract

The invention discloses a brushless direct current motor control method of a industrial sewing machine, which comprises the following steps of 1, designing the structure of the brushless direct current motor of the industrial sewing machine, 2, setting a brushless direct current motor rotating speed control method based on a whale algorithm optimization PID, 3, designing software and hardware of a brushless direct current motor control system, and 4, optimally designing numerical control system parameters of the industrial sewing machine. Meanwhile, the stability, the rapidness and the accuracy of the system are improved, and the needle stopping is rapid and accurate.

Inventors

  • LIN PENG
  • ZHENG JUN
  • JIN JIE
  • ZHOU HAOXIANG
  • WANG MENG
  • CAI JINGXIAN

Assignees

  • 浙江大学台州研究院

Dates

Publication Date
20260512
Application Date
20260209

Claims (10)

  1. 1. A brushless direct current motor control method of a sewing machine is characterized by comprising the following steps: step1, designing the structure of a brushless direct current motor of a sewing machine; Step 2, setting a brushless direct current motor rotating speed control method based on a whale algorithm optimization PID; step 3, designing software and hardware of a brushless direct current motor control system; and 4, optimally designing numerical control system parameters of the sewing machine.
  2. 2. The method for controlling a brushless DC motor of a sewing machine according to claim 1, wherein the step 1 comprises: step 11, setting the outer diameter and the effective length of a stator core of the brushless direct current motor; Step 12, a brushless direct current motor adopts a sloping shoulder round bottom groove structure; And 13, selecting neodymium iron boron materials for the brushless direct current motor.
  3. 3. The method for controlling a brushless DC motor of a sewing machine according to claim 1, wherein the step 2 comprises the steps of Step 21, improving a local search mechanism of a whale algorithm; step 22, improving PID parameter design of whale algorithm.
  4. 4. The method for controlling a brushless DC motor of a sewing machine according to claim 1, wherein the step 2 of improving the whale algorithm to optimize PID comprises the following specific steps: and S1, initializing related parameters. Initializing a population scale number, a current iteration number, a maximum iteration number Tmax and a dimension dim; s2, calculating an optimal fitness value of a whale individual; Step S3, position updating, namely inputting the fitness value into a brushless direct current motor, setting Ke, kec, kp, ki, kd values, updating the position, and calculating parameter values; S4, selecting an updating mechanism, namely comparing a P value with Q, selecting which updating mechanism is used for updating the position, if P is smaller than Q, when A is smaller than 1, using a bubble net food catching mode for whales, and if A is larger than or equal to 1, using random walks to search for hunting objects and update the position, but when P is larger than or equal to Q, using surrounding shrinkage hunting objects and spiral shrinkage updating positions; and S5, terminating and judging, namely judging whether the position updating optimal value is better than the optimal position of the previous iteration, and ending the algorithm when the iteration number reaches the maximum iteration number. If the requirement is not met, continuing to execute the step 2-4; S6, establishing a motor model; step S7, assigning the optimal fitness value Ke, kec, kp, ki, kd to whale individuals; and S8, calling a motor model to operate, and obtaining various performance indexes of the motor under the condition of no load and load.
  5. 5. The method for controlling a brushless DC motor of a sewing machine according to claim 1, wherein the step 3 comprises: Step 31, designing motor drive control system hardware; And step 32, designing motor drive control system software.
  6. 6. The method for controlling a brushless DC motor of a sewing machine according to claim 3, wherein the step 21 of improving the local search mechanism of the whale algorithm comprises the steps of: Optimizing convergence factor and probability threshold, adding Gaussian variation strategy factor and adaptive factor, introducing adaptive weight strategy factor and Gaussian variation factor into whale algorithm, and expressing Gaussian variation strategy factor and adaptive weight factor as ; In the formula, tmax is the maximum iteration number, r is a random number between [0,1], t is time, k is the variance of Gaussian variation, w is an adaptive weight factor, r is subjected to the Gaussian variation factor with mean value 0 and variance k, the adaptive weight factor can dynamically analyze and adjust the behavior and problem characteristics of whale shoals, the algorithm is adaptive to different problem scenes and search spaces through the adaptive adjustment of the weight factor, w can be gradually reduced along with the increase of the iteration number, k shows a decreasing trend along with the increase of t from 1 to Tmax, and better convergence and precision are conveniently obtained in the later stage of searching.
  7. 7. The method for controlling a brushless DC motor of a sewing machine according to claim 3, wherein the step 22 of improving PID parameter design of whale algorithm comprises the following steps of When the improved whale algorithm is used for optimizing parameters of the PID controller, the parameters of the PID algorithm are used as target variables to be optimized to become a multi-variable and multi-dimensional optimization problem, the three parameters are put into the whale algorithm for optimization, the optimal solution is continuously iterated to obtain an optimal PID parameter value, an integral absolute error is used as a fitness function, and the integral of the product of the deviation absolute value of the PID parameter and time is used as a PID parameter setting target function.
  8. 8. The method of claim 5, wherein the step 31 comprises designing the motor drive control system hardware as The master control chip selects STM32 control chip, STM32 chip has a motor control timer, each timer has an independent DMA request mechanism, the chip controls the output of 6 PWM waves simultaneously, STM32 is also provided with two 12 bit AD converters, a driving circuit of a DC brushless motor adopts three-phase half-bridge driving, a device with a MOS tube model of IRF540N is selected as a power switch tube, an output filter circuit filters out high-frequency signals in motor operation, a signal acquisition feedback circuit comprises current signal detection and voltage signal detection, current in motor operation is acquired, the current is used as control quantity in a control system after being processed, and corresponding control and protection actions are made by adjusting the current.
  9. 9. The method for designing the motor drive control system software in the step 32 is characterized by initializing the system, including variable description and assignment, setting each port, interrupting the initialization of the system, judging the rotor position of the motor by a main program through a received Hall sensor signal, inputting corresponding on-off conditions to a power tube through a driver according to the working principle and a control algorithm of a DC brushless motor, repeating an algorithm program by the motor according to a feedback signal of rotor position information, adjusting the motor speed to reach a set reference speed, designing the software flow of the communication system, starting to set serial port configuration, including setting a baud rate, data bits and stop bits, initializing the serial port, defining the frame head and the frame tail of the data and updating the data in the data frame and sending the data to an upper computer, so that the singlechip and the upper computer establish successful communication on the basis of a hardware circuit, and continuously sending information to the upper computer through a communication serial port; after the A/D sampling and communication system debugging is finished, the system continuously executes algorithm control program, and transfers the collected phase voltage, phase current and rotor position angle information to STM32 single-chip microcomputer, the control chip can obtain the estimated value of control quantity and rotating speed by means of calculation according to the design of algorithm program, and the single-chip microcomputer can utilize pulse width modulation generator to send out control command for turning on and off every power switching tube to control on and off state of every power switching tube so as to make motor rotating speed be kept near desired value, and make motor rotating speed be reached to set value and be kept in stable state, and the speed control of the direct current brushless motor is realized.
  10. 10. The method for controlling the brushless direct current motor of the industrial sewing machine according to claim 1, wherein the step 4 is characterized in that the numerical control system parameter of the industrial sewing machine is optimally designed by adopting cascade control for the numerical control system control principle of the industrial sewing machine, and a position control loop is superior to a speed control loop in advance of a current control loop.

Description

Brushless direct current motor control method of industrial sewing machine Technical Field The invention belongs to the field of industrial sewing machines, and relates to a brushless direct current motor control method of an industrial sewing machine. Background Industrial sewing machines refer to sewing machines adapted for mass production in a sewing factory or other industrial sector. In the design of the high-precision sewing machine, the most important is the accurate control of the motor, so that the needle can be quickly and accurately positioned, the needle number is accurate, and the accurate cutting line of the sewing machine can be realized in the high-speed operation process. At present, a permanent magnet synchronous motor is mainly used, but the cost is increased, the control method of the permanent magnet synchronous motor is more traditional, and the stability, the rapidity and the accuracy of the permanent magnet synchronous motor cannot meet the requirement of higher accurate control of an industrial sewing machine. Disclosure of Invention The invention provides a brushless direct current motor control method of a sewing machine, which aims to overcome at least one defect of the prior art. In order to achieve the purpose, the invention adopts the following technical scheme that the brushless direct current motor control method of the industrial sewing machine comprises the following steps: step1, designing the structure of a brushless direct current motor of a sewing machine; Step 2, setting a brushless direct current motor rotating speed control method based on a whale algorithm optimization PID; step 3, designing software and hardware of a brushless direct current motor control system; and 4, optimally designing numerical control system parameters of the sewing machine. Further, the step 1 includes: step 11, setting the outer diameter and the effective length of a stator core of the brushless direct current motor; Step 12, a brushless direct current motor adopts a sloping shoulder round bottom groove structure; And 13, selecting neodymium iron boron materials for the brushless direct current motor. Further, the improved whale algorithm in the step 2 specifically comprises Step 21, improving a local search mechanism of a whale algorithm; step 22, improving PID parameter design of whale algorithm. Further, the specific steps of improving the whale algorithm and optimizing the PID in the step 2 are as follows: and S1, initializing related parameters. Initializing a population scale number, a current iteration number, a maximum iteration number Tmax and a dimension dim; s2, calculating an optimal fitness value of a whale individual; Step S3, position updating, namely inputting the fitness value into a brushless direct current motor, setting Ke, kec, kp, ki, kd values, updating the position, and calculating parameter values; S4, selecting an updating mechanism, namely comparing a P value with Q, selecting which updating mechanism is used for updating the position, if P is smaller than Q, when A is smaller than 1, using a bubble net food catching mode for whales, and if A is larger than or equal to 1, using random walks to search for hunting objects and update the position, but when P is larger than or equal to Q, using surrounding shrinkage hunting objects and spiral shrinkage updating positions; And S5, terminating and judging, namely judging whether the position updating optimal value is better than the optimal position of the previous iteration, and ending the algorithm when the iteration number reaches the maximum iteration number. If the requirement is not met, the step 2-4 is continued. S6, establishing a motor model; step S7, assigning the optimal fitness value Ke, kec, kp, ki, kd to whale individuals; and S8, calling a motor model to operate, and obtaining various performance indexes of the motor under the condition of no load and load. Further, the step 3 includes: Step 31, designing motor drive control system hardware; And step 32, designing motor drive control system software. Further, the method of improving the local search mechanism of the whale algorithm in the step 21 is as follows: Optimizing convergence factor and probability threshold, adding Gaussian variation strategy factor and adaptive factor, introducing adaptive weight strategy factor and Gaussian variation factor into whale algorithm, and expressing Gaussian variation strategy factor and adaptive weight factor as In the formula, tmax is the maximum iteration number, r is a random number between [0,1], t is time, k is the variance of Gaussian variation, w is an adaptive weight factor, r is subjected to the Gaussian variation factor with mean value 0 and variance k, the adaptive weight factor can dynamically analyze and adjust the behavior and problem characteristics of whale shoals, the algorithm is adaptive to different problem scenes and search spaces through the adaptive adjustment of the weight factor, w can be g