Machine tool simulation driving circuit and machine tool control system

By introducing machine tool simulation drive circuits into the machine tool control system, simulating servo drivers, servo motors and incremental position sensors, and generating specific pulse signals, the problem of low safety in reference point debugging in the machine tool control system is solved, and a safer reference point debugging process is achieved.

CN119644903APending Publication Date: 2025-03-18GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411576327.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the machine tool control system, the reference point debugging process of incremental position detection sensors has low safety problems, which is prone to machine tool speed.

Method used

A machine tool analog driving circuit is provided, including a data processing unit and a data storage unit. By simulating a servo driver, a servo motor and an incremental position sensor, a phase A, B and R phase pulse signals are generated so that the CNC system can confirm and debug the reference point according to these signals.

Benefits of technology

It effectively avoids dangerous situations such as machine tool speed during reference point debugging, and improves the safety of reference point debugging process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119644903A_ABST
    Figure CN119644903A_ABST
Patent Text Reader

Abstract

The invention discloses a machine tool simulation driving circuit and a machine tool control system, and belongs to the technical field of electronic equipment. The machine tool simulation driving circuit comprises a data processing unit and a data storage unit. The data storage unit is connected with the data processing unit and is used for storing initial position data of the machine tool simulation driving circuit; the data processing unit is further connected with the numerical control system and used for receiving a motor pulse control signal output by the numerical control system equipment, reading the pulse number of the motor pulse control signal in each clock period, generating and outputting an A-phase pulse signal and a B-phase pulse signal to the numerical control system according to the pulse number, and outputting the A-phase pulse signal and the B-phase pulse signal to the numerical control system according to the A-phase pulse signal and the B-phase pulse signal. And according to the number of pulses and the initial position data, R-phase pulse signals are output every target interval. According to the invention, the safety of the reference point debugging process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of electronic equipment, and specifically relates to a machine tool simulation drive circuit and a machine tool control system. Background Art

[0002] The machine tool control system is an important system used to control the operation of machine tools. It mainly includes control components such as CNC systems, servo drives, servo motors, and position detection sensors such as encoders or grating rulers.

[0003] In the machine tool control system, the CNC system is responsible for calculating the target position to be moved to, generating the motor pulse control signal for moving to the target position, and sending the motor pulse control instruction to the servo driver. The servo driver is used to receive the motor pulse control signal sent by the CNC system, convert it into a motor signal, and send it to the servo motor. The servo motor is the actuator of the machine tool movement, which is used to move according to the motor signal sent by the driver to drive the various parts of the machine tool (such as tools, workbenches, etc.) to move. The position detection sensor is used to detect the actual position of the motor in real time, and feed back the detected actual position data to the servo driver. The servo driver compares the actual position data with the motor pulse control signal sent by the CNC system, and adjusts the movement of the motor if there is a difference, so as to ensure that the machine tool can move accurately to the target position and realize precise control of the machine tool.

[0004] There are many types of position detection sensors in machine tool control systems. In particular, incremental position detection sensors are used to detect the displacement of the motor compared to a specific reference point. Therefore, before using the machine tool, it is necessary to determine the reference point of the incremental position detection sensor on the machine tool. However, the process of determining the reference point involves the position debugging of the machine tool, which is prone to machine tool runaway, resulting in low safety in the reference point debugging process. Summary of the invention

[0005] A machine tool simulation drive circuit and a machine tool control system provided in the embodiments of the present application can improve the safety of the reference point debugging process.

[0006] In a first aspect, a machine tool simulation drive circuit is provided, which is applied to a machine tool control system, wherein the machine tool control system also includes a numerical control system; the machine tool simulation drive circuit includes: a data processing unit and a data storage unit;

[0007] The data storage unit is connected to the data processing unit and is used to store the starting position data of the machine tool simulation drive circuit, wherein the starting position data is the motor position simulated by the machine tool simulation drive circuit before the numerical control system is started;

[0008] The data processing unit is also connected to the numerical control system, and is used to receive the motor pulse control signal output by the numerical control system equipment, read the number of pulses of the motor pulse control signal in each clock cycle, generate and output A-phase pulse signal and B-phase pulse signal to the numerical control system according to the number of pulses, and output R-phase pulse signal at each target interval according to the number of pulses and the starting position data. The A-phase pulse signal and the B-phase pulse signal are used to indicate the incremental data of the number of pulses in a single clock cycle, and the motor displacement direction indicated by the motor pulse control signal.

[0009] Optionally, the data processing unit includes: a first counter and a first pulse generator;

[0010] The first counter is connected to the numerical control system and the first pulse generator, and is used to count the number of pulses of the motor pulse control signal, and periodically output the number of pulses to the first pulse generator according to the clock cycle;

[0011] The first pulse generator is connected to the numerical control system, and is used to compare the number of pulses received in the current cycle with the number of pulses received in the previous cycle, obtain incremental data of the number of pulses in the current cycle, generate and output the A-phase pulse signal and the B-phase pulse signal to the numerical control system, the number of pulses of the A-phase pulse signal and the B-phase pulse signal is the incremental data, and the phase difference between the A-phase pulse signal and the B-phase pulse signal indicates the displacement direction of the motor.

[0012] Optionally, the data processing unit further includes: a second pulse generator;

[0013] The second pulse generator is respectively connected to the first pulse generator, the data storage unit and the numerical control system, and is used to calculate the current absolute position data of the motor according to the starting position data and the incremental number of the first pulse generator, and output the R-phase pulse signal to the numerical control system when the current absolute position data of the motor meets the integer multiple of the target spacing.

[0014] Optionally, the starting position data is the number of pulses of the motor pulse control signal when the numerical control system controls the motor to move to the target position through the motor pulse control signal; the data processing unit further includes: a second counter;

[0015] The second counter is connected to the first pulse generator and the second pulse generator respectively, and is used to count the target pulse number of the A-phase pulse signal / the B-phase pulse signal in a single clock cycle, and output the target pulse number to the second pulse generator;

[0016] The second pulse generator is used to calculate the current absolute position data of the motor based on the starting position data and the target number of pulses, calculate the difference between the current absolute position data of the motor and the current absolute position data of the motor corresponding to the previous R-phase pulse signal, and output an R-phase pulse signal when the difference is equal to the number of pulses corresponding to the target spacing.

[0017] Optionally, the machine tool simulation drive circuit further includes: a sensor selection unit;

[0018] The sensor selection unit is connected to the data storage unit and the data processing unit respectively, and is used to respond to the unequal spacing signal, read the two sub-spacings constituting the target spacing from the data storage unit, and output an unequal spacing instruction and two sub-spacings of a plurality of target spacings to the data processing unit, wherein the value difference of the two sub-spacings of each target spacing is different;

[0019] The data processing unit is also used to output the R-phase pulse signal of two pulses at the sub-spacing interval within each target spacing according to the pulse quantity and the starting position data when receiving the unequal spacing instruction.

[0020] Optionally, the machine tool simulation drive circuit further comprises: a reference point selection unit;

[0021] The reference point selection unit is connected to the numerical control system and is used to output a reference point determination instruction to the numerical control system in response to the equidistant signal, wherein the reference point determination instruction is used to instruct the numerical control system to determine the current position of the motor corresponding to the first received R-phase pulse signal as the reference point;

[0022] The sensor selection unit is further used to respond to the equal spacing signal, read the target spacing from the data storage unit, and output the equal spacing instruction and the target spacing to the data processing unit;

[0023] The data processing unit is also used to output an R-phase pulse signal at each target spacing according to the pulse quantity and the starting position data when receiving the equal spacing instruction.

[0024] Optionally, the data processing unit further includes a data selection module;

[0025] The data selection module is connected to the data storage unit, the first counter, the first pulse generator and the second pulse generator respectively, and is used to respond to the incremental sensor instruction, output the pulse quantity to the first pulse generator, and output the starting position data to the second pulse generator, and respond to the absolute sensor instruction, calculate the current absolute position data of the motor according to the starting position data and the incremental quantity of the first pulse generator, and directly output the current absolute position data of the motor.

[0026] Optionally, the data processing unit further includes: a motor delay module and a buffer module;

[0027] The motor delay module is connected to the data selection module and the buffer module respectively, and is used to delay the output data of the data selection module, obtain and output the output data of the data selection module after delay processing to the buffer module;

[0028] The buffer module is also connected to the first pulse generator and the second pulse generator, and is used to output the pulse quantity to the first pulse generator and output the starting position data to the second pulse generator.

[0029] Optionally, the data processing unit is further configured to output the number of pulses of the motor pulse control instruction as the starting position data to the data storage unit when receiving a stop analog signal from the numerical control system.

[0030] In a second aspect, a machine tool control system is provided. The machine tool control system comprises: a numerical control system and any one of the machine tool simulation drive circuits described in the first aspect.

[0031] According to a third aspect, an electronic device is provided, the electronic device comprising the machine tool simulation drive circuit as described in any one of the first aspects.

[0032] The machine tool simulation drive circuit and machine tool control system provided in the embodiment of the present application include: a data processing unit and a data storage unit. The motor pulse control signal output by the numerical control system equipment is received by the data processing unit to read the number of pulses of the motor pulse control signal in each clock cycle, and then generate and output the A phase pulse signal and the B phase pulse signal to the numerical control system according to the number of pulses, and output the R phase pulse signal for each target interval according to the number of pulses and the starting position data. Among them, the A phase pulse signal and the B phase pulse signal are used to indicate the incremental data of the number of pulses in a single clock cycle, and the motor displacement direction indicated by the motor pulse control signal, and the R phase pulse signal is a pulse signal output for each target interval. In this technical solution, the servo driver, the servo motor and the incremental position sensor are simulated by the machine tool simulation drive circuit, so that the numerical control system can confirm and debug the reference point according to the signal output by the incremental position sensor simulated by the machine tool simulation drive circuit. Compared with the confirmation and debugging of the reference point on the machine tool in the related art, the dangerous situations such as the machine tool flying during the reference point debugging process are effectively avoided, and the safety of the reference point debugging process is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is one of the schematic diagrams of the machine tool simulation drive circuit provided by the related technology;

[0034] Figure 2 It is one of the schematic diagrams of reference points provided in the embodiments of the present application;

[0035] Figure 3 It is one of the schematic diagrams of the machine tool simulation drive circuit provided in the embodiment of the present application;

[0036] Figure 4 This is one of the motor-related data calculation schematic diagrams provided in the embodiments of the present application;

[0037] Figure 5 This is the second schematic diagram of motor-related data calculation provided in the embodiment of the present application;

[0038] Figure 6 This is the second schematic diagram of the machine tool simulation drive circuit provided in the embodiment of the present application. DETAILED DESCRIPTION

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

[0040] The machine tool control system is an important system used to control the operation of the machine tool. It mainly includes control components such as the CNC system, servo drive, servo motor, and position detection sensors such as encoders or grating rulers. Specifically, Figure 1 As shown, the machine tool control system mainly includes a numerical control system 11, a servo drive 12, a servo motor 13, a position detection sensor 14, and a reference point and limit switch 15.

[0041] In the machine tool control system, the numerical control system 11 is responsible for calculating the target position to be moved to, generating a motor pulse control signal (i.e., a pulse command) for moving to the target position, and sending the motor pulse control instruction to the servo driver 12. The servo driver 12 is used to receive the motor pulse control signal sent by the numerical control system, convert it into a motor signal, and send it to the servo motor 13. The servo motor 13 is the execution component of the machine tool movement, which is used to move according to the motor signal sent by the servo driver 12 to drive the various components of the machine tool (such as tools, workbenches, etc.) to move. The position detection sensor 14 is used to detect the actual position of the servo motor 13 in real time, and feed back the detected actual position data to the servo driver 12. The servo driver 12 compares the actual position data with the motor pulse control signal sent by the numerical control system 11, and adjusts the movement of the motor in the case of a difference to ensure that the machine tool can accurately move to the target position and achieve precise control of the machine tool.

[0042] The position detection sensors of the machine tool control system are of various types, for example, absolute position sensors and incremental position sensors.

[0043] The working principle of an absolute position sensor is to determine the position of an object by reading the absolute code information on the code disk (or grating ruler). Each position (each stripe) on the code disk (or grating ruler) corresponds to a unique code, i.e., position. Therefore, an absolute position sensor can directly output the absolute position of an object without determining a reference point.

[0044] The working principle of the incremental position sensor is to determine the displacement of the object compared to a specific reference point by detecting the pulse signal generated when the object moves. Figure 2 As shown in the figure, the incremental position sensor can detect the displacement X0 and Y0 of the object. However, the position of the reference point 0 must be determined in order to determine the specific position of the tool tip based on the displacement X0 and Y0.

[0045] Among them, the incremental position sensor usually has three channels of output signals, including A-phase pulse signal, B-phase pulse signal and R-phase pulse signal. The A-phase pulse signal and the B-phase pulse signal are used to indicate the displacement and movement direction of the object. The R-phase pulse signal is also called the Z-phase pulse signal, which is used for a specific reference point position.

[0046] In addition, for the incremental position sensor of the grating scale type, that is, the incremental grating scale, it includes a reference grating and a position grating. The A-phase pulse signal and the B-phase pulse signal are usually generated by the position grating. The R-phase pulse signal is usually generated by the reference grating. The incremental grating scale is further divided into an equidistant code grating scale and a non-equidistant code grating scale. When determining the reference point, the equidistant code grating scale needs to use a physical block to achieve it. The non-equidistant code grating scale is also called a spacing code grating scale, which needs to use the distance indicated by the two R-phase pulse signals output by the reference grating after the object moves a certain distance to determine it.

[0047] Based on this, for incremental position detection sensors, it is necessary to determine the reference point of the incremental position detection sensor on the machine tool before using it. However, the process of determining the reference point involves the position debugging of the machine tool, which is prone to machine tool runaway, resulting in low safety of the reference point debugging process.

[0048] Please refer to Figure 3 , which shows a schematic diagram of a machine tool control system provided by an embodiment of the present application. Figure 3 As shown, the machine tool control system includes a numerical control system 11 and a machine tool simulation drive circuit 16 provided in an embodiment of the present application. The machine tool simulation drive circuit 16 includes: a data processing unit 161 and a data storage unit 162.

[0049] The data storage unit 161 is connected to the data processing unit 162. The data storage unit 161 is used to store the starting position data of the machine tool simulation drive circuit 16. The starting position data is the motor position simulated by the machine tool simulation drive circuit 16 before the numerical control system 11 is started. Optionally, the starting position data is the position of the motor simulated by the machine tool simulation drive circuit 16 before the numerical control system 11 is started compared to the reference point. For example, the starting position data can be the motor simulated by the numerical control system 11 randomly controlling the machine tool simulation drive circuit 16 to move a certain position. Alternatively, the starting position data can be the position of the motor simulated by the machine tool simulation drive circuit 16 after the numerical control system 11 is powered on last time. Another option is that the starting position data is the distance between the motor simulated by the machine tool simulation drive circuit 16 before the numerical control system 11 is started and the previous R pulse signal. For example, the starting position data can be the position of the motor simulated by the machine tool simulation drive circuit 16 after the numerical control system 11 is powered on last time, compared to the previous R pulse signal.

[0050] The data processing unit 16 is also connected to the numerical control system 11. The data processing unit 16 is used to receive the motor pulse control signal output by the numerical control system equipment, read the number of pulses of the motor pulse control signal in each clock cycle, generate and output A-phase pulse signal and B-phase pulse signal to the numerical control system according to the number of pulses, and output R-phase pulse signal at each target interval according to the number of pulses and the starting position data. Optionally, the data processing unit 16 can be a field programmable gate array (FPGA) circuit or integrated circuit. Among them, the motor pulse control signal is also called a pulse command. The A-phase pulse signal, the B-phase pulse signal and the R-phase pulse signal are collectively referred to as position pulses.

[0051] The number of pulses of the motor pulse control signal is used to indicate the displacement of the motor, and the motor pulse control signal can be used to indicate the direction of movement of the motor. The data processing unit 16 can be used to count the number of pulses of the motor pulse control signal and read the number of pulses of the motor pulse control signal according to the clock cycle.

[0052] Optionally, the number of pulses of the motor pulse control signal in the first direction is read in each clock cycle. The data processing unit 16 can be used to read the number of pulses of the motor pulse control signal in the first direction in each clock cycle. It is not difficult to understand that when the motor pulse control signal is used to control the motor to move in the first direction, each time a pulse of the motor pulse control signal is read, the number of pulses counted is increased by 1. Conversely, when the motor pulse control signal is used to control the motor to move in the opposite direction of the first direction, each time a pulse of the motor pulse control signal is read, the number of pulses counted is reduced by 1.

[0053] For example, the first direction may be the forward direction of the motor. When the first direction is the clockwise direction, when the motor pulse control signal is used to control the motor to move clockwise, each time a pulse of the motor pulse control signal is read, the counted number of pulses is increased by 1. When the motor pulse control signal is used to control the motor to move counterclockwise, each time a pulse of the motor pulse control signal is read, the counted number of pulses is decreased by 1.

[0054] In the embodiment of the present application, after the data processing unit 16 reads the number of pulses of the motor pulse control signal in each clock cycle, it generates an A-phase pulse signal and a B-phase pulse signal in the clock cycle according to the number of pulses, and outputs the A-phase pulse signal and the B-phase pulse signal to the numerical control system. The A-phase pulse signal and the B-phase pulse signal are used to indicate the incremental data of the number of pulses in a single clock cycle, and the motor displacement direction indicated by the motor pulse control signal.

[0055] Optionally, the data processing unit 16 can compare the number of pulses of the motor pulse control signal in the current clock cycle with the number of pulses of the motor pulse control signal in the previous clock cycle to determine the incremental data of the number of pulses in the current clock cycle. It should be noted that the incremental data may be a positive number or a negative number. And the positive and negative of the incremental data can indicate the direction of movement of the motor controlled by the motor pulse control signal. For example, when the incremental data is a positive number, it indicates that the motor pulse control signal controls the motor to move in a first direction in the two clock cycles before and after. In this case, the phase of the A-phase pulse signal output by the data processing unit 16 is ahead of the phase of the B-phase pulse signal to indicate that the motor pulse control signal controls the motor to move continuously in the first direction in two clock cycles. In the case where the incremental data is a negative number, it indicates that the motor pulse control signal controls the motor to move in the opposite direction in the two clock cycles before and after. In this case, the phase of the A-phase pulse signal output by the data processing unit 16 lags behind the phase of the B-phase pulse signal to indicate that the motor pulse control signal controls the motor to move continuously in the opposite direction in two clock cycles.

[0056] In the embodiment of the present application, the data processing unit 16 is further configured to output an R-phase pulse signal at each target spacing according to the starting position data and the number of pulses in the clock cycle after reading the number of pulses of the motor pulse control signal in each clock cycle.

[0057] Specifically, the data processing unit 16 is further used to calculate the incremental data of the number of pulses in the current clock cycle according to the number of pulses in the current clock cycle and the number of pulses in the previous clock cycle after reading the number of pulses of the motor pulse control signal in each clock cycle. According to the starting position data and the incremental number, the R phase pulse signal is outputted at each target spacing.

[0058] It should be noted that the incremental data of the number of pulses of the motor pulse control signal in the current clock cycle represents the displacement of the motor movement controlled by the numerical control system in the current clock cycle. In the first clock cycle, the incremental data of the number of pulses in the current clock cycle is the number of pulses in the current clock cycle. Accordingly, based on the starting position data and the number of pulses in the clock cycle, the actual position of the motor under the control of the motor pulse control signal in the current clock cycle can be determined. The data processing unit 16 can output the R-phase pulse signal when it is determined that the actual position is greater than or equal to the target spacing.

[0059] In a non-first clock cycle, the actual position of the motor under the control of the motor pulse control signal of the current clock cycle can be determined based on the actual position of the motor corresponding to the previous R-phase pulse signal and the number of pulses in the clock cycle. Further, the data processing unit 16 can output an R-phase pulse signal when it is determined that the actual position is greater than or equal to the target spacing compared to the actual position of the motor corresponding to the previous R-phase pulse signal.

[0060] Obviously, in the embodiment of the present application, the data processing unit 16 simulates an incremental position sensor. The numerical control system 11 can determine the reference point based on the reference point determination method of the incremental position sensor according to the received A-phase pulse signal, B-phase pulse signal and R-phase pulse signal.

[0061] For ease of understanding, the data processing unit 16 simulates an incremental grating ruler as an example. Figure 4 As shown, according to the current reference point data d and the number of pulses of the A-phase pulse signal / B-phase pulse signal in the clock cycle (i.e., the pulse increment in a single clock cycle, also known as position offset data) x, the actual position d+x of the motor under the control of the motor pulse control signal in the current clock cycle can be determined. Among them, in the first clock cycle, the current reference point data d is the starting position data; in the non-first clock cycle, the current reference point data d is the actual position of the motor corresponding to the previous R-phase pulse signal, that is, the distance from the actual position corresponding to the previous R pulse signal to the reference point O.

[0062] In some embodiments of the present application, the data processing unit 16 can simulate an unequal distance code grating ruler. Each target spacing is composed of two sub-spacings, and the difference between the two sub-spacings of each target spacing is different. For example, Figure 5 As shown, the target interval is 20ms. The first target interval is composed of two sub-intervals with a value of 10ms. The second target interval is composed of a sub-interval with a value of 10.02ms and a sub-interval with a value of 9.98ms, and so on.

[0063] When the machine tool control system is powered on, the initial position of the tool tip is the position shown in P0, the number of pulses of the A-phase pulse signal and the B-phase pulse signal output by the data processing unit 16 is 0, and the R-phase pulse signal is not output. Figure 5 If the tool tip P1 is at the position shown, the number of pulses of the A-phase pulse signal and the B-phase pulse signal output by the data processing unit 16 is x1, and the R-phase pulse signal is output. Figure 5 At the position shown by the tool tip P2, the number of pulses of the A-phase pulse signal and the B-phase pulse signal output by the data processing unit 16 is x2-x1, and an R-phase pulse signal is output.

[0064] The numerical control system 11 can determine the number of pulses of the A-phase pulse signal / B-phase pulse signal between two adjacent R pulse signals as x2-x1. Based on this, the numerical control system 11 can determine the position corresponding to any R pulse signal compared to the actual position of the reference point O, and then reversely determine the position of the reference point O based on the actual position. For example, if the value of x2-x1 is the number of pulses corresponding to 10.04ms, the numerical control system 11 can determine that the actual position of the first R-phase pulse signal compared to the reference point O is 20ms, and then determine the position of the reference point O. The numerical control system 11 can also determine that the actual position of the second R-phase pulse signal compared to the reference point O is 30.04ms, and then determine the position of the reference point O.

[0065] In the embodiment of the present application, the machine tool simulation drive circuit includes: a data processing unit and a data storage unit. The motor pulse control signal output by the numerical control system equipment is received by the data processing unit to read the number of pulses of the motor pulse control signal in each clock cycle, and then generate and output the A phase pulse signal and the B phase pulse signal to the numerical control system according to the number of pulses, and output the R phase pulse signal for each target interval according to the number of pulses and the starting position data. Among them, the A phase pulse signal and the B phase pulse signal are used to indicate the incremental data of the number of pulses in a single clock cycle, and the motor displacement direction indicated by the motor pulse control signal, and the R phase pulse signal is a pulse signal output for each target interval. In this technical solution, the servo drive, the servo motor and the incremental position sensor are simulated by the machine tool simulation drive circuit, so that the numerical control system can confirm and debug the reference point according to the signal output by the incremental position sensor simulated by the machine tool simulation drive circuit. Compared with the confirmation and debugging of the reference point on the machine tool in the related art, it effectively avoids dangerous situations such as machine tool flying during the reference point debugging process, and improves the safety of the reference point debugging process.

[0066] In some embodiments of the present application, Figure 6 As shown, the data processing unit 161 includes: a first counter 1611 and a first pulse generator 1612. The first counter 1611 is connected to the numerical control system 11 and the first pulse generator 1612. The first counter 1611 is used to count the number of pulses of the motor pulse control signal and periodically output the number of pulses to the first pulse generator 1612 according to the clock cycle.

[0067] The first pulse generator 1612 is connected to the numerical control system 11. The first pulse generator 1612 is used to compare the number of pulses received in the current cycle with the number of pulses received in the previous cycle, obtain the incremental data of the number of pulses in the current cycle, generate and output the A-phase pulse signal and the B-phase pulse signal to the numerical control system. Among them, the number of pulses of the A-phase pulse signal and the B-phase pulse signal is incremental data, and the phase difference between the A-phase pulse signal and the B-phase pulse signal indicates the displacement direction of the motor.

[0068] Optionally, the first counter 1611 can be used to count the number of pulses of the motor pulse control signal in the first direction, and periodically output the number of pulses to the first pulse generator 1612 according to the clock cycle. It is not difficult to understand that when the motor pulse control signal is used to control the motor to move in the first direction, the first counter 1611 counts the number of pulses plus 1 each time it reads a pulse of the motor pulse control signal. Conversely, when the motor pulse control signal is used to control the motor to move in the opposite direction of the first direction, the first counter 1611 counts the number of pulses minus 1 each time it reads a pulse of the motor pulse control signal.

[0069] For example, the first direction may be the forward direction of the motor. When the first direction is the clockwise direction, the first counter 1611 counts the number of pulses plus 1 each time it reads a pulse of the motor pulse control signal that controls the motor to move clockwise. The first counter 1611 counts the number of pulses minus 1 each time it reads a pulse of the motor pulse control signal that controls the motor to move counterclockwise.

[0070] Further optionally, the first pulse generator 1612 is used to compare the number of pulses received in the current cycle with the number of pulses received in the previous cycle, obtain the incremental data of the number of pulses in the current cycle, generate and output the A-phase pulse signal and the B-phase pulse signal to the numerical control system. The number of pulses of the A-phase pulse signal and the B-phase pulse signal is the incremental data, and the phase difference between the A-phase pulse signal and the B-phase pulse signal indicates the displacement direction of the motor.

[0071] It should be noted that, as mentioned above, the incremental data may be a positive number or a negative number. And the positive and negative of the incremental data can indicate the direction of movement of the motor controlled by the motor pulse control signal. For example, when the incremental data is a positive number, it indicates that the motor pulse control signal controls the motor to move in the first direction in the two clock cycles before and after. In this case, the phase of the A-phase pulse signal output by the first pulse generator 1612 is ahead of the phase of the B-phase pulse signal to indicate that the motor pulse control signal controls the motor to move continuously in the first direction in two clock cycles. In the case of a negative number in the incremental data, it indicates that the motor pulse control signal controls the motor to move in the opposite direction in the two clock cycles before and after. In this case, the phase of the A-phase pulse signal output by the first pulse generator 1612 lags behind the phase of the B-phase pulse signal to indicate that the motor pulse control signal controls the motor to move continuously in the opposite direction in two clock cycles.

[0072] In some embodiments of the present application, the data processing unit 161 may further include: a second pulse generator 1613. The second pulse generator 1613 is connected to the first pulse generator 1612, the data storage unit 161 and the numerical control system 11 respectively. The second pulse generator 1613 is used to calculate the current absolute position data of the motor according to the starting position data and the number of increments of the first pulse generator 1612. When the current absolute position data of the motor meets the integer multiple of the target spacing, an R-phase pulse signal is output to the numerical control system.

[0073] Optionally, the incremental data of the first pulse generator 1612 in the current clock cycle represents the displacement of the motor movement controlled by the numerical control system in the current clock cycle. In the first clock cycle, the second pulse generator 1613 can be used to determine the current absolute position data (i.e., actual position) of the motor under the control of the motor pulse control signal of the current clock cycle according to the starting position data and the incremental data of the first pulse generator 1612 in the clock cycle. The second pulse generator 1613 can be used to output an R-phase pulse signal when it is determined that the actual position is greater than or equal to the target spacing.

[0074] In a non-first clock cycle, the second pulse generator 1613 can be used to determine the current absolute position data (i.e., actual position) of the motor under the control of the motor pulse control signal of the current clock cycle according to the current absolute position data of the motor corresponding to the previous R-phase pulse signal and the incremental data of the first pulse generator 1612 in the clock cycle. Furthermore, the second pulse generator 1613 can be used to output an R-phase pulse signal when it is determined that the current absolute position data of the motor is greater than or equal to the target spacing compared to the current absolute position data of the motor corresponding to the previous R-phase pulse signal.

[0075] In an optional case, the starting position data can be the number of pulses of the motor pulse control signal when the numerical control system controls the motor to move to the target position through the motor pulse control signal. For example, the starting position data can be the position of the motor movement simulated by the machine tool simulation drive circuit 16 after the numerical control system 11 is powered on last time. Based on this, the data processing unit 16 also includes: a second counter 1614.

[0076] Among them, the second counter 1614 is connected to the first pulse generator 1612 and the second pulse generator 1613 respectively. The second counter 1614 is used to count the target pulse number of the A-phase pulse signal / B-phase pulse signal in a single clock cycle, and output the target pulse number to the second pulse generator 1613. That is, the second counter 1614 is used to count the pulse number of the A-phase pulse signal or the B-phase pulse signal in a single clock cycle to obtain the target pulse number. The target pulse data represents the displacement of the motor movement controlled by the numerical control system in the current clock cycle.

[0077] The second pulse generator 1613 is used to calculate the current absolute position data of the motor based on the starting position data and the target number of pulses, calculate the difference between the current absolute position data of the motor and the current absolute position data of the motor corresponding to the previous R-phase pulse signal, and output an R-phase pulse signal when the difference is equal to the number of pulses corresponding to the target spacing.

[0078] Optionally, the second pulse generator 1613 is used to calculate the current absolute position data of the motor according to the starting position data and the target pulse number. Further, the difference between the current absolute position data of the motor and the current absolute position data of the motor corresponding to the previous R-phase pulse signal is calculated. The difference is compared with the number of pulses corresponding to the target spacing.

[0079] When the difference is equal to the number of pulses corresponding to the target spacing, a pulse of an R-phase pulse signal is generated and an R-phase pulse signal is output. When the difference is greater than the number of pulses corresponding to the target spacing, a target number of R-phase pulse signals are generated and an R-phase pulse signal is output. The target number is the number of pulses corresponding to the difference and the target spacing. When the difference is less than the number of pulses corresponding to the target spacing, a pulse of an R-phase pulse signal is generated. Among them, the number of pulses corresponding to the target spacing may refer to the number of pulses of the motor pulse control signal when the numerical control system 11 controls the motor to move the target spacing.

[0080] Further optionally, in the first clock cycle, the second pulse generator 1613 can be used to calculate the sum of the starting position data and the target pulse number to obtain the current absolute position data of the motor. Then, when the current absolute position data of the motor is equal to the pulse number corresponding to the target spacing, an R-phase pulse signal is output.

[0081] In the non-first clock cycle, the second pulse generator 1613 can be used to calculate the sum of the current absolute position data of the motor corresponding to the previous R-phase pulse signal and the target pulse number to obtain the current absolute position data of the motor. Then, the difference between the current absolute position data of the motor and the current absolute position data of the motor corresponding to the previous R-phase pulse signal is calculated, and when the difference is equal to the number of pulses corresponding to the target spacing, an R-phase pulse signal is output.

[0082] In some embodiments of the present application, the machine tool simulation drive circuit 16 further includes: a sensor selection unit 164. The sensor selection unit 164 is respectively connected to the data storage unit 162 and the data processing unit 161. The sensor selection unit 164 is used to respond to the unequal spacing signal, read the two sub-spacings constituting the target spacing from the data storage unit 162, and output the unequal spacing instruction and the two sub-spacings of the plurality of target spacings to the data processing unit 161, and the value difference of the two sub-spacings of each target spacing is different.

[0083] The data processing unit 161 is also used to output an R-phase pulse signal of two pulses at a sub-spacing interval within each target spacing according to the number of pulses and the starting position data when receiving an unequal spacing instruction.

[0084] Optionally, the sensor selection unit 164 is used to select the type of position sensor simulated by the machine tool simulation drive circuit 16. Optionally, the sensor selection unit 164 is used to select the type of position sensor that can be simulated by the machine tool simulation drive circuit 16, including: an absolute position sensor, an incremental position sensor, and an unequal distance code grating ruler, an equal distance code grating ruler, etc. By way of example, the sensor selection unit 164 can be a dip switch. By way of example, if the user selects an unequal distance code grating ruler through the sensor selection unit 164, the sensor selection unit 164 is used to generate and respond to an unequal spacing signal according to the user's selection, read two sub-spacings constituting the target spacing from the data storage unit 162, and output an unequal spacing instruction and two sub-spacings of multiple target spacings to the data processing unit 161.

[0085] Correspondingly, optionally, the data processing unit 161 is also used to output an R-phase pulse signal of two pulses at a sub-spacing interval within each target spacing according to the number of pulses and the starting position data when an unequal spacing instruction is received.

[0086] Specifically, optionally, the data processing unit 161 is also used to, when receiving an unequal spacing instruction, in the first clock cycle, the incremental data of the number of pulses in the current clock cycle, that is, the number of pulses in the current clock cycle. Accordingly, based on the starting position data and the number of pulses in the clock cycle, the actual position of the motor under the control of the motor pulse control signal of the current clock cycle can be determined. The data processing unit 16 can output an R-phase pulse signal of 2×(i-1)+j pulses when it is determined that the actual position is greater than or equal to the j-th sub-spacing of the i-th target spacing.

[0087] In a non-first clock cycle, the actual position of the motor under the control of the motor pulse control signal of the current clock cycle can be determined based on the actual position of the motor corresponding to the previous R-phase pulse signal and the number of pulses in the clock cycle. Further, the data processing unit 16 can output an R-phase pulse signal of one pulse every time a sub-interval is reached when the actual position is determined to be compared with the actual position of the motor corresponding to the previous R-phase pulse signal.

[0088] In an optional case, the data processing unit 161 is also used to calculate the sum of the starting position data and the target pulse number in the first clock cycle through the second pulse generator 1613 when receiving the unequal spacing instruction, and calculate the current absolute position data of the motor. Further, when the current absolute position data of the motor is greater than or equal to the jth sub-spacing of the i-th target spacing, an R-phase pulse signal of 2×(i-1)+j pulses is output.

[0089] The second pulse generator 1613 calculates the sum of the current absolute position data of the motor corresponding to the previous R-phase pulse signal and the target pulse number in a non-first clock cycle to obtain the current absolute position data of the motor. Further, the difference between the current absolute position data of the motor and the current absolute position data of the motor corresponding to the previous R-phase pulse signal is calculated, and an R-phase pulse signal of one pulse is output every time a sub-interval is reached.

[0090] For example, Figure 5 As shown, the target interval is 20ms. The first target interval is composed of two sub-intervals with a value of 10ms. The second target interval is composed of a sub-interval with a value of 10.02ms and a sub-interval with a value of 9.98ms, and so on.

[0091] The second pulse generator 1613 can be used to generate an R-phase pulse signal with one pulse when the current absolute position data of the motor reaches the number of pulses corresponding to 10ms; generate another R-phase pulse signal when the current absolute position data of the motor reaches the number of pulses corresponding to 10ms; generate another R-phase pulse signal when the current absolute position data of the motor reaches the number of pulses corresponding to 10.02ms; generate another R-phase pulse signal when the current absolute position data of the motor reaches the number of pulses corresponding to 9.98ms, and so on.

[0092] In some embodiments of the present application, the machine tool simulation drive circuit 16 further includes: a reference point selection unit. The reference point selection unit is connected to the numerical control system 11. The reference point selection unit is used to output a reference point determination instruction to the numerical control system 11 in response to the equidistant signal. The reference point determination instruction is used to instruct the numerical control system to determine the current position of the motor corresponding to the first received R-phase pulse signal as the reference point.

[0093] The sensor selection unit 164 is also used to respond to the equal spacing signal, read the target spacing from the data storage unit 162, and output the equal spacing instruction and the target spacing to the data processing unit 161. The data processing unit 161 is also used to output the R phase pulse signal at each target spacing according to the pulse number and the starting position data when receiving the equal spacing instruction. The equal spacing signal indicates that the type of the position sensor simulated by the machine tool simulation drive circuit 16 is an absolute position sensor.

[0094] By way of example, the sensor selection unit 164 may be a dip switch. The reference point selection unit may be a push button switch. By way of example, if the user selects an equidistant code grating ruler through the sensor selection unit 164, and triggers the input of a reference point determination instruction to the reference point selection unit, the reference point selection unit is used to respond to the equidistant signal and output the reference point determination instruction to the numerical control system 11. Furthermore, the sensor selection unit 164 is used to generate and respond to the equidistant signal according to the user's selection, read the target spacing from the data storage unit 162, and output the equidistant instruction and the target spacing to the data processing unit 161.

[0095] In an optional case, the data processing unit 161 is also used to determine the current absolute position data of the motor under the control of the motor pulse control signal of the current clock cycle through the second pulse generator 1613 in the first clock cycle when receiving the equal spacing instruction, according to the starting position data and the incremental data of the first pulse generator 1612 in the clock cycle. Output the R phase pulse signal when it is determined that the actual position is greater than or equal to the target spacing.

[0096] The second pulse generator 1613 determines the current absolute position data of the motor under the control of the motor pulse control signal of the current clock cycle according to the current absolute position data of the motor corresponding to the previous R-phase pulse signal and the incremental data of the first pulse generator 1612 in the clock cycle in the non-first clock cycle. Then, the R-phase pulse signal is output when it is determined that the current absolute position data of the motor is greater than or equal to the target spacing compared to the current absolute position data of the motor corresponding to the previous R-phase pulse signal.

[0097] In some embodiments of the present application, the data processing unit 161 further includes a data selection module 1618. The data selection module 1618 is respectively connected to the data storage unit 162, the first counter 1611, the first pulse generator 1612, and the second pulse generator 1613. The data selection module 1618 is used to output the number of pulses to the first pulse generator 1612 and output the starting position data to the second pulse generator 1613 in response to the incremental sensor instruction. The incremental sensor instruction is used to instruct the machine tool simulation drive circuit 16 to simulate the incremental position sensor.

[0098] Correspondingly, optionally, the first pulse generator 1612 is used to compare the number of pulses received in the current cycle with the number of pulses received in the previous cycle when receiving the number of pulses counted by the first counter, obtain the incremental data of the number of pulses in the current cycle, generate and output A-phase pulse signal and B-phase pulse signal to the numerical control system. The second pulse generator 1613 is used to calculate the current absolute position data of the motor according to the starting position data and the incremental number of the first pulse generator 1612 when receiving the starting position data. When the current absolute position data of the motor meets the integer multiple of the target spacing, the R-phase pulse signal is output to the numerical control system. Among them, the implementation method of the first pulse generator 1612 outputting the A-phase pulse signal and the B-phase pulse signal refers to the aforementioned related description. The implementation method of the second pulse generator 1613 outputting the R-phase pulse signal also refers to the aforementioned related description, and the embodiments of the present application will not be repeated.

[0099] The data selection module 1618 is also used to respond to the absolute sensor instruction, calculate the current absolute position data of the motor according to the starting position data and the number of increments of the first pulse generator, and directly output the current absolute position data of the motor. The absolute sensor instruction is used to instruct the machine tool simulation drive circuit 16 to simulate the absolute position sensor. Optionally, the data selection module 1618 can directly calculate the sum of the starting position data and the number of increments of the first pulse generator to obtain the current absolute position data of the motor, and directly output the current absolute position data of the motor. For example, the data selection module 1618 is also used to respond to the absolute sensor instruction, calculate the current absolute position data of the motor according to the starting position data and the number of increments of the first pulse generator, and directly output the current absolute position data of the motor to the numerical control system 11.

[0100] In an alternative case, if Figure 6 As shown, the sensor selection unit 164 is connected to the data selection module 1618. The sensor selection unit 164 is also used to respond to the incremental sensor signal and output an incremental instruction to the data selection unit 1618. The sensor selection unit 164 is also used to respond to the absolute sensor signal and output an absolute instruction to the data selection unit 1618.

[0101] For example, the sensor selection unit 164 can be a dip switch. For example, if the user selects an incremental position sensor through the sensor selection unit 164, the sensor selection unit 164 is used to generate and respond to the incremental sensor signal according to the user's selection, and output an incremental instruction to the data selection unit 1618, so that the data selection module 1618 responds to the absolute sensor instruction, calculates the current absolute position data of the motor according to the starting position data and the increment number of the first pulse generator, and directly outputs the current absolute position data of the motor.

[0102] In some embodiments of the present application, the data processing unit 161 may further include: a motor delay module (i.e., a delay module) 1619 and a buffer module 16110. The motor delay module 1619 is connected to the data selection module 1618 and the buffer module 1610 respectively. The motor delay module 1619 is used to delay the output data of the data selection module 1618, obtain and output the output data of the data selection module 1018 after delay processing to the buffer module 16110. Among them, the motor delay module 1619 is used to simulate the delay effect of the servo drive and servo motor, which can be a fixed period delay, or can be designed as a delay with a smooth effect, etc. The embodiment of the present application does not limit it and can be set according to actual conditions.

[0103] The buffer module 16110 is also connected to the first pulse generator 1612 and the second pulse generator 1613. The buffer module 16110 is used to output the number of pulses to the first pulse generator 1612 and output the starting position data to the second pulse generator 1613. Optionally, the buffer module 16110 can be a buffer such as a first-in first-out queue (First Input First Output, FIFO). For example, the first pulse generator 1612 is used to periodically take out the number of pulses counted by the first counter in the current cycle from the buffer module 16110, and then compare it with the number of pulses received in the previous cycle to obtain the incremental data of the number of pulses in the current cycle, and generate and output the A-phase pulse signal and the B-phase pulse signal whose pulse number is the incremental data in the current cycle.

[0104] In some embodiments of the present application, the data processing unit 161 may further include: a data reading and writing module 16111. The data reading and writing module 16111 is respectively connected to the data storage unit 162 and the data selection module 1618. The data reading and writing module 16111 is used to read data from the data storage unit 162. Optionally, the data reading and writing module 16111 is used to read data such as target spacing, sub-spacing, and starting position data from the data storage unit 162. The data reading and writing module 16111 is also used to write the starting position data and the sum of the number of pulses of the motor pulse control signal counted by the first counter to the data storage unit 162 when the machine tool simulation drive circuit 16 is powered off, that is, write the position where the numerical control system last controlled the motor movement before the machine tool simulation drive circuit 16 was powered off.

[0105] For example, the data storage unit 162 may be a storage chip, which may communicate with the data storage unit 162 using an integrated circuit bus (Inter-Integrated Circuit, I2C). In this way, the data storage unit is also called an I2C read-write module. For example, the data storage unit 162 is a flash chip of model 24C02, which is used to store data such as target spacing, sub-spacing, and starting position data.

[0106] In some embodiments of the present application, the machine tool simulation drive circuit 16 may further include: a differential signal receiver 166 and a differential signal transmitter 165. The differential signal receiver 166 is connected to the numerical control system 11 and the first counter 1611, respectively. The differential signal receiver 166 is used to receive the motor pulse control signal output by the numerical control system 11, and output the motor pulse control signal to the first counter 1611. The differential signal transmitter 165 is connected to the first pulse generator 1612, the second pulse generator 1613 and the numerical control system 11, respectively. The differential signal transmitter 165 is used to receive the A-phase pulse signal and the B-phase pulse signal output by the first pulse generator 1612, and receive the R-phase pulse signal output by the second pulse generator 1613, and output the A-phase pulse signal, the B-phase pulse signal and the R-phase pulse signal to the numerical control system 11. For example, the differential signal receiver 166 and the differential signal transmitter 165 may be a differential signal receiver of model AM26C32 and a differential signal transmitter of model AM26C31, respectively, which are used to improve the quality of the transmission signal and increase the length of the transmission signal.

[0107] In some embodiments of the present application, the data processing unit 161 is further used to output the number of pulses of the motor pulse control instruction as the starting position data to the data storage unit 162 when receiving a stop analog signal from the numerical control system 11 .

[0108] Optionally, the machine tool simulation drive circuit 16 further includes: a power-off trigger unit 163. The power-off trigger unit 163 is connected to the data processing unit 161. The power-off trigger unit 163 is used to output a power-off storage signal to the data processing unit 161 when it is detected that the data processing unit 161 is powered off, so that the data processing unit 161 uses the number of pulses of the motor pulse control instruction as the starting position data and outputs it to the data storage unit 162. By way of example, the power-off trigger unit 163 is used to detect that the data processing unit 161 is powered off when a stop simulation signal from the numerical control system 11 is received, and output a power-off storage signal to the data processing unit 161, so that the data processing unit 161 uses the number of pulses of the motor pulse control instruction as the starting position data and outputs it to the data storage unit 162.

[0109] Further optionally, the data processing unit 161 further includes a clock module 1617. The clock module 1617 is used to connect with each module in the data processing unit 161, and the clock module 1617 is used to output multiple global clock signals and provide clock signals to each module in the data processing unit 161 respectively.

[0110] The machine tool simulation drive circuit 16 also includes a limit switch unit. The limit switch unit is used to simulate Figure 1The limit switch shown is used to test the limit control of the motor by the numerical control system 11. For example, the limit switch unit can respond to the limit command triggered by the user and send a limit command to the data system 11, so that the numerical control system 11 stops outputting the motor pulse signal when the motor limit position indicated by the limit command is reached, so as to control the motor to stop rotating.

[0111] In the embodiment of the present application, the machine tool simulation drive circuit includes: a data processing unit and a data storage unit. The motor pulse control signal output by the numerical control system equipment is received by the data processing unit to read the number of pulses of the motor pulse control signal in each clock cycle, and then generate and output the A phase pulse signal and the B phase pulse signal to the numerical control system according to the number of pulses, and output the R phase pulse signal for each target interval according to the number of pulses and the starting position data. Among them, the A phase pulse signal and the B phase pulse signal are used to indicate the incremental data of the number of pulses in a single clock cycle, and the motor displacement direction indicated by the motor pulse control signal, and the R phase pulse signal is a pulse signal output for each target interval. In this technical solution, the servo drive, the servo motor and the incremental position sensor are simulated by the machine tool simulation drive circuit, so that the numerical control system can confirm and debug the reference point according to the signal output by the incremental position sensor simulated by the machine tool simulation drive circuit. Compared with the confirmation and debugging of the reference point on the machine tool in the related art, it effectively avoids dangerous situations such as machine tool flying during the reference point debugging process, and improves the safety of the reference point debugging process.

[0112] The embodiment of the present application also provides a machine tool control system. The machine tool control system includes: a numerical control system and a machine tool simulation drive circuit provided by the embodiment of the present application. In this way, in the machine tool control system provided by the embodiment of the present application, the machine tool simulation drive circuit can receive the motor pulse control signal output by the numerical control system device through the data processing unit to read the number of pulses of the motor pulse control signal in each clock cycle, and then generate and output the A-phase pulse signal and the B-phase pulse signal to the numerical control system according to the number of pulses, and output the R-phase pulse signal for each target interval according to the number of pulses and the starting position data. Among them, the A-phase pulse signal and the B-phase pulse signal are used to indicate the incremental data of the number of pulses in a single clock cycle, and the motor displacement direction indicated by the motor pulse control signal, and the R-phase pulse signal is a pulse signal output for each target interval. In this technical solution, the servo driver, the servo motor and the incremental position sensor are simulated by the machine tool simulation drive circuit, so that the numerical control system can confirm and debug the reference point according to the signal output by the incremental position sensor simulated by the machine tool simulation drive circuit. Compared with the related art of confirming and debugging the reference point on the machine tool, it effectively avoids dangerous situations such as machine tool runaway during the reference point debugging process, and improves the safety of the reference point debugging process.

[0113] The embodiment of the present application also provides an electronic device, which may include the machine tool simulation drive circuit provided by the embodiment of the present application. In this way, in the electronic device provided by the embodiment of the present application, the machine tool simulation drive circuit of the machine tool simulation drive circuit can receive the motor pulse control signal output by the numerical control system device through the data processing unit to read the number of pulses of the motor pulse control signal in each clock cycle, and then generate and output the A phase pulse signal and the B phase pulse signal to the numerical control system according to the number of pulses, and output the R phase pulse signal for each target interval according to the number of pulses and the starting position data. Among them, the A phase pulse signal and the B phase pulse signal are used to indicate the incremental data of the number of pulses in a single clock cycle, and the motor displacement direction indicated by the motor pulse control signal, and the R phase pulse signal is a pulse signal output for each target interval. In this technical solution, the servo driver, the servo motor and the incremental position sensor are simulated by the machine tool simulation drive circuit, so that the numerical control system can confirm and debug the reference point according to the signal output by the incremental position sensor simulated by the machine tool simulation drive circuit. Compared with the confirmation and debugging of the reference point on the machine tool in the related art, dangerous situations such as machine tool flying during the reference point debugging process are effectively avoided, and the safety of the reference point debugging process is improved.

[0114] Optionally, the electronic device may further include a processor and a memory. The memory is used to store a computer program. The processor is used to implement the control method of the driver chip in the method embodiment of the present application when executing the program stored in the memory.

[0115] The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the control method of the above-mentioned driver chip is implemented. Wherein, the processor is the processor in the electronic device in the above-mentioned embodiment. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0116] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A machine tool simulation drive circuit, characterized in that: Applicable to a machine tool control system, the machine tool control system also includes a numerical control system; the machine tool simulation drive circuit includes: a data processing unit and a data storage unit; The data storage unit is connected to the data processing unit and is used to store the starting position data of the machine tool simulation drive circuit, wherein the starting position data is the motor position simulated by the machine tool simulation drive circuit before the numerical control system is started; The data processing unit is also connected to the numerical control system, and is used to receive the motor pulse control signal output by the numerical control system device, read the number of pulses of the motor pulse control signal in each clock cycle, generate and output A-phase pulse signal and B-phase pulse signal to the numerical control system according to the number of pulses, and output R-phase pulse signal at each target interval according to the number of pulses and the starting position data. The A-phase pulse signal and the B-phase pulse signal are used to indicate the incremental data of the number of pulses in a single clock cycle, and the motor displacement direction indicated by the motor pulse control signal.

2. The machine tool simulation drive circuit according to claim 1, characterized in that: The data processing unit includes: a first counter and a first pulse generator; The first counter is connected to the numerical control system and the first pulse generator, and is used to count the number of pulses of the motor pulse control signal, and periodically output the number of pulses to the first pulse generator according to the clock cycle; The first pulse generator is connected to the numerical control system, and is used to compare the number of pulses received in the current cycle with the number of pulses received in the previous cycle, obtain incremental data of the number of pulses in the current cycle, generate and output the A-phase pulse signal and the B-phase pulse signal to the numerical control system, the number of pulses of the A-phase pulse signal and the B-phase pulse signal is the incremental data, and the phase difference between the A-phase pulse signal and the B-phase pulse signal indicates the displacement direction of the motor.

3. The machine tool simulation drive circuit according to claim 2, characterized in that: The data processing unit further includes: a second pulse generator; The second pulse generator is respectively connected to the first pulse generator, the data storage unit and the numerical control system, and is used to calculate the current absolute position data of the motor according to the starting position data and the incremental number of the first pulse generator, and output the R-phase pulse signal to the numerical control system when the current absolute position data of the motor meets the integer multiple of the target spacing.

4. The machine tool simulation drive circuit according to claim 3, characterized in that: The starting position data is the number of pulses of the motor pulse control signal when the numerical control system controls the motor to move to the target position through the motor pulse control signal; The data processing unit further includes: a second counter; The second counter is connected to the first pulse generator and the second pulse generator respectively, and is used to count the target pulse number of the A-phase pulse signal / the B-phase pulse signal in a single clock cycle, and output the target pulse number to the second pulse generator; The second pulse generator is used to calculate the current absolute position data of the motor based on the starting position data and the target number of pulses, calculate the difference between the current absolute position data of the motor and the current absolute position data of the motor corresponding to the previous R-phase pulse signal, and output an R-phase pulse signal when the difference is equal to the number of pulses corresponding to the target spacing.

5. The machine tool simulation drive circuit according to claim 1, characterized in that: The machine tool simulation drive circuit further includes: a sensor selection unit; The sensor selection unit is connected to the data storage unit and the data processing unit respectively, and is used to respond to the unequal spacing signal, read the two sub-spacings constituting the target spacing from the data storage unit, and output an unequal spacing instruction and two sub-spacings of a plurality of target spacings to the data processing unit, wherein the value difference of the two sub-spacings of each target spacing is different; The data processing unit is also used to output the R-phase pulse signal of two pulses at the sub-spacing interval within each target spacing according to the pulse quantity and the starting position data when receiving the unequal spacing instruction.

6. The machine tool simulation drive circuit according to claim 5, characterized in that: The machine tool simulation drive circuit further comprises: a reference point selection unit; The reference point selection unit is connected to the numerical control system and is used to output a reference point determination instruction to the numerical control system in response to the equidistant signal, wherein the reference point determination instruction is used to instruct the numerical control system to determine the current position of the motor corresponding to the first received R-phase pulse signal as the reference point; The sensor selection unit is further used to respond to the equal spacing signal, read the target spacing from the data storage unit, and output the equal spacing instruction and the target spacing to the data processing unit; The data processing unit is also used to output an R-phase pulse signal at each target spacing according to the pulse quantity and the starting position data when receiving the equal spacing instruction.

7. The machine tool simulation drive circuit according to any one of claims 2 to 4, characterized in that: The data processing unit also includes a data selection module; The data selection module is connected to the data storage unit, the first counter, the first pulse generator and the second pulse generator respectively, and is used to respond to the incremental sensor instruction, output the pulse quantity to the first pulse generator, and output the starting position data to the second pulse generator, and respond to the absolute sensor instruction, calculate the current absolute position data of the motor according to the starting position data and the incremental quantity of the first pulse generator, and directly output the current absolute position data of the motor.

8. The machine tool simulation drive circuit according to claim 7, characterized in that: The data processing unit further includes: a motor delay module and a buffer module; The motor delay module is connected to the data selection module and the buffer module respectively, and is used to delay the output data of the data selection module, obtain and output the output data of the data selection module after delay processing to the buffer module; The buffer module is also connected to the first pulse generator and the second pulse generator, and is used to output the pulse quantity to the first pulse generator and output the starting position data to the second pulse generator.

9. The machine tool simulation drive circuit according to claim 1, characterized in that: The data processing unit is also used to output the number of pulses of the motor pulse control instruction as the starting position data to the data storage unit when receiving the stop simulation signal of the numerical control system.

10. A machine tool control system, characterized in that: The machine tool control system comprises: a numerical control system and a machine tool simulation drive circuit as described in any one of claims 1 to 9.