Color changing method and system for embroidery machine

By setting equally spaced magnetic switches and magnetic encoders in the embroidery machine, real-time detection and calibration compensation are achieved, and error accumulation and data loss problems in the color change method of traditional embroidery machine are solved, improving the accuracy and reliability of color change , improves the quality of embroidery products.

CN119083064AActive Publication Date: 2024-12-06FUZHOU HUICHUANG INTELLIGENT CONTROL TECHNOLOGY CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411246888.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-06
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

The traditional embroidery machine color change method has problems such as accumulation of errors, assembly errors, poor efficiency, poor reliability, and data loss when the power supply is powered off.

Method used

In the color change device of the embroidery machine, four magnetic switches are set at 90° intervals, and real-time detection and calibration compensation are performed through the magnetic switch and magnetic encoder, so as to realize automatic reset and emergency power supply, storing and restoring working data.

Benefits of technology

It improves the accuracy, efficiency and reliability of color change of embroidery machine, avoids data loss, and improves the quality of embroidery products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119083064A_ABST
    Figure CN119083064A_ABST
Patent Text Reader

Abstract

The invention provides a color changing method and system for an embroidery machine in the technical field of embroidery machines. The method comprises the following steps: S1, arranging four magnetic switches at equal intervals; s2, setting an initial position of a motor, moving a color changing rod by a stroke, and calibrating a rotation angle sensed by a magnetic encoder; s3, the embroidery machine is reset based on the initial position after being powered on, and the color changing rod is driven to move based on the embroidery operation file; s4, detecting a first moving distance of the color changing rod through a magnetic switch in the operation process of the motor, and detecting a second moving distance of the color changing rod through a magnetic encoder so as to calculate a distance error; s5, querying the corresponding relation table based on the distance error to calibrate and compensate the second movement distance; and step S6, when power failure is monitored, switching to a lithium battery for emergency power supply, and rotating the embroidery operation file for multiple circles and storing the embroidery operation file in an EEPROM (Electrically Erasable Programmable Read-Only Memory). The color changing device has the advantages that the color changing accuracy, efficiency and reliability of the embroidery machine are greatly improved, and the quality of embroidery products is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of embroidery machines, in particular to a color changing method and system for embroidery machines. Background Art

[0002] Embroidery machine, also known as computer embroidery machine, is the most advanced embroidery machine in contemporary times. It can make traditional hand embroidery be realized with high speed and high efficiency, and can also realize the requirements of "multi-level, multi-function, unity and perfection" that hand embroidery cannot achieve. It is an electromechanical product that embodies a variety of high-tech. As computer embroidery replaces hand embroidery, computer embroidery machine will also become the main machine type in the embroidery industry.

[0003] In order to ensure the aesthetics of embroidery products, it is generally necessary to set multiple colors to express different things, so multiple colors of embroidery threads are needed; during the operation of the embroidery machine, the embroidery needle on the color-changing rod needs to be adjusted in position so that the embroidery needle that threads the embroidery threads of different colors can be in the working position when needed, that is, to perform the color-changing operation.

[0004] For the color change of embroidery machines, the motor drives the transmission mechanism to link the color change rod to move, and the displacement distance of the color change rod is detected by the magnetic encoder, that is, the number of rotations of the transmission mechanism is detected and converted into the displacement distance. However, the traditional method has the following disadvantages:

[0005] 1. Errors are inevitable during the detection process of the magnetic encoder. As the errors accumulate, the embroidery needle will gradually deviate from the preset working position. 2. As assembly errors are inevitable during the assembly process of the embroidery machine, traditionally, the initial positioning operation of the color-changing rod needs to be performed manually every time the embroidery machine is powered on, which is time-consuming and labor-intensive, thus affecting the color-changing efficiency of the embroidery machine. 3. When the embroidery machine suddenly loses power, the magnetic encoder will lose its operating data, resulting in the inability to continue the previous work when the power is restored, thus affecting the reliability of the embroidery machine's color change.

[0006] Therefore, how to provide an embroidery machine color changing method and system to improve the accuracy, efficiency and reliability of the embroidery machine color changing and improve the quality of the embroidery products has become a technical problem that needs to be solved urgently. Summary of the invention

[0007] The technical problem to be solved by the present invention is to provide an embroidery machine color changing method and system, so as to improve the accuracy, efficiency and reliability of the embroidery machine color changing and improve the quality of the embroidery products.

[0008] In a first aspect, the present invention provides an embroidery machine color changing method, comprising the following steps:

[0009] Step S1, four magnetic switches for detecting the rotation angle of the motor are arranged at intervals of 90 degrees in the color changing device of the embroidery machine;

[0010] Step S2, setting the initial position of the motor based on the magnetic switch, moving the color-changing rod in the color-changing device by one stroke, and calibrating the rotation angle sensed by the magnetic encoder;

[0011] Step S3, after the embroidery machine is powered on, a reset operation is performed based on the initial position, and the motor is driven to operate based on the input embroidery operation file, so as to move the color-changing rod in linkage, so that the corresponding embroidery needle is in the working position;

[0012] Step S4, during the operation of the motor, the single chip microcomputer detects the first moving distance of the color changing rod in real time through the magnetic switch, detects the second moving distance of the color changing rod in real time through the magnetic encoder, and calculates the distance error between the first moving distance and the second moving distance;

[0013] Step S5, the single chip computer performs calibration compensation on the second moving distance by querying a corresponding relationship table between the absolute needle position of the embroidery needle and the rotation angle sensed by the magnetic encoder based on the distance error;

[0014] Step S6: When the power switching circuit detects that the external power module loses power, it synchronously switches to the lithium battery for emergency power supply;

[0015] Step S7, the single chip microcomputer stores the embroidery operation file and the multi-turn rotation angle sensed by the magnetic encoder into the EEPROM memory, and when the external power module resumes power supply, the embroidery operation file and the multi-turn rotation angle are read from the EEPROM memory to continue the work;

[0016] Step S8: The single chip microcomputer performs health monitoring on the lithium battery.

[0017] Furthermore, the step S1 further includes: calibrating the displacement distance of the color-changing rod when the motor rotates 90° as a calibration distance;

[0018] In step S2, the initial position of the motor is set based on the magnetic switch as follows:

[0019] The initial position of the motor is set based on one of the magnetic switches, or the initial position of the motor is set based on two adjacent magnetic switches.

[0020] Furthermore, the step S3 is specifically as follows:

[0021] After the embroidery machine is powered on, the single chip controls the motor to automatically perform a reset operation based on the initial position, obtains an embroidery job file input through the human-computer interaction interface or the communication module, which carries at least the embroidery trajectory, embroidery points, the embroidery needle number corresponding to the embroidery points, and the embroidery thread color, and drives the motor to operate based on the embroidery job file to move the color-changing rod in a linked manner, so that the corresponding embroidery needle is in the working position.

[0022] Furthermore, the step S4 is specifically as follows:

[0023] During the operation of the motor, the single chip microcomputer detects the first moving distance corresponding to the color changing rod through four magnetic switches respectively, and based on the moving time taken to move the first moving distance, the magnetic encoder detects the rotation angle of the motor within the moving time in real time, converts the rotation angle into the second moving distance of the color changing rod, and calculates the distance error between the first moving distance and the second moving distance.

[0024] Furthermore, the step S6 is specifically as follows:

[0025] When the power switching circuit detects power failure of the external power module through the voltage sensor, it will switch to the lithium battery for emergency power supply through the ATS;

[0026] The step S8 is specifically as follows:

[0027] The single-chip computer performs health monitoring on the lithium battery through a pre-trained health status estimation model and generates a lithium battery health monitoring report. When the lithium battery health monitoring report indicates that there is a health risk, the lithium battery health monitoring report is displayed on a display screen, and the lithium battery health monitoring report is pushed to a pre-associated management terminal in real time through a communication module;

[0028] The health status estimation model is constructed based on a vector conversion unit, an attention unit, a sampling unit and a linear projection unit connected in sequence;

[0029] The attention unit includes three Transformer layers;

[0030] The vector conversion unit is used to convert the charge and discharge data into a feature vector;

[0031] The sampling unit is used to perform average sampling and maximum sampling on the output of the attention unit;

[0032] The linear projection unit is used to perform linear calculation on the output of the sampling unit to obtain the predicted value of the health status estimation model.

[0033] In a second aspect, the present invention provides an embroidery machine color changing system, comprising the following modules:

[0034] A magnetic switch setting module is used to set four magnetic switches for detecting the rotation angle of the motor at intervals of 90 degrees in the color changing device of the embroidery machine;

[0035] The initial state calibration module is used to set the initial position of the motor based on the magnetic switch, and to calibrate the rotation angle sensed by the magnetic encoder when the color-changing rod in the color-changing device moves a stroke;

[0036] The color-changing module is used to perform a reset operation based on the initial position after the embroidery machine is powered on, and to drive the motor to operate based on the input embroidery operation file, so as to move the color-changing rod in linkage, so that the corresponding embroidery needle is in the working position;

[0037] A distance error calculation module is used for, during the operation of the motor, the single chip microcomputer detects the first moving distance of the color changing rod in real time through the magnetic switch, detects the second moving distance of the color changing rod in real time through the magnetic encoder, and calculates the distance error between the first moving distance and the second moving distance;

[0038] A distance error application module is used for the single chip computer to calibrate and compensate the second moving distance based on the distance error by querying a corresponding relationship table between the absolute needle position of the embroidery needle and the rotation angle sensed by the magnetic encoder;

[0039] Emergency power supply module, used for switching to lithium battery for emergency power supply when the power switching circuit detects that the external power module loses power;

[0040] A work continuation module is used for the single chip microcomputer to store the embroidery operation file and the multi-turn rotation angle sensed by the magnetic encoder into the EEPROM memory, and when the external power module resumes power supply, the embroidery operation file and the multi-turn rotation angle are read from the EEPROM memory to continue the work;

[0041] The lithium battery health monitoring module is used for the microcontroller to monitor the health of the lithium battery.

[0042] Furthermore, the magnetic switch setting module is also used to: calibrate the displacement distance of the color-changing rod when the motor rotates 90° as a calibration distance;

[0043] In the initial state calibration module, the initial position of the motor is set based on the magnetic switch as follows:

[0044] The initial position of the motor is set based on one of the magnetic switches, or the initial position of the motor is set based on two adjacent magnetic switches.

[0045] Furthermore, the color changing module is specifically used for:

[0046] After the embroidery machine is powered on, the single chip controls the motor to automatically perform a reset operation based on the initial position, obtains an embroidery job file input through the human-computer interaction interface or the communication module, which carries at least the embroidery trajectory, embroidery points, the embroidery needle number corresponding to the embroidery points, and the embroidery thread color, and drives the motor to operate based on the embroidery job file to move the color-changing rod in a linked manner, so that the corresponding embroidery needle is in the working position.

[0047] Furthermore, the distance error calculation module is specifically used for:

[0048] During the operation of the motor, the single chip microcomputer detects the first moving distance corresponding to the color changing rod through four magnetic switches respectively, and based on the moving time taken to move the first moving distance, the magnetic encoder detects the rotation angle of the motor within the moving time in real time, converts the rotation angle into the second moving distance of the color changing rod, and calculates the distance error between the first moving distance and the second moving distance.

[0049] Furthermore, the emergency power supply module is specifically used for:

[0050] When the power switching circuit detects power failure of the external power module through the voltage sensor, it will switch to the lithium battery for emergency power supply through the ATS;

[0051] The lithium battery health monitoring module is specifically used for:

[0052] The single-chip computer performs health monitoring on the lithium battery through a pre-trained health status estimation model and generates a lithium battery health monitoring report. When the lithium battery health monitoring report indicates that there is a health risk, the lithium battery health monitoring report is displayed on a display screen, and the lithium battery health monitoring report is pushed to a pre-associated management terminal in real time through a communication module;

[0053] The health status estimation model is constructed based on a vector conversion unit, an attention unit, a sampling unit and a linear projection unit connected in sequence;

[0054] The attention unit includes three Transformer layers;

[0055] The vector conversion unit is used to convert the charge and discharge data into a feature vector;

[0056] The sampling unit is used to perform average sampling and maximum sampling on the output of the attention unit;

[0057] The linear projection unit is used to perform linear calculation on the output of the sampling unit to obtain the predicted value of the health status estimation model.

[0058] The advantages of the present invention are:

[0059] 1. By setting four magnetic switches for detecting the rotation angle of the motor at intervals of 90° in the color-changing device of the embroidery machine, the initial position of the motor is set based on the magnetic switches, the color-changing rod in the color-changing device moves a stroke, and the rotation angle sensed by the magnetic encoder is calibrated; after the embroidery machine is powered on, a reset operation is performed based on the initial position, and the motor is driven to operate based on the input embroidery job file, so as to link the color-changing rod to move, so that the corresponding embroidery needle is in the working position; during the operation of the motor, the single-chip microcomputer detects the first moving distance of the color-changing rod in real time through the magnetic switch, and detects the second moving distance of the color-changing rod in real time through the magnetic encoder, calculates the distance error between the first moving distance and the second moving distance, queries the corresponding relationship table between the absolute needle position of the embroidery needle and the rotation angle sensed by the magnetic encoder based on the distance error, and calibrates and compensates the second moving distance; when the power switching circuit detects that the external power module is powered off, it synchronously switches to the lithium battery for emergency power supply, and the single-chip microcomputer stores the embroidery job file and the rotation angle of multiple circles in the EEPROM memory. When the external power is on, the single-chip microcomputer stores the embroidery job file and the rotation angle of multiple circles in the EEPROM memory. When the module resumes power supply, the embroidery operation file is read from the EEPROM memory and the multi-turn angle is rotated to continue working, and the single-chip microcomputer monitors the health of the lithium battery; that is, based on four magnetic switches set at equal intervals, the second moving distance detected by the magnetic encoder is continuously calibrated and compensated with the motor rotating 90° as a cycle to avoid cumulative errors; after the embroidery machine is powered on, the single-chip microcomputer controls the motor to automatically perform a reset operation based on the initial position, without the need for manual operation as traditionally; by setting a power switching circuit and a lithium battery, when the power switching circuit detects that the external power module is powered off, it switches to the lithium battery for emergency power supply, and the single-chip microcomputer stores the embroidery operation file and the multi-turn angle in the EEPROM memory. When the external power module resumes power supply, the single-chip microcomputer can read the embroidery operation file and the multi-turn angle from the EEPROM memory to continue working, avoiding the loss of related data due to power failure, and ultimately greatly improving the accuracy, efficiency and reliability of the embroidery machine's color change, and greatly improving the quality of embroidery products.

[0060] 2. By calibrating the displacement distance of the color-changing rod when the motor rotates 90°, the color-changing rod in the color-changing device moves a stroke, and the rotation angle sensed by the magnetic encoder is calibrated. The four magnetic switches are set at equal intervals, that is, 90° apart from each other. The sensing data of the magnetic switches and the magnetic encoder can be converted into the displacement distance of the color-changing rod, and then the calibration compensation of the moving distance is performed, which effectively improves the accuracy of color changing of the embroidery machine.

[0061] 3. After the embroidery machine is powered on, the microcontroller controls the motor to automatically perform the reset operation based on the initial position, without the need for workers to perform the reset operation. That is, the embroidery machine can be put into work immediately after it is automatically reset after being powered on, effectively improving the efficiency of the embroidery machine's color changing.

[0062] 4. During the operation of the motor, the microcontroller detects the first moving distance corresponding to the color-changing rod through four magnetic switches respectively. Based on the moving time taken to move the first moving distance, the magnetic encoder detects the rotation angle of the motor in the moving time in real time, converts the rotation angle into the second moving distance of the color-changing rod, calculates the distance error between the first moving distance and the second moving distance, and calibrates and compensates the second moving distance based on the distance error with the motor rotating 90° as a cycle; that is, the first moving distance and the second moving distance are calculated once every 90° rotation of the motor to perform distance calibration compensation, thereby avoiding cumulative errors and effectively improving the accuracy of color changing of the embroidery machine.

[0063] 5. When the voltage sensor detects that the external power module loses power, the power switching circuit switches to the lithium battery for emergency power supply through ATS to ensure seamless connection of the lithium battery, avoiding data loss caused by the microcontroller not having enough time to save relevant data, affecting subsequent embroidery work, and thus greatly improving the reliability of color change of the embroidery machine.

[0064] 6. The health status of lithium batteries is monitored through the pre-trained health status estimation model and a lithium battery health monitoring report is generated. When the lithium battery health monitoring report shows that there is a health risk, the lithium battery health monitoring report is displayed on the display screen, and the lithium battery health monitoring report is pushed to the management terminal in real time, that is, the health status of the lithium battery is monitored in real time to prevent the lithium battery from being unable to supply power in the event of a sudden power failure, and to prevent the microcontroller from not having time to save relevant data and causing data loss, affecting subsequent embroidery work, thereby greatly improving the reliability of the embroidery machine's color change. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.

[0066] Figure 1 The present invention is a flow chart of a color changing method for an embroidery machine.

[0067] Figure 2 The invention discloses a structural schematic diagram of a color changing system for an embroidery machine.

[0068] Figure 3 It is a schematic diagram of the hardware architecture of the present invention.

[0069] Figure 4 It is a schematic diagram of the arrangement of the magnetic switch and the magnetic encoder of the present invention. DETAILED DESCRIPTION

[0070] The technical solution in the embodiment of the present application has the following overall idea: based on four magnetic switches arranged at equal intervals, the second moving distance detected by the magnetic encoder is continuously calibrated and compensated with the motor rotating 90° as a cycle to avoid cumulative errors; after the embroidery machine is powered on, the single-chip microcomputer controls the motor to automatically perform a reset operation based on the initial position, without the need for manual operation as traditionally; when power is off, the single-chip microcomputer automatically switches to a lithium battery for emergency power supply, and the single-chip microcomputer stores the embroidery job files and the multi-turn rotation angles in the EEPROM memory. When the external power module resumes power supply, the single-chip microcomputer can read the embroidery job files and the multi-turn rotation angles from the EEPROM memory for continued work, avoiding the loss of relevant data due to power off, so as to improve the accuracy, efficiency and reliability of color changing of the embroidery machine and improve the quality of embroidery products.

[0071] Please refer to Figures 1 to 4 As shown, a preferred embodiment of the color changing method of an embroidery machine of the present invention comprises the following steps:

[0072] Step S1, four magnetic switches for detecting the rotation angle of the motor are arranged at intervals of 90 degrees in the color changing device of the embroidery machine;

[0073] Step S2, setting the initial position of the motor based on the magnetic switch, moving the color-changing rod in the color-changing device by one stroke, and calibrating the rotation angle sensed by the magnetic encoder;

[0074] Step S3, after the embroidery machine is powered on, a reset operation is performed based on the initial position, and the motor is driven to operate based on the input embroidery operation file, so as to move the color-changing rod in linkage, so that the corresponding embroidery needle is in the working position;

[0075] Step S4, during the operation of the motor, the single chip microcomputer detects the first moving distance of the color changing rod in real time through the magnetic switch, detects the second moving distance of the color changing rod in real time through the magnetic encoder, and calculates the distance error between the first moving distance and the second moving distance;

[0076] Step S5, the single chip computer performs calibration compensation on the second moving distance by querying a corresponding relationship table between the absolute needle position of the embroidery needle and the rotation angle sensed by the magnetic encoder based on the distance error;

[0077] Step S6: When the power switching circuit detects that the external power module loses power, it synchronously switches to the lithium battery for emergency power supply;

[0078] Step S7, the single chip microcomputer stores the embroidery operation file and the multi-turn rotation angle sensed by the magnetic encoder into the EEPROM memory, and when the external power module resumes power supply, the embroidery operation file and the multi-turn rotation angle are read from the EEPROM memory to continue the work;

[0079] Step S8: The single chip microcomputer performs health monitoring on the lithium battery.

[0080] The step S1 further includes: calibrating the displacement distance of the color-changing rod when the motor rotates 90° as a calibration distance;

[0081] In step S2, the initial position of the motor is set based on the magnetic switch as follows:

[0082] The initial position of the motor is set based on one of the magnetic switches, or the initial position of the motor is set based on two adjacent magnetic switches.

[0083] By calibrating the displacement distance of the color-changing rod when the motor rotates 90°, the color-changing rod in the color-changing device moves a stroke, and the rotation angle sensed by the magnetic encoder is calibrated. The four magnetic switches are arranged at equal intervals, that is, 90° apart from each other. The sensing data of the magnetic switches and the magnetic encoder can be converted into the displacement distance of the color-changing rod, and then the movement distance is calibrated and compensated, which effectively improves the accuracy of color changing of the embroidery machine.

[0084] The step S3 is specifically as follows:

[0085] After the embroidery machine is powered on, the single chip controls the motor to automatically perform a reset operation based on the initial position, obtains an embroidery job file input through the human-computer interaction interface or the communication module, which carries at least the embroidery trajectory, embroidery points, the embroidery needle number corresponding to the embroidery points, and the embroidery thread color, and drives the motor to operate based on the embroidery job file to move the color-changing rod in a linked manner, so that the corresponding embroidery needle is in the working position.

[0086] After the embroidery machine is powered on, the microcontroller controls the motor to automatically perform a reset operation based on the initial position, without the need for workers to perform a reset operation. That is, the embroidery machine can be put into work immediately after it is automatically reset after being powered on, effectively improving the efficiency of the embroidery machine's color changing.

[0087] The step S4 is specifically as follows:

[0088] During the operation of the motor, the single chip microcomputer detects the first moving distance corresponding to the color changing rod through four magnetic switches respectively, and based on the moving time taken to move the first moving distance, the magnetic encoder detects the rotation angle of the motor within the moving time in real time, converts the rotation angle into the second moving distance of the color changing rod, and calculates the distance error between the first moving distance and the second moving distance.

[0089] During the operation of the motor, the single chip microcomputer detects the first moving distance corresponding to the color changing rod through four magnetic switches respectively, and based on the moving time taken to move the first moving distance, the rotation angle of the motor within the moving time is detected in real time through the magnetic encoder, and the rotation angle is converted into the second moving distance of the color changing rod, and the distance error between the first moving distance and the second moving distance is calculated. The second moving distance is continuously calibrated and compensated based on the distance error with the motor rotating 90° as a cycle; that is, the first moving distance and the second moving distance are calculated once every 90° rotation of the motor to perform distance calibration compensation, so as to avoid cumulative errors and effectively improve the accuracy of color changing of the embroidery machine.

[0090] The step S6 is specifically as follows:

[0091] When the power switching circuit detects power failure of the external power module through the voltage sensor, it will switch to the lithium battery for emergency power supply through the ATS;

[0092] When the voltage sensor detects that the external power module loses power, the power switching circuit switches to the lithium battery for emergency power supply through ATS, ensuring that the lithium battery can be seamlessly connected, avoiding data loss caused by the microcontroller not having time to save relevant data, affecting subsequent embroidery work, and greatly improving the reliability of color changing of the embroidery machine.

[0093] The step S8 is specifically as follows:

[0094] The single-chip computer performs health monitoring on the lithium battery through a pre-trained health status estimation model and generates a lithium battery health monitoring report. When the lithium battery health monitoring report indicates that there is a health risk, the lithium battery health monitoring report is displayed on a display screen, and the lithium battery health monitoring report is pushed to a pre-associated management terminal in real time through a communication module;

[0095] The health status of lithium batteries is monitored through a pre-trained health status estimation model and a lithium battery health monitoring report is generated. When the lithium battery health monitoring report shows that there is a health risk, the lithium battery health monitoring report is displayed on the display screen and pushed to the management terminal in real time. That is, the health status of the lithium battery is monitored in real time to prevent the lithium battery from being unable to supply power in the event of a sudden power outage, and to prevent the microcontroller from not having time to save relevant data and resulting in data loss, which affects subsequent embroidery work, thereby greatly improving the reliability of the embroidery machine's color change.

[0096] The health status estimation model is constructed based on a vector conversion unit (Embedding), an attention unit, a sampling unit (Meanpooling & MaxPooling) and a linear projection unit (Linera) connected in sequence;

[0097] The attention unit includes three Transformer layers, which greatly improves the expressiveness of the model; that is, the health status estimation model is created based on Transformer;

[0098] The mathematical representation of the Transformer layer is:

[0099]

[0100] Z2=FFN(Z)=max(0,ZW1+b1)W2+b2;

[0101] Among them, Q, K, V are the same matrix with shape [3,128]; d k is the arithmetic square root of 128; FFN() is a linear projection layer, which eventually transforms a matrix of shape [500,128] into a matrix of shape [500,256]; Z represents the output value of the Attention function, which is a matrix of shape [500,128]; Z2 represents the output value of the FFN function, which is a matrix of shape [500,256]; W1 represents the first parameter matrix, whose shape is [128,256]; W2 represents the second parameter matrix, whose shape is [128,256]; b1 represents the first bias vector of length 500; b2 represents the second bias vector of length 500.

[0102] The vector conversion unit is used to convert the charge and discharge data into a feature vector;

[0103] The sampling unit is used to perform average sampling and maximum sampling on the output of the attention unit, which is mathematically expressed as:

[0104]

[0105] in, represents the convolution window; x kpq Represents the original value in the convolution window; the matrix obtained by the formula is concatenated and finally converted into a matrix shape of [500,128];

[0106] The linear projection unit is used to perform linear calculation on the output of the sampling unit, thereby obtaining the predicted value of the health state estimation model, which is mathematically expressed as:

[0107] Y = LN (Z3) = Z3W + b;

[0108] The data shape after upper layer sampling is [500,128], and then the data is stretched into a 1-dimensional vector by straightening method, and finally converted into a matrix shape of [1].

[0109] The training process of the health status estimation model is:

[0110] Acquire a large amount of charging and discharging data of lithium batteries, segment the charging and discharging data based on a preset time threshold to obtain a data set, set the target optimization function of the health status estimation model, train the health status estimation model through the data set, and constrain the predicted value of the health status estimation model through the target optimization function during the training process.

[0111] The formula of the objective optimization function is:

[0112] F(x)=sigmoid(x)*(x high -x low )+x low ;

[0113] sigmoid(x)=1 / (1+exp(-x));

[0114] Where F(x) represents the target optimization function; sigmoid(x) represents the activation function, which is used to map x to between 0 and 1; x high represents the upper limit of the constraint; x low Represents the lower limit of the constraint; exp() represents the exponential function with the natural constant e as the base.

[0115] A health status estimation model is created through Transformer. The model structure is simple. The vector conversion unit of the health status estimation model is used to convert the charge and discharge data into a feature vector and input it into the attention unit. The feature vector is captured by the attention unit, and the output of the attention unit is averaged and sampled by the sampling unit. That is, the deep learning method is used to automatically extract features instead of traditional manual feature extraction. It can not only better capture the feature representation of long time series, but also reduce the development time of the model. In addition, since deep learning performs algorithm fitting from a large amount of charge and discharge data, it has better generalization ability than traditional methods, which greatly improves the accuracy and generalization ability of lithium battery health status estimation, thereby greatly improving the reliability of embroidery machine color change.

[0116] A preferred embodiment of the color changing system of an embroidery machine of the present invention comprises the following modules:

[0117] A magnetic switch setting module is used to set four magnetic switches for detecting the rotation angle of the motor at intervals of 90 degrees in the color changing device of the embroidery machine;

[0118] The initial state calibration module is used to set the initial position of the motor based on the magnetic switch, and to calibrate the rotation angle sensed by the magnetic encoder when the color-changing rod in the color-changing device moves a stroke;

[0119] The color-changing module is used to perform a reset operation based on the initial position after the embroidery machine is powered on, and to drive the motor to operate based on the input embroidery operation file, so as to move the color-changing rod in linkage, so that the corresponding embroidery needle is in the working position;

[0120] A distance error calculation module is used for, during the operation of the motor, the single chip microcomputer detects the first moving distance of the color changing rod in real time through the magnetic switch, detects the second moving distance of the color changing rod in real time through the magnetic encoder, and calculates the distance error between the first moving distance and the second moving distance;

[0121] A distance error application module is used for the single chip computer to calibrate and compensate the second moving distance based on the distance error by querying a corresponding relationship table between the absolute needle position of the embroidery needle and the rotation angle sensed by the magnetic encoder;

[0122] Emergency power supply module, used for switching to lithium battery for emergency power supply when the power switching circuit detects that the external power module loses power;

[0123] A work continuation module is used for the single chip microcomputer to store the embroidery operation file and the multi-turn rotation angle sensed by the magnetic encoder into the EEPROM memory, and when the external power module resumes power supply, the embroidery operation file and the multi-turn rotation angle are read from the EEPROM memory to continue the work;

[0124] The lithium battery health monitoring module is used for the microcontroller to monitor the health of the lithium battery.

[0125] The magnetic switch setting module is also used to: calibrate the displacement distance of the color-changing rod when the motor rotates 90° as a calibration distance;

[0126] In the initial state calibration module, the initial position of the motor is set based on the magnetic switch as follows:

[0127] The initial position of the motor is set based on one of the magnetic switches, or the initial position of the motor is set based on two adjacent magnetic switches.

[0128] By calibrating the displacement distance of the color-changing rod when the motor rotates 90°, the color-changing rod in the color-changing device moves a stroke, and the rotation angle sensed by the magnetic encoder is calibrated. The four magnetic switches are arranged at equal intervals, that is, 90° apart from each other. The sensing data of the magnetic switches and the magnetic encoder can be converted into the displacement distance of the color-changing rod, and then the movement distance is calibrated and compensated, which effectively improves the accuracy of color changing of the embroidery machine.

[0129] The color changing module is specifically used for:

[0130] After the embroidery machine is powered on, the single chip controls the motor to automatically perform a reset operation based on the initial position, obtains an embroidery job file input through the human-computer interaction interface or the communication module, which carries at least the embroidery trajectory, embroidery points, the embroidery needle number corresponding to the embroidery points, and the embroidery thread color, and drives the motor to operate based on the embroidery job file to move the color-changing rod in a linked manner, so that the corresponding embroidery needle is in the working position.

[0131] After the embroidery machine is powered on, the microcontroller controls the motor to automatically perform a reset operation based on the initial position, without the need for workers to perform a reset operation. That is, the embroidery machine can be put into work immediately after it is automatically reset after being powered on, effectively improving the efficiency of the embroidery machine's color changing.

[0132] The distance error calculation module is specifically used for:

[0133] During the operation of the motor, the single chip microcomputer detects the first moving distance corresponding to the color changing rod through four magnetic switches respectively, and based on the moving time taken to move the first moving distance, the magnetic encoder detects the rotation angle of the motor within the moving time in real time, converts the rotation angle into the second moving distance of the color changing rod, and calculates the distance error between the first moving distance and the second moving distance.

[0134] During the operation of the motor, the single chip microcomputer detects the first moving distance corresponding to the color changing rod through four magnetic switches respectively, and based on the moving time taken to move the first moving distance, the rotation angle of the motor within the moving time is detected in real time through the magnetic encoder, and the rotation angle is converted into the second moving distance of the color changing rod, and the distance error between the first moving distance and the second moving distance is calculated. The second moving distance is continuously calibrated and compensated based on the distance error with the motor rotating 90° as a cycle; that is, the first moving distance and the second moving distance are calculated once every 90° rotation of the motor to perform distance calibration compensation, so as to avoid cumulative errors and effectively improve the accuracy of color changing of the embroidery machine.

[0135] The emergency power supply module is specifically used for:

[0136] When the power switching circuit detects power failure of the external power module through the voltage sensor, it will switch to the lithium battery for emergency power supply through the ATS;

[0137] When the voltage sensor detects that the external power module loses power, the power switching circuit switches to the lithium battery for emergency power supply through ATS, ensuring that the lithium battery can be seamlessly connected, avoiding data loss caused by the microcontroller not having time to save relevant data, affecting subsequent embroidery work, and greatly improving the reliability of color changing of the embroidery machine.

[0138] The lithium battery health monitoring module is specifically used for:

[0139] The single-chip computer performs health monitoring on the lithium battery through a pre-trained health status estimation model and generates a lithium battery health monitoring report. When the lithium battery health monitoring report indicates that there is a health risk, the lithium battery health monitoring report is displayed on a display screen, and the lithium battery health monitoring report is pushed to a pre-associated management terminal in real time through a communication module;

[0140] The health status of lithium batteries is monitored through a pre-trained health status estimation model and a lithium battery health monitoring report is generated. When the lithium battery health monitoring report shows that there is a health risk, the lithium battery health monitoring report is displayed on the display screen and pushed to the management terminal in real time. That is, the health status of the lithium battery is monitored in real time to prevent the lithium battery from being unable to supply power in the event of a sudden power outage, and to prevent the microcontroller from not having time to save relevant data and resulting in data loss, which affects subsequent embroidery work, thereby greatly improving the reliability of the embroidery machine's color change.

[0141] The health status estimation model is constructed based on a vector conversion unit (Embedding), an attention unit, a sampling unit (Meanpooling & MaxPooling) and a linear projection unit (Linera) connected in sequence;

[0142] The attention unit includes three Transformer layers, which greatly improves the expressiveness of the model; that is, the health status estimation model is created based on Transformer;

[0143] The mathematical representation of the Transformer layer is:

[0144]

[0145] Z2=FFN(Z)=max(0,ZW1+b1)W2+b2;

[0146] Among them, Q, K, V are the same matrix with shape [3,128]; d k is the arithmetic square root of 128; FFN() is a linear projection layer, which eventually transforms a matrix of shape [500,128] into a matrix of shape [500,256]; Z represents the output value of the Attention function, which is a matrix of shape [500,128]; Z2 represents the output value of the FFN function, which is a matrix of shape [500,256]; W1 represents the first parameter matrix, whose shape is [128,256]; W2 represents the second parameter matrix, whose shape is [128,256]; b1 represents the first bias vector of length 500; b2 represents the second bias vector of length 500.

[0147] The vector conversion unit is used to convert the charge and discharge data into a feature vector;

[0148] The sampling unit is used to perform average sampling and maximum sampling on the output of the attention unit, which is mathematically expressed as:

[0149]

[0150] in, represents the convolution window; x kpq Represents the original value in the convolution window; the matrix obtained by the formula is concatenated and finally converted into a matrix shape of [500,128];

[0151] The linear projection unit is used to perform linear calculation on the output of the sampling unit, thereby obtaining the predicted value of the health state estimation model, which is mathematically expressed as:

[0152] Y = LN (Z3) = Z3W + b;

[0153] The data shape after upper layer sampling is [500,128], and then the data is stretched into a 1-dimensional vector by straightening method, and finally converted into a matrix shape of [1].

[0154] The training process of the health status estimation model is:

[0155] Acquire a large amount of charging and discharging data of lithium batteries, segment the charging and discharging data based on a preset time threshold to obtain a data set, set the target optimization function of the health status estimation model, train the health status estimation model through the data set, and constrain the predicted value of the health status estimation model through the target optimization function during the training process.

[0156] The formula of the objective optimization function is:

[0157] F(x)=sigmoid(x)*(x high -x low )+x low ;

[0158] sigmoid(x)=1 / (1+exp(-x));

[0159] Where F(x) represents the target optimization function; sigmoid(x) represents the activation function, which is used to map x to between 0 and 1; x high represents the upper limit of the constraint; x low Represents the lower limit of the constraint; exp() represents the exponential function with the natural constant e as the base.

[0160] A health status estimation model is created through Transformer. The model structure is simple. The vector conversion unit of the health status estimation model is used to convert the charge and discharge data into a feature vector and input it into the attention unit. The feature vector is captured by the attention unit, and the output of the attention unit is averaged and sampled by the sampling unit. That is, the deep learning method is used to automatically extract features instead of traditional manual feature extraction. It can not only better capture the feature representation of long time series, but also reduce the development time of the model. In addition, since deep learning performs algorithm fitting from a large amount of charge and discharge data, it has better generalization ability than traditional methods, which greatly improves the accuracy and generalization ability of lithium battery health status estimation, thereby greatly improving the reliability of embroidery machine color change.

[0161] In summary, the advantages of the present invention are:

[0162] 1. By setting four magnetic switches for detecting the rotation angle of the motor at intervals of 90° in the color-changing device of the embroidery machine, the initial position of the motor is set based on the magnetic switches, the color-changing rod in the color-changing device moves a stroke, and the rotation angle sensed by the magnetic encoder is calibrated; after the embroidery machine is powered on, a reset operation is performed based on the initial position, and the motor is driven to operate based on the input embroidery job file, so as to link the color-changing rod to move, so that the corresponding embroidery needle is in the working position; during the operation of the motor, the single-chip microcomputer detects the first moving distance of the color-changing rod in real time through the magnetic switch, and detects the second moving distance of the color-changing rod in real time through the magnetic encoder, calculates the distance error between the first moving distance and the second moving distance, queries the corresponding relationship table between the absolute needle position of the embroidery needle and the rotation angle sensed by the magnetic encoder based on the distance error, and calibrates and compensates the second moving distance; when the power switching circuit detects that the external power module is powered off, it synchronously switches to the lithium battery for emergency power supply, and the single-chip microcomputer stores the embroidery job file and the rotation angle of multiple circles in the EEPROM memory. When the external power is on, the single-chip microcomputer stores the embroidery job file and the rotation angle of multiple circles in the EEPROM memory. When the module resumes power supply, the embroidery operation file is read from the EEPROM memory and the multi-turn angle is rotated to continue working, and the single-chip microcomputer monitors the health of the lithium battery; that is, based on four magnetic switches set at equal intervals, the second moving distance detected by the magnetic encoder is continuously calibrated and compensated with the motor rotating 90° as a cycle to avoid cumulative errors; after the embroidery machine is powered on, the single-chip microcomputer controls the motor to automatically perform a reset operation based on the initial position, without the need for manual operation as traditionally; by setting a power switching circuit and a lithium battery, when the power switching circuit detects that the external power module is powered off, it switches to the lithium battery for emergency power supply, and the single-chip microcomputer stores the embroidery operation file and the multi-turn angle in the EEPROM memory. When the external power module resumes power supply, the single-chip microcomputer can read the embroidery operation file and the multi-turn angle from the EEPROM memory to continue working, avoiding the loss of related data due to power failure, and ultimately greatly improving the accuracy, efficiency and reliability of the embroidery machine's color change, and greatly improving the quality of embroidery products.

[0163] 2. By calibrating the displacement distance of the color-changing rod when the motor rotates 90°, the color-changing rod in the color-changing device moves a stroke, and the rotation angle sensed by the magnetic encoder is calibrated. The four magnetic switches are set at equal intervals, that is, 90° apart from each other. The sensing data of the magnetic switches and the magnetic encoder can be converted into the displacement distance of the color-changing rod, and then the calibration compensation of the moving distance is performed, which effectively improves the accuracy of color changing of the embroidery machine.

[0164] 3. After the embroidery machine is powered on, the microcontroller controls the motor to automatically perform the reset operation based on the initial position, without the need for workers to perform the reset operation. That is, the embroidery machine can be put into work immediately after it is automatically reset after being powered on, effectively improving the efficiency of the embroidery machine's color changing.

[0165] 4. During the operation of the motor, the microcontroller detects the first moving distance corresponding to the color-changing rod through four magnetic switches respectively. Based on the moving time taken to move the first moving distance, the magnetic encoder detects the rotation angle of the motor in the moving time in real time, converts the rotation angle into the second moving distance of the color-changing rod, calculates the distance error between the first moving distance and the second moving distance, and calibrates and compensates the second moving distance based on the distance error with the motor rotating 90° as a cycle; that is, the first moving distance and the second moving distance are calculated once every 90° rotation of the motor to perform distance calibration compensation, thereby avoiding cumulative errors and effectively improving the accuracy of color changing of the embroidery machine.

[0166] 5. When the voltage sensor detects that the external power module loses power, the power switching circuit switches to the lithium battery for emergency power supply through ATS to ensure seamless connection of the lithium battery, avoiding data loss caused by the microcontroller not having enough time to save relevant data, affecting subsequent embroidery work, and thus greatly improving the reliability of color change of the embroidery machine.

[0167] 6. The health status of lithium batteries is monitored through the pre-trained health status estimation model and a lithium battery health monitoring report is generated. When the lithium battery health monitoring report shows that there is a health risk, the lithium battery health monitoring report is displayed on the display screen, and the lithium battery health monitoring report is pushed to the management terminal in real time, that is, the health status of the lithium battery is monitored in real time to prevent the lithium battery from being unable to supply power in the event of a sudden power failure, and to prevent the microcontroller from not having time to save relevant data and causing data loss, affecting subsequent embroidery work, thereby greatly improving the reliability of the embroidery machine's color change.

[0168] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.

Claims

1. A color changing method for an embroidery machine, characterized in that: The steps include: Step S1, four magnetic switches for detecting the rotation angle of the motor are arranged at intervals of 90 degrees in the color changing device of the embroidery machine; Step S2, setting the initial position of the motor based on the magnetic switch, moving the color-changing rod in the color-changing device by one stroke, and calibrating the rotation angle sensed by the magnetic encoder; Step S3, after the embroidery machine is powered on, a reset operation is performed based on the initial position, and the motor is driven to operate based on the input embroidery operation file, so as to move the color-changing rod in linkage, so that the corresponding embroidery needle is in the working position; Step S4, during the operation of the motor, the single chip microcomputer detects the first moving distance of the color changing rod in real time through the magnetic switch, detects the second moving distance of the color changing rod in real time through the magnetic encoder, and calculates the distance error between the first moving distance and the second moving distance; Step S5, the single chip computer performs calibration compensation on the second moving distance by querying a corresponding relationship table between the absolute needle position of the embroidery needle and the rotation angle sensed by the magnetic encoder based on the distance error; Step S6: When the power switching circuit detects that the external power module loses power, it synchronously switches to the lithium battery for emergency power supply; Step S7, the single chip microcomputer stores the embroidery operation file and the multi-turn rotation angle sensed by the magnetic encoder into the EEPROM memory, and when the external power module resumes power supply, the embroidery operation file and the multi-turn rotation angle are read from the EEPROM memory to continue the work; Step S8: The single chip microcomputer performs health monitoring on the lithium battery.

2. The color changing method of an embroidery machine according to claim 1, characterized in that: The step S1 further includes: calibrating the displacement distance of the color-changing rod when the motor rotates 90° as a calibration distance; In step S2, the initial position of the motor is set based on the magnetic switch as follows: The initial position of the motor is set based on one of the magnetic switches, or the initial position of the motor is set based on two adjacent magnetic switches.

3. The color changing method of an embroidery machine as claimed in claim 1, characterized in that: The step S3 is specifically as follows: After the embroidery machine is powered on, the single chip controls the motor to automatically perform a reset operation based on the initial position, obtains an embroidery job file input through the human-computer interaction interface or the communication module, which carries at least the embroidery trajectory, embroidery points, the embroidery needle number corresponding to the embroidery points, and the embroidery thread color, and drives the motor to operate based on the embroidery job file to move the color-changing rod in a linked manner, so that the corresponding embroidery needle is in the working position.

4. The color changing method of an embroidery machine as claimed in claim 1, characterized in that: The step S4 is specifically as follows: During the operation of the motor, the single chip microcomputer detects the first moving distance corresponding to the color changing rod through four magnetic switches respectively, and based on the moving time taken to move the first moving distance, the magnetic encoder detects the rotation angle of the motor within the moving time in real time, converts the rotation angle into the second moving distance of the color changing rod, and calculates the distance error between the first moving distance and the second moving distance.

5. The color changing method of an embroidery machine as claimed in claim 1, characterized in that: The step S6 is specifically as follows: When the power switching circuit detects power failure of the external power module through the voltage sensor, it will switch to the lithium battery for emergency power supply through the ATS; The step S8 is specifically as follows: The single-chip computer performs health monitoring on the lithium battery through a pre-trained health status estimation model and generates a lithium battery health monitoring report. When the lithium battery health monitoring report indicates that there is a health risk, the lithium battery health monitoring report is displayed on a display screen, and the lithium battery health monitoring report is pushed to a pre-associated management terminal in real time through a communication module; The health status estimation model is constructed based on a vector conversion unit, an attention unit, a sampling unit and a linear projection unit connected in sequence; The attention unit includes three Transformer layers; The vector conversion unit is used to convert the charge and discharge data into a feature vector; The sampling unit is used to perform average sampling and maximum sampling on the output of the attention unit; The linear projection unit is used to perform linear calculation on the output of the sampling unit to obtain the predicted value of the health status estimation model.

6. An embroidery machine color changing system, characterized in that: Includes the following modules: A magnetic switch setting module is used to set four magnetic switches for detecting the rotation angle of the motor at intervals of 90 degrees in the color changing device of the embroidery machine; The initial state calibration module is used to set the initial position of the motor based on the magnetic switch, and to calibrate the rotation angle sensed by the magnetic encoder when the color-changing rod in the color-changing device moves a stroke; The color-changing module is used to perform a reset operation based on the initial position after the embroidery machine is powered on, and to drive the motor to operate based on the input embroidery operation file, so as to move the color-changing rod in linkage, so that the corresponding embroidery needle is in the working position; A distance error calculation module is used for, during the operation of the motor, the single chip microcomputer detects the first moving distance of the color changing rod in real time through the magnetic switch, detects the second moving distance of the color changing rod in real time through the magnetic encoder, and calculates the distance error between the first moving distance and the second moving distance; A distance error application module is used for the single chip computer to calibrate and compensate the second moving distance based on the distance error by querying a corresponding relationship table between the absolute needle position of the embroidery needle and the rotation angle sensed by the magnetic encoder; Emergency power supply module, used for switching to lithium battery for emergency power supply when the power switching circuit detects that the external power module loses power; A work continuation module is used for the single chip microcomputer to store the embroidery operation file and the multi-turn rotation angle sensed by the magnetic encoder into the EEPROM memory, and when the external power module resumes power supply, the embroidery operation file and the multi-turn rotation angle are read from the EEPROM memory to continue the work; The lithium battery health monitoring module is used for the microcontroller to monitor the health of the lithium battery.

7. The color changing system for an embroidery machine as claimed in claim 6, characterized in that: The magnetic switch setting module is also used to: calibrate the displacement distance of the color-changing rod when the motor rotates 90° as a calibration distance; In the initial state calibration module, the initial position of the motor is set based on the magnetic switch as follows: The initial position of the motor is set based on one of the magnetic switches, or the initial position of the motor is set based on two adjacent magnetic switches.

8. The color changing system for an embroidery machine as claimed in claim 6, characterized in that: The color changing module is specifically used for: After the embroidery machine is powered on, the single chip controls the motor to automatically perform a reset operation based on the initial position, obtains an embroidery job file input through the human-computer interaction interface or the communication module, which carries at least the embroidery trajectory, embroidery points, the embroidery needle number corresponding to the embroidery points, and the embroidery thread color, and drives the motor to operate based on the embroidery job file to move the color-changing rod in a linked manner, so that the corresponding embroidery needle is in the working position.

9. The color changing system for an embroidery machine as claimed in claim 6, characterized in that: The distance error calculation module is specifically used for: During the operation of the motor, the single chip microcomputer detects the first moving distance corresponding to the color changing rod through four magnetic switches respectively, and based on the moving time taken to move the first moving distance, the magnetic encoder detects the rotation angle of the motor within the moving time in real time, converts the rotation angle into the second moving distance of the color changing rod, and calculates the distance error between the first moving distance and the second moving distance.

10. The color changing system for an embroidery machine according to claim 6, characterized in that: The emergency power supply module is specifically used for: When the power switching circuit detects power failure of the external power module through the voltage sensor, it will switch to the lithium battery for emergency power supply through the ATS; The lithium battery health monitoring module is specifically used for: The single-chip computer performs health monitoring on the lithium battery through a pre-trained health status estimation model and generates a lithium battery health monitoring report. When the lithium battery health monitoring report indicates that there is a health risk, the lithium battery health monitoring report is displayed on a display screen, and the lithium battery health monitoring report is pushed to a pre-associated management terminal in real time through a communication module; The health status estimation model is constructed based on a vector conversion unit, an attention unit, a sampling unit and a linear projection unit connected in sequence; The attention unit includes three Transformer layers; The vector conversion unit is used to convert the charge and discharge data into a feature vector; The sampling unit is used to perform average sampling and maximum sampling on the output of the attention unit; The linear projection unit is used to perform linear calculation on the output of the sampling unit to obtain the predicted value of the health status estimation model.

Citation Information

Patent Citations

  • Multiple horizontal needle quilting machine and method

    CA2476721A1

  • Sewing machine

    CN101768839A

  • Computerized embroidery machine and needle position detecting method of computerized embroidery machine

    CN103541162A

  • Control method and setting device for industrial sewing machine direct drive motor needle stopping position

    CN104711793A

  • Power supply circuit capable of outputting symmetrical positive and negative voltages

    CN108390569A