Encoder failure handling method, plc device, and storage medium

By automatically identifying encoder faults using PLC equipment and simulating encoder pulse counts using time relays, the positioning problem caused by encoder faults was solved, achieving automated processing and improving production efficiency.

CN116795035BActive Publication Date: 2026-03-31SGIS SONGSHAN CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-27
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Encoder malfunction prevents the PLC from calculating the roller rotation speed, resulting in the billet not being automatically positioned, which affects production efficiency. Existing handling methods require manual intervention, which impacts production time.

Method used

The PLC device automatically detects encoder faults and uses time relays to simulate encoder pulse counts, thereby automatically handling encoder faults and locating the billet position.

Benefits of technology

When encoder malfunctions, no manual intervention is required; the system automatically handles encoder failures, improving production efficiency and reducing the impact on production time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116795035B_ABST
    Figure CN116795035B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides an encoder fault processing method, a PLC device and a storage medium, and relates to the technical field of control. The method is applied to the PLC device, the PLC device and an encoder are in communication connection, the encoder is arranged at a furnace charging roller of a billet, a photoelectric switch is further arranged at the furnace charging roller, the photoelectric switch and the PLC device are in communication connection, and the method comprises the following steps: recording the pulse number generated by the encoder according to a preset time, judging whether the encoder is faulty according to the recorded pulse number generated by the encoder, if yes, responding to the operation of automatically processing the encoder fault, controlling a time relay to act under the condition that a signal sent by the photoelectric switch is received, obtaining time data, converting and correcting the time data to obtain target pulse data, and positioning the position of the billet on the furnace charging roller according to the target pulse data. The embodiment of the application realizes automatic judgment and processing of the encoder fault.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of control technology, and more specifically, to an encoder fault handling method, a PLC device, and a storage medium. Background Technology

[0002] Currently, steel rolling mill heating furnaces require steel billets to be centrally positioned along the furnace width to ensure uniform load distribution on the furnace support components and equal distances between both ends of the billet and the furnace walls. This minimizes accidents such as billet deviation and collisions. Accurate billet length measurement and precise alignment upon entering the furnace are crucial to guarantee centered billet placement. The industry typically employs a photoelectric switch + encoder solution for billet length measurement and alignment. An encoder is installed on the entry roller conveyor to measure roller rotations, while a photoelectric switch is installed at a specific position on the conveyor to detect the billet's position. The photoelectric switch and encoder work together to complete the billet length measurement and alignment upon entry.

[0003] When the encoder malfunctions, the PLC cannot calculate the roller rotation speed, which will cause the billet to fail to be automatically positioned. The billet will directly hit the stopper in the furnace and stop. The current solution is for the operator to notify the equipment maintenance personnel to replace the encoder after discovering the fault, or to manually operate the roller and manually determine the position, which will greatly affect the production efficiency. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide an encoder fault handling method, a PLC device and a storage medium, so as to automatically determine encoder faults and automatically handle encoder faults according to corresponding operations.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:

[0006] In a first aspect, embodiments of the present invention provide an encoder fault handling method applied to a PLC device, wherein the PLC device and the encoder are communicatively connected, the encoder is disposed at the furnace entry roller conveyor of the steel billet, and a photoelectric switch is also disposed at the furnace entry roller conveyor, wherein the photoelectric switch and the PLC device are communicatively connected.

[0007] The method includes:

[0008] The number of pulses generated by the encoder is recorded at a preset time.

[0009] The encoder's malfunction is determined based on the recorded number of pulses it generates.

[0010] If so, in response to the automatic encoder fault handling operation, upon receiving a signal sent by the photoelectric switch, the time relay is controlled to operate to obtain time data;

[0011] The time data is converted and corrected to obtain the target pulse data;

[0012] The position of the steel billet on the furnace feed roller conveyor is located based on the target pulse data.

[0013] In an optional implementation, the PLC device includes a first memory and a second memory, and the step of recording the number of pulses generated by the encoder at preset intervals includes:

[0014] The number of pulses generated by the encoder is alternately stored in the first memory and the second memory at preset times.

[0015] In an optional implementation, the step of determining whether the encoder is faulty based on the recorded number of pulses generated by the encoder includes:

[0016] The difference between the number of pulses generated by the encoder stored in the second memory and the number of pulses generated by the encoder stored in the first memory is calculated and used as the difference to be compared.

[0017] Determine whether the difference to be compared is lower than a preset threshold to determine whether the encoder is faulty.

[0018] In an optional implementation, the step of controlling the time relay to operate in response to an automatic encoder fault, upon receiving a signal from the photoelectric switch, to obtain time data, includes:

[0019] In response to the automatic encoder fault handling operation, upon receiving a signal from the photoelectric switch, the time relay is controlled to count down from a preset countdown time, so that the remaining time BCD code generated by the time relay based on the remaining time of the countdown operation is used as time data.

[0020] In an optional implementation, the preset countdown time is 5 seconds and 10 milliseconds.

[0021] In an optional implementation, the step of converting and correcting the time data to obtain the target pulse data includes:

[0022] Convert the time data into real time data;

[0023] The first corrected data is obtained by dividing the real time data by the first correction coefficient and multiplying it by the second correction coefficient, or by dividing the real time data by the first correction coefficient, or by multiplying the real time data by the second correction coefficient.

[0024] The first correction data and the third correction coefficient are added together to obtain the target pulse data.

[0025] In an optional implementation, the step of converting the time data into real-time data includes:

[0026] The time data is converted into integers to obtain the time data to be calculated;

[0027] Calculate the difference between the preset countdown time and the time data to be calculated, and use it as the real time data.

[0028] In an optional implementation, the method further includes:

[0029] Determine whether the furnace feed roller conveyor is working;

[0030] If not, the manual encoder fault handling interface will be displayed;

[0031] In response to the completion of the encoder malfunction handling operation, and assuming the furnace feed roller conveyor is operating, the position of the steel billet on the furnace feed roller conveyor is determined based on the recorded number of pulses generated by the encoder.

[0032] Secondly, embodiments of the present invention provide a PLC device, including a memory and a processor;

[0033] The memory is used to store computer programs;

[0034] The processor is used to execute the computer program to implement the encoder fault handling method provided as described in the first aspect embodiment and / or in combination with possible implementations of the first aspect embodiment.

[0035] Thirdly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the encoder fault handling method provided as described in the first aspect embodiments and / or in combination with possible implementations of the first aspect embodiments.

[0036] The beneficial effects of the embodiments of the present invention include, for example:

[0037] The present invention provides an encoder fault handling method, PLC device and storage medium. When the encoder fails, the operator does not need to judge the fault himself, but can directly select automatic handling. During automatic handling, the target pulse data can be obtained by time relay to simulate the encoder pulse number. This realizes the replacement of the encoder to generate pulse number when the encoder fails. The whole process does not affect the normal billet production, greatly saves production time and improves production efficiency.

[0038] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0039] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 An exemplary structural block diagram of a PLC device provided in an embodiment of the present invention is shown;

[0041] Figure 2 A flowchart illustrating an encoder fault handling method provided by an embodiment of the present invention is shown.

[0042] Figure 3 This is a second schematic flowchart of an encoder fault handling method provided by an embodiment of the present invention;

[0043] Figure 4 The third schematic flowchart of an encoder fault handling method provided by an embodiment of the present invention is shown;

[0044] Figure 5 The fourth schematic flowchart of an encoder fault handling method provided by an embodiment of the present invention is shown;

[0045] Figure 6 The fifth illustration shows a flowchart of an encoder fault handling method provided by an embodiment of the present invention;

[0046] Figure 7 This illustration shows a flowchart of an encoder fault handling method provided by an embodiment of the present invention. Figure 6 ;

[0047] Figure 8 This illustration shows a flowchart of an encoder fault handling method provided by an embodiment of the present invention. Figure 7 .

[0048] Icons: 110-PLC device; 1101-Memory; 1102-Processor; 1103-Communication interface. Detailed Implementation

[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0050] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0051] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0052] It should be noted that, where there is no conflict, the features in the embodiments of the present invention can be combined with each other.

[0053] Currently, steel rolling mill heating furnaces require steel billets to be centrally positioned along the furnace width to ensure uniform load distribution on the furnace support components and equal distances between both ends of the billet and the furnace walls. This minimizes accidents such as billet deviation and collisions. Accurate billet length measurement and precise alignment upon entering the furnace are crucial to guarantee centered billet placement. The industry typically employs a photoelectric switch + encoder solution for billet length measurement and alignment. An encoder is installed on the entry roller conveyor to measure roller rotations, while a photoelectric switch is installed at a specific position on the conveyor to detect the billet's position. The photoelectric switch and encoder work together to complete the billet length measurement and alignment upon entry.

[0054] When the encoder malfunctions, the PLC cannot calculate the number of rotations of the roller conveyor, which will cause the billet to fail to be automatically positioned. The billet will directly hit the stopper in the furnace and stop. The current solution is for the operator to notify the equipment maintenance personnel to replace the encoder after discovering the fault, or to manually operate the roller conveyor and manually determine the position by visual inspection.

[0055] The above-mentioned traditional handling methods have the following drawbacks: First, they cannot detect encoder failures in the first place. If the encoder failure is confirmed and the machine is stopped to handle the failure, production will be stopped. Second, if the encoder failure is handled without stopping production, the manual operation of the roller conveyor is temporarily used. This method is difficult for workers to operate, and manual visual positioning makes it difficult for the steel billet in the furnace to stop in the center position. The manual operation of the roller conveyor takes a long time, which affects production time.

[0056] Based on this, embodiments of the present invention provide an encoder fault handling method to solve the above problems.

[0057] Please refer to the following: Figure 1 , Figure 1 An exemplary structural block diagram of a PLC device 110 provided in an embodiment of the present invention is shown, as follows: Figure 1 As shown, the PLC device 110 includes a memory 1101, a processor 1102, and a communication interface 1103. The memory 1101, processor 1102, and communication interface 1103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0058] The memory 1101 can be used to store software programs and modules. The processor 1102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 1101. The communication interface 1103 can be used to communicate with other node devices for signaling or data.

[0059] The memory 1101 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0060] The processor 1102 can be an integrated circuit chip with signal processing capabilities. The processor 1102 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0061] Based on the PLC device 110 described above, the following executor describes an encoder fault handling method provided by an embodiment of the present invention, using the PLC device 110 as the execution subject. Please refer to... Figure 2 , Figure 2 The diagram shows a flowchart of an encoder fault handling method provided by an embodiment of the present invention.

[0062] like Figure 2 As shown, the encoder fault handling method described above is applied to PLC device 110. PLC device 110 and encoder are communicatively connected. The encoder is installed at the furnace inlet roller conveyor of the steel billet. A photoelectric switch is also installed at the furnace inlet roller conveyor. The photoelectric switch is communicatively connected to PLC device 110. The encoder fault handling method described above may include the following steps:

[0063] S210 records the number of pulses generated by the encoder at a preset time.

[0064] S220 determines whether the encoder is faulty based on the recorded number of pulses generated by the encoder.

[0065] If not, the position of the billet on the furnace feed roller conveyor is determined based on the number of pulses generated by the recorded encoder.

[0066] S230, if so, in response to the operation of automatically handling encoder faults, upon receiving a signal sent by the photoelectric switch, controls the time relay to operate in order to obtain time data.

[0067] S240 converts and corrects the time data to obtain the target pulse data.

[0068] S250 locates the position of the steel billet on the furnace feed roller conveyor based on the target pulse data.

[0069] The above steps enable the PLC device to automatically diagnose encoder faults, and after the user selects to automatically handle encoder faults, the PLC device obtains the target pulse data through a time relay to simulate the encoder pulse count.

[0070] Step S210 involves recording the number of pulses generated by the encoder at preset intervals. For example, the number of pulses generated by the encoder is recorded and saved every hour. The step of recording the number of pulses generated by the encoder may also include alternately saving the number of pulses generated by the encoder to two memories in the PLC device at preset intervals. After recording the number of pulses generated by the encoder, step S220 is then executed.

[0071] In this embodiment of the invention, step S220 can determine whether the encoder is faulty based on the recorded number of pulses generated by the encoder. Specifically, if step S210 involves alternately storing the number of pulses generated by the encoder in two memories of the PLC device at preset intervals, then step S220 can involve comparing the difference between the number of pulses stored in the two memories. If the difference is lower than a set threshold, then the encoder is faulty.

[0072] After determining that the encoder is faulty, step S230 is executed. In response to the automatic encoder fault handling operation, the time relay is controlled to operate to obtain time data when a signal sent by the photoelectric switch is received.

[0073] It should be noted that a photoelectric switch is installed at the furnace feed roller conveyor to detect the position of the steel billet. When the steel billet is moved to the position of the photoelectric switch by the roller conveyor, the photoelectric switch will send a signal to the PLC device. Usually, when the encoder is working normally, the PLC records the number of pulses of the encoder and calculates the number of roller conveyor revolutions based on the number of pulses. Therefore, with the photoelectric switch and encoder working together, the position of the steel billet can be located, and the length measurement and centering of the steel billet in the furnace can be completed.

[0074] Based on this, if an encoder malfunction is detected in step S230, the number of pulses obtained by the PLC at this time cannot correctly calculate the roller rotation, resulting in the inability to correctly position the billet. Therefore, in the case of encoder malfunction, an alarm window will pop up on the display interface of the PLC device. In steps S240 to S250, when the user selects automatic fault handling based on the display interface (i.e., the PLC device responds to the operation of automatically handling encoder malfunction), the PLC device will control the time relay to act when it receives the signal sent by the photoelectric switch to obtain time data. The time data will be converted and corrected to obtain the target pulse data. That is, the above process simulates the number of pulses generated when the encoder is working normally.

[0075] Furthermore, in step S240, the time data is actually the remaining time BCD code generated by the time relay during the countdown operation from the preset countdown time. For example, if the preset countdown time is set to 5 seconds and 10 milliseconds, the time relay will start counting down from 5 seconds and 10 milliseconds, and will acquire the current time in real time and generate the remaining time BCD code during the countdown process.

[0076] Meanwhile, since the motor of the furnace roller conveyor does not run at a constant speed when it is working, the speed and acceleration time of the motor will cause the pulse number curve generated by the encoder to be a non-linear curve. Therefore, based on the remaining time BCD code obtained in step S240, in step S250, the remaining time BCD code needs to be converted into a real number and corrected based on the preset corresponding correction system to simulate the pulse number generated by the encoder, so that the simulated pulse number curve is approximately the same as the actual encoder pulse number curve.

[0077] For example, in step S250, the remaining time BCD code can be converted into a real number first, and then a series of correction coefficients can be obtained according to the pulse number curve of the actual encoder. The obtained real number and the correction coefficients are divided, multiplied, and added together to make the simulated pulse number curve close to the pulse number curve of the actual encoder, and finally the target pulse data is obtained and stored in the memory.

[0078] In this embodiment of the invention, after obtaining the target pulse data, step S250 is executed to locate the position of the steel billet on the furnace roller conveyor according to the target pulse data.

[0079] The present invention provides an encoder fault handling method, PLC device and storage medium. When the encoder fails, the operator does not need to judge the fault himself, but can directly select automatic handling. During automatic handling, the target pulse data can be obtained by time relay to simulate the encoder pulse number. This realizes the replacement of the encoder to generate pulse number when the encoder fails. The whole process does not affect the normal billet production, greatly saves production time and improves production efficiency.

[0080] Optionally, the process of recording the number of pulses generated by the encoder at a preset time can be achieved through the following steps:

[0081] exist Figure 2 Based on this, please refer to Figure 3 , Figure 3 This is a second schematic flowchart of the encoder fault handling method provided in an embodiment of the present invention. The PLC device includes a first memory and a second memory. Step S210, which records the number of pulses generated by the encoder at a preset time, includes:

[0082] S211, the number of pulses generated by the encoder is alternately stored in the first memory and the second memory according to a preset time.

[0083] The above steps realize the process of recording the number of pulses generated by the encoder at a preset time.

[0084] Optionally, the process of determining whether the encoder is faulty based on the recorded number of pulses generated by the encoder can be implemented through the following steps:

[0085] exist Figure 3 Based on this, please refer to Figure 4 , Figure 4 This illustrates a third flowchart of an encoder fault handling method according to an embodiment of the present invention. Step S220, which involves determining whether the encoder is faulty based on the recorded number of pulses generated by the encoder, includes:

[0086] S221, calculate the difference between the number of encoder pulses stored in the second memory and the number of encoder pulses stored in the first memory, and use it as the difference to be compared.

[0087] S222, determine whether the difference to be compared is lower than a preset threshold in order to determine whether the encoder is faulty.

[0088] The above steps realize the process of determining whether the encoder is faulty based on the number of pulses generated by the recorded encoder.

[0089] Optionally, in response to the automatic encoder fault handling operation, upon receiving a signal from the photoelectric switch, the specific process of controlling the time relay to obtain time data can be implemented through the following steps:

[0090] exist Figure 2 Based on this, please refer to Figure 5 , Figure 5 The fourth step of the encoder fault handling method provided in this embodiment of the invention is illustrated. Step S230, in response to the automatic encoder fault handling operation, involves controlling the time relay to operate upon receiving a signal from the photoelectric switch to obtain time data. This step includes:

[0091] S231, in response to the operation of automatically handling encoder faults, upon receiving a signal sent by the photoelectric switch, controls the time relay to perform a countdown operation from a preset countdown time, so as to use the remaining time BCD code generated by the time relay based on the remaining time of the countdown operation as time data.

[0092] The above steps realize the process of obtaining time data through a time relay.

[0093] For example, if the preset countdown time is set to 5 seconds and 10 milliseconds, the time relay will start counting down from 5 seconds and 10 milliseconds. During the countdown, the current time will be obtained in real time and the remaining time BCD code will be generated.

[0094] Optionally, the preset countdown time is 5 seconds and 10 milliseconds.

[0095] In this embodiment of the invention, since the total time for positioning the billet by means of an encoder and a photoelectric switch will not exceed 3 seconds, a preset countdown time of 5 seconds and 10 milliseconds is set to ensure that the target pulse data obtained is more accurate, and to further ensure that the billet positioning is accurate based on the target pulse data.

[0096] It should be noted that, in the case where the target pulse data can be simulated by a time relay in the embodiments of the present invention, the above-mentioned preset countdown time can also be set to other times, and the embodiments of the present invention do not limit this.

[0097] Optionally, the process of converting and correcting the time data to obtain the target pulse data can be achieved through the following steps:

[0098] exist Figure 5 Based on this, please refer to Figure 6 , Figure 6 The fifth step of the encoder fault handling method provided in this embodiment of the invention is illustrated. Step S240, which involves converting and correcting the time data to obtain the target pulse data, includes:

[0099] S241 converts time data into real time data.

[0100] S242, divide the real time data by the first correction coefficient and multiply it by the second correction coefficient, or divide the real time data by the first correction coefficient, or multiply the real time data by the second correction coefficient to obtain the first correction data.

[0101] S243, add the first correction data and the third correction coefficient to obtain the target pulse data.

[0102] The above steps convert and correct the time data to obtain the target pulse data.

[0103] For example, if the preset countdown time in step S230 is set to 5 seconds, after the time relay has run for 5 seconds, the real time data converted by step S241 is 5000. If the actual number of pulses generated by the encoder is 6000, the preset second correction coefficient can be 1.2. Then, in step S242, the real time data and the second correction coefficient need to be multiplied to obtain the first correction data.

[0104] Furthermore, since the initial segment of the pulse count curve of the actual encoder is non-linear, the first correction data and the preset third correction coefficient can be added together to finally obtain the target pulse data.

[0105] Optionally, the specific process of converting time data into real time data can be achieved through the following steps:

[0106] exist Figure 6 Based on this, please refer to Figure 7 , Figure 7 This illustrates a flowchart of an encoder fault handling method according to an embodiment of the present invention, specifically step S241, which involves converting time data into real time data.

[0107] S2411 converts the time data into an integer to obtain the time data to be calculated.

[0108] S2412, calculate the difference between the preset countdown time and the time data to be calculated, and use it as the real time data.

[0109] The above steps realize the process of converting time data into real time data.

[0110] For example, if the preset countdown time in step S230 is set to 5 seconds and 10 milliseconds (i.e., 510 milliseconds), after the time relay has run for 5 seconds and 10 milliseconds, the time data is converted into an integer in step S2411 to obtain the time data to be calculated. Then, the difference between the preset countdown time of 510 milliseconds and the time data to be calculated is calculated, and a positive value is obtained, which is the real time data.

[0111] Optionally, when the furnace feed roller conveyor on the production line stops operating, encoder malfunctions can be troubleshooted. Therefore, when manual encoder troubleshooting is required, the PLC will determine the operating status of the furnace feed roller conveyor to facilitate manual troubleshooting of the encoder while the conveyor is stopped. After troubleshooting, the correct pulse count generated by a normally operating encoder can be obtained. The above process can be implemented through the following steps:

[0112] exist Figure 2 Based on this, please refer to Figure 8 , Figure 8 This is illustrated in the seventh flowchart of an encoder fault handling method provided by an embodiment of the present invention. The encoder fault handling method further includes:

[0113] S260, determine whether the furnace feed roller conveyor is working.

[0114] If so, return to step S260.

[0115] S261, if not, display the manual encoder fault handling interface.

[0116] S262, in response to the operation of handling encoder failure, and if it is determined that the furnace feed roller is working, locates the position of the billet on the furnace feed roller based on the recorded number of pulses generated by the encoder.

[0117] The above steps enable manual handling of encoder malfunctions when the furnace feed roller conveyor is stopped, and positioning of the billet on the furnace feed roller conveyor based on the recorded number of pulses generated by the encoder when the encoder is running normally.

[0118] It should be noted that the above encoder fault handling method uses a time relay to simulate the target pulse number, which can replace the actual encoder. When the encoder fails, it can automatically identify the fault and handle it accordingly without affecting production. Moreover, the encoder fault can be investigated after the furnace feed roller of the production line stops running, further saving production time.

[0119] Furthermore, the above-mentioned method of obtaining the target pulse number can also be achieved by generating the target pulse number using a fixed pulse generator, and this embodiment of the present invention does not limit this.

[0120] Based on the same inventive concept, this embodiment of the invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by the processor 1102, implements an encoder fault handling method provided in the above embodiment.

[0121] The steps executed by the aforementioned computer program during runtime will not be described in detail here, but can be found in the explanation of the encoder fault handling method described above.

[0122] In the several embodiments provided in this application, it should be understood that the disclosed methods can also be implemented in other ways. The embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0123] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0124] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0125] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An encoder failure handling method, characterized by, The application is applied to a PLC device, the PLC device is in communication connection with an encoder, the encoder is arranged at a charging roller of a billet, and a photoelectric switch is also arranged at the charging roller, and the photoelectric switch is in communication connection with the PLC device; The method comprises: recording the pulse number generated by the encoder at a preset time; judging whether the encoder is faulty according to the recorded pulse number generated by the encoder; if yes, in response to an operation of automatically processing the encoder fault, controlling a time relay to act in the case of receiving a signal sent by the photoelectric switch to obtain time data; converting and correcting the time data to obtain target pulse data; positioning the billet at the charging roller according to the target pulse data; the step of controlling the time relay to act in the case of receiving the signal sent by the photoelectric switch to obtain the time data in response to the operation of automatically processing the encoder fault, comprising: in response to the operation of automatically processing the encoder fault, controlling the time relay to count down from a preset countdown time to generate a remaining time BCD code of the time relay according to the remaining time of the countdown operation, simulating a pulse number curve according to the time data, and making the pulse number curve approximate to a pulse curve of a time encoder.

2. The encoder failure handling method of claim 1, wherein, The PLC device comprises a first memory and a second memory, and the step of recording the pulse number generated by the encoder at a preset time comprises: alternately saving the pulse number generated by the encoder in the first memory and the second memory at a preset time.

3. The encoder failure handling method of claim 2, wherein, The step of judging whether the encoder is faulty according to the recorded pulse number generated by the encoder comprises: calculating a difference value between the pulse number generated by the encoder saved in the second memory and the pulse number generated by the encoder saved in the first memory as a comparison difference value; judging whether the comparison difference value is lower than a preset threshold value to judge whether the encoder is faulty.

4. The encoder failure handling method of claim 1, wherein, The preset countdown time is 5 seconds and 10 milliseconds.

5. The encoder failure handling method of claim 1, wherein, The step of converting and correcting the time data to obtain the target pulse data comprises: converting the time data into real time data; dividing the real time data by a first correction coefficient and multiplying the real time data by a second correction coefficient, or dividing the real time data by the first correction coefficient, or multiplying the real time data by the second correction coefficient to obtain first correction data; adding the first correction data and a third correction coefficient to obtain the target pulse data.

6. The encoder failure handling method of claim 5, wherein, The step of converting the time data into real time data comprises: converting the time data into an integer to obtain to-be-calculated time data; calculating a difference value between the preset countdown time and the to-be-calculated time data as the real time data.

7. The encoder failure handling method of claim 1, wherein, The method further comprises: judging whether the charging roller is working; if no, displaying a manual processing encoder fault interface; in response to an operation of processing the encoder fault, positioning the billet at the charging roller according to the recorded pulse number generated by the encoder in the case of determining that the charging roller is working.

8. A PLC device, characterized by, comprising a memory and a processor; the memory is configured to store a computer program; the processor is configured to execute the computer program to implement the encoder failure handling method according to any one of claims 1-7.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, the computer program, when executed by the processor, implements the encoder failure handling method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Method for continuously operating equipment without shutdown after position encoder fails

    CN114035502A

  • Heating furnace inner space tracking correction apparatus

    CN204129492U

  • Device for detecting fault of position detector

    JP1982098002A