A control method, device, equipment and medium for a fully automatic template sewing machine

By integrating the target chip and controller in a fully automatic template sewing machine and using PID algorithm for control, the problem of complex hardware connection and high cost in synchronous operation of servo system is solved, and the effect of accurate synchronization and cost reduction is achieved.

CN119596825BActive Publication Date: 2025-05-02ZHEJIANG HECHUAN TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510139503.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-08
Publication Date
2025-05-02
Estimated Expiration
2045-02-08

AI Technical Summary

Technical Problem

In the prior art, the hardware wiring structure of the two servo systems that need to be operated simultaneously in a fully automatic template sewing machine is complex, the cost investment is too high, and the space occupies a large volume.

Method used

The first controller and the second controller are connected through the target chip and integrated on the same circuit board. The PID algorithm uses a PID algorithm to obtain the target expected speed based on position instructions and feedback values, and control the rotation speed of the servo system through the current loop.

Benefits of technology

It reduces the complexity and space usage of hardware connections, reduces cost investment, and realizes the precise synchronous operation of the servo system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119596825B_ABST
    Figure CN119596825B_ABST
Patent Text Reader

Abstract

The present application discloses a control method, device, equipment and medium for a fully automatic template sewing machine, and relates to the technical field of sewing machines. The method includes: based on the PID algorithm, and according to the position instruction of the first servo system when executing the current position loop task and the position feedback value of the first servo system and the second servo system when executing the current position loop task, obtaining the target expected speed of the first servo system when executing the current speed loop task; based on the PID algorithm, and according to the target expected speed and the speed feedback value of the first servo system when executing the current speed loop task, obtaining the target input signal of the first servo system when executing the current current loop task; and using the target input signal to control the speed of the first servo system. This method can solve the technical problems of complex hardware wiring structure, high cost investment and large space volume when controlling two servo systems that need to run synchronously in a fully automatic template sewing machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sewing machines, and in particular to a control method, device, equipment and medium for a full-automatic template sewing machine. Background Art

[0002] The fully automatic template sewing machine is a device based on industrial automation. It can perform sewing operations through pre-set working templates. When the fully automatic template sewing machine performs sewing work, it generally completes the sewing operation of the fully automatic template sewing machine through the cooperation of three pairs of servo systems. Among them, one pair of servo systems controls the head of the sewing machine to move horizontally left and right; one pair of servo systems controls the head of the fully automatic template sewing machine to move vertically up and down; one pair of servo systems controls the sewing needle and hook in the head of the fully automatic template sewing machine to move. The pair of servo systems responsible for each task needs to perform precise synchronous operations to complete the normal sewing process, otherwise the sewing stitches will be disordered, and even the sewing needle will break or the equipment will be stuck. Therefore, how to ensure the precise synchronous movement of a pair of servo systems is crucial to the safe and stable operation of the fully automatic template sewing machine.

[0003] In the prior art, in order to ensure the precise synchronous operation of a pair of servo systems in a fully automatic template sewing machine, it is generally achieved through two independent servo drivers, which transmit each other's position information through pulse frequency division, and realize the synchronous operation of the two servo systems through a gantry synchronization algorithm. Assuming that the pair of servo systems that need to be synchronously operated are the first servo system and the second servo system, the pulse frequency division output interface on the first servo system needs to be connected to the gantry pulse input interface of the second servo system, and the pulse frequency division output interface on the second servo system also needs to be connected to the gantry pulse input interface of the first servo system. This method not only causes the hardware wiring of the drive system to be more complicated, but also the two independent servo drivers also need two sets of independent power supplies to power them, which leads to excessive cost investment in synchronous control of the first servo system and the second servo system, and also requires a large space volume. At present, there is no more effective solution to this technical problem. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a control method, device, equipment and medium for a fully automatic template sewing machine, so as to solve the technical problems in the prior art of complex hardware wiring structure, high cost investment and large space occupied when controlling two servo systems that need to run synchronously in a fully automatic template sewing machine. The specific scheme is as follows:

[0005] In order to solve the above technical problems, the present invention provides a control method for a fully automatic template sewing machine, wherein a first servo system and a second servo system in the fully automatic template sewing machine need to run synchronously, a first controller and a second controller for controlling the first servo system and the second servo system respectively are connected through a target chip, and the first controller, the second controller and the target chip are integrated on the same circuit board, and the method comprises:

[0006] Based on the PID algorithm, and according to the position instruction of the first servo system when executing the current position loop task and the position feedback values ​​of the first servo system and the second servo system when executing the current position loop task, the target expected speed of the first servo system when executing the current speed loop task is obtained;

[0007] Based on the PID algorithm, and according to the target expected speed and the speed feedback value of the first servo system when performing the current speed loop task, a target input signal of the first servo system when performing the current current loop task is obtained;

[0008] The rotation speed of the first servo system is controlled using the target input signal.

[0009] Preferably, the first controller is a first MCU, the second controller is a second MCU, and the target chip is an FPGA.

[0010] Preferably, the method of obtaining the target expected speed of the first servo system when performing the current speed loop task based on the PID algorithm and according to the position instruction of the first servo system when performing the current position loop task and the position feedback values ​​of the first servo system and the second servo system when performing the current position loop task includes:

[0011] When the timer of the fully automatic template sewing machine is triggered, a position instruction of the first servo system when executing the current position loop task is obtained to obtain a target position instruction;

[0012] Obtaining a position deviation value corresponding to the first servo system in a current operation cycle according to the target position instruction and a position feedback value of the first servo system when executing a current position loop task, to obtain a first deviation value;

[0013] Obtaining a position deviation value corresponding to the second servo system in a current operation cycle according to a position feedback value of the first servo system when executing the current position loop task and a position feedback value of the second servo system when executing the current position loop task, to obtain a second deviation value;

[0014] The target expected speed of the first servo system when executing the current speed loop task is obtained according to the proportional gain constant, the first deviation value and the second deviation value in the PID algorithm.

[0015] Preferably, the acquiring the position instruction of the first servo system when executing the current position loop task to obtain the target position instruction includes:

[0016] Acquire a pulse signal corresponding to the first servo system when executing a current position loop task to obtain a first pulse signal, and acquire a pulse signal corresponding to the first servo system when executing a previous position loop task to obtain a second pulse signal;

[0017] Calculating a difference between the first pulse signal and the second pulse signal to obtain a target difference;

[0018] The position instruction of the first servo system when executing the current position loop task is determined according to the target difference and the electronic gear ratio of the first servo system to obtain the target position instruction.

[0019] Preferably, the step of obtaining the position deviation value corresponding to the first servo system in the current operation cycle according to the target position instruction and the position feedback value of the first servo system when executing the current position loop task to obtain the first deviation value includes:

[0020] Reading the position data corresponding to the first servo system when executing the current position loop task and the last position loop task from the encoder corresponding to the first servo system through the target chip, respectively, to obtain the first position data and the second position data;

[0021] Calculating a difference between the first position data and the second position data to obtain a position feedback value of the first servo system when executing a current position loop task;

[0022] Obtaining a position deviation value corresponding to the first servo system in a current operation cycle according to the target position instruction and a position feedback value of the first servo system when executing a current position loop task, to obtain the first deviation value;

[0023] Correspondingly, the position deviation value corresponding to the second servo system in the current operation cycle is obtained according to the position feedback value of the first servo system when executing the current position loop task and the position feedback value of the second servo system when executing the current position loop task, to obtain the second deviation value, including:

[0024] The target chip reads the position data corresponding to the second servo system when executing the current position loop task and the last position loop task from the encoder corresponding to the second servo system, respectively, to obtain the third position data and the fourth position data;

[0025] Calculating a difference between the third position data and the fourth position data to obtain a position feedback value of the second servo system when executing a current position loop task;

[0026] The position deviation value corresponding to the second servo system in the current operation cycle is obtained according to the position feedback value of the first servo system when executing the current position loop task and the position feedback value of the second servo system when executing the current position loop task, so as to obtain the second deviation value.

[0027] Preferably, it also includes:

[0028] When the synchronization pulse signal sent by the target chip is received, it is determined that the timer is re-triggered, and the step of obtaining the position instruction of the first servo system when performing the current position loop task to obtain the target position instruction is re-executed; wherein, the target chip sends the synchronization pulse signal to the first controller at preset intervals.

[0029] Preferably, the step of obtaining a target input signal of the first servo system when performing a current current loop task based on the PID algorithm and according to the target expected speed and a speed feedback value of the first servo system when performing a current speed loop task includes:

[0030] Obtaining a speed deviation value of the first servo system when executing the current current loop task according to the target expected speed and a speed feedback value of the first servo system when executing the current speed loop task, to obtain a target speed deviation value;

[0031] The target input signal of the first servo system when executing the current current loop task is obtained according to the proportional gain constant and the integral time constant in the PID algorithm and the target speed deviation value.

[0032] In order to solve the above technical problems, the present invention also provides a control device for a fully automatic template sewing machine, wherein a first servo system and a second servo system in the fully automatic template sewing machine need to run synchronously, a first controller and a second controller for controlling the first servo system and the second servo system respectively are connected through a target chip, and the first controller, the second controller and the target chip are integrated on the same circuit board, and the device comprises:

[0033] A speed acquisition module, used for acquiring a target expected speed of the first servo system when performing a current speed loop task based on a PID algorithm and according to a position instruction of the first servo system when performing a current position loop task and position feedback values ​​of the first servo system and the second servo system when performing the current position loop task;

[0034] A signal acquisition module, used for acquiring a target input signal of the first servo system when performing a current loop task based on the PID algorithm and according to the target expected speed and a speed feedback value of the first servo system when performing a current loop task;

[0035] The rotation speed control module is used to control the rotation speed of the first servo system using the target input signal.

[0036] In order to solve the above technical problem, the present invention further provides an electronic device, comprising:

[0037] Memory for storing computer programs;

[0038] A processor is used to implement the steps of the control method of a fully automatic template sewing machine disclosed above when executing the computer program.

[0039] In order to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a control method for a fully automatic template sewing machine as disclosed above are implemented.

[0040] Beneficial effect: It can be seen that in the fully automatic template sewing machine provided by the present invention, the first controller and the second controller for controlling the first servo system and the second servo system are pre-connected through the target chip, and the first controller, the second controller and the target chip are integrated on the same circuit board. When controlling the fully automatic template sewing machine, firstly, based on the PID algorithm, the target expected speed of the first servo system when performing the current speed loop task is obtained according to the position instruction of the first servo system when performing the current position loop task and the position feedback value of the first servo system and the second servo system when performing the current position loop task; then, based on the PID algorithm, the target input signal of the first servo system when performing the current current loop task is obtained according to the target expected speed and the speed feedback value of the first servo system when performing the current speed loop task; finally, the speed of the first servo system is controlled by using the target input signal.

[0041] Compared with the prior art, since the first controller, the second controller and the target chip are integrated on the same circuit board, the first servo system and the second servo system can share a set of power supply. At the same time, the first controller and the second controller directly exchange data through the target chip, without the need to use connecting wires to connect the corresponding pulse frequency division output interface and gantry pulse input interface in the first servo system and the second servo system respectively, which can not only greatly reduce the structural complexity of the hardware connection and the space volume occupied when the first servo system and the second servo system are synchronously controlled, but also reduce the cost investment required for the synchronous control of the first servo system and the second servo system.

[0042] Moreover, in the control method, the target expected speed of the first servo system when executing the current speed loop task is determined mainly based on the PID algorithm, and according to the position instruction of the first servo system when executing the current position loop task and the position feedback value of the first servo system and the second servo system when executing the current position loop task. Since the target expected speed takes into account the position feedback value of the first servo system and the second servo system when executing the current position loop task, it is equivalent to obtaining the target expected speed corresponding to the first servo system when executing the current speed loop task with the first servo system and the second servo system running synchronously as the goal. Afterwards, based on the PID algorithm, the target input signal of the first servo system when executing the current current loop task is obtained according to the target expected speed and the speed feedback value of the first servo system when executing the current speed loop task. Because the output signal of the current loop can directly control the rotation speed of the first servo system, the rotation speed of the first servo system can be regulated by using the target input signal, so that the first servo system and the second servo system can achieve the purpose of synchronous operation.

[0043] Correspondingly, the control device, equipment and medium of the full-automatic template sewing machine provided by the present invention also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0045] Figure 1 A flow chart of a control method for a fully automatic template sewing machine provided by an embodiment of the present invention;

[0046] Figure 2 This is the overall structure diagram of the fully automatic template sewing machine;

[0047] Figure 3 for Figure 2 A schematic diagram of the structure of the fifth servo system and the sixth servo system;

[0048] Figure 4 It is a schematic diagram of the principle of a pair of servo systems working synchronously;

[0049] Figure 5 A structural diagram of a control device for a fully automatic template sewing machine provided by an embodiment of the present invention;

[0050] Figure 6 A structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0052] See also Figure 1 , Figure 1 A flow chart of a control method for a fully automatic template sewing machine provided by an embodiment of the present invention. The first servo system and the second servo system in the fully automatic template sewing machine need to run synchronously, and the first controller and the second controller that respectively control the first servo system and the second servo system are connected through a target chip, and the first controller, the second controller and the target chip are integrated on the same circuit board. The method includes:

[0053] Step S11: Based on the PID algorithm, and according to the position instruction of the first servo system when executing the current position loop task and the position feedback values ​​of the first servo system and the second servo system when executing the current position loop task, the target expected speed of the first servo system when executing the current speed loop task is obtained;

[0054] Step S12: Based on the PID algorithm, and according to the target expected speed and the speed feedback value of the first servo system when performing the current speed loop task, a target input signal of the first servo system when performing the current current loop task is obtained;

[0055] Step S13: Using the target input signal to control the rotation speed of the first servo system.

[0056] In order to enable those skilled in the art to more clearly understand the implementation principle of the present invention, the control principle of the servo system that needs to be synchronously operated in the fully automatic template sewing machine in the prior art is first described in detail.

[0057] The fully automatic template sewing machine is mainly composed of an electrical control part and a mechanical transmission part. The electrical control part includes: a host computer for human-computer interaction (such as a PC equipped with professional software, a touch screen, etc.), a controller that parses the sewing template into motion instructions (such as a motion board, a single-chip microcomputer, etc.), a servo driver that processes motion instructions, and a servo motor; the mechanical transmission part includes: rack and pinion, ball screw, synchronous belt, connecting rod, cam, etc.

[0058] In actual applications, the operator can first set up the textile template that needs to be sewn on the fabric in the upper computer of the fully automatic template sewing machine, and set the relevant parameters such as stitch size, shape, and running speed in the textile template; then, the controller can parse the information in the textile template into a language that can be understood by its lower-level equipment, and enable the servo motor to drive other related mechanical structures to complete the sewing operation on the fabric.

[0059] See also Figure 2 , Figure 2 The figure is the overall structure diagram of the fully automatic template sewing machine. There are three pairs of servo systems in the fully automatic template sewing machine that need to run synchronously. Among them, the first pair of servo systems includes the first servo system and the second servo system, the second pair of servo systems includes the third servo system and the fourth servo system, and the third pair of servo systems includes the fifth servo system and the sixth servo system. Since the sixth servo system is set directly below the fifth servo system, Figure 2 The schematic diagram shown is blocked by the working area of ​​the fully automatic template sewing machine. Figure 2 Only five servos can be seen in the image.

[0060] exist Figure 2 In the figure, the first servo system and the second servo system are used to control the head of the fully automatic template sewing machine to move vertically up and down, the third servo system and the fourth servo system are used to control the head of the fully automatic template sewing machine to move horizontally left and right, and the fifth servo system and the sixth servo system are used to control the movement of the sewing needle and the thread hook in the fully automatic template sewing machine. The pair of servo systems responsible for each task need to perform precise synchronous operations to complete the normal sewing process, otherwise the sewing stitches will be disordered, and even the sewing needle will break or the equipment will be stuck. In general, the functions of the fully automatic template sewing machine can be summarized into two points. One is to move the head of the fully automatic template sewing machine according to the pre-set motion trajectory, and the other is to sew the pre-set stitches on the fabric.

[0061] Specifically, the first servo system and the second servo system can rotate clockwise or counterclockwise at the same time, and the guide rail is driven by the screw drive to move, thereby realizing the up and down movement of the head in the fully automatic template sewing machine in the vertical direction. The third servo system and the fourth servo system rotate clockwise or counterclockwise at the same time, which can drive the head on the guide rail to move left and right in the horizontal direction. The fifth servo system controls the head to move up and down in the vertical direction, so as to press the sewing needle down on the fabric or lift the sewing needle. The sixth servo system controls the head to rotate 360°, so that the sewing needle can sew the stitches on the fabric at any angle. The operation of the fifth servo system and the sixth servo system is relatively simple, and they are only responsible for completing their own operation commands. The first servo system and the second servo system, as well as the third servo system and the fourth servo system, need to consider the synchronization between each other. If the rotation speeds of the two servo systems are not synchronized, it is easy to cause deformation and disorder of the sewing stitches, and even the phenomenon of the fully automatic template sewing machine being stuck.

[0062] See also Figure 3 , Figure 3 for Figure 2 The structural diagram of the fifth servo system and the sixth servo system. When the third servo system and the fourth servo system move to the right together, the fifth servo system runs clockwise. The clockwise operation of the fifth servo system will drive the belt, connecting rod and other mechanical structures to control the sewing machine to move up and down reciprocatingly. At the same time, the sixth servo system will control the thread hook to run counterclockwise.

[0063] When the sewing needle penetrates the fabric with the suture on the fabric, the thread hooker rotates to the thread hooker, and the thread hooker will hook the suture on the sewing needle. As the sixth servo system continues to rotate, a thread buckle will be formed, and it will pass through the thread hooker and the suture under the fabric to form a knot. At this time, one sewing stitch is completed. In this way, the fabric sewing work can be completed. It can be seen that the fifth servo system and the sixth servo system also need to strictly complete the synchronous operation work. If the speed of the sixth servo system is faster than that of the fifth servo system, the phenomenon of ejection and broken needles will occur. If the speed of the fifth servo system is faster than that of the sixth servo system, the phenomenon of missing needles and empty needles will occur.

[0064] See also Figure 4 , Figure 4 This is a schematic diagram of the principle of a pair of servo systems working synchronously. Figure 4In the embodiment, the synchronous operation of the first servo system and the second servo system is taken as an example for specific description. The synchronous operation of the first servo system and the second servo system is realized by the cooperation of the host computer, the motion controller, the first servo controller, the second servo controller, the first servo motor and the second servo motor. Among them, the first servo driver is the controller in the first servo system, and the second servo driver is the controller in the second servo system.

[0065] Specifically, the staff can pass various configuration information and sewing template data to the motion controller through the host computer. The motion controller is equivalent to the command center of the entire fully automatic template sewing machine. It will parse the configuration information and sewing template data in the host computer, and send the parsed data to the first servo drive and the second servo drive in the form of motion instructions. The motion controller, the first servo drive and the second servo drive usually exchange data through RS485.

[0066] When the first servo driver receives the motion instruction sent by the motion controller, it calculates the running speed of the first servo motor and converts it into a corresponding three-phase AC signal to control the running speed of the first servo motor. Similarly, when the second servo driver receives the motion instruction sent by the motion controller, it calculates the running speed of the second servo motor and converts it into a corresponding three-phase AC signal to control the running speed of the second servo motor.

[0067] At the same time, the first encoder will feed back the real-time speed of the first servo motor to the first servo driver. When the first servo driver receives the feedback data sent by the first encoder, it will send the feedback data to the motion controller, so that the motion controller can timely know the real-time operating status of the first servo motor, and the first servo driver can more accurately control the first servo motor. Similarly, the second encoder will feed back the real-time speed of the second servo motor to the second servo driver. When the second servo driver receives the feedback data sent by the second encoder, it will send the feedback data to the motion controller, so that the motion controller can timely know the real-time operating status of the second servo motor, and the second servo driver can more accurately control the second servo motor.

[0068] Among them, the first servo driver and the second servo driver transmit each other's position information through pulse frequency division, and realize the synchronous operation of the first servo system and the second servo system through the gantry synchronization algorithm. In order to realize the synchronous operation of the first servo system and the second servo system, the pulse frequency division output interface on the first servo system needs to be connected to the gantry pulse input interface of the second servo system, and the pulse frequency division output interface on the second servo system also needs to be connected to the gantry pulse input interface of the first servo system. Under this setting mode, the first servo system will send a fixed number of pulses to the second servo system every time it rotates one circle, and the second servo system will also send a fixed number of pulses to the first servo system every time it rotates one circle. The two servo systems tell each other their current operating positions through this method. In this process, the first servo system and the second servo system also need to obtain the position data fed back by their own encoders in order to perform algorithmic compensation for the motion difference of the two servo systems.

[0069] From the above discussion, it can be seen that in the prior art, when a pair of servo systems that need to run synchronously execute relevant synchronization algorithms, not only a relatively complex hard-wired connection structure is required, but also two independent servo drives also require two independent power supplies for power supply. This results in excessively high costs for synchronous control of the first servo system and the second servo system, and also requires a larger space volume.

[0070] In order to solve the above technical problems, in the present invention, the hardware structure of the fully automatic template sewing machine is first improved. Assuming that the first servo system and the second servo system in the fully automatic template sewing machine need to run synchronously, it is necessary to use a target chip to connect the first controller and the second controller respectively used to control the first servo system and the second servo system, and the first controller, the second controller and the target chip are integrated on the same circuit board.

[0071] In a servo system, there are usually position loops, speed loops and current loops. The output of the position loop is the input of the speed loop, the output of the speed loop is the input of the current loop, and the signal output by the current loop is usually used to control the speed of the servo system. Therefore, the speed of the servo system can be controlled according to this control principle of the servo system.

[0072] At the same time, in the PID (Proportional Integral Derivative) algorithm, only the three parameters of proportion, integration and differentiation in the PID algorithm need to be adjusted to intuitively change the control effect of the servo system, which is convenient for debugging and optimization. Therefore, in this application, the speed of the servo system is accurately controlled based on the PID algorithm and combined with the position loop, speed loop and current loop in the servo system.

[0073] Among them, the calculation formula of PID algorithm is as follows:

[0074] ;

[0075] In the formula, is the output of the PID algorithm, is the input deviation value, Usually obtained by subtracting the command value from the feedback value. is the proportional gain constant, is the integration time constant, is the differential time constant.

[0076] Specifically, in this embodiment, the control method of the fully automatic template sewing machine is specifically described with the first controller in the first servo system as the execution subject. It should be noted that in actual applications, the execution logic of the controller corresponding to each servo system is consistent, and here only the first controller is used as the execution subject to specifically describe the speed control process of the first servo system.

[0077] In this method, first, the position instruction of the first servo system when executing the current position loop task is obtained, that is, the ideal position corresponding to the first servo system when executing the current position loop task is obtained; then, the position feedback value of the first servo system when executing the current position loop task and the position feedback value of the second servo system when executing the current position loop task are obtained. Among them, the position feedback value of the first servo system when executing the current position loop task and the position feedback value of the second servo system when executing the current position loop task are respectively used to represent the real positions corresponding to the first servo system and the second servo system when executing the current position loop task.

[0078] When the position instruction of the first servo system when executing the current position loop task, the position feedback value of the first servo system when executing the current position loop task, and the position feedback value of the second servo system when executing the current position loop task are obtained, based on the PID algorithm and according to the position instruction of the first servo system when executing the current position loop task, the position feedback value of the first servo system when executing the current position loop task, and the position feedback value of the second servo system when executing the current position loop task, the target expected speed corresponding to the first servo system when executing the current speed loop task can be calculated.

[0079] When calculating the target expected speed corresponding to the first servo system when executing the current speed loop task, since the position feedback value of the first servo system when executing the current position loop task and the position feedback value of the second servo system when executing the current position loop task are taken into consideration, the target expected speed corresponding to the first servo system when executing the current speed loop task will be aimed at the synchronous operation of the first servo system and the second servo system.

[0080] Then, a speed feedback value of the first servo system when executing the current speed loop task is obtained, wherein the speed feedback value of the first servo system when executing the current speed loop task is used to represent the actual speed of the first servo system when executing the current speed loop task.

[0081] When the speed feedback value of the first servo system when executing the current speed loop task is obtained, based on the PID algorithm and according to the target expected speed and the speed feedback value of the first servo system when executing the current speed loop task, the target input signal of the first servo system when executing the current current loop task can be obtained.

[0082] Since the current loop can output three-phase alternating current for regulating the rotational speed of the first servo system, when the target input signal corresponding to the first servo system when executing the current current loop task is obtained, through relevant calculations of the current loop, the current loop can output three-phase alternating current for regulating the rotational speed of the first servo system according to the target input signal.

[0083] At the same time, because the target expected speed corresponding to the first servo system when executing the current speed loop task is based on the premise that the first servo system and the second servo system operate synchronously, the effect of synchronous operation of the first servo system and the second servo system can be achieved by regulating the speed of the first servo system.

[0084] In addition, since the first servo system and the second servo system exchange data through the target chip, there is no need to use complex pulse frequency division to transmit position information between each other. This makes it easier for developers to develop more position correction functions related to the servo system in subsequent work.

[0085] Compared with the prior art, since the first controller, the second controller and the target chip are integrated on the same circuit board, the first servo system and the second servo system can share a set of power supply. At the same time, the first controller and the second controller directly exchange data through the target chip, without the need to use connecting wires to connect the corresponding pulse frequency division output interface and gantry pulse input interface in the first servo system and the second servo system respectively, which can not only greatly reduce the structural complexity of the hardware connection and the space volume occupied when the first servo system and the second servo system are synchronously controlled, but also reduce the cost investment required for the synchronous control of the first servo system and the second servo system.

[0086] Moreover, in the control method, the target expected speed of the first servo system when executing the current speed loop task is determined mainly based on the PID algorithm, and according to the position instruction of the first servo system when executing the current position loop task and the position feedback value of the first servo system and the second servo system when executing the current position loop task. Since the target expected speed takes into account the position feedback value of the first servo system and the second servo system when executing the current position loop task, it is equivalent to obtaining the target expected speed corresponding to the first servo system when executing the current speed loop task with the first servo system and the second servo system running synchronously as the goal. Afterwards, based on the PID algorithm, the target input signal of the first servo system when executing the current current loop task is obtained according to the target expected speed and the speed feedback value of the first servo system when executing the current speed loop task. Because the output signal of the current loop can directly control the rotation speed of the first servo system, the rotation speed of the first servo system can be regulated by using the target input signal, so that the first servo system and the second servo system can achieve the purpose of synchronous operation.

[0087] Based on the above embodiments, this embodiment further illustrates and optimizes the technical solution. As a preferred implementation, the first controller is a first MCU, the second controller is a second MCU, and the target chip is an FPGA.

[0088] In this embodiment, the first controller can be set as the first MCU (Micro Controller Unit), the second controller can be set as the second MCU, and the target chip can be set as FPGA (Field Programmable Gate Array). Because MCU is small in size, low in power consumption, and easy to program and develop compared to other controllers, this can not only reduce the space occupied by the first controller and the second controller, but also reduce the difficulty of developers to develop the first controller and the second controller. At the same time, FPGA has a high degree of parallel processing capability and can realize high-speed logic operations and data processing at the hardware level, thereby ensuring the accuracy and stability of the first controller when controlling the first servo system.

[0089] In addition, in this embodiment, when the first servo system and the second servo system are synchronously controlled, two MCUs are used to synchronously control the first servo system and the second servo system, so the working performance requirements of the MCU are not too harsh. In addition, the MCU is easy to program and develop, which makes the algorithm transplantation, cutting and maintenance of the MCU relatively simple, thereby reducing the difficulty of the developer's work.

[0090] Obviously, the technical solution provided by this embodiment can further improve the working performance of the full-automatic template sewing machine.

[0091] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. As a preferred implementation, the above steps: based on the PID algorithm, and according to the position instruction of the first servo system when executing the current position loop task and the position feedback value of the first servo system and the second servo system when executing the current position loop task, the target expected speed of the first servo system when executing the current speed loop task is obtained, including:

[0092] When the timer of the full-automatic template sewing machine is triggered, the position instruction of the first servo system when executing the current position loop task is obtained to obtain the target position instruction;

[0093] Obtaining a position deviation value corresponding to the first servo system in the current operation cycle according to the target position instruction and the position feedback value of the first servo system when executing the current position loop task, to obtain a first deviation value;

[0094] Obtaining a position deviation value corresponding to the second servo system in the current operation cycle according to a position feedback value of the first servo system when executing the current position loop task and a position feedback value of the second servo system when executing the current position loop task, to obtain a second deviation value;

[0095] The target expected speed of the first servo system when executing the current speed loop task is obtained according to the proportional gain constant, the first deviation value and the second deviation value in the PID algorithm.

[0096] In this embodiment, the execution actions of the position loop, speed loop and current loop in the fully automatic template sewing machine are triggered by a timer. The timer is equivalent to a timer alarm clock, which triggers the first controller to execute corresponding actions at fixed intervals.

[0097] Specifically, when the timer of the fully automatic template sewing machine is triggered, the first controller first obtains the position instruction of the first servo system when executing the current position loop task, and obtains the target position instruction; wherein the target position instruction is equivalent to the ideal position corresponding to the first servo system when executing the current position loop task.

[0098] The first servo system and the second servo system will execute multiple sets of mutually cascaded position loop tasks, speed loop tasks and current loop tasks in one operation cycle. The operation cycles of the first servo system and the second servo system are parameter values ​​pre-set by the fully automatic template sewing machine, and one operation cycle usually includes multiple sets of mutually cascaded position loop tasks, speed loop tasks and current loop tasks.

[0099] In order to enable the first controller to timely and accurately know the accumulated position errors generated by the first servo system and the second servo system during actual operation, and to avoid losing tracking of the motion trajectories of the first servo system and the second servo system, the first controller needs to obtain the position deviation value corresponding to the first servo system in the current operation cycle according to the target position instruction and the position feedback value of the first servo system when the system executes the current position loop task, and obtain the first deviation value; and obtain the position deviation value corresponding to the second servo system in the current operation cycle according to the position feedback value of the first servo system when executing the current position loop task and the position feedback value of the second servo system when executing the current position loop task, and obtain the second deviation value.

[0100] After obtaining the first deviation value and the second deviation value, the first controller is equivalent to knowing the accumulated position error generated by the first servo system and the second servo system during the actual operation. Because the position loop in the servo system only has the proportional gain calculation part in the PID algorithm, the target expected speed corresponding to the first servo system when executing the current speed loop task can be calculated based on the proportional gain constant, the first deviation value and the second deviation value in the PID algorithm.

[0101] If the first deviation value is , and the second deviation value is , then the target expected speed corresponding to the first servo system when executing the current speed loop task is:

[0102] ;

[0103] In the formula, is the target desired speed, is the speed command of the first servo system, is the speed compensation instruction of the first servo system, is the proportional gain constant, is the first deviation value, is the second deviation value.

[0104] Obviously, through the technical solution provided in this embodiment, the target expected speed corresponding to the first servo system when executing the current speed loop task can be accurately calculated.

[0105] As a preferred implementation, the above step of obtaining the position instruction of the first servo system when executing the current position loop task to obtain the target position instruction includes:

[0106] Acquire a pulse signal corresponding to the first servo system when executing the current position loop task to obtain a first pulse signal, and acquire a pulse signal corresponding to the first servo system when executing the previous position loop task to obtain a second pulse signal;

[0107] Calculating the difference between the first pulse signal and the second pulse signal to obtain a target difference;

[0108] The position instruction of the first servo system when executing the current position loop task is determined according to the target difference and the electronic gear ratio of the first servo system to obtain the target position instruction.

[0109] In this embodiment, when the first controller obtains the target position instruction corresponding to the first servo system when executing the current position loop task, it first obtains the pulse signal corresponding to the first servo system when executing the current position loop task to obtain the first pulse signal, and obtains the pulse signal corresponding to the first servo system when executing the previous position loop task to obtain the second pulse signal. The first pulse signal and the second pulse signal are usually sent by the main station of the fully automatic template sewing machine, and the main station is the controller of the first controller and the second controller.

[0110] Then, the difference between the first pulse signal and the second pulse signal is calculated to obtain the target difference. , and according to the target difference and the electronic gear ratio of the first servo system Determine the position command of the first servo system when executing the current position loop task, and obtain the target position command .

[0111] That is, ;

[0112] In the formula, is the target position instruction, is the target difference, is the electronic gear ratio of the first servo system, It is the ratio between the numerator and denominator of the electronic gear ratio. Usually, the numerator and denominator of the electronic gear ratio are open to the user as functional parameters, and the user can modify them by definition.

[0113] Obviously, through the technical solution provided in this embodiment, the target position instruction corresponding to the first servo system when executing the current position loop task can be accurately calculated.

[0114] As a preferred implementation, the above step of obtaining the position deviation value corresponding to the first servo system in the current operation cycle according to the target position instruction and the position feedback value of the first servo system when executing the current position loop task to obtain the first deviation value includes:

[0115] The target chip reads the position data corresponding to the first servo system when executing the current position loop task and the last position loop task from the encoder corresponding to the first servo system, respectively, to obtain the first position data and the second position data;

[0116] Calculating a difference between the first position data and the second position data to obtain a position feedback value of the first servo system when executing the current position loop task;

[0117] Obtaining a position deviation value corresponding to the first servo system in the current operation cycle according to the target position instruction and the position feedback value of the first servo system when executing the current position loop task, to obtain a first deviation value;

[0118] Correspondingly, the position deviation value corresponding to the second servo system in the current operation cycle is obtained according to the position feedback value of the first servo system when executing the current position loop task and the position feedback value of the second servo system when executing the current position loop task, to obtain the second deviation value, including:

[0119] The target chip is used to read the position data corresponding to the second servo system when executing the current position loop task and the previous position loop task from the encoder corresponding to the second servo system to obtain the third position data and the fourth position data;

[0120] Calculate the difference between the third position data and the fourth position data to obtain a position feedback value of the second servo system when executing the current position loop task;

[0121] The position deviation value corresponding to the second servo system in the current operation cycle is obtained according to the position feedback value of the first servo system when executing the current position loop task and the position feedback value of the second servo system when executing the current position loop task, so as to obtain the second deviation value.

[0122] In this embodiment, when the first controller obtains the position deviation corresponding to the first servo system in the current operation cycle, it first reads the position data corresponding to the first servo system when executing the current position loop task and the previous position loop task from the encoder corresponding to the first servo system through the target chip to obtain the first position data and the second position data; then, the difference between the first position data and the second position data is obtained to determine the position feedback value of the first servo system when executing the current position loop task. .

[0123] Since the first servo system runs very fast in actual applications, it is usually impossible to track the position of the first servo system in real time. In order to accurately calculate the cumulative position error generated by the first servo system during actual operation, it is necessary to accumulate the position errors generated by the first servo system when executing all position loop tasks in the current operation cycle to obtain the position deviation value corresponding to the first servo system in the current operation cycle, thereby obtaining the first deviation value. .

[0124] That is, ;

[0125] In the formula, is the first deviation value, The first servo system is executing The position command corresponding to the position loop task is: The first servo system is executing The position feedback value corresponding to the position loop task, It is the total number of position loop tasks executed by the first servo system in one operation cycle.

[0126] Similarly, when the first controller obtains the position deviation corresponding to the second servo system in the current operation cycle, it first reads the position data corresponding to the second servo system when executing the current position loop task and the previous position loop task from the encoder corresponding to the second servo system through the target chip to obtain the third position data and the fourth position data; then, the difference between the third position data and the fourth position data is calculated to determine the position feedback value of the second servo system when executing the current position loop task. .

[0127] Afterwards, the position errors generated by the second servo system when executing all position loop tasks in the current operation cycle are accumulated to obtain the position deviation value corresponding to the second servo system in the current operation cycle, thereby obtaining the second deviation value .

[0128] That is, ;

[0129] In the formula, is the second deviation value, The first servo system is executing The position feedback value corresponding to the position loop task, The second servo system is executing The position feedback value corresponding to the position loop task, It is the total number of position loop tasks executed by the second servo system in one operation cycle.

[0130] Obviously, through the technical solution provided in this embodiment, the position deviation values ​​corresponding to the first servo system and the second servo system in the current operation cycle can be accurately calculated.

[0131] As a preferred implementation, the control method further includes:

[0132] When a synchronization pulse signal sent by the target chip is received, it is determined that the timer is re-triggered, and the step of obtaining the position instruction of the first servo system when performing the current position loop task and obtaining the target position instruction is re-executed; wherein the target chip sends a synchronization pulse signal to the first controller at preset intervals.

[0133] In this embodiment, the target chip sends a synchronization pulse signal to the first controller and the second controller via a timer at preset time intervals, thereby ensuring the synchronization of the first servo system and the second servo system during operation.

[0134] Specifically, when the first controller receives the synchronization pulse signal sent by the target chip, it means that the timer is re-triggered and the count value in the timer has been cleared. At this time, the first controller will re-execute the steps of obtaining the position instruction of the first servo system when executing the current position loop task, obtaining the target position instruction, and subsequent steps, and thus start executing a new round of position loop tasks, speed loop tasks and current loop tasks.

[0135] Obviously, through the technical solution provided in this embodiment, the accumulated position error generated during the operation of the first servo system and the second servo system can be relatively reduced, and the synchronous operation of the first servo system and the second servo system can be ensured.

[0136] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. As a preferred implementation mode, the above steps: based on the PID algorithm, and according to the target expected speed and the speed feedback value of the first servo system when performing the current loop task, the target input signal of the first servo system when performing the current loop task is obtained, including:

[0137] Obtaining a speed deviation value of the first servo system when executing the current current loop task according to the target expected speed and the speed feedback value of the first servo system when executing the current speed loop task, to obtain a target speed deviation value;

[0138] The target input signal of the first servo system when executing the current current loop task is obtained according to the proportional gain constant and the integral time constant in the PID algorithm and the target speed deviation value.

[0139] In this embodiment, when determining the target input signal of the first servo system when performing the current current loop task, the speed deviation value of the first servo system when performing the current current loop task is first obtained based on the target expected speed and the speed feedback value of the first servo system when performing the current speed loop task to obtain the target speed deviation value.

[0140] When determining the speed feedback value of the first servo system when executing the current speed loop task, it is only necessary to take the ratio between the position feedback value of the first servo system when executing the current position loop task and the time, so as to calculate the speed feedback value of the first servo system when executing the current speed loop task.

[0141] The calculation expression of the target speed deviation value is as follows:

[0142] ;

[0143] In the formula, is the target speed deviation value, is the target desired speed, It is the speed feedback value of the first servo system when executing the current speed loop task.

[0144] In order to avoid the error caused by the amplified control, the differential calculation link in the PID algorithm is usually removed. Therefore, the current loop in the servo system only involves the proportional gain and integral calculation parts in the PID algorithm. In this case, the target input signal corresponding to the first servo system when executing the current current loop task can be calculated based on the proportional gain constant and integral time constant in the PID algorithm and the target speed deviation value.

[0145] Among them, the expression of the target input signal is:

[0146] ;

[0147] In the formula, For the target input signal, is the proportional gain constant, is the integration time constant, is the target speed deviation value.

[0148] When the target input signal corresponding to the first servo system when executing the current loop task is obtained, the current loop can output the three-phase alternating current required to control the rotational speed of the first servo system through relevant calculations of the current loop. The rotational speed of the first servo system can be controlled by the three-phase alternating current output by the current loop, thereby achieving the effect of synchronous operation of the first servo system and the second servo system.

[0149] Obviously, through the technical solution provided in this embodiment, the rotation speed of the first servo system can be controlled in real time and accurately.

[0150] See also Figure 5 , Figure 5 A structural diagram of a control device for a fully automatic template sewing machine provided by an embodiment of the present invention. The first servo system and the second servo system in the fully automatic template sewing machine need to run synchronously, and the first controller and the second controller that respectively control the first servo system and the second servo system are connected through a target chip, and the first controller, the second controller and the target chip are integrated on the same circuit board. The device includes:

[0151] A speed acquisition module 21 is used to acquire a target expected speed of the first servo system when performing a current speed loop task based on a PID algorithm and according to a position instruction of the first servo system when performing a current position loop task and position feedback values ​​of the first servo system and the second servo system when performing the current position loop task;

[0152] A signal acquisition module 22, configured to acquire a target input signal of the first servo system when performing a current loop task based on the PID algorithm and according to the target expected speed and a speed feedback value of the first servo system when performing a current loop task;

[0153] The rotation speed control module 23 is used to control the rotation speed of the first servo system using the target input signal.

[0154] Preferably, the speed acquisition module 21 includes:

[0155] An instruction acquisition submodule, used for acquiring a position instruction of the first servo system when executing a current position loop task to obtain a target position instruction when the timer of the full-automatic template sewing machine is triggered;

[0156] A first difference acquisition submodule is used to acquire a position deviation value corresponding to the first servo system in a current operation cycle according to the target position instruction and a position feedback value of the first servo system when executing a current position loop task, so as to obtain a first deviation value;

[0157] A second difference acquisition submodule, used to acquire a position deviation value corresponding to the second servo system in a current operation cycle according to a position feedback value of the first servo system when executing the current position loop task and a position feedback value of the second servo system when executing the current position loop task, to obtain a second deviation value;

[0158] The speed acquisition submodule is used to acquire the target expected speed of the first servo system when executing the current speed loop task according to the proportional gain constant, the first deviation value and the second deviation value in the PID algorithm.

[0159] Preferably, the instruction acquisition submodule includes:

[0160] A pulse acquisition unit, used to acquire a pulse signal corresponding to the first servo system when executing a current position loop task, to obtain a first pulse signal, and to acquire a pulse signal corresponding to the first servo system when executing a previous position loop task, to obtain a second pulse signal;

[0161] A difference obtaining unit, used for obtaining a difference between the first pulse signal and the second pulse signal to obtain a target difference;

[0162] The instruction acquisition unit is used to determine the position instruction of the first servo system when executing the current position loop task according to the target difference and the electronic gear ratio of the first servo system, so as to obtain the target position instruction.

[0163] Preferably, the first difference acquisition submodule includes:

[0164] A first data reading unit is used to read the position data corresponding to the first servo system when executing the current position loop task and the last position loop task from the encoder corresponding to the first servo system through the target chip to obtain the first position data and the second position data;

[0165] A first position obtaining unit, used for obtaining a difference between the first position data and the second position data, to obtain a position feedback value of the first servo system when executing a current position loop task;

[0166] A first deviation calculation unit is used to obtain a position deviation value corresponding to the first servo system in a current operation cycle according to the target position instruction and a position feedback value of the first servo system when executing a current position loop task, so as to obtain the first deviation value;

[0167] Correspondingly, the second difference acquisition submodule includes:

[0168] A second data reading unit is used to read the position data corresponding to the second servo system when executing the current position loop task and the previous position loop task from the encoder corresponding to the second servo system through the target chip to obtain third position data and fourth position data;

[0169] A second position obtaining unit is used to obtain a difference between the third position data and the fourth position data to obtain a position feedback value of the second servo system when executing a current position loop task;

[0170] The second deviation calculation unit is used to obtain the position deviation value corresponding to the second servo system in the current operation cycle according to the position feedback value of the first servo system when executing the current position loop task and the position feedback value of the second servo system when executing the current position loop task, so as to obtain the second deviation value.

[0171] Preferably, it also includes:

[0172] A pulse receiving submodule is used to determine that the timer is re-triggered when receiving the synchronization pulse signal sent by the target chip, and re-execute the step of obtaining the position instruction of the first servo system when executing the current position loop task to obtain the target position instruction; wherein, the target chip sends the synchronization pulse signal to the first controller at preset intervals.

[0173] Preferably, the signal acquisition module 22 includes:

[0174] a speed obtaining submodule, used for obtaining a speed deviation value of the first servo system when executing the current current loop task according to the target expected speed and a speed feedback value of the first servo system when executing the current speed loop task, so as to obtain a target speed deviation value;

[0175] The signal acquisition submodule is used to acquire the target input signal of the first servo system when executing the current current loop task according to the proportional gain constant and the integral time constant in the PID algorithm and the target speed deviation value.

[0176] A control device for a fully automatic template sewing machine provided by an embodiment of the present invention has the beneficial effects of the control method for a fully automatic template sewing machine disclosed above.

[0177] See also Figure 6 , Figure 6 This is a structural diagram of an electronic device provided by an embodiment of the present invention, and the fully automatic template sewing machine includes:

[0178] A memory 31, used for storing computer programs;

[0179] The processor 32 is used to implement the steps of the control method of a fully automatic template sewing machine disclosed above when executing the computer program.

[0180] An electronic device provided by an embodiment of the present invention has the beneficial effects of the control method of the fully automatic template sewing machine disclosed above.

[0181] Correspondingly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a control method for a fully automatic template sewing machine as disclosed above are implemented.

[0182] A computer-readable storage medium provided by an embodiment of the present invention has the beneficial effects of the control method of the fully automatic template sewing machine disclosed above.

[0183] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0184] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0185] The control method, device, equipment and medium of a fully automatic template sewing machine provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A control method for a fully automatic template sewing machine, characterized in that: The first servo system and the second servo system in the fully automatic template sewing machine need to run synchronously, the first controller and the second controller for controlling the first servo system and the second servo system respectively are connected through a target chip, and the first controller, the second controller and the target chip are integrated on the same circuit board, and the method includes: Based on the PID algorithm, and according to the position instruction of the first servo system when executing the current position loop task and the position feedback values ​​of the first servo system and the second servo system when executing the current position loop task, the target expected speed of the first servo system when executing the current speed loop task is obtained; Based on the PID algorithm, and according to the target expected speed and the speed feedback value of the first servo system when performing the current speed loop task, a target input signal of the first servo system when performing the current current loop task is obtained; controlling the rotation speed of the first servo system using the target input signal; The method of obtaining the target expected speed of the first servo system when executing the current speed loop task based on the PID algorithm and according to the position instruction of the first servo system when executing the current position loop task and the position feedback values ​​of the first servo system and the second servo system when executing the current position loop task includes: When the timer of the fully automatic template sewing machine is triggered, a position instruction of the first servo system when executing the current position loop task is obtained to obtain a target position instruction; Obtaining a position deviation value corresponding to the first servo system in a current operation cycle according to the target position instruction and a position feedback value of the first servo system when executing a current position loop task, to obtain a first deviation value; Obtaining a position deviation value corresponding to the second servo system in a current operation cycle according to a position feedback value of the first servo system when executing the current position loop task and a position feedback value of the second servo system when executing the current position loop task, to obtain a second deviation value; The target expected speed of the first servo system when executing the current speed loop task is obtained according to the proportional gain constant, the first deviation value and the second deviation value in the PID algorithm.

2. The control method of a fully automatic template sewing machine according to claim 1, characterized in that: The first controller is a first MCU, the second controller is a second MCU, and the target chip is an FPGA.

3. The control method of a fully automatic template sewing machine according to claim 1, characterized in that: The step of obtaining the position instruction of the first servo system when executing the current position loop task to obtain the target position instruction includes: Acquire a pulse signal corresponding to the first servo system when executing a current position loop task to obtain a first pulse signal, and acquire a pulse signal corresponding to the first servo system when executing a previous position loop task to obtain a second pulse signal; Calculating a difference between the first pulse signal and the second pulse signal to obtain a target difference; The position instruction of the first servo system when executing the current position loop task is determined according to the target difference and the electronic gear ratio of the first servo system to obtain the target position instruction.

4. The control method of a fully automatic template sewing machine according to claim 1, characterized in that: The step of obtaining a position deviation value corresponding to the first servo system in the current operation cycle according to the target position instruction and the position feedback value of the first servo system when executing the current position loop task, and obtaining the first deviation value, comprises: Reading the position data corresponding to the first servo system when executing the current position loop task and the last position loop task from the encoder corresponding to the first servo system through the target chip, respectively, to obtain the first position data and the second position data; Calculating a difference between the first position data and the second position data to obtain a position feedback value of the first servo system when executing a current position loop task; Obtaining a position deviation value corresponding to the first servo system in a current operation cycle according to the target position instruction and a position feedback value of the first servo system when executing a current position loop task, to obtain the first deviation value; Correspondingly, the position deviation value corresponding to the second servo system in the current operation cycle is obtained according to the position feedback value of the first servo system when executing the current position loop task and the position feedback value of the second servo system when executing the current position loop task, to obtain the second deviation value, including: The target chip reads the position data corresponding to the second servo system when executing the current position loop task and the last position loop task from the encoder corresponding to the second servo system, respectively, to obtain the third position data and the fourth position data; Calculating a difference between the third position data and the fourth position data to obtain a position feedback value of the second servo system when executing a current position loop task; The position deviation value corresponding to the second servo system in the current operation cycle is obtained according to the position feedback value of the first servo system when executing the current position loop task and the position feedback value of the second servo system when executing the current position loop task, so as to obtain the second deviation value.

5. The control method of a fully automatic template sewing machine according to claim 1, characterized in that: Also includes: When the synchronization pulse signal sent by the target chip is received, it is determined that the timer is re-triggered, and the step of obtaining the position instruction of the first servo system when performing the current position loop task to obtain the target position instruction is re-executed; wherein, the target chip sends the synchronization pulse signal to the first controller at preset intervals.

6. The control method of a fully automatic template sewing machine according to claim 1, characterized in that: The method of obtaining a target input signal of the first servo system when executing the current current loop task based on the PID algorithm and according to the target expected speed and the speed feedback value of the first servo system when executing the current speed loop task includes: Obtaining a speed deviation value of the first servo system when executing the current current loop task according to the target expected speed and a speed feedback value of the first servo system when executing the current speed loop task, to obtain a target speed deviation value; The target input signal of the first servo system when executing the current current loop task is obtained according to the proportional gain constant and the integral time constant in the PID algorithm and the target speed deviation value.

7. A control device for a fully automatic template sewing machine, characterized in that: The first servo system and the second servo system in the fully automatic template sewing machine need to run synchronously, and the first controller and the second controller that respectively control the first servo system and the second servo system are connected through a target chip, and the first controller, the second controller and the target chip are integrated on the same circuit board. The device includes: A speed acquisition module, used for acquiring a target expected speed of the first servo system when performing a current speed loop task based on a PID algorithm and according to a position instruction of the first servo system when performing a current position loop task and position feedback values ​​of the first servo system and the second servo system when performing the current position loop task; A signal acquisition module, used for acquiring a target input signal of the first servo system when performing a current loop task based on the PID algorithm and according to the target expected speed and a speed feedback value of the first servo system when performing a current loop task; A speed control module, used to control the speed of the first servo system using the target input signal; The speed acquisition module comprises: An instruction acquisition submodule, used for acquiring a position instruction of the first servo system when executing a current position loop task to obtain a target position instruction when the timer of the full-automatic template sewing machine is triggered; A first difference acquisition submodule is used to acquire a position deviation value corresponding to the first servo system in a current operation cycle according to the target position instruction and a position feedback value of the first servo system when executing a current position loop task, so as to obtain a first deviation value; A second difference acquisition submodule, used to acquire a position deviation value corresponding to the second servo system in a current operation cycle according to a position feedback value of the first servo system when executing the current position loop task and a position feedback value of the second servo system when executing the current position loop task, to obtain a second deviation value; The speed acquisition submodule is used to acquire the target expected speed of the first servo system when executing the current speed loop task according to the proportional gain constant, the first deviation value and the second deviation value in the PID algorithm.

8. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, used to implement the steps of a control method for a fully automatic template sewing machine as described in any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the control method of a fully automatic template sewing machine as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Control method and system of servo motor, machine tool, and friction-compressing device

    JP2000152693A

  • Numerical controller

    US20070145931A1