Control method and system for system positioning and position feedback of laser engraving machine

Through the combination of magnetic encoder and Modbus protocol, high-precision position feedback control of the laser engraving machine system is realized, solving the problem of inaccurate positioning of traditional laser engraving machines, and improving the stability of precision machining and finished product quality.

CN120460908APending Publication Date: 2025-08-12SHENZHEN AOFENUO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510559170.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The traditional laser engraving machine system has insufficient accuracy in motor motion position control feedback and laser position position position position, which leads to the engraved images not matching the design drawings and the position deviation cannot be corrected in real time, limiting its application in precision machining scenarios.

Method used

The magnetic encoder is used to collect the motor rotation position data in real time, combine the forward and reverse calibration algorithm and the Modbus protocol for high-reliability communication, and pass 20kHz high-frequency sampling and arithmetic average filtering, combined with the dynamic position synchronization mechanism, integrate laser power PWM closed-loop control and optical path focusing design, and combine it with nonvolatile calibration parameter storage to achieve accurate position control and anti-vibration interference.

Benefits of technology

It effectively solves the problem of positioning misalignment caused by cumulative error of stepper motor and external interference. The position deviation is controlled within the range of ±0.5 step accuracy, which significantly improves the system stability and finished product qualification rate in precision machining scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120460908A_ABST
    Figure CN120460908A_ABST
Patent Text Reader

Abstract

The invention discloses a control method and system for system positioning and position feedback of a laser engraving machine, and the method comprises the steps: collecting the rotation position data of a motor in real time through a magnetic encoder, eliminating a direction error in combination with a forward and reverse calibration algorithm, and achieving the high-reliability communication through an RS485 bus and a Modbus protocol. The problem that positioning of a traditional laser engraving machine is not accurate due to accumulative errors of a stepping motor, external interference and manual misoperation is effectively solved; through 20kHz high-frequency sampling and arithmetic average filtering and in combination with a dynamic position synchronization mechanism, the position deviation is controlled within a + / -0.5 stepping precision range; an interpolation algorithm is introduced to optimize free path carving, and track smoothness is improved through step length self-adaptive interpolation; laser power PWM closed-loop control and light path focusing design are integrated, nonvolatile calibration parameter storage is matched, hierarchical engraving precision and anti-vibration interference capacity are achieved, and system stability and finished product percent of pass under a precision machining scene are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of laser engraving machines, and in particular relates to a control method and system for positioning and position feedback of a laser engraving machine system. Background Art

[0002] Traditional laser engraving systems suffer from insufficient accuracy in motor position control feedback and laser positioning. Specifically, existing systems rely on the mechanical motion characteristics of stepper motors for position calculations. However, due to limitations in the motor production process and accumulated errors in the motion structure, positional offsets can easily occur after long periods of operation, resulting in significant discrepancies between the engraved image and the design drawing. Furthermore, when the laser is displaced by external forces, the system is unable to sense and correct the positional deviation in real time, resulting in incorrect engraving areas or the risk of equipment collision. This lag in position feedback and environmental sensitivity significantly limits the application of laser engraving machines in precision machining scenarios.

[0003] Traditional laser engraving machine systems lack a dynamic position compensation mechanism and are unable to correct motor motion errors and laser position offsets caused by external interference in real time, resulting in engraving accuracy and system reliability that are difficult to meet high-precision processing requirements. Summary of the Invention

[0004] The purpose of the present invention is to provide a control method and system for positioning and position feedback of a laser engraving machine system, which can accurately control the motor movement to a specified position and actively correct the position when deviation occurs, so as to solve the problem that the laser cannot achieve position positioning.

[0005] To achieve the above object, the present invention adopts the following technical solution: a control method for positioning and position feedback of a laser engraving machine system, comprising the following steps: Initialize the magnetic encoder, set up the hardware SPI interface, and use a timer to collect magnetic encoder data at a sampling frequency of 20kHz. Determine the rotation direction of the stepper motor by comparing the change direction of two consecutive magnetic encoder sampling data. When the current data is greater than the previous data, it is determined to be forward rotation, otherwise it is reverse rotation. Sample the magnetic encoder data N times in a row, and calculate the arithmetic mean to filter out high-frequency noise. Transmit the filtered magnetic encoder data to the motion control module via the bus, using the Modbus protocol for communication, defining the X-axis motor address as 12, the Y-axis motor address as 13, and the baud rate as 921600, and calibrate the magnetic encoder.

[0006] Preferably, the calibration of the magnetic encoder includes: controlling the motor to rotate forward one circle after idling to release stress, and recording the magnetic encoder value at each step; rotating the motor backward one circle to eliminate direction error, and recording the magnetic encoder value again; verifying the cyclic consistency of the forward and reverse data, and calculating the calibration parameters after eliminating the sudden change value.

[0007] Preferably, the calculation formula of the calibration parameter is: data_u16=CycleRem(Move_Divide_NUM*step_x+Move_Divide_NUM*step_y / data_i32,Move_Pulse_NUM); Where CycleRem is the cyclic remainder algorithm: CycleRem(a, b) = (a + b) % b, Move_Divide_NUM is the subdivision coefficient, step_x and step_y are the step numbers, data_i32 is the calibration direction correction value, and Move_Pulse_NUM is the number of steps required for the motor to rotate one revolution.

[0008] Preferably, it also includes: real-time synchronization of motion position, by comparing the number of motor pulses and the position of the magnetic encoder, when the difference between the two exceeds 5 steps, forcibly updating the system coordinates to achieve position synchronization.

[0009] Preferably, it further includes: entering a positioning mode, wherein the positioning mode includes supporting point positioning and continuous positioning; the point positioning mode includes: recording multiple coordinate points specified by the user, fitting a regular graphic path and engraving; the continuous positioning mode includes: regularly recording the laser movement trajectory, and supplementing the path points through an interpolation algorithm, the formula is: , k=1,2,...,m; in, , L is the distance between adjacent points, δ is the step threshold; Represents the position coordinates of the i-th point.

[0010] On the other hand, the present invention provides a control system for positioning and position feedback of a laser engraving machine system, comprising: Stepper motor motion control module, used to control X / Y axis motor motion and acceleration and deceleration; The magnetic encoder data acquisition module is installed just above the motor optical axis and realizes data acquisition and direction detection through microcontroller programming; The laser emission control module adjusts the laser power through PWM signals and realizes beam focusing through optical path design.

[0011] Preferably, the magnetic encoder data acquisition module is connected to the motion control module via an RS485 bus, data is transmitted using the Modbus protocol, and calibration parameters are stored in a non-volatile memory.

[0012] Preferably, the magnetic encoder data acquisition module includes: a magnet mounted on the backlight axis of the stepper motor; a magnetic encoder chip located directly above the magnet; and a microcontroller for programming and controlling magnetic encoder data reading, direction detection, and filtering.

[0013] Preferably, the stepper motor motion control module includes: a motor drive circuit supporting forward and reverse control of the stepper motor; a pulse counter recording the number of motor motion pulses in real time; and a calibration data storage unit storing calibration parameters of the forward and reverse magnetic encoders.

[0014] Preferably, the laser emission control module includes: a PWM signal generator for receiving control instructions from a motion controller; a constant current drive circuit for converting the PWM signal into a laser drive current; and an optical path focusing component for focusing the laser beam onto a processing plane.

[0015] Technical effects and advantages of the present invention: Compared with the prior art, the present invention provides a method and system for controlling positioning and position feedback of a laser engraving machine system, which has the following advantages: The present invention uses a magnetic encoder to collect motor rotation position data in real time, combines forward and reverse calibration algorithms to eliminate direction errors, and uses RS485 bus and Modbus protocol to achieve high-reliability communication, effectively solving the positioning inaccuracy problem of traditional laser engraving machines caused by cumulative errors of stepping motors, external interference and human misoperation; through 20kHz high-frequency sampling and arithmetic average filtering, combined with a dynamic position synchronization mechanism, the position deviation is controlled within the step accuracy range of ±0.5; an interpolation algorithm is introduced to optimize free path engraving, and the trajectory smoothness is improved through step-size adaptive interpolation; integrated laser power PWM closed-loop control and optical path focusing design, combined with non-volatile calibration parameter storage, achieve hierarchical engraving accuracy and anti-vibration interference capability, and significantly improve system stability and finished product qualification rate in precision machining scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 Flowchart of the control method for positioning and position feedback of the laser engraving machine system of the present invention; Figure 2 This is a block diagram of the control system for positioning and position feedback of the laser engraving machine system of the present invention. DETAILED DESCRIPTION

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

[0018] The present invention provides Figure 1The following is a control method for positioning and position feedback of a laser engraving machine system. This method can accurately control the motor movement to a specified position and actively correct the position when it deviates. In application, it solves the problem that the laser cannot achieve position positioning. The details are as follows: In this embodiment, the control method for positioning and position feedback of a laser engraving machine system includes the following steps: Initialize the magnetic encoder, set up the hardware SPI interface, and use the timer to collect magnetic encoder data at a sampling frequency of 20kHz to ensure real-time data.

[0019] By comparing the changing direction of two consecutive sampling data of the magnetic encoder, the rotation direction of the stepper motor is determined. When the current data is greater than the previous data, it is determined to be forward rotation, otherwise it is reverse rotation; The magnetic encoder data is sampled N times continuously and the arithmetic mean is calculated to filter out high-frequency noise; the formula is: , is the kth filtering output value, The randomness of noise is used to cancel each other out, thereby suppressing high-frequency or periodic interference, improving signal smoothness, and improving the accuracy of angle sampling; the original signal value is continuously collected N times at a fixed sampling frequency. , , the code is implemented as follows: floatsum=0.0; for(int i = 0; i <N;i++){ sum+=buffer[i]; } floatfiltered_value=sum / N.

[0020] The filtered magnetic encoder data is transmitted to the motion control module via the bus, using the Modbus protocol for communication. The X-axis motor address is defined as 12, the Y-axis motor address is 13, and the baud rate is 921600. The magnetic encoder is calibrated.

[0021] The sampled data is transmitted to the motion control module via the RS485 bus. RS485 uses two complementary signal lines (A+ and B-) and uses voltage differences to indicate logic states. The voltage of line A is higher than that of line B (+2V to +6V), and the voltage of line B is higher than that of line A (-6V to -2V). Only one device is allowed to send data at a time, while the rest of the devices are in a receiving state. The master node coordinates multiple slave nodes through a polling mechanism to avoid data conflicts. The protocol layer uses the Modbus protocol. The X-axis motor communication address is defined as 12, and the Y-axis motor communication address is defined as 13 to avoid communication conflicts due to the same address. The baud rate uses 921600 to improve transmission efficiency.

[0022] The microcontroller uses a 20kHz timer to accurately collect magnetic encoder data and filters the data to obtain real-time and effective data. The data is transmitted to the motion control module via the RS485 bus using the Modbus data protocol to achieve effective data collection and transmission.

[0023] Among them, the magnetic encoder is calibrated, including: controlling the motor to rotate forward one circle after idling to release stress, and recording the magnetic encoder value under each step; rotating it in the opposite direction one circle to eliminate the direction error, and recording the magnetic encoder value again; verifying the cyclic consistency of the forward and reverse data, and calculating the calibration parameters after eliminating the sudden change value.

[0024] Furthermore, the calculation formula of the calibration parameters is: data_u16=CycleRem(Move_Divide_NUM*step_x+Move_Divide_NUM*step_y / data_i32,Move_Pulse_NUM); Where CycleRem is the cyclic remainder algorithm: CycleRem(a, b) = (a + b) % b, Move_Divide_NUM is the subdivision coefficient, step_x and step_y are the step numbers, data_i32 is the calibration direction correction value, and Move_Pulse_NUM is the number of steps required for the motor to rotate one revolution.

[0025] In another embodiment, the control method for positioning and position feedback of the laser engraving machine system further includes: synchronizing the motion position in real time by comparing the number of motor pulses with the position of the magnetic encoder. When the difference between the two exceeds 5 steps, the system coordinates are forcibly updated to achieve position synchronization.

[0026] In another embodiment, the control method for positioning and position feedback of a laser engraving machine system further includes: entering a positioning mode, wherein the entering a positioning mode includes support point positioning and continuous positioning; The point positioning mode includes: recording multiple coordinate points specified by the user, fitting a regular graphic path and engraving; the continuous positioning mode includes: regularly recording the laser movement trajectory, and supplementing the path points through the interpolation algorithm. The formula is: , k=1,2,...,m; in, , L is the distance between adjacent points, δ is the step threshold; Represents the position coordinates of the i-th point. Example 2

[0027] In this embodiment, a control system for positioning and position feedback of a laser engraving machine system is proposed. Figure 2 As shown, including: Stepper motor motion control module, used to control X / Y axis motor motion and acceleration and deceleration; Furthermore, the stepper motor motion control module includes: a motor drive circuit that supports forward and reverse control of the stepper motor; a pulse counter that records the number of motor motion pulses in real time; and a calibration data storage unit that stores forward and reverse magnetic encoder calibration parameters.

[0028] The magnetic encoder data acquisition module is installed directly above the motor optical axis and realizes data acquisition and direction detection through microcontroller programming. The magnetic encoder data acquisition module is connected to the motion control module through the RS485 bus, using the Modbus protocol to transmit data, and the calibration parameters are stored in the non-volatile memory.

[0029] Furthermore, the magnetic encoder data acquisition module includes: a magnet installed on the backlight shaft of the stepper motor; a magnetic encoder chip located directly above the magnet; and a microcontroller for programming and controlling magnetic encoder data reading, direction detection, and filtering.

[0030] The laser emission control module adjusts the laser power through PWM signals and realizes beam focusing through optical path design.

[0031] Furthermore, the laser emission control module includes: a PWM signal generator that receives control instructions from the motion controller; a constant current drive circuit that converts the PWM signal into a laser drive current; and an optical path focusing component that focuses the laser beam onto the processing plane.

[0032] When executed, the above modules are also used to implement other steps of the above-mentioned laser engraving machine system positioning and position feedback control method, which are as follows: Magnetic encoder calibration is a critical step in balancing the hardware advantages of magnetic encoders with system control requirements, and is particularly essential in high-precision applications such as industrial automation and robotics. For absolute magnetic encoders, initial calibration provides a one-time, one-time solution. However, incremental encoders or those used in specialized operating conditions still require regular calibration to ensure long-term reliability.

[0033] Motor idling to release stress: First, let the motor quickly idle for one circle to release the stress of the motor and structure to reduce the error during measurement, and make a preliminary comparison between the theoretical movement distance and the actual movement distance to ensure that there is no obstruction within this movement range.

[0034] Forward magnetic encoding data measurement and acquisition: For a slow forward rotating motor, record the sample value and step number of this code at each step of the motor. Record 10 times quickly and perform average filtering to obtain the measured value at that point. Then continue to move to the next step and perform the same data acquisition and calculation work until the motor completes one circle. Assume that the motor drive is subdivided into Move_Divide_NUM and the number of steps per circle of the stepper motor is Move_Step_NUM. Then the number of steps required for one circle, Move_Pulse_NUM, is (Move_Step_NUM*Move_Divide_NUM). That is: Move_Pulse_NUM=(Move_Step_NUM*Move_Divide_NUM); The data collected when the motor rotates one circle is counted into the array coder_data_f[] with a length of Move_Step_NUM+1.

[0035] Reverse error cancellation: To avoid measurement errors caused by quickly reversing the direction of movement, after completing the forward movement measurement, continue to move the distance in one circle without measuring, and then move the distance in the reverse direction without measuring the data to eliminate the error caused by the reverse direction.

[0036] Reverse magnetic encoding data measurement and acquisition: Slowly rotate the motor in the opposite direction and record the sampling value and step number of the magnetic encoder at each step of the motor. Record it quickly 10 times and perform average filtering to obtain the measurement value at that point. Then continue to move to the next step and perform the same data acquisition and calculation work until the motor rotates a full circle. The data collected during one rotation of the motor is counted into the array coder_data_r[] with a length of Move_Step_NUM+1.

[0037] Data accuracy check: In order to obtain an accurate calibration result, it is necessary to check the data before calculating the calibration value. The sampled arrays coder_data_f[] and coder_data_r[] are checked for data validity. First, the cyclic average of the sampled values at the same position in coder_data_f[] and coder_data_r[] is calculated. The specific process is as follows: coder_data_f[count]=(uint16_t)CycleAverage((int32_t)cali_ctrl.coder_data_f[count],(int32_t)cali_ctrl.coder_data_r[count],CALI_Encode_Res); CALI_Encode_Res is the sampling accuracy of the magnetic encoder, and CycleAverage is the algorithm for calculating the cyclic average value. The value range of the magnetic encoder is 0~16384. Therefore, there will inevitably be two sudden changes in the value during one rotation sampling process. If the average value is directly calculated, the calculation result will have a half-circle error. When calculating the average value of these two sudden changes, the error of half a circle needs to be compensated according to the direction to achieve the effect of calculating the continuous average value and the sudden change average value at the same time. The calculation process is as follows: int32_tCycleAverage(int32_ta,int32_tb,int32_tcyc) { int32_tsub_data int32_tave_data sub_data=ab ave_data=(a+b)>>1 if(abs(sub_data)>(cyc>>1)) { if(ave_data>=(cyc>>1)) ave_data-=(cyc>>1) else ave_data+=(cyc>>1) } returnave_data }; After obtaining the average value and storing it in coder_data_f[], the adjacent data are cyclically subtracted to check whether the direction of the sampling value is correct. When the obtained difference sub_data=0, the direction is wrong. When sub_data>0, the movement direction is considered to be in the positive direction dir=true. When sub_data<0, the movement direction is considered to be in the reverse direction dir=false.

[0038] The cyclic difference process is as follows: sub_data=CycleSub((int32_t)cali_ctrl.coder_data_f[0],(int32_t)cali_ctrl.coder_data_f[Move_Step_NUM-1],CALI_Encode_Res); Implementation of loop difference function: int32_tCycleSub(int32_ta,int32_tb,int32_tcyc) { int32_tsub_data sub_data=ab if(sub_data>(cyc>>1)) sub_data-=cyc if(sub_data<(-cyc>>1)) sub_data+=cyc returnsub_data }; After obtaining the correct calibration motion direction, perform a cyclic difference calculation on all adjacent two data in coder_data_f[] to obtain sub_data and judge the difference. The range of the difference is limited to ± accuracy of CALI_Gather_Encode_Res*1 / 2. CALI_Gather_Encode_Res is the accuracy range of each step: CALI_Gather_Encode_Res=((int32_t)(CALI_Encode_Res / Move_Step_NUM)). Sampling data outside this range is considered invalid data, while data within this range is considered valid.

[0039] At the same time, sub_data cannot be equal to 0, and the direction of sub_data must be consistent with the direction of dir, otherwise the collected data is considered invalid. After confirming the continuous validity of the data, it is necessary to find the step difference value and the position of the lower interval in coder_data_f[]. If there is no lower interval position, the collected data is also considered invalid.

[0040] According to the motion direction dir and the data in coder_data_f[] obtained from the further calculation above, the encoder value corresponding to each step is calculated from the position cali_ctrl.rcd_x and cali_ctrl.rcd_y of the lower interval: data_u16=CycleRem(Move_Divide_NUM*step_x+Move_Divide_NUM*step_y / data_i32,Move_Pulse_NUM); The calibrated data is stored in the non-volatile storage area of the computer and can be directly accessed when needed. The data will not be lost when the power is off.

[0041] Motion position synchronization: Real-time encoder data reading: Reads encoder sampling data in real time and performs validation on the data. Converts encoder data into position data: After obtaining the encoder data, uses a table lookup method to find the step number corresponding to the encoder value from the calibration table. By determining the movement direction and step number, the accumulated movement steps are used to obtain the actual movement distance steps_location.

[0042] Position comparison: During motor motion, motor_out_location records the actual number of motion pulses output. Compare the difference between motor_out_location and steps_location to determine if motion is offset.

[0043] Position correction synchronization: Under normal motion conditions, motor_out_location==steps_location. By judging the difference between (motor_out_location-steps_location) and the set error location_error_range (half of which is set to within 5 steps), if it is greater than location_error_range, it is judged that there is an abnormal position offset. Then the position of steps_location is converted and synchronized to the motion coordinates of the laser engraving machine system to achieve position synchronization. For example: in the initial state, motor_out_location=1000, steps_location=1000, the position is normal and no offset occurs. At this time, the device is manually moved 100 steps, steps_location=1100 but motor_out_location is still equal to 1000. (motor_out_location-steps_location)>location_error_range The position is offset and needs to be corrected. At this time, motor_out_location=steps_location is forced to update the motor_out_location value to achieve synchronization of the motion coordinate system position.

[0044] current_steps is the step value converted from the current reading, cali_table is the calibration table, motion_info.angle is the magnetic encoder reading, last_steps is the position value calculated last time, and steps_per_circle is the number of steps required for one circle. First, determine whether the reading has a sudden change. If so, it is considered that the reading has crossed the boundary. Calculate steps_location based on the size relationship between current_steps and last_steps.

[0045] Laser engraving position positioning includes: Enter positioning mode: Enter the positioning mode by setting the machine mode. The positioning mode is divided into continuous positioning and point positioning. Point positioning only records a few specified points. You need to set the shape (such as circle, square, rectangle, etc.) and the number of points. Generally, three points can determine a circle, and two points can determine a rectangle. For example, if the user selects 3-point positioning circle, after recording three points, a circular path will be fitted through the three points and the shape will be engraved. Continuous positioning will continuously record the movement of the laser. You only need to set the recording time interval. The shorter the interval, the more points will be recorded, and the resulting image will be more consistent with the movement path of the laser.

[0046] Record mobile location: In point positioning mode: the laser records each point when it moves to a position, and finally obtains the array of recod_position[], each array element contains X, Y coordinate information.

[0047] In continuous positioning mode: a timer task is designed to perform coordinate recording once at each recording interval. The time interval for recording the coordinates each time to obtain each element of the recod_position[] array is 1ms.

[0048] Laser engraving and drawing: In point positioning mode: the selected regular shape (circle, square, rectangle, triangle, ellipse, variable rhombus) and the coordinate data recorded in the recod_position[] array are fitted into the corresponding motion path, and the path is converted into motion control instructions to the motion control module and laser generation module for laser engraving to obtain the corresponding work.

[0049] In continuous positioning mode: directly plan the path of the recod_position[] array, and perform necessary smoothing between two points to obtain a continuous and smooth motion path. The path is converted into motion control instructions to the motion control module and laser generation module for laser engraving operations to obtain the corresponding works.

[0050] The smoothing process of laser engraving path planning is achieved by linear interpolation and segmentation. The principle is to insert intermediate points between adjacent path points and reduce curvature mutations by increasing the density of path points. The specific implementation is as follows: Given a path point sequence P= , calculate the distance between adjacent points .

[0051] like (step threshold), insert interpolation points, interpolation formula: k=1,2,...,m.

[0052] This invention provides real-time position feedback for the laser engraving machine, preventing position errors or loss caused by external factors, and improving the reliability and user experience of the laser engraving system. The position synchronization function effectively solves the problem of motor step loss and manual laser movement causing the laser engraving system to lose motion coordinates. The addition of a position positioning function enables rapid drawing of regular graphics or freehand drawing, bringing more application scenarios to the machine.

[0053] In summary, the present invention uses a magnetic encoder to collect motor rotation position data in real time, combines forward and reverse calibration algorithms to eliminate direction errors, and uses RS485 bus and Modbus protocol to achieve high-reliability communication, effectively solving the positioning inaccuracy problem of traditional laser engraving machines caused by cumulative errors of stepper motors, external interference and manual misoperation; through 20kHz high-frequency sampling and arithmetic average filtering, combined with a dynamic position synchronization mechanism, the position deviation is controlled within the range of ±0.5 step accuracy; an interpolation algorithm is introduced to optimize free path engraving, and the trajectory smoothness is improved through step-size adaptive interpolation; integrated laser power PWM closed-loop control and optical path focusing design, combined with non-volatile calibration parameter storage, achieve hierarchical engraving accuracy and anti-vibration interference capability, and significantly improve the system stability and finished product qualification rate in precision machining scenarios.

[0054] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A control method for positioning and position feedback of a laser engraving machine system, characterized in that: The following steps are involved: Initialize the magnetic encoder, set up the hardware SPI interface and collect magnetic encoder data through the timer at a sampling frequency of 20kHz; The rotation direction of the stepper motor is determined by comparing the change direction of two consecutive sampling data of the magnetic encoder. When the current data is greater than the previous data, it is determined to be forward rotation, otherwise it is reverse rotation; The magnetic encoder data is sampled N times continuously and the arithmetic mean is calculated to filter out high-frequency noise; The filtered magnetic encoder data is transmitted to the motion control module via the bus, using the Modbus protocol for communication. The X-axis motor address is defined as 12, the Y-axis motor address is 13, and the baud rate is 921600. The magnetic encoder is calibrated.

2. A method for controlling positioning and position feedback of a laser engraving machine system according to claim 1, characterized in that: The calibrating of the magnetic encoder comprises: Control the motor to rotate forward one circle after idling to release stress, and record the magnetic encoder value at each step; Rotate in the opposite direction for one circle to eliminate the direction error and record the magnetic encoder value again; Verify the cyclic consistency of forward and reverse data, and calculate the calibration parameters after removing the mutation values.

3. A control method for positioning and position feedback of a laser engraving machine system according to claim 2, characterized in that: The calculation formula of the calibration parameter is: data_u16=CycleRem(Move_Divide_NUM*step_x+Move_Divide_NUM*step_y / data_i32,Move_Pulse_NUM); Where CycleRem is the cyclic remainder algorithm: CycleRem(a, b) = (a + b) % b, Move_Divide_NUM is the subdivision coefficient, step_x and step_y are the step numbers, data_i32 is the calibration direction correction value, and Move_Pulse_NUM is the number of steps required for the motor to rotate one revolution.

4. The method for controlling positioning and position feedback of a laser engraving machine system according to claim 1, characterized in that: Also includes: Real-time synchronization of motion position, by comparing the number of motor pulses and the magnetic encoder position, when the difference between the two exceeds 5 steps, the system coordinates are forced to update to achieve position synchronization.

5. The control method for positioning and position feedback of a laser engraving machine system according to claim 1, characterized in that: Also includes: Entering a positioning mode, wherein the positioning mode includes support point positioning and continuous positioning; Point positioning modes include: recording multiple coordinate points specified by the user, fitting a regular graphic path and engraving; The continuous positioning mode includes: regularly recording the laser movement trajectory and supplementing the path points through the interpolation algorithm. The formula is: , k=1,2,...,m; in, , L is the distance between adjacent points, δ is the step threshold; Represents the position coordinates of the i-th point.

6. A control system for positioning and position feedback of a laser engraving machine system for implementing the method according to any one of claims 1 to 5, characterized in that: include: Stepper motor motion control module, used to control X / Y axis motor motion and acceleration and deceleration; The magnetic encoder data acquisition module is installed just above the motor optical axis and realizes data acquisition and direction detection through microcontroller programming; The laser emission control module adjusts the laser power through PWM signals and realizes beam focusing through optical path design.

7. The control system for positioning and position feedback of a laser engraving machine system according to claim 6, characterized in that: The magnetic encoder data acquisition module is connected to the motion control module via an RS485 bus, and data is transmitted using the Modbus protocol. Calibration parameters are stored in a non-volatile memory.

8. The control system for positioning and position feedback of a laser engraving machine system according to claim 6, characterized in that: The magnetic encoder data acquisition module includes: A magnet mounted on the backlight shaft of the stepper motor; The magnetic encoder chip is located directly above the magnet; Microcontroller, used to program and control magnetic encoder data reading, direction detection and filtering.

9. The control system for positioning and position feedback of a laser engraving machine system according to claim 6, characterized in that: The stepper motor motion control module includes: Motor drive circuit, supporting forward and reverse control of stepper motor; Pulse counter, records the number of motor motion pulses in real time; The calibration data storage unit stores the calibration parameters of the forward and reverse magnetic encoders.

10. The control system for positioning and position feedback of a laser engraving machine system according to claim 6, characterized in that: The laser emission control module includes: PWM signal generator, receiving control instructions from motion controller; Constant current drive circuit, converting PWM signal into laser drive current; The optical path focusing component focuses the laser beam onto the processing plane.