A method, device and storage medium for predicting motor position to improve printing efficiency

Through real-time detection and acceleration planning algorithms, the Y-axis paper movement is triggered in advance, which solves the problem of mutual exclusion of X-axis and Y-axis movements, improves printing efficiency and productivity, and ensures the integrity and accuracy of the printing process.

CN117601566BActive Publication Date: 2024-10-29GUANGZHOU SENYANG ELECTRONIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311620118.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2024-10-29
Estimated Expiration
2043-11-29

AI Technical Summary

Technical Problem

In existing printing technology, the movements of the X-axis and Y-axis are mutually exclusive, resulting in a waste of time and efficiency and a decrease in printer output.

Method used

The MCU detects the FPGA printout in real time, estimates the X-axis acceleration zone time, triggers the Y-axis paper movement in advance, and uses acceleration planning algorithms and prediction models to optimize the movement synchronization of the X-axis and Y-axis and reduce waiting time.

Benefits of technology

It improves printing efficiency and productivity, ensures the integrity and accuracy of the printing process, realizes synchronous movement of the X-axis and Y-axis, and improves printing accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117601566B_ABST
    Figure CN117601566B_ABST
Patent Text Reader

Abstract

The invention discloses a method, a device and a storage medium for predicting a motor position to improve printing efficiency, and relates to the technical field of digital printing; the steps include S1: MCU detects FPGA printing output in real time through a 1ms periodic timing interrupt, and determines that the X-axis completes printing of the last inkjet point; S2: before triggering the Y-axis paper feeding, firstly calculates the time T of the acceleration area of ​​the vehicle according to the known X-axis acceleration distance and the target movement speed; S3: after completing the above calculation, the Y-axis paper feeding movement can be triggered, and when the Y-axis reaches the OverlaySteps pulse value, the X-axis printing movement can be triggered; the invention realizes the paper feeding movement immediately after the last point of the X-axis is printed, and the X-axis starts to move before the paper feeding stops, and the Y-axis stops moving after reaching the first inkjet point of printing, so as to achieve the highest output; ensure the integrity and accuracy of the printing process, avoid the problem of incomplete or repeated printing, and improve the quality of the printing result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of printing control technology, and in particular to a method, a device and a storage medium for predicting motor positions to improve printing efficiency. Background Art

[0002] In the traditional printing process, the X-axis is responsible for controlling the horizontal movement of the print head. When a line of text or image needs to be printed, the X-axis carriage starts to accelerate and stops after reaching the target stop position. Once the X-axis stops, the Y-axis starts to control the vertical movement of the printed paper, that is, paper feeding. The Y-axis will gradually push the printed paper forward one line according to the preset step length.

[0003] In the prior art, during printing, the movements of the X-axis and the Y-axis are mutually exclusive, such as Figure 3 As shown, only one of the axes can move at the same time, and they cannot move at the same time. There will be a certain amount of time efficiency wasted, resulting in a decrease in the output of the printing machine. Summary of the invention

[0004] The purpose of the present invention is to provide a method, device and storage medium for predicting motor position to improve printing efficiency. By linking the X-axis and the Y-axis, the waiting time for printing is reduced, the printing movement effect is smoother, and the printing capacity is improved.

[0005] The purpose of the present invention can be achieved through the following technical solutions:

[0006] The present application provides a method for predicting motor position to improve printing efficiency, comprising the following steps:

[0007] S1: MCU detects FPGA printing output in real time through a 1ms periodic interrupt, and determines that the X-axis has completed printing the last inkjet point;

[0008] S2: Before triggering the Y-axis paper feeding, first calculate the time T of the acceleration area of ​​the car based on the known X-axis acceleration distance and target movement speed;

[0009] S3: After completing the above calculations, the Y-axis paper feeding movement can be triggered, and when the Y-axis reaches the OverlaySteps pulse value, the X-axis printing movement can be triggered.

[0010] Preferably, according to the detection FPGA described in step S1, the FPGA status bit is set, and a status bit is set in the FPGA to indicate the status of the current print output. When the X-axis is printing, the status bit is set to a high level, and when the X-axis completes printing of the last inkjet dot, the status bit is set to a low level.

[0011] Preferably, the timer interrupt processing program sets a timer interrupt with a period of 1 ms in the MCU, and performs detection and judgment in the timer interrupt processing program, each time the timer interrupt is triggered;

[0012] By reading the FPGA status bit, communicating with the FPGA, reading the FPGA status bit value; and judging the X-axis state, according to the value of the FPGA status bit;

[0013] The X-axis printing judgment logic determines the judgment condition for the X-axis to complete the printing of the last inkjet point. When the FPGA status bit changes from a high level to a low level, it is determined that the X-axis has completed the printing of the last inkjet point.

[0014] Preferably, the calculation formula of the time T in the acceleration area according to step S2 is:

[0015] T=(S*2)÷(V0+Vt);

[0016] Among them, T is the time in the acceleration area of ​​the car; S is the acceleration distance of the X axis; V0 is the initial speed; Vt is the target speed; through the generated acceleration and deceleration table, the number of pulses moved by the Y axis in the T time is deduced, and finally the following calculation is performed:

[0017] The Y-axis pulse value OverlaySteps that triggers the movement of the car = the total number of Y-axis movement pulses – the number of Y-axis movement pulses in the acceleration area of ​​the car, that is, the Y-axis pulse value that triggers the movement of the X-axis in advance is obtained.

[0018] Preferably, in step S2, an acceleration planning algorithm is introduced to control the acceleration and deceleration process of the X-axis according to the acceleration curve, and the acceleration planning algorithm uses an S-curve acceleration planning algorithm;

[0019] By using the S-curve function to control the change of acceleration, the S-curve has continuous derivability.

[0020] Among them, in the S-curve acceleration planning algorithm, the acceleration change conforms to the change law of the S-curve function. Assume that the starting speed is V0, the target speed is Vt, the acceleration is a, and the acceleration area distance is S;

[0021] Acceleration time: T1 = (Vt-V0) / a;

[0022] Acceleration area distance: Sa = V0*T1+0.5*a*T1 2 ;

[0023] Deceleration time: T3 = Vt / a;

[0024] Deceleration area distance: Sd = Vt*T3-0.5*a*T3 2 ;

[0025] Uniform speed time: T2 = (S-Sa-Sd) / Vt;

[0026] Total time: T = T1 + T2 + T3;

[0027] Among them, T1 is the acceleration time, Sa is the acceleration area distance, T3 is the deceleration time, Sd is the deceleration area distance, T2 is the uniform speed time, and T is the total time.

[0028] Preferably, before triggering the Y-axis paper feeding, the distance that the Y-axis needs to feed the paper is predicted, and the Y-axis paper feeding movement is triggered in advance;

[0029] First, collect and record historical printing data;

[0030] Data analysis and modeling: Based on historical printing data, data analysis and modeling are performed to find the correlation between the X-axis position and the Y-axis paper feeding distance, and a prediction model is established using linear regression analysis;

[0031] Prediction algorithm design: Based on the established prediction model, a prediction algorithm is designed to predict the position of the next inkjet point according to the current X-axis position and calculate the distance the paper needs to travel;

[0032] Trigger the Y-axis paper feed movement. Before the X-axis completes the last inkjet point, the distance that needs to be fed is calculated in advance based on the result of the prediction algorithm. When the distance reaches the threshold, the Y-axis paper feed movement can be triggered to move the printing paper in advance.

[0033] Preferably, the prediction model is established by analyzing through a linear regression algorithm.

[0034] Assume that the Y-axis paper distance is predicted by the X-axis position. There are n sample data, where the X-axis position of the i-th sample is Xi, and the corresponding Y-axis paper distance is Yi;

[0035] Construct a linear regression model, the linear relationship is Y = a*X + b, where a is the slope and b is the intercept;

[0036] According to the least squares formula, the slope a is estimated by calculating the ratio of the covariance of X_centered and Y_centered to the variance of X_centered:

[0037] a=Cov(X_centered,Y_centered) / Var(X_centered);

[0038] Among them, Cov(X_centered,Y_centered) represents the covariance of X_centered and Y_centered, and Var(X_centered) represents the variance of X_centered;

[0039] Using the known slope a and the mean of the sample data, calculate the estimated value of the intercept b:

[0040] b = Y_mean-a*X_mean; fit the best slope a and intercept b;

[0041] The prediction algorithm sets the current X-axis position, recorded as X_current; calculates the predicted Y-axis paper travel distance, recorded as Y_predicted, through the slope a and intercept b obtained in the linear regression model; then the prediction of the Y-axis paper travel distance is: Y_predicted=a*X_current+b.

[0042] Preferably, according to the triggering of the Y-axis paper feeding movement as described in step S3, the acceleration area time T of the trolley on the X-axis is calculated. During this time period, the trolley will gradually accelerate from a stationary state to a target movement speed; by controlling the Y-axis driver or actuator, the printing paper moves forward one line. During the Y-axis paper feeding movement, it is necessary to monitor the position of the Y-axis or the number of step pulses. The position information of the Y-axis is obtained by using the feedback signal of the encoder. When the position of the Y-axis reaches the predetermined OverlaySteps pulse value, it indicates that the Y-axis has completed the paper feeding movement.

[0043] A device for predicting motor position to improve printing efficiency includes: a printer, at least one processor, at least one memory and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the above-mentioned method is implemented.

[0044] A storage medium stores computer program instructions, which implement the above-mentioned method when the computer program instructions are executed by a processor.

[0045] The beneficial effects of the present invention are:

[0046] (1) Compared with the traditional method, the paper feed is realized immediately after the last point of the X-axis is printed, and the X-axis starts to move before the paper feed stops, and the Y-axis stops when it reaches the first inkjet point of the print, so as to achieve the highest output; ensure the integrity and accuracy of the printing process, avoid incomplete or repeated printing problems, and improve the quality of the printing results;

[0047] (2) By precalculating the acceleration zone time T of the trolley and controlling the acceleration and deceleration process, the movement is made smoother and more stable; by predicting the distance that the Y-axis needs to travel and triggering the Y-axis paper travel movement in advance, the waiting time of the X-axis and Y-axis is reduced, thereby improving printing efficiency and production capacity. When the Y-axis reaches the predetermined OverlaySteps pulse value, the X-axis printing movement is triggered to ensure the synchronization of the Y-axis paper travel and the X-axis printing, thereby improving printing accuracy and efficiency;

[0048] (3) By establishing a prediction model and designing a prediction algorithm, the corresponding Y-axis paper distance is predicted according to the current X-axis position, thereby predicting the printing position in advance, reducing waiting time, and further optimizing printing efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] For better understanding and implementation, the technical solution of the present application is described in detail below with reference to the accompanying drawings.

[0050] Figure 1 A flow chart of a method for predicting motor position and improving printing efficiency provided in Example 1 of the present application;

[0051] Figure 2 A method and device for predicting motor position to improve printing efficiency, and a schematic diagram of the efficiency of the X-axis carriage and Y-axis paper feed of the storage medium after linkage and coordination provided in Example 1 of the present application;

[0052] Figure 3 A method and device for predicting motor position to improve printing efficiency, as provided in Example 1 of the present application, and an efficiency diagram of an X-axis trolley and Y-axis paper feed for storing a medium without coordinated coordination. DETAILED DESCRIPTION

[0053] In order to further explain the technical means and effects taken by the present invention to achieve the predetermined invention purpose, exemplary embodiments will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of methods and systems consistent with some aspects of the present application as detailed in the attached claims.

[0054] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0055] The specific implementation methods, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.

[0056] Example 1

[0057] See also Figure 1-Figure 3 This embodiment provides a method, device and storage medium for predicting the motor position to improve printing efficiency. Through the linkage of the X-axis and the Y-axis, the waiting time for printing is reduced, and the printing movement effect is smoother, thereby improving printing capacity.

[0058] The present invention provides a method for predicting motor position and improving printing efficiency, comprising the following steps:

[0059] S1: The MCU detects the FPGA print output in real time through a 1ms periodic interrupt to determine whether the X-axis has completed the printing of the last inkjet point; it ensures that the X-axis has completed the content to be printed before the Y-axis starts feeding the paper, thus avoiding the problem of incomplete or repeated printing.

[0060] S2: Before triggering the Y-axis paper feeding, first calculate the time T of the car's acceleration area based on the known X-axis acceleration distance and target movement speed; pre-calculate the car's acceleration area time T to better control the acceleration and deceleration process of the car, making the movement smoother and more stable.

[0061] S3: After completing the above calculations, the Y-axis paper feeding movement can be triggered, and when the Y-axis reaches the OverlaySteps pulse value, the X-axis printing movement can be triggered to ensure the synchronization of the Y-axis paper feeding and the X-axis printing, thereby improving the printing accuracy and efficiency.

[0062] By judging the X-axis printing status in real time, calculating the acceleration zone time in advance, and accurately controlling the triggering timing of Y-axis paper feeding and X-axis printing, the accuracy, stability, and efficiency of the printing process can be improved. This can ensure the quality of the printing results and improve the production capacity of the printer.

[0063] In this embodiment, according to the detection FPGA described in step S1, the FPGA status bit is set, and a status bit is set in the FPGA to indicate the status of the current print output. For example, the status bit can be named "Printing". When the X-axis is printing, the status bit is set to a high level, and the printing status of the X-axis can be monitored in real time. In this way, it can be accurately determined whether the X-axis is performing a printing operation; when the X-axis completes the printing of the last inkjet point, the status bit is set to a low level; accurately determining whether the X-axis has completed the entire printing task, including the printing of the last inkjet point, helps to ensure the integrity and accuracy of the printing process.

[0064] By setting the FPGA status bit and detecting its changes in real time, accurate print output status information is provided to ensure the accuracy of X-axis printing status monitoring and the printing judgment of the last inkjet point, which helps to optimize the control and management of the printing process and improve printing efficiency and the quality of printing results.

[0065] In this embodiment, the timer interrupt processing program sets a timer interrupt with a period of 1ms in the MCU, and performs detection and judgment in the timer interrupt processing program, each time the timer interrupt is triggered;

[0066] By reading the FPGA status bit and communicating with the FPGA, the FPGA status bit value is read; and the X-axis status is determined, and according to the value of the FPGA status bit, whether the X-axis is printing or has completed the printing of the last inkjet point is determined.

[0067] The X-axis printing judgment logic determines the judgment condition for the X-axis to complete the printing of the last inkjet point according to actual needs and printer design. When the FPGA status bit changes from a high level to a low level, it is determined that the X-axis has completed the printing of the last inkjet point.

[0068] The communication method, status bit definition and judgment logic need to be determined according to the specific system architecture and hardware design. The FPGA printing output can be detected in real time through timer interrupts, and it can be determined whether the X-axis has completed the printing of the last inkjet point.

[0069] In this embodiment, according to the calculation formula of the time T in the acceleration area described in step S2:

[0070] T=(S*2)÷(V0+Vt);

[0071] Among them, T is the time in the acceleration area of ​​the car; S is the acceleration distance of the X axis; V0 is the initial speed; Vt is the target speed; through the generated acceleration and deceleration table, the number of pulses moved by the Y axis in the T time is derived, and finally the following calculation is performed:

[0072] The Y-axis pulse value OverlaySteps that triggers the movement of the car = the total number of Y-axis movement pulses – the number of Y-axis movement pulses in the acceleration area of ​​the car;

[0073] That is, the Y-axis pulse value that triggers the X-axis movement in advance is obtained.

[0074] By calculating the acceleration time T of the carriage, deriving the number of Y-axis motion pulses and calculating the Y-axis pulse value of the X-axis advance trigger movement, the Y-axis paper feeding movement can be triggered at the right time, and the X-axis printing movement can be triggered when the Y-axis reaches the corresponding position, ensuring the synchronous movement of the X-axis and the Y-axis, and improving printing efficiency and accuracy.

[0075] In this embodiment, an acceleration planning algorithm is introduced in step S2 to control the acceleration and deceleration process of the X axis according to the acceleration curve, so that the acceleration is smoother, the sudden change is avoided to affect the printing quality, and higher efficiency is achieved in the acceleration and deceleration process;

[0076] The acceleration planning algorithm includes a trapezoidal acceleration planning algorithm or an S-curve acceleration planning algorithm;

[0077] The trapezoidal acceleration planning algorithm divides the acceleration process into three stages: the starting stage, the uniform speed stage, and the deceleration stage. By controlling the change of acceleration, the acceleration planning algorithm can make the car more stable during the acceleration and deceleration process. This can reduce the impact of vibration and friction on the printing quality and improve the accuracy and clarity of the printing results.

[0078] In the initial stage, the car starts to accelerate from a stationary state, and the acceleration gradually increases until it reaches the set maximum acceleration;

[0079] Uniform speed stage: In the uniform speed stage, the car moves at a constant speed, keeping the maximum acceleration unchanged;

[0080] Deceleration phase,During the deceleration phase, the car begins to decelerate, and the acceleration gradually decreases until it reaches zero.

[0081] During the entire acceleration process, the acceleration of the car changes smoothly, avoiding the impact of sudden changes on printing quality.

[0082] Among them, in the trapezoidal acceleration planning algorithm, the acceleration changes in a step-like manner. Assume that the starting speed is V0, the target speed is Vt, the acceleration is a, and the acceleration area distance is S;

[0083] Acceleration time: T1 = (Vt-V0) / a;

[0084] Acceleration area distance: Sa = 0.5*a*T1^2;

[0085] Uniform speed time: T2 = (S-2*Sa) / Vt;

[0086] Total time: T = T1 + T2;

[0087] Among them, T1 is the acceleration time, Sa is the acceleration area distance, T2 is the uniform speed time, and T is the total time.

[0088] The S-curve acceleration planning algorithm uses the S-curve function to control the change of acceleration. The S-curve has continuous derivability and can achieve a smoother acceleration and deceleration process.

[0089] Among them, in the S-curve acceleration planning algorithm, the acceleration change conforms to the change law of the S-curve function. Assume that the starting speed is V0, the target speed is Vt, the acceleration is a, and the acceleration area distance is S;

[0090] Acceleration time: T1 = (Vt-V0) / a

[0091] Acceleration area distance: Sa = V0*T1+0.5*a*T1 2 ;

[0092] Deceleration time: T3 = Vt / a;

[0093] Deceleration area distance: Sd = Vt*T3-0.5*a*T3 2 ;

[0094] Uniform speed time: T2 = (S-Sa-Sd) / Vt;

[0095] Total time: T = T1 + T2 + T3;

[0096] Among them, T1 is the acceleration time, Sa is the acceleration area distance, T3 is the deceleration time, Sd is the deceleration area distance, T2 is the uniform speed time, and T is the total time.

[0097] In the S-curve acceleration planning algorithm, the acceleration of the car changes with time in accordance with the change law of the S-curve function to achieve a smooth transition. By adjusting the parameters of the S-curve, the rate and smoothness of the acceleration change can be controlled to meet different printing requirements.

[0098] By adopting the trapezoidal acceleration planning algorithm or the S-curve acceleration planning algorithm, a smooth acceleration and deceleration process can be achieved, improving the printing quality and efficiency. This can ensure the stability and accuracy of the printing process and improve the overall performance and productivity of the printer.

[0099] In this embodiment, before the Y-axis paper feeding is triggered, the distance that the Y-axis needs to feed the paper is predicted, and the Y-axis paper feeding movement is triggered in advance to reduce the waiting time of the X-axis and the Y-axis, thereby improving the printing efficiency;

[0100] First, collect and record historical printing data, including X-axis position information, inkjet point position, and corresponding Y-axis paper distance and other related data;

[0101] Data analysis and modeling: Based on the collected historical printing data, data analysis and modeling are performed to find the correlation between the X-axis position and the Y-axis paper feeding distance, and statistical methods, linear regression analysis or machine learning techniques are used to establish a prediction model;

[0102] Prediction algorithm design: Based on the established prediction model, design the corresponding prediction algorithm. The algorithm predicts the position of the next inkjet point based on the current X-axis position and calculates the distance the paper needs to travel;

[0103] Trigger the Y-axis paper feed movement. Before the X-axis completes the last inkjet point, the distance that needs to be fed is calculated in advance based on the result of the prediction algorithm. When the distance reaches a certain threshold, the Y-axis paper feed movement can be triggered to move the printing paper in advance. This can reduce the waiting time of the X-axis and Y-axis, thereby improving printing efficiency.

[0104] Real-time adjustment: As the printing process progresses, new printing data is continuously collected, and the prediction model and algorithm are updated based on the real-time data. This can continuously optimize the prediction accuracy and improve the prediction accuracy of the printing position.

[0105] By predicting the distance the Y-axis needs to move the paper and triggering the Y-axis paper movement in advance, the waiting time of the X-axis and Y-axis can be reduced, thereby improving printing efficiency. Real-time adjustment of prediction accuracy can further optimize the accuracy of the printing position and printing efficiency, improve the smoothness and production capacity of the printing process, and provide a faster and more efficient printing experience.

[0106] In this embodiment, the prediction model is established by analyzing the linear regression algorithm.

[0107] Assume that the Y-axis paper distance is predicted by the X-axis position. There are n sample data, where the X-axis position of the i-th sample is Xi, and the corresponding Y-axis paper distance is Yi;

[0108] Construct a linear regression model, the linear relationship is Y = a*X + b, where a is the slope and b is the intercept;

[0109] Use the least squares method to calculate the average values ​​of the X-axis position and Y-axis paper distance, which are recorded as X_mean and Y_mean respectively; for each sample data, calculate the difference between its X-axis position and Y-axis paper distance and the mean, and record them as X_centered and Y_centered respectively;

[0110] X_centered=Xi-X_mean

[0111] Y_centered=Yi-Y_mean

[0112] According to the least squares formula, the slope a is estimated by calculating the ratio of the covariance of X_centered and Y_centered to the variance of X_centered:

[0113] a=Cov(X_centered,Y_centered) / Var(X_centered);

[0114] Among them, Cov(X_centered,Y_centered) represents the covariance of X_centered and Y_centered, and Var(X_centered) represents the variance of X_centered;

[0115] Using the known slope a and the mean of the sample data, calculate the estimated value of the intercept b:

[0116] b=Y_mean-a*X_mean; fit the best slope a and intercept b.

[0117] The prediction algorithm sets the current X-axis position, recorded as X_current; calculates the predicted Y-axis paper travel distance, recorded as Y_predicted, through the slope a and intercept b obtained in the linear regression model; then the prediction of the Y-axis paper travel distance is: Y_predicted=a*X_current+b.

[0118] By establishing a prediction model and designing a prediction algorithm, the corresponding Y-axis paper distance can be predicted according to the current X-axis position. This can predict the printing position in advance, reduce waiting time, and improve printing efficiency. The linear regression model and the least squares method help to establish an accurate prediction model, and make predictions through the estimation of the slope and intercept, which can improve the prediction accuracy of the Y-axis paper distance, thereby optimizing the printing process and improving the printing quality.

[0119] In this embodiment, according to the triggering of the Y-axis paper feeding movement described in step S3, the acceleration area time T of the trolley on the X-axis is calculated. During this time period, the trolley will gradually accelerate from a stationary state to the target movement speed; by controlling the Y-axis driver or actuator, the printing paper moves forward one line. During the Y-axis paper feeding movement, it is necessary to monitor the position of the Y-axis or the number of step pulses. The position information of the Y-axis is obtained by using the feedback signal of the encoder. When the position of the Y-axis reaches the predetermined OverlaySteps pulse value, it means that the Y-axis has completed the paper feeding movement.

[0120] A device for predicting motor position to improve printing efficiency includes: a printer, at least one processor, at least one memory and computer program instructions stored in the memory. When the computer program instructions are executed by the processor, the above-mentioned method is implemented.

[0121] A storage medium stores computer program instructions, which implement the above-mentioned method when the computer program instructions are executed by a processor.

[0122] Example 2

[0123] This embodiment uses a servo motor and a position feedback system to achieve higher position control accuracy and stability.

[0124] This embodiment provides a method for predicting a motor position to improve printing efficiency, including:

[0125] Servo motor drive, using servo motor as the driver of XY axis. The servo motor precisely controls the position and speed by receiving control signals;

[0126] Control system, build a control system to generate control signals and send them to the servo motor driver. The control system can be composed of a microprocessor, controller or other embedded device;

[0127] Position feedback system: In order to achieve accurate position control, a position feedback system is equipped. Common position feedback systems include encoders, grating rulers, etc. The position feedback system will monitor the actual position of the XY axis in real time and feed the information back to the control system;

[0128] Motion planning algorithm, which is implemented in the control system. It calculates the target position and speed of the XY axis motor according to the instructions input by the user or the coordinate information in the printed file.

[0129] Control signal generation, based on the results of the motion planning algorithm, the control system generates corresponding control signals, including position and speed information, and sends them to the servo motor driver;

[0130] Servo motor drive: After receiving the control signal, the servo motor driver drives the XY axis motor to move according to the position and speed information indicated by the signal. The servo motor can accurately adjust its output through closed-loop control to reach the target position.

[0131] Real-time monitoring and adjustment: During the printing process, the control system can monitor the position of the XY axis in real time and adjust the control signal according to the actual situation to achieve a more accurate printing effect.

[0132] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A method for predicting motor position to improve printing efficiency, characterized in that: The steps include: S1: MCU detects the printing output of FPGA in real time through a 1ms periodic interrupt, and determines that the X-axis has completed the printing of the last inkjet point; S2: Before triggering the Y-axis paper feeding, first calculate the time T of the car's acceleration area based on the known X-axis acceleration distance and target motion speed; S3: After completing the calculation of step S2, the Y-axis paper feeding movement can be triggered, and when the Y-axis reaches the OverlaySteps pulse value, the X-axis printing movement is triggered; According to the detection FPGA described in step S1, the FPGA status bit is set, and a status bit is set in the FPGA to indicate the status of the current print output. When the X axis is printing, the status bit is set to a high level, and when the X axis completes printing of the last inkjet point, the status bit is set to a low level; According to the calculation formula of the time T in the acceleration area described in step S2: T=(S*2)÷(V0+Vt); Among them, T is the time in the acceleration area of ​​the car; S is the acceleration distance of the X axis; V0 is the initial speed; Vt is the target speed; through the generated acceleration and deceleration table, the number of pulses moved by the Y axis in the T time is deduced, and finally the following calculation is performed: The Y-axis pulse value OverlaySteps that triggers the movement of the car = the total number of Y-axis movement pulses – the number of Y-axis movement pulses in the acceleration area of ​​the car, that is, the Y-axis pulse value that triggers the movement of the X-axis in advance is obtained; In step S2, an acceleration planning algorithm is introduced to control the acceleration and deceleration process of the X-axis according to the acceleration curve. The acceleration planning algorithm uses an S-curve acceleration planning algorithm. By using the S-curve function to control the change of acceleration, the S-curve has continuous derivability. Among them, in the S-curve acceleration planning algorithm, the acceleration change conforms to the change law of the S-curve function, setting the starting speed to V0, the target speed to Vt, the acceleration to a, and the acceleration area distance to S; Acceleration time: T1=(Vt-V0) / a; Acceleration area distance: Sa=V0*T1+0.5*a* T1 2 ; Deceleration time: T3=Vt / a; Deceleration area distance: Sd=Vt*T3-0.5*a*T3 2 ; Uniform speed time: T2=(S-Sa-Sd) / Vt; Total time: T=T1+T2+T3; Among them, T1 is the acceleration time, Sa is the acceleration area distance, T3 is the deceleration time, Sd is the deceleration area distance, T2 is the uniform speed time, and T is the total time.

2. The method for predicting motor position and improving printing efficiency according to claim 1, characterized in that: The timer interrupt handler sets a timer interrupt with a period of 1 ms in the MCU, and performs detection and judgment in the timer interrupt handler, each time the timer interrupt is triggered; By reading the FPGA status bit, communicating with the FPGA, reading the FPGA status bit value; and judging the X-axis state, according to the value of the FPGA status bit; The X-axis printing judgment logic determines the judgment condition for the X-axis to complete the printing of the last inkjet point. When the FPGA status bit changes from a high level to a low level, it is determined that the X-axis has completed the printing of the last inkjet point.

3. The method for predicting motor position to improve printing efficiency according to claim 1, characterized in that: Before triggering the Y-axis paper feeding, predict the distance that the Y-axis needs to feed the paper, and trigger the Y-axis paper feeding movement in advance; First, collect and record historical printing data; Data analysis and modeling: Based on historical printing data, data analysis and modeling are performed to find the correlation between the X-axis position and the Y-axis paper feeding distance, and a prediction model is established using linear regression analysis; Prediction algorithm design: Based on the established prediction model, a prediction algorithm is designed to predict the position of the next inkjet point according to the current X-axis position and calculate the distance the paper needs to travel; Trigger the Y-axis paper feed movement. Before the X-axis completes the last inkjet point, the distance that needs to be fed is calculated in advance based on the result of the prediction algorithm. When the distance reaches the threshold, the Y-axis paper feed movement is triggered, so that the printing paper moves in advance.

4. The method for predicting motor position and improving printing efficiency according to claim 3, characterized in that: The prediction model is established by analyzing the linear regression algorithm. The Y-axis paper distance is predicted by the X-axis position. There are n sample data, where the X-axis position of the i-th sample is Xi and the Y-axis paper distance is Yi. Construct a linear regression model, the linear relationship is Y=a*X+b, where a is the slope and b is the intercept; According to the least squares formula, the slope a is estimated by calculating the ratio of the covariance of X_centered and Y_centered to the variance of X_centered: a=Cov(X_centered,Y_centered) / Var(X_centered); Among them, Cov(X_centered,Y_centered) represents the covariance of X_centered and Y_centered, and Var(X_centered) represents the variance of X_centered; Using the known slope a and the mean of the sample data, calculate the estimated value of the intercept b: b=Y_mean-a*X_mean; fit the best slope a and intercept b; The prediction algorithm sets the current X-axis position, recorded as X_current; calculates the predicted Y-axis paper travel distance, recorded as Y_predicted, through the slope a and intercept b obtained in the linear regression model; then the prediction of the Y-axis paper travel distance is: Y_predicted=a*X_current+b.

5. The method for predicting motor position to improve printing efficiency according to claim 1, characterized in that: According to the triggering of the Y-axis paper feeding motion described in step S3, the acceleration zone time T of the trolley on the X-axis is calculated. During this time period, the trolley will gradually accelerate from a stationary state to a target motion speed; By controlling the Y-axis driver or actuator, the printing paper moves forward one line. During the Y-axis paper feeding process, it is necessary to monitor the position of the Y-axis or the number of step pulses. The position information of the Y-axis is obtained by using the feedback signal of the encoder. When the position of the Y-axis reaches the predetermined OverlaySteps pulse value, it means that the Y-axis has completed the paper feeding movement.

6. A device for predicting motor position to improve printing efficiency, characterized in that: The invention comprises a printer, at least one processor, at least one memory and computer program instructions stored in the memory, and when the computer program instructions are executed by the processor, the method according to any one of claims 1 to 5 is implemented.

7. A storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Controlling method for intelligent waterless painting and dyeing equipment

    CN101205673A

  • Calibration method and device for paper speed of digital printing system, and digital printing system

    CN106671614A