Error troubleshooting method, storage medium, and machining center based on one-way serial communication between a machining center and an additional axis
By establishing an association relationship and signal feedback mechanism between the machining center and the additional axis, the transmission error problem in one-way serial communication is solved, ensuring the stability and accuracy of the machining center.
Patent Information
- Application Number
- CN202010402336.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-13
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2040-05-13
AI Technical Summary
The one-way serial communication between the existing machining center and the additional shaft cannot effectively verify the transmission error, resulting in a deviation in transmission information and affecting the processing stability.
By establishing an association relationship between the machining center and the additional axis, generating check codes and performing verification, signal feedback is achieved using electronic control switches to ensure the correctness of transmission.
Effectively eliminate transmission errors in one-way serial communication to improve the stability and accuracy of the machining center.
Smart Images

Figure CN111596584B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machining, and particularly to a troubleshooting method, a storage medium, and a machining center based on one-way serial communication between a machining center and an additional axis. Background Art
[0002] Currently, the number of motion axes that a general machining center (also known as a numerically controlled machine tool) can control is three axes. It can no longer fully meet the requirements for products with increasing machining difficulty. Therefore, a rotating fourth axis or even more axes need to be added to meet the machining requirements.
[0003] When adding axes, the option of increasing the number of axes by the original factory can be selected, but this solution is relatively costly. Therefore, the common practice in most factories is to purchase additional axes provided by third-party rotating axis suppliers by themselves for installation to meet the demand. When installing by themselves, the additional axis needs to cooperate with the machining center for movement. Therefore, the controller of the machining center must communicate with the additional axis.
[0004] Since the controllers of current machining centers, whether domestic, Japanese, or European and American, all have the ability to output characters to the serial port, this feature can be utilized. As Figure 1 shown, the controller is made to send a specified character (ASCII) to the serial port to the additional axis through a machining program to achieve communication. However, for machining centers of domestic, Japanese, or European and American production, most of their controllers can only provide output instructions to the serial port and do not provide reception. The reason is that the original design of the controller only provides this function for sending signals to external devices, rather than for communication. This directly results in the communication method of making the controller send a specified character (ASCII) to the serial port to the additional axis through a machining program being only one-way communication.
[0005] Since only one-way communication is possible, that is, only signals can be sent and not received. Therefore, if during the communication process, due to the influence of equipment, environment, or other factors, the transmitted information deviates. As mentioned before, since the machining center controller only outputs information and does not receive, it is impossible to determine whether the transmission is correct. If this situation occurs in the control of the machine, serious consequences will result.
[0006] This type of transmission error can be handled by standard check codes (such as parity check codes, Hamming check codes, and cyclic redundancy check codes) when placed in other communication systems with strong computing capabilities. However, the core principle of the standard check code is to derive the check code based on the required data through a certain agreed association relationship, and then insert the check code characters between the data bits or the last bit of the required data, and then package the check code and the required data into a data packet for one-time transmission. In other words, the standard check code requires the controller to support control of a single data bit or a single character code, but the controller of the machining center does not support this aspect very well, and most controllers cannot perform too complex calculations in the machining program, so the standard check code method is difficult to implement in the machining center.
[0007] Based on this, it is necessary to develop methods for troubleshooting during serial port communication in response to the special circumstances of the machining center. Summary of the invention
[0008] The purpose of the present invention is to eliminate possible transmission errors during the one-way serial communication of a machining center.
[0009] To achieve the above object, the present invention is implemented through the following technical solutions:
[0010] A troubleshooting method based on one-way serial port communication between a machining center and an additional axis is provided, comprising the following steps:
[0011] Step S1. After the machining center sends a control instruction to the additional axis via its serial port, it generates a check code according to a pre-agreed association relationship, and sends the check code to the additional axis via its serial port;
[0012] Step S2: After the additional axis receives the control instruction and the check code respectively, the control instruction is verified by using the check code according to the association relationship.
[0013] As a preferred solution, the association relationship is specifically: the numerical value corresponding to the control instruction character string and the numerical value corresponding to the check code character string are different from each other and are associated with each other.
[0014] As a preferred solution, the association relationship is specifically: a value obtained by adding a value corresponding to the control instruction character string and a value corresponding to the check code character string is a set constant.
[0015] As a preferred solution, the additional axis has an electric switch controlled by its controller, and the electric switch is used to output a switch signal to the controller of the machining center;
[0016] Step S1 further includes: after the additional axis receives the control instruction, it gives a reception feedback to the machining center through the switch signal, and the machining center sends the check code only after receiving the reception feedback.
[0017] As a preferred solution, step S1 further includes: the machining center prepares the check code immediately after sending the control instruction.
[0018] As a preferred solution, step S2 further includes: after the additional axis receives the check code, if the inspection passes, it gives an inspection feedback to the machining center through the switch signal.
[0019] As a preferred solution, step S2 further includes: if the machining center does not receive the verification feedback within the timeout period, it retransmits the control instruction.
[0020] There is also provided a machining center equipped with an additional axis. The controller of the machining center is unidirectionally communicatively connected to the controller of the additional axis through its serial port to unidirectionally transmit instructions to the controller of the additional axis. The controller of the machining center is electrically connected to an electric control switch, and the controlled end of the electric control switch is connected to the controller of the additional axis; there is also included a memory arranged to store computer-executable instructions, and the executable instructions, when executed, cause the controller of the machining center and the controller of the additional axis to implement the method as described above.
[0021] As a preferred solution, the electric control switch has a pair of switch pins controlled by its controlled end, and these two switch pins are respectively connected to two pins of the controller of the machining center.
[0022] As a preferred solution, the electric control switch is specifically a relay.
[0023] As a preferred solution, the controller of the machining center has a serial port, and the controller of the machining center is specifically unidirectionally communicatively connected to the controller of the additional axis through its serial port.
[0024] As a preferred solution, the controller of the machining center is unidirectionally communicatively connected to the controller of the additional axis only.
[0025] As a preferred solution, the performance of the controller of the machining center is not sufficient to support the control of a single data bit or a single character code.
[0026] There is also provided a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs, when executed by the controller, implement the method as described above.
[0027] Advantageous effects:
[0028] By sending control instructions and check codes in two separate steps and setting up an association between the control instructions and the check codes, the controller of the machining center can avoid complex calculations and does not need to control a single data bit or a single character code. The additional axis can also perform verification operations, ensuring that during the one-way serial communication of the machining center, possible transmission errors during transmission can be excluded, thereby accurately controlling the additional axis and improving the stability of the machining center.
[0029] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable, the following specifically illustrates the embodiments of the present invention. Brief Description of the Drawings
[0030] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. And throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0031] Figure 1 Shows a system block diagram when the machining center controller and the additional axis controller perform one-way serial communication in the prior art;
[0032] Figure 2 Shows a flowchart implemented on the architecture of the present invention based on the one-way serial communication between the machining center controller and the additional axis controller;
[0033] Figure 3 Shows a system block diagram of the present invention after adding a feedback loop to the machining center;
[0034] Figure 4 Shows a flowchart implemented on the architecture of the present invention after adding a feedback loop. Detailed Embodiments
[0035] The following will describe the exemplary embodiments of the present disclosure in more detail with reference to the drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.
[0036] Based on Figure 1 the architecture of the one-way serial communication between the machining center controller and the additional axis controller shown, as shown in Figure 2 , the following methods can be implemented to achieve the purpose of error correction during transmission:
[0037] Step S1. After the machining center sends a control instruction to the additional axis alone through its serial port, it generates a check code according to a pre-agreed association relationship, and sends the check code to the additional axis alone through its serial port;
[0038] Among them, since some errors in the transmission process will be repetitive in a short time, that is, two adjacent transmitted data have the same error, resulting in the same data content, therefore, in this embodiment, the method of retransmitting and verifying the control instruction is not adopted, but the value corresponding to the string of the control instruction and the value corresponding to the string of the check code are set to be different from each other to further enhance the ability to detect transmission errors.
[0039] At the same time, considering that the controller of the machining center does not support controlling a single data bit or a single character code, in the agreed association relationship, it is set that the check code is obtained by subtracting the value corresponding to the string of the control instruction from the set constant. Specifically, for example, the following operation example:
[0040] Assume that the set constant is 361.000, and the machining center needs to transmit a value of 121.000 to the additional axis. Then the machining center first converts 121.000 into a string to form the control instruction, and then transmits it to the controller of the additional axis through the serial port;
[0041] After that, the machining center immediately prepares the check code for subsequent direct transmission. Among them, the check code = set constant - value corresponding to the control instruction = 361.000 - 121.000 = 240.000. After the check code is prepared, it is converted into a string and then sent to the additional axis controller for verification.
[0042] In the above, the set constant is preferably an odd number to ensure that the values of the control instruction and the check code are different from each other. Specifically, the value of the constant can be selected as the maximum value of the instruction x 2 + 1.
[0043] Step S2. After the additional axis receives the control instruction and the check code respectively, it verifies the control instruction with the check code according to the association relationship.
[0044] Specifically, the set constant 361.000 is stored in the controller of the additional axis. After it receives the control instruction and the check code respectively, it adds the values corresponding to the control instruction and the check code. If it is consistent with the set constant 361.000, the verification passes and it is considered that the transmission is correct.
[0045] In this embodiment, control instructions and check codes are sent in two separate times, and an association is set between the control instructions and the check codes, so that the controller of the machining center does not need to perform complex operations and does not need to control a single data bit or a single character code. The additional axis can also perform a verification operation, ensuring that during the one-way serial communication of the machining center, possible transmission errors in the transmission can be excluded, thereby accurately controlling the additional axis and improving the stability of the machining center, that is, the numerical control machine tool.
[0046] Further, to ensure that the machining program of the machining center can know when to send instructions during execution, refer to Figure 3 , in this embodiment, on the basis that the controller of the machining center is unidirectionally communicatively connected to the controller of the additional axis through its serial port, a signal feedback loop is set up to achieve signal feedback. Specifically: Figure 1 An electric control switch is added. The electric control switch has a pair of switch pins that are controlled by its controlled end to achieve on / off. These two switch pins are respectively connected to two pins of the controller of the machining center, and then the controlled end of the electric control switch is connected to the pin X05 on the controller of the additional axis. In this way, the controller of the additional axis can control the on / off of the electric control switch by outputting high and low levels, and thus output a switch signal to the controller of the machining center as feedback.
[0047] In the above, the electric control switch is preferably a relay to achieve electrical isolation protection.
[0048] Based on
[0049] , the above steps S1 and S2 can be optimized to form the operation process shown in Figure 3 , specifically: Figure 4 In step S1, after the additional axis receives the control instruction, it pulls the voltage of the pin X05 on its controller to a low level, causing the electric control switch to disconnect and thus giving the machining center a reception feedback. After the controller of the machining center senses the disconnection of the electric control switch through its pin, it then sends the prepared check code. At this time, the additional axis is ready to receive the check code, avoiding the disorder of the communication timing between the two parties and ensuring orderly communication.
[0050] In addition, in step S2, similarly, after the additional axis receives the check code, it performs verification. When the verification passes, it pulls the voltage of the pin X05 on its controller back to a high level, causing the electric control switch to connect and thus giving the machining center a verification feedback. When the machining center receives the verification feedback, it can know that the transmission is normal and then continue to execute the next operation. However, if the machining center does not receive the verification feedback within the timeout period, it means that the transmission fails, and the control instruction and the check code are retransmitted to make up for the error.
[0051] It should be noted that:
[0052]
[0053] The method used in this embodiment can be transformed into program steps and devices that can be stored in a computer storage medium and implemented by being called and executed by a controller.
[0054] In the specification provided herein, a large number of specific details are set forth. However, it is understood that embodiments of the present invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0055] Those skilled in the art can understand that the modules in the devices in the embodiments can be adaptively changed and disposed in one or more devices different from those in this embodiment. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition, they can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all the features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) can be replaced by an alternative feature that provides the same, equivalent, or similar purpose.
[0056] In addition, those skilled in the art can understand that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments means that it is within the scope of the present invention and forms different embodiments.
[0057] Each component embodiment of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. The present invention can also be implemented as a device or device program (such as a computer program and a computer program product) for executing part or all of the methods described herein. Such a program for implementing the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0058] It should be noted that the above embodiments are illustrative of the present invention and not restrictive thereof, and alternative embodiments can be designed by those skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim listing several devices, several of these devices can be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words can be interpreted as names.
Claims
1. A troubleshooting method based on one-way serial communication between a machining center and an additional axis, characterized in that, Including the following steps: Step S1. After the machining center sends a control instruction to the additional axis alone through its serial port, a check code is generated according to a pre-agreed association relationship, and the check code is sent to the additional axis alone through its serial port. The specific association relationship is that the value corresponding to the control instruction string is different from the value corresponding to the check code string and they are associated with each other. The value obtained by adding the value corresponding to the control instruction string and the value corresponding to the check code string is a set constant; Step S2. After the additional axis receives the control instruction and the check code respectively, the control instruction is verified with the check code according to the association relationship.
2. The error correction method according to claim 1, characterized in that The additional axis has an electric control switch controlled by its controller, and the electric control switch is used to output a switch signal to the controller of the machining center; Step S1 further includes: After the additional axis receives the control instruction, it gives a reception feedback to the machining center through the switch signal, and the machining center sends the check code only after receiving the reception feedback.
3. The error correction method according to claim 2, characterized in that, Step S1 further includes: The machining center prepares the check code immediately after sending the control instruction.
4. The error correction method according to claim 2, wherein, Step S2 further includes: After the additional axis receives the check code, if the verification passes, it gives a verification feedback to the machining center through the switch signal.
5. The error correction method according to claim 4, wherein Step S2 further includes: If the machining center does not receive the verification feedback within the timeout period, it retransmits the control instruction.
6. A storage medium stores a computer program, and when the program is executed by a processor, it implements the method according to any one of claims 1-5.
7. A machining center is equipped with an additional axis. The controller of the machining center is unidirectionally communicatively connected to the controller of the additional axis through its serial port to unidirectionally transmit instructions to the controller of the additional axis. It is characterized in that: The controller of the machining center is electrically connected to an electric control switch, and the controlled end of the electric control switch is connected to the controller of the additional axis; It further includes a memory arranged to store computer-executable instructions, and when the executable instructions are executed, the controller of the machining center and the controller of the additional axis implement the method according to any one of claims 1-5.
8. The machining center according to claim 7, characterized in that: The controller of the machining center has only a unidirectional communication connection to the controller of the additional axis; and / or the performance of the controller of the machining center is not sufficient to support the control of a single data bit or a single character code.
Citation Information
Patent Citations
Interrupt recovery method for machine tool processing file and machine tool suitable for the method
CN109426579A