Encoder abnormality detection method, device, storage medium, controller and equipment

文档序号:6981 发布日期:2021-09-17 浏览:31次 中文

阅读说明:本技术 编码器异常检测方法、装置、存储介质、控制器及设备 (Encoder abnormality detection method, device, storage medium, controller and equipment ) 是由 柏倩 胡飞鹏 刘旭 雷俊松 赵航 于 2021-06-21 设计创作,主要内容包括:本发明提供一种编码器异常检测方法、装置、存储介质、控制器及设备,所述方法包括:当所述编码器所在的设备断电时,记录所述编码器当前的第一编码器值;当所述编码器所在的设备再次上电时,读取所述编码器当前的第二编码器值;判断读取的所述第二编码器值和记录的所述第一编码器值的差值的绝对值是否大于预设阈值;若判断所述第二编码器值和所述第一编码器值的差值的绝对值大于所述预设阈值,则确定所述编码器发生异常。本发明提供的方案能够避免因多圈编码器值异常引发安全问题。(The invention provides an encoder anomaly detection method, an encoder anomaly detection device, a storage medium, a controller and equipment, wherein the method comprises the following steps: when the equipment where the encoder is located is powered off, recording a current first encoder value of the encoder; when the equipment where the encoder is located is powered on again, reading a current second encoder value of the encoder; judging whether the absolute value of the difference value between the read second encoder value and the recorded first encoder value is larger than a preset threshold value or not; and if the absolute value of the difference value between the second encoder value and the first encoder value is judged to be larger than the preset threshold value, determining that the encoder is abnormal. The scheme provided by the invention can avoid the safety problem caused by abnormal values of the multi-turn encoder.)

1. An encoder anomaly detection method for use in a controller of a device in which the encoder is located, comprising:

when the equipment where the encoder is located is powered off, recording a current first encoder value of the encoder;

when the equipment where the encoder is located is powered on again, reading a current second encoder value of the encoder;

judging whether the absolute value of the difference value between the read second encoder value and the recorded first encoder value is larger than a preset threshold value or not;

and if the absolute value of the difference value between the second encoder value and the first encoder value is judged to be larger than the preset threshold value, determining that the encoder is abnormal.

2. The method of claim 1, further comprising:

if the encoder is determined to be abnormal, sending an encoder abnormity prompt to prompt the zero position encoder value of the encoder to be calibrated;

and/or the presence of a gas in the gas,

receiving a calibration command to calibrate a zero encoder value of the encoder if it is determined that the encoder is abnormal;

and if the calibration command is received, calibrating a zero encoder value of the encoder.

3. The method of claim 2, wherein calibrating the zero encoder value of the encoder comprises:

and when the calibration command is received, acquiring the encoder value currently uploaded by the servo driver as the calibrated zero encoder value.

4. The method according to any one of claims 1-3, further comprising:

when the equipment where the encoder is located is powered off, judging whether the abnormal shaft of the encoder value is calibrated or not before recording the current first encoder value of the encoder;

if the encoder value abnormal shaft is judged to be calibrated, recording a current first encoder value of the encoder;

and if the encoder value abnormal shaft is not calibrated, not recording the current first encoder value of the encoder.

5. The method of claim 4,

determining whether an abnormal axis of the encoder has been calibrated, comprising:

judging whether a preset abnormal zone bit is in a reset state or not; wherein the abnormal flag bit is set when the encoder abnormality is detected;

if the abnormal zone bit is in a reset state, determining that the abnormal shaft of the encoder is calibrated;

and if the abnormal flag bit is in a set state, determining that the abnormal shaft of the encoder is not calibrated.

6. The method of any of claims 1-5, wherein recording the encoder's current first encoder value comprises:

acquiring a current actual encoder value of the encoder, an encoder intermediate value of the encoder and a zero position encoder value of the encoder;

when the actual encoder value is smaller than the intermediate encoder value and the zero encoder value is larger than the intermediate encoder value, recording the current first encoder value of the encoder as the actual encoder value plus the total encoder digit and then minus the zero encoder value;

when the actual encoder value is greater than the encoder intermediate value and the zero encoder value is less than the encoder intermediate value, recording a current first encoder value of the encoder as: subtracting the zero encoder value from the actual encoder value by the total number of encoder bits;

when the actual encoder value and the zero encoder value are both greater than the encoder intermediate value or both less than the encoder intermediate value, recording a current first encoder value of the encoder as: the actual encoder value minus the zero encoder value.

7. An encoder abnormality detection apparatus used in a controller of a device in which the encoder is located, the apparatus comprising:

the recording unit is used for recording a current first encoder value of the encoder when the equipment where the encoder is located is powered off;

the reading unit is used for reading the current second encoder value of the encoder when the equipment where the encoder is located is powered on again;

a first judgment unit configured to judge whether an absolute value of a difference between the second encoder value read by the reading unit and the first encoder value recorded by the recording unit is greater than a preset threshold;

and the determining unit is used for determining that the encoder is abnormal if the first judging unit judges that the absolute value of the difference value between the second encoder value and the first encoder value is greater than the preset threshold value.

8. The apparatus of claim 7, further comprising:

the reminding unit is used for sending an encoder abnormity reminding to remind the zero position encoder value of the encoder to be calibrated if the determining unit determines that the encoder is abnormal;

and/or the presence of a gas in the gas,

a receiving unit, configured to receive a calibration command for calibrating a zero encoder value of the encoder if the determining unit determines that the encoder is abnormal;

and the calibration unit is used for calibrating the zero encoder value of the encoder if the receiving unit receives the calibration command.

9. The apparatus of claim 8, wherein the calibration unit calibrates the zero encoder value of the encoder, comprising:

and when the receiving unit receives the calibration command, acquiring the encoder value currently uploaded by the servo driver as the calibrated zero encoder value.

10. The apparatus of any one of claims 7-9, further comprising:

the second judging unit is used for judging whether the abnormal shaft of the encoder value is calibrated or not before the recording unit records the current first encoder value of the encoder when the equipment where the encoder is positioned is powered off;

the recording unit is further configured to: if the second judging unit judges that the encoder value abnormal shaft is calibrated, recording a current first encoder value of the encoder;

and if the second judging unit judges that the encoder value abnormal shaft is not calibrated, the current first encoder value of the encoder is not recorded.

11. The apparatus of claim 10,

the second determination unit that determines whether or not the abnormal axis of the encoder has been calibrated includes:

judging whether a preset abnormal zone bit is in a reset state or not; wherein the abnormal flag bit is set when the encoder abnormality is detected;

if the abnormal zone bit is in a reset state, determining that the abnormal shaft of the encoder is calibrated;

and if the abnormal flag bit is in a set state, determining that the abnormal shaft of the encoder is not calibrated.

12. The apparatus according to any one of claims 7-11, wherein the recording unit records a current first encoder value of the encoder, including:

acquiring a current actual encoder value of the encoder, an encoder intermediate value of the encoder and a zero position encoder value of the encoder;

when the actual encoder value is smaller than the intermediate encoder value and the zero encoder value is larger than the intermediate encoder value, recording the current first encoder value of the encoder as the actual encoder value plus the total encoder digit and then minus the zero encoder value;

when the actual encoder value is greater than the encoder intermediate value and the zero encoder value is less than the encoder intermediate value, recording a current first encoder value of the encoder as: subtracting the zero encoder value from the actual encoder value by the total number of encoder bits;

when the actual encoder value and the zero encoder value are both greater than the encoder intermediate value or both less than the encoder intermediate value, recording a current first encoder value of the encoder as: the actual encoder value minus the zero encoder value.

13. A storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.

14. A controller comprising a processor, a memory, and a computer program stored on the memory and operable on the processor, the processor when executing the program implementing the steps of the method of any of claims 1 to 6, or comprising the encoder anomaly detection apparatus of any of claims 7 to 12.

15. An apparatus, characterized in that the apparatus has a servo motor having an encoder; the apparatus, comprising: the controller of claim 14.

Technical Field

The present invention relates to the field of control, and in particular, to a method and an apparatus for detecting an encoder anomaly, a storage medium, a controller, and a device.

Background

With the increasing demand for manufacturing equipment in the fields of food, industry, consumer electronics, and the like, high speed and high precision have become essential requirements for high-end manufacturing equipment. At present, most high-end manufacturing equipment such as industrial robots, machine tools, position changers and other equipment can use servo motors as actuating mechanisms. The servo motor is mainly used in the occasions with higher requirements on position, speed and moment control accuracy. Like a common motor, an ac servo motor is also composed of a stator and a rotor. The rotor in the servo motor is a permanent magnet and rotates under the action of the magnetic field, meanwhile, an encoder of the motor feeds back a signal to the servo driver, and the servo driver compares a feedback value with a target value to adjust the rotation angle of the rotor.

An encoder carried by a servo motor used by most high-end equipment such as an industrial robot is an absolute encoder with a plurality of circles, a method for detecting the number of the circles of the plurality of circles mainly comprises a battery and a counting register, and the principle of the battery and the counting register is that the accumulation or decrement of the number of the circles when the encoder rotates is recorded and stored by utilizing a register additionally arranged in the encoder; the battery is used for ensuring that the number of turns can be accumulated and recorded continuously when the encoder is powered off.

Absolute encoder battery life time is limited, and unable accurate calculation battery life, therefore high-end equipment such as industrial robot can appear under the long-time condition of not using because of reasons such as battery power low excessively, lead to the multiloop value of record unusual, and the encoder value that acquires when electrifying the use once more is not actual encoder value, removes this equipment and can have the potential safety hazard.

Disclosure of Invention

The present invention is directed to overcome the drawbacks of the related art, and provides a method, an apparatus, a storage medium, a controller and a device for detecting an encoder anomaly, so as to solve the problem that an absolute encoder in the related art is abnormal in a multi-turn value due to low battery level and other reasons when the absolute encoder is not used for a long time.

One aspect of the present invention provides an encoder anomaly detection method for a controller of a device in which an encoder is located, where the method includes: when the equipment where the encoder is located is powered off, recording a current first encoder value of the encoder; when the equipment where the encoder is located is powered on again, reading a current second encoder value of the encoder; judging whether the absolute value of the difference value between the read second encoder value and the recorded first encoder value is larger than a preset threshold value or not; and if the absolute value of the difference value between the second encoder value and the first encoder value is judged to be larger than the preset threshold value, determining that the encoder is abnormal.

Optionally, the method further comprises: if the encoder is determined to be abnormal, sending an encoder abnormity prompt to prompt the zero position encoder value of the encoder to be calibrated; and/or, in the event that an anomaly is determined for the encoder, receiving a calibration command to calibrate a zero encoder value for the encoder; and if the calibration command is received, calibrating a zero encoder value of the encoder.

Optionally, calibrating a zero encoder value of the encoder comprises: and when the calibration command is received, acquiring the encoder value currently uploaded by the servo driver as the calibrated zero encoder value.

Optionally, the method further comprises: when the equipment where the encoder is located is powered off, judging whether the abnormal shaft of the encoder value is calibrated or not before recording the current first encoder value of the encoder; if the encoder value abnormal shaft is judged to be calibrated, recording a current first encoder value of the encoder; and if the encoder value abnormal shaft is not calibrated, not recording the current first encoder value of the encoder.

Optionally, the determining whether the abnormal axis of the encoder has been calibrated includes: judging whether a preset abnormal zone bit is in a reset state or not; wherein the abnormal flag bit is set when the encoder abnormality is detected; if the abnormal zone bit is in a reset state, determining that the abnormal shaft of the encoder is calibrated; and if the abnormal flag bit is in a set state, determining that the abnormal shaft of the encoder is not calibrated.

Optionally, recording a current first encoder value of the encoder comprises: acquiring a current actual encoder value of the encoder, an encoder intermediate value of the encoder and a zero position encoder value of the encoder; when the actual encoder value is smaller than the intermediate encoder value and the zero encoder value is larger than the intermediate encoder value, recording the current first encoder value of the encoder as the actual encoder value plus the total encoder digit and then minus the zero encoder value; when the actual encoder value is greater than the encoder intermediate value and the zero encoder value is less than the encoder intermediate value, recording a current first encoder value of the encoder as: subtracting the zero encoder value from the actual encoder value by the total number of encoder bits; when the actual encoder value and the zero encoder value are both greater than the encoder intermediate value or both less than the encoder intermediate value, recording a current first encoder value of the encoder as: the actual encoder value minus the zero encoder value.

Another aspect of the present invention provides an encoder abnormality detection apparatus for use in a controller of a device in which an encoder is located, the apparatus including: the recording unit is used for recording a current first encoder value of the encoder when the equipment where the encoder is located is powered off; the reading unit is used for reading the current second encoder value of the encoder when the equipment where the encoder is located is powered on again; a first judgment unit configured to judge whether an absolute value of a difference between the second encoder value read by the reading unit and the first encoder value recorded by the recording unit is greater than a preset threshold; and the determining unit is used for determining that the encoder is abnormal if the first judging unit judges that the absolute value of the difference value between the second encoder value and the first encoder value is greater than the preset threshold value.

Optionally, the method further comprises: the reminding unit is used for sending an encoder abnormity reminding to remind the zero position encoder value of the encoder to be calibrated if the determining unit determines that the encoder is abnormal; and/or, a receiving unit, configured to receive a calibration command for calibrating a zero encoder value of the encoder when the determining unit determines that the encoder is abnormal; and the calibration unit is used for calibrating the zero encoder value of the encoder if the receiving unit receives the calibration command.

Optionally, the calibration unit calibrates a zero encoder value of the encoder, and includes: and when the receiving unit receives the calibration command, acquiring the encoder value currently uploaded by the servo driver as the calibrated zero encoder value.

Optionally, the method further comprises: the second judging unit is used for judging whether the abnormal shaft of the encoder value is calibrated or not before the recording unit records the current first encoder value of the encoder when the equipment where the encoder is positioned is powered off; the recording unit is further configured to: if the second judging unit judges that the encoder value abnormal shaft is calibrated, recording a current first encoder value of the encoder; and if the second judging unit judges that the encoder value abnormal shaft is not calibrated, the current first encoder value of the encoder is not recorded.

Optionally, the second determining unit, determining whether the abnormal axis of the encoder has been calibrated, includes: judging whether a preset abnormal zone bit is in a reset state or not; wherein the abnormal flag bit is set when the encoder abnormality is detected; if the abnormal zone bit is in a reset state, determining that the abnormal shaft of the encoder is calibrated; and if the abnormal flag bit is in a set state, determining that the abnormal shaft of the encoder is not calibrated.

Optionally, the recording unit records a current first encoder value of the encoder, and includes: acquiring a current actual encoder value of the encoder, an encoder intermediate value of the encoder and a zero position encoder value of the encoder; when the actual encoder value is smaller than the intermediate encoder value and the zero encoder value is larger than the intermediate encoder value, recording the current first encoder value of the encoder as the actual encoder value plus the total encoder digit and then minus the zero encoder value; when the actual encoder value is greater than the encoder intermediate value and the zero encoder value is less than the encoder intermediate value, recording a current first encoder value of the encoder as: subtracting the zero encoder value from the actual encoder value by the total number of encoder bits; when the actual encoder value and the zero encoder value are both greater than the encoder intermediate value or both less than the encoder intermediate value, recording a current first encoder value of the encoder as: the actual encoder value minus the zero encoder value.

A further aspect of the invention provides a storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of any of the methods described above.

A further aspect of the invention provides a controller comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of any of the methods described above when executing the program. The equipment where the controller is located is provided with a servo motor, and the servo motor is provided with an encoder.

In a further aspect, the present invention provides a controller comprising an encoder anomaly detection apparatus as described in any one of the preceding. The equipment where the controller is located is provided with a servo motor, and the servo motor is provided with an encoder.

In yet another aspect, the present invention provides an apparatus having a servo motor with an encoder; the apparatus comprises any one of the controllers described above.

According to the technical scheme of the invention, the encoder value is recorded by the controller of the equipment where the encoder is located, whether the encoder value is abnormal or not can be detected after the battery of the encoder is powered off, and if the encoder value is abnormal, a user is reminded to recalibrate the zero point, so that the safety problem caused by abnormal values of a plurality of circles of encoders is avoided. The problem of the encoder cause many rings of abnormalities because of reasons such as battery under-voltage is solved. The problem that safety is affected due to the fact that collision and the like can be caused after the problem of multi-circle abnormity of manufacturing equipment such as an industrial robot is solved.

Drawings

The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:

FIG. 1 is a method diagram of an embodiment of an encoder anomaly detection method provided by the present invention;

FIG. 2 is a schematic flow chart of recording encoder values according to an embodiment of the present invention;

FIG. 3 is a method diagram of another embodiment of an encoder anomaly detection method provided by the present invention;

FIG. 4 is a method diagram of another embodiment of an encoder anomaly detection method provided by the present invention;

FIG. 5 is a method diagram illustrating an embodiment of an encoder anomaly detection method according to the present invention;

FIG. 6 is a block diagram of an embodiment of an encoder anomaly detection apparatus according to the present invention;

FIG. 7 is a block diagram of another embodiment of an encoder anomaly detection apparatus according to the present invention;

fig. 8 is a block diagram of an encoder abnormality detection apparatus according to still another embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the specific embodiments of the present invention and the accompanying drawings. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.

The invention provides an encoder anomaly detection method. The method may be used in a controller of a device in which the encoder is located. The equipment is provided with a servo motor, and the encoder is an encoder carried by the servo motor. The device may in particular be a manufacturing device, in particular a manufacturing device capable of process automation, intelligence, such as an industrial robot, having a servomotor with an encoder. For example, it may be an industrial robot used in welding, handling, palletizing, etc. The encoder anomaly detection method can be particularly used in controllers of manufacturing equipment.

Fig. 1 is a schematic method diagram of an embodiment of an encoder anomaly detection method provided by the present invention.

As shown in fig. 1, according to an embodiment of the present invention, the encoder abnormality detecting method includes at least step S110, step S120, step S130, and step S140.

And step S110, when the equipment where the encoder is located is powered off, recording the current first encoder value of the encoder.

And step S120, when the equipment where the encoder is located is powered on again, reading the current second encoder value of the encoder.

For example, due to the zero crossing problem of the encoder value, when the manipulator is powered off, the encoder is at the zero boundary position, and when the manipulator is powered on again, the zero crossing of the encoder multi-turn value may be caused due to other factors such as jitter. In this case, even if the encoder multi-turn value is not abnormal, the difference from the last power-off is larger than the threshold value, and thus a false alarm occurs.

To prevent this, the recorded encoder value does not directly use the actual value of the encoder, and the current actual encoder value (actdrive), the intermediate encoder value (middle) of the encoder, and the zero-bit encoder value (homeoffset) of the encoder are obtained, and recorded according to the following conditions, and the schematic flow chart of recording the encoder value shown in fig. 2 can be combined:

(1) and when the actual encoder value is smaller than the intermediate encoder value and the zero encoder value is larger than the intermediate encoder value, recording the current first encoder value of the encoder as the actual encoder value plus the total encoder digit and then subtracting the zero encoder value.

That is, when the zero point position is larger than the encoder intermediate value (HomeOffsets)>midle), and the actual encoder value is less than the encoder intermediate value (ActDrives)<midle), the encoder value calculation method is: drive +2 midle-homeoffset; wherein, the ActDrives is an actual encoder value of the servo feedback; 2 × middle is the total value of the encoder for a single turn plus a plurality of turns, i.e. the total number of bits of the encoder, e.g. when the single turn is 20 bits and the plurality of turns is 12 bits, the middle value is 231(ii) a Homeoffset is the set zero encoder value.

(2) When the actual encoder value is greater than the encoder intermediate value and the zero encoder value is less than the encoder intermediate value, recording a current first encoder value of the encoder as: the actual encoder value minus the total number of encoder bits minus the zero encoder value.

That is, when the zero point position is smaller than the encoder intermediate value (HomeOffsets < middle), and the actual encoder value is larger than the encoder intermediate value (ActDrives > middle), the encoder value calculation method is: drive-2 midle-homeoffset; wherein, the ActDrives is an actual encoder value of the servo feedback; 2, middle is the total value of a single circle and multiple circles of the encoder, namely the total number of digits of the encoder; homeoffset is the set zero encoder value.

(3) When the actual encoder value and the zero-bit encoder value are both greater than the encoder intermediate value (i.e., (ActDrives > middle) and (HomeOffsets > middle)), or the actual encoder value and the zero-bit encoder value are both less than the encoder intermediate value (i.e., (ActDrives < middle) and (HomeOffsets < middle)), recording the encoder's current first encoder value as: the actual encoder value minus the zero encoder value.

That is, when the actual encoder value and the null encoder value are both greater than the encoder intermediate value or both less than the encoder intermediate value, the encoder value calculation method is: ActDrive-HomeOffsets. Wherein, the ActDrives is an actual encoder value of the servo feedback; homeoffset is the set zero encoder value.

The device where the encoder is located may specifically be a manufacturing device, and may specifically be a manufacturing device capable of implementing process automation and intelligence.

Specifically, whether the device in which the encoder is located is powered off can be determined by monitoring the power-off detection signal. For example, a controller of the device has a power module, a power-off detection mechanism is arranged in a controller system, when a user performs power-off processing, the power module of the controller sends a power-off detection signal, and the power-off detection signal is judged in a program to judge whether the device is powered off or not.

For example, once a device such as an industrial robot is powered off, a current first encoder value of an encoder is recorded, and a current second encoder value of the encoder is read when the device is powered on again.

Step S130, determining whether an absolute value of a difference between the read second encoder value and the recorded first encoder value is greater than a preset threshold.

Step S140, if the absolute value of the difference between the second encoder value and the first encoder value is greater than the preset threshold, it is determined that the encoder is abnormal.

Specifically, the second encoder value is compared with the first encoder value, and if the absolute value of the difference between the second encoder value and the first encoder value is greater than a preset threshold, it is determined that the encoder value is abnormal, that is, the encoder is determined to be abnormal.

Further, if the encoder is determined to be abnormal, an encoder abnormity prompt is sent out to prompt the zero position encoder value of the encoder to be calibrated. Specifically, if it is determined that the encoder is abnormal, an alarm is given to prompt that a zero encoder value of the encoder needs to be recalibrated, and the zero encoder value is used for calculating an actual angle value, namely an angle value relative to a zero point. For example, an alarm code is uploaded to alert the user that the encoder value is abnormal and that the zero point needs to be recalibrated.

Fig. 3 is a schematic method diagram of another embodiment of an encoder anomaly detection method provided by the present invention. As shown in fig. 3, according to another embodiment of the present invention, the encoder abnormality detecting method further includes step S150 and step S160.

Step S150, receiving a calibration command for calibrating a zero encoder value of the encoder when it is determined that the encoder is abnormal.

Step S160, if the calibration command is received, calibrating a zero encoder value of the encoder.

For example, when a user performs calibration on a robot, the user moves an axis to be calibrated to a position near a zero point of the robot, then clicks a calibration button on a robot demonstrator, and a calibration command is sent to a controller by the robot demonstrator.

Specifically, after the calibration command is received, the zero encoder value used for calculating the actual angle value (the angle value of each axis of the robot relative to zero, each axis of the robot has a zero position, and the change of the angle value can occur when a user moves in the positive and negative directions through the demonstrator) in the controller program is updated, and the updated zero encoder value is recorded. In one embodiment, when the calibration command is received, the encoder value currently uploaded by the servo driver is obtained as the calibrated zero encoder value. More specifically, when a calibration operation occurs, the controller assigns the real-time encoder values uploaded by the servo drive directly to the program interface for calculating the actual angle values of the robot as zero encoder values. For example, the controller writes the real-time encoder values uploaded by the servo drive as zero encoder values to the system file, which is recorded in this manner.

Updating the zero encoder value used for calculating the actual angle value in the controller program, so that the updated zero encoder value can be directly used in the subsequent program, and the robot does not need to be restarted after zero calibration; the updated (calibrated) zero encoder value is then recorded, facilitating the reading of the most recently calibrated zero encoder value upon initialization upon power-up again after power-down.

Fig. 4 is a schematic method diagram of an encoder anomaly detection method according to another embodiment of the present invention. As shown in fig. 4, according to still another embodiment of the present invention, the encoder abnormality detecting method further includes step S102, step S104, and step S106.

And S102, when the equipment where the encoder is located is powered off, judging whether the abnormal shaft of the encoder value is calibrated or not before recording the current first encoder value of the encoder.

And step S104, if the encoder value abnormal shaft is judged to be calibrated, recording the current first encoder value of the encoder.

And step S106, if the encoder value abnormal shaft is judged not to be calibrated, the current first encoder value of the encoder is not recorded. Judging whether the absolute value of the difference value between the read second encoder value and a third encoder value of the encoder recorded when the equipment where the encoder is located is powered off last time is larger than a preset threshold value or not; and if the absolute value of the difference value between the second encoder value and the third encoder value is judged to be larger than the preset threshold value, determining that the encoder is abnormal.

Specifically, the encoder value abnormal axis is an axis in which the encoder value is abnormal, and the maximum number of abnormal axes depends on which type of robot, for example, a six-axis robot, and there may be 6 abnormal axes at the maximum. In order to prevent the user from powering off and restarting when the encoder is abnormal and is not calibrated, a mechanism for judging whether the encoder value abnormal shaft is detected is arranged. If the encoder value abnormal shaft calibration is not carried out, the encoder value cannot be recorded during the current power failure, and the encoder value read during the power failure and the encoder value recorded during the last power failure are still compared during the power failure again, namely, the encoder value recorded during the last power failure of the encoder. If the encoder value abnormal axis calibration is performed, the encoder value is recorded when the power is cut off again and the encoder value recorded when the power is cut off last time is covered.

That is, a first encoder value is recorded when the power is off (the first encoder value can be stored in a power-down mode), a second encoder value is recorded when the power is on again (the second encoder value is not stored in a power-down mode), and at the moment, if the abnormity is detected but the calibration is not carried out, the power is off again and the encoder value is not recorded; after the abnormity occurs, the user calibrates, the power is cut off to record the encoder value, and the previously recorded first encoder value is covered; if the abnormity is not detected, the encoder value is also recorded when the power is cut off, and the previously recorded first encoder value is covered; that is, the encoder value is recorded without exception, and the encoder value is not recorded with exception. When the power is turned on again, the real-time encoder value (i.e., the second encoder value) is recorded, and the second encoder value is compared with the first encoder value for anomaly detection, and so on.

The abnormal axis, which is not calibrated, does not record the encoder value when the device is powered off. Theoretically, if no anomaly occurs, the encoder values should be the same when power is turned off and when power is turned on again. If the encoder value is a random number when the abnormal encoder shaft is electrified, the difference value of the encoder value is particularly large compared with the encoder value (normal value) recorded when the power is cut off last time, if the calibration is not carried out, the normal value is kept, the comparison is still the normal value when the power is electrified for the second time, and the difference value is still particularly large so as to give an alarm again.

In an embodiment, the determining whether the encoder value abnormal axis has been calibrated may specifically include: judging whether a preset abnormal zone bit is in a reset state or not; wherein the abnormal flag bit is set when the encoder abnormality is detected; if the abnormal zone bit is in a reset state, determining that the abnormal shaft of the encoder is calibrated; and if the abnormal flag bit is in a set state, determining that the abnormal shaft of the encoder is not calibrated.

Specifically, an abnormal flag bit is established for each abnormal shaft, and if the encoder is detected to be abnormal, the abnormal flag bit is set, and the abnormal flag bit is reset only when the abnormal shaft is calibrated. When the equipment where the encoder is located is powered off, the encoder value before the power off is read firstly, then whether the abnormal zone bit is in a reset state or not is judged, only when the abnormal zone bit is in the reset state, the encoder value recorded before is abandoned, and the real-time encoder value, namely the current first encoder value, is recorded after the abnormal shaft of the encoder value is determined to be calibrated. If the abnormal flag bit is judged to be in a set state, representing that the user does not calibrate the abnormal shaft, recording the previous encoder value and not recording the real-time encoder value. Therefore, when the power is supplied again, the abnormal axis which is not calibrated can still be alarmed to prompt the user to pay attention to zero calibration. Wherein the calibration of the abnormal axis is performed when the encoder is detected to be abnormal.

That is to say, when the encoder is powered on to perform the encoder abnormality detection, if the encoder is detected to be abnormal, the abnormal flag bit is set, the abnormal flag bit is reset only after all the abnormal shafts are calibrated, when the power is off, the abnormal flag bit is judged before the current encoder value (first encoder value) is recorded, and when the abnormal flag bit is in a reset state, the abnormal shaft of the encoder is determined to be calibrated, and the current first encoder value is recorded. And if the abnormal flag bit is in a set state, determining that the abnormal shaft of the encoder is not calibrated, and recording a third encoder value of the encoder recorded when the equipment where the encoder is located is powered off under the condition that the encoder is determined to be abnormal last time. That is, if the shaft with an abnormal encoder value is not calibrated (by the user), the encoder value is not recorded during the current power-off, and the encoder value recorded during the current power-off is compared during the next power-on, and the alarm is given again.

For clearly explaining the technical solution of the present invention, the following describes an execution flow of the encoder anomaly detection method provided by the present invention with a specific embodiment.

FIG. 5 is a method diagram of an encoder anomaly detection method according to an embodiment of the present invention. As shown in fig. 5, taking a robot as an example:

when the robot is powered off, recording a current encoder value, and when the robot is powered on again, acquiring the current encoder value and reading the encoder value recorded when the robot is powered off last time; comparing the two encoder values, judging whether the difference value between the current encoder value and the encoder value recorded in the last power-off process is larger than a preset threshold value, and if not, normally operating; if yes, sequentially alarming the abnormal shaft to remind a user that the encoder value is abnormal and the zero point needs to be calibrated again; if the controller receives a calibration command, firstly updating a zero position encoder value used for calculating an actual angle value in a controller program, so that the updated zero position encoder value can be directly used in a subsequent program, and the robot does not need to be restarted after zero position calibration; and then recording the updated zero-position encoder value, so that the latest calibrated zero-position encoder value can be conveniently read when the power is powered on again for initialization after power failure. Recoding the encoder value for comparison when the power is cut off; and when the abnormal and uncalibrated shaft is powered off, the real-time encoder value is not recorded, and the alarm is still given when the shaft is powered on again.

The invention also provides an encoder anomaly detection device. The apparatus may be used in a controller of a device in which the encoder is located. The equipment is provided with a servo motor, and the encoder is an encoder carried by the servo motor. The equipment specifically can be manufacturing equipment, manufacturing equipment specifically can be can realize process automation, intelligent manufacturing equipment, for example industrial robot, for example specifically can be for the industrial robot that is used for scenes such as welding, transport, pile up neatly. The encoder anomaly detection method can be particularly used in controllers of manufacturing equipment.

Fig. 6 is a block diagram of an encoder abnormality detection apparatus according to an embodiment of the present invention. As shown in fig. 6, the encoder abnormality detection apparatus 100 includes a recording unit 110, a reading unit 120, a first judgment unit 130, and a determination unit 140.

The recording unit 110 is configured to record a current first encoder value of the encoder when the apparatus in which the encoder is located is powered off. The reading unit 120 is configured to read a current second encoder value of the encoder when the device where the encoder is located is powered on again.

For example, due to the zero crossing problem of the encoder value, when the manipulator is powered off, the encoder is at the zero boundary position, and when the manipulator is powered on again, the zero crossing of the encoder multi-turn value may be caused due to other factors such as jitter. In this case, even if the encoder multi-turn value is not abnormal, the difference from the last power-off is larger than the threshold value, and thus a false alarm occurs.

To prevent this, the recorded encoder value does not directly use the actual value of the encoder, and obtains the current actual encoder value (actdrive), the intermediate encoder value (middle) of the encoder, and the zero-bit encoder value (homeoffset) of the encoder, and the recording unit 110 records according to the following situations, and may be combined with the flow chart of recording the encoder value shown in fig. 2:

(1) and when the actual encoder value is smaller than the intermediate encoder value and the zero encoder value is larger than the intermediate encoder value, recording the current first encoder value of the encoder as the actual encoder value plus the total encoder digit and then subtracting the zero encoder value.

That is, when the zero point position is larger than the encoder intermediate value (HomeOffsets)>midle), and the actual encoder value is less than the encoder intermediate value (ActDrives)<midle), the encoder value calculation method is: drive +2 midle-homeoffset; wherein, the ActDrives is an actual encoder value of the servo feedback; 2 × middle is the total value of the encoder for a single turn plus a plurality of turns, i.e. the total number of bits of the encoder, e.g. when the single turn is 20 bits and the plurality of turns is 12 bits, the middle value is 231(ii) a Homeoffset is the set zero encoder value.

(2) When the actual encoder value is greater than the encoder intermediate value and the zero encoder value is less than the encoder intermediate value, recording a current first encoder value of the encoder as: the actual encoder value minus the total number of encoder bits minus the zero encoder value.

That is, when the zero point position is smaller than the encoder intermediate value (HomeOffsets < middle), and the actual encoder value is larger than the encoder intermediate value (ActDrives > middle), the encoder value calculation method is: ActDrives-2 midles-HomeOffsets; wherein, the ActDrives is an actual encoder value of the servo feedback; 2 middle is the total value of a single circle and multiple circles of the encoder; homeoffset is the set zero encoder value.

(3) When the actual encoder value and the zero-bit encoder value are both greater than the encoder intermediate value (i.e., (ActDrives > middle) and (HomeOffsets > middle)), or the actual encoder value and the zero-bit encoder value are both less than the encoder intermediate value (i.e., (ActDrives < middle) and (HomeOffsets < middle)), recording the encoder's current first encoder value as: the actual encoder value minus the zero encoder value.

That is, when the actual encoder value and the null encoder value are both greater than the encoder intermediate value or both less than the encoder intermediate value, the encoder value calculation method is: ActDrive-HomeOffsets. Wherein, the ActDrives is an actual encoder value of the servo feedback; homeoffset is the set zero encoder value.

The device where the encoder is located may specifically be a manufacturing device, and may specifically be a manufacturing device capable of implementing process automation and intelligence.

Specifically, whether the device in which the encoder is located is powered off can be determined by monitoring the power-off detection signal. For example, a controller of the device has a power module, a power-off detection mechanism is arranged in a controller system, when a user performs power-off processing, the power module of the controller sends a power-off detection signal, and the power-off detection signal is judged in a program to judge whether the device is powered off or not.

For example, once a device such as an industrial robot is powered off, a current first encoder value of an encoder is recorded, and a current second encoder value of the encoder is read when the device is powered on again.

The first determining unit 130 is configured to determine whether an absolute value of a difference between the second encoder value read by the reading unit 120 and the first encoder value recorded by the recording unit is greater than a preset threshold.

The determining unit 140 is configured to determine that the encoder is abnormal if the first determining unit 130 determines that the absolute value of the difference between the second encoder value and the first encoder value is greater than the preset threshold.

Specifically, the second encoder value is compared with the first encoder value, and if the absolute value of the difference between the second encoder value and the first encoder value is greater than a preset threshold, it is determined that the encoder value is abnormal, that is, the encoder is determined to be abnormal.

Further, the apparatus 100 further comprises: and a reminding unit (not shown) for sending an encoder abnormality reminder to remind the zero-position encoder value of the encoder to be calibrated if the determining unit determines that the encoder is abnormal. Specifically, if it is determined that the encoder is abnormal, an alarm is given to prompt that a zero encoder value of the encoder needs to be recalibrated, and the zero encoder value is used for calculating an actual angle value, namely an angle value relative to a zero point. For example, an alarm code is uploaded to alert the user that the encoder value is abnormal and that the zero point needs to be recalibrated.

Fig. 7 is a block diagram of another embodiment of the encoder abnormality detection apparatus according to the present invention. As shown in fig. 7, the encoder abnormality detection apparatus 100 further includes a receiving unit 150 and a calibration unit 160.

The receiving unit 150 is configured to receive a calibration command for calibrating a zero encoder value of the encoder if the determining unit determines that the encoder is abnormal.

For example, when a user performs calibration on a robot, the user moves an axis to be calibrated to a position near a zero point of the robot, then clicks a calibration button on a robot demonstrator, and a calibration command is sent to a controller by the robot demonstrator.

The calibration unit 160 is configured to calibrate a zero encoder value of the encoder if the receiving unit receives the calibration command.

Specifically, after the receiving unit 150 receives the calibration command, the calibration unit 160 updates the zero encoder value used for calculating the actual angle value (the angle value of each axis of the robot relative to zero, each axis of the robot has a zero position, and the change of the angle value occurs when the user moves in the positive and negative directions through the teach pendant) in the controller program, and records the updated zero encoder value. In one embodiment, when the receiving unit 150 receives the calibration command, the calibration unit 160 obtains the encoder value currently uploaded by the servo driver as the calibrated null encoder value. More specifically, when a calibration operation occurs, the controller assigns the real-time encoder values uploaded by the servo drive directly to the program interface for calculating the actual angle values of the robot as zero encoder values. For example, the controller writes the real-time encoder values uploaded by the servo drive as zero encoder values to the system file, which is recorded in this manner.

Updating the zero encoder value used for calculating the actual angle value in the controller program, so that the updated zero encoder value can be directly used in the subsequent program, and the robot does not need to be restarted after zero calibration; the updated (calibrated) zero encoder value is then recorded, facilitating the reading of the most recently calibrated zero encoder value upon initialization upon power-up again after power-down.

Fig. 8 is a block diagram of an encoder abnormality detection apparatus according to still another embodiment of the present invention. As shown in fig. 8, according to still another embodiment of the present invention, the encoder abnormality detecting apparatus 100 further includes a second judging unit 102.

The second judging unit 102 is configured to, when the apparatus where the encoder is located is powered off, judge whether an encoder value abnormal axis has been calibrated before the recording unit records the current first encoder value of the encoder; the recording unit 110 is further configured to: if the second determining unit 102 determines that the encoder value abnormal axis has been calibrated, recording a current first encoder value of the encoder; if the second determining unit 102 determines that the encoder value abnormal axis is not calibrated, the current first encoder value of the encoder is not recorded. The first judging unit 130 judges whether an absolute value of a difference between the read second encoder value and a third encoder value of the encoder recorded when the device in which the encoder is located is powered off last time is greater than a preset threshold; and if the absolute value of the difference value between the second encoder value and the third encoder value is judged to be larger than the preset threshold value, determining that the encoder is abnormal.

Specifically, the encoder value abnormal axis is an axis in which the encoder value is abnormal, and the maximum number of abnormal axes depends on which type of robot, for example, a six-axis robot, and there may be 6 abnormal axes at the maximum. In order to prevent the user from powering off and restarting when the encoder is abnormal and is not calibrated, a mechanism for judging whether the encoder value abnormal shaft is detected is arranged. If the encoder value abnormal shaft calibration is not carried out, the encoder value cannot be recorded during the current power failure, and the encoder value read during the power failure and the encoder value recorded during the last power failure are still compared during the power failure again, namely, the encoder value recorded during the last power failure of the encoder. If the encoder value abnormal axis calibration is performed, the encoder value is recorded when the power is cut off again and the encoder value recorded when the power is cut off last time is covered.

That is, a first encoder value is recorded when the power is off (the first encoder value can be stored in a power-down mode), a second encoder value is recorded when the power is on again (the second encoder value is not stored in a power-down mode), and at the moment, if the abnormity is detected but the calibration is not carried out, the power is off again and the encoder value is not recorded; after the abnormity occurs, the user calibrates, the power is cut off to record the encoder value, and the previously recorded first encoder value is covered; if the abnormity is not detected, the encoder value is also recorded when the power is cut off, and the previously recorded first encoder value is covered; that is, the encoder value is recorded without exception, and the encoder value is not recorded with exception. When the power is turned on again, the real-time encoder value (i.e., the second encoder value) is recorded, and the second encoder value is compared with the first encoder value for anomaly detection, and so on.

The abnormal axis, which is not calibrated, does not record the encoder value when the device is powered off. Theoretically, if no anomaly occurs, the encoder values should be the same when power is turned off and when power is turned on again. If the encoder value is a random number when the abnormal encoder shaft is electrified, the difference value of the encoder value is particularly large compared with the encoder value (normal value) recorded when the power is cut off last time, if the calibration is not carried out, the normal value is kept, the comparison is still the normal value when the power is electrified for the second time, and the difference value is still particularly large so as to give an alarm again.

In one embodiment, the determining whether the encoder value abnormal axis has been calibrated by the second determining unit 102 specifically includes: judging whether a preset abnormal zone bit is in a reset state or not; wherein the abnormal flag bit is set when the encoder abnormality is detected; if the abnormal zone bit is in a reset state, determining that the abnormal shaft of the encoder is calibrated; and if the abnormal flag bit is in a set state, determining that the abnormal shaft of the encoder is not calibrated.

Specifically, an abnormal flag bit is established for each abnormal shaft, and if the encoder is detected to be abnormal, the abnormal flag bit is set, and the abnormal flag bit is reset only when the abnormal shaft is calibrated. When the equipment where the encoder is located is powered off, the encoder value before the power off is read firstly, then whether the abnormal zone bit is in a reset state or not is judged, only when the abnormal zone bit is in the reset state, the encoder value recorded before is abandoned, and the real-time encoder value, namely the current first encoder value, is recorded after the abnormal shaft of the encoder value is determined to be calibrated. If the abnormal flag bit is judged to be in a set state, representing that the user does not calibrate the abnormal shaft, recording the previous encoder value and not recording the real-time encoder value. Therefore, when the power is supplied again, the abnormal axis which is not calibrated can still be alarmed to prompt the user to pay attention to zero calibration. Wherein the calibration of the abnormal axis is performed when the encoder is detected to be abnormal.

That is to say, when the encoder is powered on to perform the encoder abnormality detection, if the encoder is detected to be abnormal, the abnormal flag bit is set, the abnormal flag bit is reset only after all the abnormal shafts are calibrated, when the power is off, the abnormal flag bit is judged before the current encoder value (first encoder value) is recorded, and when the abnormal flag bit is in a reset state, the abnormal shaft of the encoder is determined to be calibrated, and the current first encoder value is recorded. And if the abnormal flag bit is in a set state, determining that the abnormal shaft of the encoder is not calibrated, and recording a third encoder value of the encoder recorded when the equipment where the encoder is located is powered off under the condition that the encoder is determined to be abnormal last time. That is, if the shaft with an abnormal encoder value is not calibrated (by the user), the encoder value is not recorded during the current power-off, and the encoder value recorded during the current power-off is compared during the next power-on, and the alarm is given again.

The present invention also provides a storage medium corresponding to the encoder anomaly detection method, on which a computer program is stored, which when executed by a processor implements the steps of any of the methods described above.

The invention also provides a controller corresponding to the encoder abnormality detection method, which comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps of any one of the methods. The equipment where the controller is located is provided with a servo motor, and the servo motor is provided with an encoder.

The invention also provides a controller corresponding to the encoder abnormality detection device, which comprises the encoder abnormality detection device. The equipment where the controller is located is provided with a servo motor, and the servo motor is provided with an encoder.

The invention also provides a device corresponding to the controller, wherein the device is provided with a servo motor which is provided with an encoder; the apparatus comprises any one of the controllers described above.

Therefore, according to the scheme provided by the invention, the encoder value is recorded through the controller of the equipment where the encoder is located, whether the encoder value is abnormal or not can be detected after the battery of the encoder is powered off, and if the encoder value is abnormal, the user is reminded to recalibrate the zero point when the user moves the equipment again, so that the safety problem caused by abnormal values of multiple circles of encoders is avoided. The problem of the encoder cause many rings of abnormalities because of reasons such as battery under-voltage is solved. The problem that safety is affected due to the fact that collision and the like can be caused after the problem of multi-circle abnormity of manufacturing equipment such as an industrial robot is solved.

The functions described herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Other examples and implementations are within the scope and spirit of the invention and the following claims. For example, due to the nature of software, the functions described above may be implemented using software executed by a processor, hardware, firmware, hardwired, or a combination of any of these. In addition, each functional unit may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.

In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.

The units described as separate parts may or may not be physically separate, and the parts serving as the control device may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.

The above description is only an example of the present invention, and is not intended to limit the present invention, and it is obvious to those skilled in the art that various modifications and variations can be made in the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

22页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:智能压力平衡控制系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类