Motion synchronization abnormality warning method, device, equipment and readable storage medium
By calculating the position offset and historical offset of the motion axis, and outputting abnormal alarm information, the problem of abnormal motion synchronization in multi-axis motion mechanisms is solved, and the safety and reliability of the equipment are improved.
Patent Information
- Application Number
- CN202410750317.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-06-12
AI Technical Summary
In multi-axis motion mechanisms, motion synchronization abnormalities may occur in the motion axes, resulting in excessive position deviations, endangering equipment and personal safety, and affecting the reliability and safety of the equipment.
By obtaining the current position offset and historical position offset of the motion axis, the accumulated position offset is calculated. If the accumulated position offset is greater than or equal to the preset threshold, the motion synchronization abnormal alarm message is output to realize synchronization of the motion axis. Status monitoring and alarming.
Effectively monitor the synchronization status of the motion axis, alarm in time, avoid equipment damage, and improve the safety and reliability of equipment operation.
Smart Images

Figure CN118334841B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motion control technology, and in particular to a motion synchronization abnormality warning method, device, equipment and readable storage medium. Background Art
[0002] Multi-axis motion mechanisms are widely used in industrial production, such as in parts processing and assembly. In the working process of multi-axis motion mechanisms, some occasions require synchronous motion between two motion axes. For example, the material buffer device, the main action of the device is through the synchronous rotation of the main motion axis and the slave motion axis, that is, the main motion axis and the slave motion axis need to keep the motion synchronous, drive the equipment material to rotate, and then transport it to the assembly line.
[0003] In the process of conceiving and implementing this application, the inventor found that there are at least the following problems: the motion axis that requires synchronous motion may have a large deviation in the motion axis position and asynchronous motion, which will endanger the safety of equipment and personnel and seriously affect the reliability and safety of equipment operation. Therefore, there is an urgent need for an effective monitoring method that can realize abnormal motion synchronization of the motion axis. Summary of the invention
[0004] The main purpose of the present application is to provide a motion synchronization anomaly warning method, device, equipment and readable storage medium, aiming to solve the technical problem of how to achieve effective monitoring of motion synchronization anomalies of motion axes.
[0005] To achieve the above object, the present application provides a motion synchronization abnormality early warning method, the motion synchronization abnormality early warning method comprising the following steps:
[0006] Acquire a current position offset and a historical position offset of a motion axis, wherein the motion axis includes a first motion axis and a second motion axis that require motion synchronization, and the current position offset is used to indicate a position deviation between the first motion axis and the second motion axis in a current communication cycle;
[0007] Determining a cumulative position offset according to the current position offset and the historical position offset;
[0008] If the accumulated position offset is greater than or equal to a preset threshold, a motion synchronization abnormality alarm message is output.
[0009] Optionally, before the step of obtaining the current position offset and the historical position offset of the motion axis, the method further includes:
[0010] Obtain a first position offset of the first motion axis, and obtain a second position offset of the second motion axis;
[0011] A difference between the first position offset and the second position offset is determined, and the difference is used as a current position offset of the motion axis.
[0012] Optionally, before the step of obtaining the first position offset of the first motion axis, the method further includes:
[0013] Acquire a first position of a first motion axis at a current moment, and acquire a second position of the first motion axis at a previous moment;
[0014] A first position offset of the first motion axis is determined according to the first position and the second position.
[0015] Optionally, the step of determining a first position offset of the first motion axis according to the first position and the second position includes:
[0016] Acquire a corresponding single-turn zero-crossing mark of the first motion axis, wherein the single-turn zero-crossing mark includes a first threshold and a second threshold, the first threshold is used to indicate that the first motion axis does not have a single-turn zero-crossing during the motion process, and the second threshold is used to indicate that the first motion axis has a single-turn zero-crossing during the motion process;
[0017] If the single-turn zero-crossing flag is a first threshold, a position difference between the first position and the second position is determined, and a first position offset of the first motion axis is determined according to the position difference.
[0018] Optionally, the step of determining the first position offset of the first motion axis according to the position difference comprises:
[0019] If the movement direction of the first movement axis is consistent with the preset positive direction, determining the absolute value of the position difference, and taking the absolute value of the position difference as the first position offset of the first movement axis;
[0020] If the moving direction of the moving axis is inconsistent with the preset positive direction, the absolute negative value of the position difference is determined, and the absolute negative value of the position difference is used as the first position offset of the first moving axis.
[0021] Optionally, after the step of acquiring the corresponding single-turn zero-crossing mark of the first motion axis, the method further includes:
[0022] If the single-circle zero-crossing flag is a second threshold, obtaining a single-circle distance corresponding to the first motion axis;
[0023] If the movement direction of the first movement axis is consistent with the preset positive direction, a first offset is obtained by subtracting the second position from the first position, a first sum of the first offset and a single-circuit distance is determined, and the first sum is used as a first position offset of the first movement axis;
[0024] If the movement direction of the first movement axis is inconsistent with the preset positive direction, a second offset is obtained by subtracting the first position from the second position, a second sum of the second offset and the single-circuit distance is determined, and the negative value of the second sum is used as the first position offset.
[0025] Optionally, it is characterized in that after the step of determining the cumulative position offset according to the current position offset and the historical position offset, the method further comprises:
[0026] If the accumulated position offset is less than a preset threshold, updating the historical position offset of the motion axis with the accumulated position offset;
[0027] Based on the updated historical position offset, return to execute the step of obtaining the current position offset and the historical position offset of the motion axis.
[0028] In addition, to achieve the above-mentioned purpose, the present application also provides a motion synchronization abnormality warning device, the motion synchronization abnormality warning device comprising:
[0029] An acquisition module, used for acquiring a current position offset and a historical position offset of a motion axis, wherein the motion axis includes a first motion axis and a second motion axis that need motion synchronization, and the current position offset is used for indicating a position deviation between the first motion axis and the second motion axis in a current communication cycle;
[0030] An accumulation module, used for determining an accumulated position offset according to the current position offset and the historical position offset;
[0031] The alarm module is used to output motion synchronization abnormality alarm information if the accumulated position offset is greater than or equal to a preset threshold.
[0032] In addition, to achieve the above-mentioned purpose, the present application also provides a motion synchronization abnormality warning device, including: a memory, a processor, and a motion synchronization abnormality warning program stored on the memory and executable on the processor, wherein the motion synchronization abnormality warning program, when executed by the processor, implements the steps of the motion synchronization abnormality warning method as described above.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a readable storage medium, on which a motion synchronization abnormality warning program is stored. When the motion synchronization abnormality warning program is executed by a processor, the steps of the motion synchronization abnormality warning method as described above are implemented.
[0034] In the present application, the current position offset and the historical position offset of the motion axis are obtained, wherein the motion axis includes a first motion axis and a second motion axis that need motion synchronization, and the current position offset is used to indicate the position deviation between the first motion axis and the second motion axis in the current communication cycle; the cumulative position offset is determined according to the current position offset and the historical position offset; if the cumulative position offset is greater than or equal to the preset threshold, the motion synchronization abnormality alarm information is output. In this way, the position offset between the motion axes is accumulated, and the position offset is used to detect whether the motion axis is abnormally synchronized. When the motion axes are synchronized, the position offset between the motion axes is small. When the position offset is too large, it means that the motion axis does not maintain motion synchronization, so when the cumulative position offset is greater than or equal to the preset threshold, the motion synchronization abnormality alarm information is output, and the motion synchronization abnormality of the motion axis is promptly reminded. The cumulative position offset of the motion axis is used to monitor whether the motion synchronization of the motion axis is abnormal, and the effective monitoring of the motion synchronization abnormality of the motion axis is realized, and the alarm can be timely and accurately when the motion synchronization is abnormal, thereby avoiding equipment damage and improving the safety of equipment operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
[0036] Figure 1 It is a schematic diagram of the terminal\system structure of the hardware operating environment involved in the embodiment of the present application;
[0037] Figure 2 This is a flow chart of the first embodiment of the motion synchronization abnormality warning method of the present application;
[0038] Figure 3 This is an illustrative schematic diagram of the structure of the detection device for the motion synchronization abnormality early warning method of this application;
[0039] Figure 4 This is a schematic diagram of the cumulative offset waveform of the motion synchronization abnormality warning method of this application;
[0040] Figure 5 This is a first schematic diagram of the offset of the motion synchronization abnormality warning method of this application;
[0041] Figure 6 This is the second schematic diagram of the offset of the motion synchronization abnormality warning method of this application;
[0042] Figure 7This is the third schematic diagram of the offset of the motion synchronization abnormality warning method of this application;
[0043] Figure 8 This is a fourth schematic diagram of the offset of the motion synchronization abnormality warning method of this application;
[0044] Fig. 9 This is a schematic diagram of the device structure of the motion synchronization abnormality warning device of this application. DETAILED DESCRIPTION
[0045] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0046] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a motion synchronization anomaly warning device for a hardware operating environment involved in an embodiment of the present application.
[0047] like Figure 1 As shown, the motion synchronization abnormality warning device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage system independent of the aforementioned processor 1001.
[0048] Those skilled in the art will understand that Figure 1 The structure shown in does not constitute a limitation on the motion synchronization abnormality warning device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0049] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and a motion synchronization abnormality warning program.
[0050] exist Figure 1In the motion synchronization abnormality warning device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the motion synchronization abnormality warning device of the present application can be set in the motion synchronization abnormality warning device, and the motion synchronization abnormality warning device calls the motion synchronization abnormality warning program stored in the memory 1005 through the processor 1001, and executes the motion synchronization abnormality warning method provided in the embodiment of the present application.
[0051] Based on the above questions, please refer to Figure 2 , Figure 2 This is a flow chart of the first embodiment of the motion synchronization abnormality early warning method of the present application. It should be noted that although the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than here.
[0052] In this embodiment, the motion synchronization abnormality warning method of the present application is applied to the above-mentioned terminal device. It should be understood that based on different design requirements of actual applications, in different feasible implementation methods, the motion synchronization abnormality warning method of the present application can of course be specifically applied to other terminal devices.
[0053] In this embodiment, if Figure 2 As shown, the motion synchronization abnormality warning method includes the following steps:
[0054] Step S10, obtaining a current position offset and a historical position offset of a motion axis, wherein the motion axis includes a first motion axis and a second motion axis that need motion synchronization, and the current position offset is used to indicate a position deviation between the first motion axis and the second motion axis in a current communication cycle;
[0055] In this embodiment, the motion synchronization abnormality warning method can be applied to equipment that needs to perform motion synchronization abnormality monitoring, such as material buffer machines, conveyor belts, etc., and this embodiment does not make specific restrictions on this.
[0056] The device includes a motor and a first motion axis and a second motion axis that need to keep motion synchronously, and the motor is used to drive the first motion axis and the second motion axis synchronously. Figure 3 As shown, for the equipment driven by the master and slave axes, the first motion axis and the second motion axis can be the master motion axis and the slave motion axis respectively. Specifically, when the first motion axis is the master motion axis, the second motion axis is the slave motion axis, and when the first motion axis is the slave motion axis, the second motion axis is the master motion axis. The master motion axis and the slave motion axis are respectively connected to the motor, and the motor drives the master motion axis and the slave motion axis to move.
[0057] Optionally, at every communication cycle, the current positions of the first moving axis and the second moving axis are collected once, and the positions collected at that time are recorded. The length of the communication cycle can be set in advance by the user, such as 125 microseconds, 150 microseconds, etc., and this embodiment does not make specific restrictions on this.
[0058] Based on the real-time collected position in the current communication cycle and the position collected last time, the position deviation (or position offset) of each moving axis relative to the previous communication cycle can be obtained. The position deviation is also the distance traveled by the moving axis in the current communication cycle, and the current position offset is calculated. For example, let the position deviation of the first moving axis relative to the previous communication cycle in the current communication cycle be X1, and the position deviation of the second moving axis relative to the previous communication cycle be X2, then the current position offset is X1-X2 or X2-X1. For the convenience of subsequent elaboration and explanation, in this embodiment, preferably, the position deviation X1 of the first moving axis minus the position deviation X2 of the second moving axis, that is, X1-X2, is selected as the current position offset.
[0059] The historical position offset is the position deviation between the first moving axis and the second moving axis in the historical communication cycle, and the historical communication cycle may be a communication cycle from the initial communication cycle to the end of the previous cycle of the current communication cycle. For example, the current communication cycle is n, the current position offset is △n, then △n=X1-X2, the historical position offset is △H, the initial communication cycle is 1, then the historical position offset △H=△1+△2+......+△i+......+△n-1, where i is the i-th communication cycle, and △i is the position offset of the i-th cycle.
[0060] Step S20, determining a cumulative position offset according to the current position offset and the historical position offset;
[0061] It should be noted that, in this embodiment, the sum of the current position offset and the historical position offset is taken as the cumulative position offset, and the cumulative position offset is denoted as △N, then △N=△n+△H=△1+△2+......+△i+......+△n-1+△n, then, it can be understood that △N is taken as the historical position offset of the next communication cycle. For example, the waveform of the cumulative position offset can be referred to Figure 4 As shown, the horizontal axis is time, the vertical axis is the accumulated position offset, and when the moving axis maintains motion synchronization, the accumulated position offset fluctuates within the neighborhood of zero and is in dynamic balance.
[0062] In a possible implementation manner, after the step of determining the cumulative position offset according to the current position offset and the historical position offset, the method further includes:
[0063] Step S201, if the accumulated position offset is less than a preset threshold, updating the historical position offset of the motion axis with the accumulated position offset;
[0064] Step S202: based on the updated historical position offset, return to the step of obtaining the current position offset and the historical position offset of the motion axis.
[0065] The historical position offset of the motion axis is updated with the accumulated position offset, that is, the accumulated position offset is updated as the new historical position offset of the motion axis, thereby updating the historical position offset in real time, and ensuring the accuracy of the historical position offset. When the accumulated position offset is less than the preset threshold, the process returns to step S10, and the accumulated position offset of the motion axis is continuously monitored, thereby realizing real-time monitoring of the synchronous motion of the motion axis, so as to timely discover the abnormality of the motion synchronization of the motion axis.
[0066] Step S30: If the accumulated position offset is greater than or equal to a preset threshold, output motion synchronization abnormality alarm information.
[0067] The motion axis synchronization abnormality alarm information may include one or more of a voice alarm, a vibration alarm, and a prompt light alarm to remind the user of the motion axis motion synchronization abnormality. In this embodiment, a prompt light alarm is used. Furthermore, the motor can be controlled to stop running, that is, the motion axis can be controlled to stop moving, thereby further avoiding equipment damage, safety accidents, etc., and improving the reliability and safety of equipment operation.
[0068] As another implementation, the distance traveled by the first moving axis relative to the mechanical zero point can be determined, and compared with the distance traveled by the second moving axis relative to the mechanical zero point to obtain the position deviation value of the two axes, and the position deviation value of the two axes can be compared with the set position deviation value threshold, which can be used as the basis for judging the alarm. That is, X1-Y1=△X, and an alarm is triggered if △X>Th. Among them, X1 is the position offset of the first moving axis relative to the mechanical zero point, Y1 is the position offset of the second moving axis relative to the mechanical zero point, △X is the deviation value of the positions of the two moving axes relative to the zero point offset, and Th is the set threshold. It can be understood that in this implementation, as the distance traveled by the moving axis relative to the mechanical zero point increases, the required storage space will gradually increase. For example, if the moving axis travels 2 relative to the mechanical zero point, the storage space required will gradually increase. 16-1=65535 turns, 2 bytes of storage space are required. If the calculation is not restarted from zero, an external expansion space is required for storage. If the calculation is restarted from zero, it is easy to cause an alarm for the master-slave axis (because when the master axis is reset and recalculated, the circle value of the slave axis may be very large, resulting in a large deviation in the calculation). In the embodiment of the present application, the deviation value of the master-slave axis position offset is accumulated. When the moving axis maintains motion synchronization, the accumulated position offset is usually very small. When the accumulated position offset is greater than a preset threshold, an alarm operation is performed. The accumulated position offset may not be stored. Even if the accumulated position offset is stored, the accumulated position offset is usually much smaller than the distance traveled by the moving axis relative to the mechanical zero point. The longer the moving axis moves, the smaller the accumulated position offset and the distance traveled by the moving axis relative to the mechanical zero point. Less storage space is required, and the storage cost is low, thereby reducing the implementation cost of abnormal motion axis synchronization monitoring.
[0069] Further, in order to help understand the technical concept or working principle of the present application, a specific embodiment is listed. In this specific embodiment, the motion synchronization abnormality warning process is as follows:
[0070] Note that x1-y1=△X1, x2-y2=△X2, x3-y3=△X3, x4-y4=△X4, …, xn-yn=△Xn, then △X=△x1+△x2+△x3+△x4…+△xn>Th, an alarm is triggered, where x1: the position offset of the host in the first communication cycle relative to the previous communication cycle, y1: the position offset of the slave in the first communication cycle relative to the previous communication cycle, x2: the position offset of the host in the second communication cycle relative to the previous communication cycle, y2: the position offset of the slave in the second communication cycle relative to the previous communication cycle, x3: the position offset of the host in the third communication cycle relative to the previous communication cycle, y3: the position offset of the slave in the third communication cycle relative to the previous communication cycle, …, xn: the position offset of the host in the Nth communication cycle relative to the previous communication cycle, yn: the position offset of the slave in the Nth communication cycle relative to the previous communication cycle, Th: the set threshold.
[0071] It should be noted that the above specific embodiments are only used to understand the present application and do not constitute a limitation on the motion synchronization abnormal warning process of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0072] In this embodiment, the current position offset and the historical position offset of the motion axis are obtained, wherein the motion axis includes a first motion axis and a second motion axis that need motion synchronization, and the current position offset is used to indicate the position deviation between the first motion axis and the second motion axis in the current communication cycle; the cumulative position offset is determined according to the current position offset and the historical position offset; if the cumulative position offset is greater than or equal to the preset threshold, the motion synchronization abnormality alarm information is output. In this way, the present embodiment accumulates the position offsets between the motion axes, and uses the position offset to detect whether the motion axis is abnormally synchronized. When the motion axes are synchronized, the position offsets between the motion axes are small. When the position offsets are too large, it means that the motion axes do not maintain motion synchronization, so when the cumulative position offset is greater than or equal to the preset threshold, the motion synchronization abnormality alarm information is output, and the motion synchronization abnormality of the motion axis is promptly reminded. The cumulative position offset of the motion axis is used to monitor whether the motion synchronization of the motion axis is abnormal, and the effective monitoring of the motion synchronization abnormality of the motion axis is realized, and the alarm can be timely and accurately when the motion synchronization is abnormal, thereby avoiding equipment damage and improving the safety of equipment operation.
[0073] Further, based on the first embodiment of the present application, a second embodiment of the motion synchronization abnormality warning method of the present application is proposed. The same or similar contents as the first embodiment can be referred to the above introduction and will not be repeated later. In this embodiment, before the step of obtaining the current position offset and the historical position offset of the motion axis, the method further includes:
[0074] Step A10, obtaining a first position offset of the first motion axis, and obtaining a second position offset of the second motion axis;
[0075] Step A20: determine the difference between the first position offset and the second position offset, and use the difference as the current position offset of the motion axis.
[0076] The first position offset is the position offset of the first moving axis in the current communication cycle, that is, the distance traveled by the first moving axis in the current communication cycle. Similarly, the second position offset is the position offset of the second moving axis in the current communication cycle. The difference between the first position offset and the second position offset is taken as the current position offset, that is, the first position offset is X1, the second position offset is X2, and the current position offset is X1-X2 or X2-X1. In this embodiment, preferably, X1-X2 is taken as the current position offset. The second position offset of the second moving axis is determined in a similar manner to the first position offset, and the determination method of the second position offset is not repeated in this embodiment.
[0077] As one implementation manner, the second motion axis may report its own second position offset to the first motion axis, and the first motion axis calculates its own first position offset and then determines the current position offset in combination with the second position offset reported by the second motion axis.
[0078] In a possible implementation manner, before the step of obtaining the first position offset of the first motion axis, the method further includes:
[0079] Step B10, obtaining a first position of the first motion axis at a current moment, and obtaining a second position of the first motion axis at a previous moment;
[0080] Step B20, determining a first position offset of the first motion axis according to the first position and the second position.
[0081] The current moment is the moment of collecting the position of the first motion axis, and the previous moment is the moment of collecting the position of the motion axis last time. Let the first position be x1 and the second position be x2, then the first position offset can be calculated based on x1 and x2, and the first position offset is the distance traveled by the first motion axis in the communication cycle from the previous moment to the current moment.
[0082] The rotation angle of the motor in the current communication cycle can also be obtained, and the position offset (including the first position offset and the second position offset) can be calculated based on the rotation angle of the motor in the current communication cycle. For example, if the position offset of the motion axis is m when the motor rotates a unit angle, and if the angle of rotation of the motor in the current communication cycle is w, the position offset of the motion axis is w*m, and when the motor rotates forward, the position offset takes a positive value, i.e. w*m, and when the motor rotates reversely, the position offset takes a negative value, i.e. -w*m, to ensure the accuracy of the position offset.
[0083] In this embodiment, the first position offset of the first motion axis is determined according to the first position and the second position, thereby ensuring the accuracy of the first position offset.
[0084] In a possible implementation manner, the step of determining a first position offset of the first motion axis according to the first position and the second position includes:
[0085] Step C10, obtaining a corresponding single-turn zero-crossing mark of the first motion axis, wherein the single-turn zero-crossing mark includes a first threshold and a second threshold, the first threshold is used to indicate that the first motion axis does not have a single-turn zero-crossing during the motion process, and the second threshold is used to indicate that the first motion axis has a single-turn zero-crossing during the motion process;
[0086] The single-turn zero crossing indicator indicates whether there is a single-turn zero crossing. The single-turn zero crossing means whether the motion axis passes through the mechanical zero point during the motion process.
[0087] As one of the implementation modes, a mechanical zero point is pre-set on the motion path of the motion axis, such as randomly selecting a point on the motion path of the motion axis as the mechanical zero point. At this time, when the motion axis passes through this point during the movement of the motion axis in the current communication cycle, the motion axis has a single-turn zero crossing, and the single-turn zero crossing flag is set to the second threshold. Otherwise, the motion axis does not have a single-turn zero crossing, and the single-turn zero crossing flag is set to the first threshold.
[0088] As another implementation, it can also be the point when the count value of the motor encoder is zero. It can be understood that the motor can drive the motion axis to move by counting the encoder. For example, if the motor encoder is a 23-bit encoder, the encoder starts counting from 0 and counts to 2. 23 -1, and then restart counting from zero. Usually, one counting cycle of the encoder controls the motion axis to move one circle, that is, when the encoder counts plus one, the motion axis moves (1 / 8388608)*360 degrees. The encoder count is zero at the mechanical zero point. At this time, in the current communication cycle, the encoder counting process restarts counting from zero. If the motion axis has a single-turn zero crossing, the single-turn zero crossing flag is set to the second threshold. Otherwise, the motion axis does not have a single-turn zero crossing, and the single-turn zero crossing flag is set to the first threshold.
[0089] The first threshold and the second threshold are used to distinguish whether the motion axis has a single-turn zero crossing. For example, the first threshold can be 1 and the second threshold can be 0, or the first threshold can be 0 and the second threshold can be 1. This embodiment does not impose any specific limitation on this.
[0090] Step C20: if the single-turn zero-crossing flag is a first threshold, determine a position difference between the first position and the second position, and determine a first position offset of the first motion axis according to the position difference.
[0091] The single-turn zero crossing mark is the first threshold value, that is, when the first moving axis does not have a single-turn zero crossing during the movement process, the first position offset can be determined according to the difference between the first position and the second position. In this embodiment, whether the moving axis has a single-turn zero crossing is recorded to avoid the phenomenon that the moving position of the moving axis is suddenly changed due to the single-turn zero crossing of the moving axis, resulting in incorrect calculation of the first position offset, thereby improving the accuracy of the first position offset.
[0092] In a possible implementation manner, the step of determining the first position offset of the first motion axis according to the position difference includes:
[0093] Step D10, if the movement direction of the first movement axis is consistent with the preset positive direction, determining the absolute value of the position difference, and taking the absolute value of the position difference as the first position offset of the first movement axis;
[0094] The preset positive direction can be preset. For example, when the motor rotates forward, the movement direction of the motion axis is set to the preset positive direction. When the movement method of the first motion axis is consistent with the preset positive direction and there is no single-turn zero crossing, the absolute value of the position difference, the first position offset, is a positive value. Figure 5 As shown, the first movement axis moves from the second position x2 to the first position x1, and the first position offset is x1-x2.
[0095] Step D20: If the moving direction of the moving axis is inconsistent with the preset positive direction, determine the negative value of the absolute value of the position difference, and use the negative value of the absolute value of the position difference as the first position offset of the first moving axis.
[0096] When the movement direction of the first movement axis is inconsistent with the preset positive direction and there is no single-turn zero crossing, the negative value of the absolute value of the position difference is used as the first position offset of the first movement axis, that is, the first position offset takes a negative value. Figure 6 As shown, the first movement axis moves from the second position x2 to the first position x1, and the first position offset is -(x2-x1).
[0097] In this embodiment, when the moving direction of the moving axis is consistent with the preset positive direction, the first position offset takes a positive value, and when the moving direction of the moving axis is inconsistent with the preset positive direction, the first position offset takes a negative value. For example, when the moving direction of the moving axis is consistent with the preset positive direction, the first moving axis moves from 10 to 20, and the first position offset is 10. When the moving direction of the moving axis is inconsistent with the preset positive direction, the first moving axis moves from 20 to 10, and the first position offset is -10, instead of 10, thereby improving the accuracy of the position offset.
[0098] In a possible implementation manner, after the step of acquiring the corresponding single-turn zero-crossing mark of the first motion axis, the method further includes:
[0099] Step E10, if the single-circle zero-crossing flag is a second threshold, obtaining a single-circle distance corresponding to the first motion axis;
[0100] Step E20, if the movement direction of the first movement axis is consistent with the preset positive direction, subtract the second position from the first position to obtain a first offset, determine a first sum of the first offset and a single-circuit distance, and use the first sum as a first position offset of the first movement axis;
[0101] The single-circle distance is the total distance traveled by the motion axis in one circle. For example, the maximum count of the encoder can be used as the single-circle distance. For example, for a 23-bit encoder, the single-circle distance can be 2 23 , refer to Figure 7 As shown, if we assume that the distance of a single lap is 223 , the movement direction of the first movement axis is the same as the preset positive direction and there is a single-turn zero crossing, moving from the second position x2 to the first position x1, then the first position offset is x1-x2+2 23 .
[0102] Step E30, if the movement direction of the first movement axis is inconsistent with the preset positive direction, subtract the first position from the second position to obtain a second offset, determine the second sum of the second offset and the single-circuit distance, and use the negative value of the second sum as the first position offset.
[0103] Reference Figure 8 As shown, if we assume that the distance of a single lap is 2 23 , the movement direction of the first movement axis is opposite to the preset positive direction and there is a single-turn zero crossing, moving from the second position x2 to the first position x1, then the first position offset is -(x2-x1+2 23 ).
[0104] In this embodiment, the first position offset is determined in different ways based on whether the moving axis passes through zero in a single turn and whether the moving direction is consistent with the preset positive direction. This avoids the situation where the motor is always rotating in one direction, causing the multi-turn count value of the single moving axis to jump, resulting in a large calculated position deviation and causing a false alarm. This improves the accuracy of the first position offset and thereby improves the accuracy of the alarm.
[0105] In addition, the present application also provides a motion synchronization abnormality warning device, referring to Fig. 9 As shown, the motion synchronization abnormality warning device includes:
[0106] An acquisition module 10 is used to acquire a current position offset and a historical position offset of a motion axis, wherein the motion axis includes a first motion axis and a second motion axis that need motion synchronization, and the current position offset is used to indicate a position deviation between the first motion axis and the second motion axis in a current communication cycle;
[0107] The accumulation module 20 is used to determine the accumulated position offset according to the current position offset and the historical position offset;
[0108] The alarm module 30 is used to output motion synchronization abnormality alarm information if the accumulated position offset is greater than or equal to a preset threshold.
[0109] The acquisition module is further used for:
[0110] Obtain a first position offset of the first motion axis, and obtain a second position offset of the second motion axis;
[0111] A difference between the first position offset and the second position offset is determined, and the difference is used as a current position offset of the motion axis.
[0112] The motion synchronization abnormality early warning device further includes an offset determination module, and the offset determination module is used to:
[0113] Acquire a first position of a first motion axis at a current moment, and acquire a second position of the first motion axis at a previous moment;
[0114] A first position offset of the first motion axis is determined according to the first position and the second position.
[0115] The offset determination module is further used for:
[0116] Acquire a corresponding single-turn zero-crossing mark of the first motion axis, wherein the single-turn zero-crossing mark includes a first threshold and a second threshold, the first threshold is used to indicate that the first motion axis does not have a single-turn zero-crossing during the motion process, and the second threshold is used to indicate that the first motion axis has a single-turn zero-crossing during the motion process;
[0117] If the single-turn zero-crossing flag is a first threshold, a position difference between the first position and the second position is determined, and a first position offset of the first motion axis is determined according to the position difference.
[0118] The offset determination module is further used for:
[0119] If the movement direction of the first movement axis is consistent with the preset positive direction, determining the absolute value of the position difference, and taking the absolute value of the position difference as the first position offset of the first movement axis;
[0120] If the moving direction of the moving axis is inconsistent with the preset positive direction, the absolute negative value of the position difference is determined, and the absolute negative value of the position difference is used as the first position offset of the first moving axis.
[0121] The offset determination module is further used for:
[0122] If the single-circle zero-crossing flag is a second threshold, obtaining a single-circle distance corresponding to the first motion axis;
[0123] If the movement direction of the first movement axis is consistent with the preset positive direction, a first offset is obtained by subtracting the second position from the first position, a first sum of the first offset and a single-circuit distance is determined, and the first sum is used as a first position offset of the first movement axis;
[0124] If the movement direction of the first movement axis is inconsistent with the preset positive direction, a second offset is obtained by subtracting the first position from the second position, a second sum of the second offset and the single-circuit distance is determined, and the negative value of the second sum is used as the first position offset.
[0125] The motion synchronization abnormality warning device further includes an updating module, which is used to:
[0126] If the accumulated position offset is less than a preset threshold, updating the historical position offset of the motion axis with the accumulated position offset;
[0127] Based on the updated historical position offset, return to execute the step of obtaining the current position offset and the historical position offset of the motion axis.
[0128] In addition, an embodiment of the present application also proposes a motion synchronization abnormality warning device, which includes a memory, a processor, and a motion synchronization abnormality warning program stored in the memory and executable on the processor, and when the motion synchronization abnormality warning program is executed by the processor, the steps of the motion synchronization abnormality warning method as described above are implemented.
[0129] The specific implementation of the motion synchronization abnormality warning device of the present application is basically the same as each embodiment of the above-mentioned motion synchronization abnormality warning method, and will not be repeated here.
[0130] In addition, to achieve the above-mentioned purpose, the present application also provides a readable storage medium, on which a motion synchronization abnormality warning program is stored. When the motion synchronization abnormality warning program is executed by a processor, the steps of the motion synchronization abnormality warning method as described above are implemented.
[0131] The specific implementation of the readable storage medium of the present application is basically the same as each embodiment of the above-mentioned motion synchronization abnormality warning method, and will not be repeated here.
[0132] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0133] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0134] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the method described in each embodiment of the present application.
[0135] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A motion synchronization abnormality warning method, characterized in that: The motion synchronization abnormality early warning method comprises the following steps: Acquire a current position offset and a historical position offset of a motion axis, wherein the motion axis includes a first motion axis and a second motion axis that require motion synchronization, and the current position offset is used to indicate a position deviation between the first motion axis and the second motion axis in a current communication cycle; Determining a cumulative position offset according to the current position offset and the historical position offset; If the accumulated position offset is greater than or equal to a preset threshold, outputting motion synchronization abnormality alarm information; Before the step of obtaining the current position offset and the historical position offset of the motion axis, the method further includes: Acquire a first position of a first motion axis at a current moment, and acquire a second position of the first motion axis at a previous moment; Acquire a corresponding single-turn zero-crossing mark of the first motion axis, wherein the single-turn zero-crossing mark includes a first threshold and a second threshold, the first threshold is used to indicate that the first motion axis does not have a single-turn zero-crossing during the motion process, and the second threshold is used to indicate that the first motion axis has a single-turn zero-crossing during the motion process; If the single-turn zero-crossing indicator is a first threshold, determining a position difference between the first position and the second position; If the movement direction of the first movement axis is consistent with the preset positive direction, determining the absolute value of the position difference, and taking the absolute value of the position difference as the first position offset of the first movement axis; If the moving direction of the moving axis is inconsistent with the preset positive direction, determining the negative value of the absolute value of the position difference, and using the negative value of the absolute value of the position difference as the first position offset of the first moving axis; If the single-circle zero-crossing mark is a second threshold, obtaining a single-circle distance corresponding to the first motion axis; If the movement direction of the first movement axis is consistent with the preset positive direction, a first offset is obtained by subtracting the second position from the first position, a first sum of the first offset and a single-circuit distance is determined, and the first sum is used as a first position offset of the first movement axis; If the movement direction of the first movement axis is inconsistent with the preset positive direction, subtract the first position from the second position to obtain a second offset, determine a second sum of the second offset and the single-circuit distance, and use the negative value of the second sum as the first position offset; Obtaining a second position offset of a second motion axis; A difference between the first position offset and the second position offset is determined, and the difference is used as a current position offset of the motion axis.
2. The motion synchronization abnormality early warning method according to claim 1, characterized in that: After the step of determining the accumulated position offset according to the current position offset and the historical position offset, the method further comprises: If the accumulated position offset is less than a preset threshold, updating the historical position offset of the motion axis with the accumulated position offset; Based on the updated historical position offset, return to execute the step of obtaining the current position offset and the historical position offset of the motion axis.
3. A motion synchronization abnormality warning device, characterized in that: The motion synchronization abnormality early warning device comprises: An acquisition module, used for acquiring a current position offset and a historical position offset of a motion axis, wherein the motion axis includes a first motion axis and a second motion axis that need motion synchronization, and the current position offset is used for indicating a position deviation between the first motion axis and the second motion axis in a current communication cycle; An accumulation module, used for determining an accumulated position offset according to the current position offset and the historical position offset; An alarm module, configured to output motion synchronization abnormality alarm information if the accumulated position offset is greater than or equal to a preset threshold; The acquisition module is further used for: Acquire a first position of a first motion axis at a current moment, and acquire a second position of the first motion axis at a previous moment; Acquire a corresponding single-turn zero-crossing mark of the first motion axis, wherein the single-turn zero-crossing mark includes a first threshold and a second threshold, the first threshold is used to indicate that the first motion axis does not have a single-turn zero-crossing during the motion process, and the second threshold is used to indicate that the first motion axis has a single-turn zero-crossing during the motion process; If the single-turn zero-crossing indicator is a first threshold, determining a position difference between the first position and the second position; If the movement direction of the first movement axis is consistent with the preset positive direction, determining the absolute value of the position difference, and taking the absolute value of the position difference as the first position offset of the first movement axis; If the moving direction of the moving axis is inconsistent with the preset positive direction, determining the negative value of the absolute value of the position difference, and using the negative value of the absolute value of the position difference as the first position offset of the first moving axis; If the single-circle zero-crossing mark is a second threshold, obtaining a single-circle distance corresponding to the first motion axis; If the movement direction of the first movement axis is consistent with the preset positive direction, a first offset is obtained by subtracting the second position from the first position, a first sum of the first offset and a single-circuit distance is determined, and the first sum is used as a first position offset of the first movement axis; If the movement direction of the first movement axis is inconsistent with the preset positive direction, subtract the first position from the second position to obtain a second offset, determine a second sum of the second offset and the single-circuit distance, and use the negative value of the second sum as the first position offset; Obtaining a second position offset of a second motion axis; A difference between the first position offset and the second position offset is determined, and the difference is used as a current position offset of the motion axis.
4. A motion synchronization abnormality warning device, characterized in that: The motion synchronization abnormality warning device includes: a memory, a processor, and a motion synchronization abnormality warning program stored in the memory and executable on the processor. When the motion synchronization abnormality warning program is executed by the processor, the steps of the motion synchronization abnormality warning method as described in any one of claims 1 to 2 are implemented.
5. A readable storage medium, characterized in that: The readable storage medium stores a motion synchronization abnormality warning program, and when the motion synchronization abnormality warning program is executed by the processor, the steps of the motion synchronization abnormality warning method as described in any one of claims 1 to 2 are implemented.
