Robot reference position extension method and verification method
By expanding the reference position using position registers and teach pendants, and combining it with the tolerance verification method of the Karel language, the problem of insufficient reference position for ordinary users in complex process scenarios is solved, thereby improving robot flexibility and reducing hardware costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HARBIN SHIMADA BIG BIRD IND
- Filing Date
- 2025-05-13
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies lack a simple and effective mechanism that allows ordinary users to easily add or manage more industrial robot reference positions. In particular, in complex process scenarios, 10 preset reference positions are insufficient to meet the needs of multi-station collaboration.
The reference position is stored using a position register. The number of reference positions can be expanded through a graphical user interface of a teach pendant and simple keyboard operation. The tolerance verification method of joint angle is implemented through the Karel language. The absolute value of the deviation between the current joint coordinate position and the target joint coordinate position is compared axis by axis. The status flag control is performed using numerical registers and digital output ports.
It enables flexible expansion of user-defined reference positions, enhances the flexibility and adaptability of robot operation, reduces hardware costs, is suitable for FANUC robots, and supports the management and verification of 300 reference positions.
Smart Images

Figure CN120422273B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial robot control technology, and more particularly to the extension of the reference position of industrial robots. Background Technology
[0002] Industrial robots play a vital role in modern manufacturing, especially in production processes that require high repetition and precision. In industrial robot systems, the reference position function is a core element for achieving precise motion control.
[0003] FANUC, one of the world's leading manufacturers of industrial robots, has products widely used in various fields such as automotive manufacturing and electronic assembly. However, despite the excellent performance of FANUC robots, limitations still exist in certain application scenarios, particularly regarding the setting of reference positions.
[0004] Currently, FANUC industrial robots provide 10 preset reference positions by default. These positions are primarily used to ensure that the robot can safely move to the designated location without colliding with the surrounding environment when performing tasks. However, in complex production environments, only 10 reference positions are often insufficient to meet actual needs (e.g., more than 10 reference positions make it impossible to transmit signals to the PLC). In complex process scenarios such as automotive welding and electronic assembly, 10 reference positions cannot meet the needs of multi-station collaboration. Providing only 10 preset reference positions limits users' ability to further improve the flexibility and efficiency of robot operation. The reasons for this limitation may include simplification considerations in system design to reduce user interface complexity and configuration difficulty, as well as resource optimization purposes, such as considerations of memory usage and processing power.
[0005] While the number of reference locations can be increased by modifying system parameters, this typically requires advanced programming skills and can increase system complexity and maintenance costs. Furthermore, using third-party extension modules may present compatibility issues, potentially triggering system protection mechanisms and leading to emergency stops.
[0006] In summary, existing solutions lack a simple and effective mechanism that allows ordinary users to easily add or manage more reference locations. Therefore, solving this problem presents a considerable technical barrier for most operators without a strong programming background. Summary of the Invention
[0007] This invention proposes a robot reference position extension method and a verification method, which solves the problem of the lack of a simple and effective mechanism in the existing technology, allowing most operators without a deep programming background to easily add or manage more reference positions.
[0008] The robot reference position extension method of the present invention includes the following steps:
[0009] A position register is used to store the reference position. One position register stores one reference position. The reference position is stored in the position register in the form of the target joint coordinate position, thereby realizing the expansion of the reference position.
[0010] This invention also proposes a robot reference position verification method, which is used to verify whether the current joint position of the robot is within the reference position of the robot reference position extension method described in the above embodiments; the method includes the following steps:
[0011] Step S1: Obtain the position register number, value register number, and digital output port number, and verify their validity range;
[0012] Step S2: Read the robot's current joint coordinate position; obtain the reference position stored in the corresponding position register in the form of the target joint coordinate position according to the position register number;
[0013] Step S3: Convert the current joint coordinate position and the target joint coordinate position into real number arrays respectively;
[0014] Step S4: Based on the real number array, compare the absolute value of the deviation of each joint angle between the current joint coordinate position and the target joint coordinate position with the given tolerance threshold to determine whether the robot's current joint coordinate position is at the reference position.
[0015] Step S5: Based on the judgment result, write a status flag (1 or 0) to the value register corresponding to the value register number, and control the pulse signal output of the digital output port:
[0016] If it is determined that the robot's current joint coordinate position is at the reference position, then write status flag 1 to the numerical register and trigger the digital output port corresponding to the digital output port number to output a 1-second pulse signal;
[0017] Otherwise, write status flag 0 to the value register and close the digital output port corresponding to the digital output port number.
[0018] Furthermore, a preferred embodiment is provided in which the given tolerance threshold is 0.1° to 0.3°.
[0019] Furthermore, a preferred embodiment is provided, in step S1:
[0020] The valid range for the location register number is 1 to 300;
[0021] The valid range for the numerical register number is 1 to 200;
[0022] The valid range for digital output port numbers is 1 to 1024.
[0023] Furthermore, a preferred embodiment is provided in which, in step S3, the CHV_JPOS_REL function is used to convert the current joint coordinate position and the target joint coordinate position, represented by the JOINTPOS type, into real number arrays containing 6 joint axes.
[0024] Furthermore, a preferred embodiment is provided, in step S4:
[0025] Determine whether the absolute value of the deviation between the current joint coordinate position and the joint angle corresponding to the first 3 joint axes of the target joint coordinate position is less than the given tolerance threshold: if it is less than the given tolerance threshold, the result is assigned a Boolean value of 1; otherwise, it is assigned a Boolean value of 0.
[0026] Determine the absolute value of the deviation between the current joint coordinate position and the target joint coordinate position for the last three joint axes and whether it is less than the given tolerance threshold. If it is, assign a Boolean value of 1 to the result; otherwise, assign a Boolean value of 0.
[0027] The final judgment result consists of two sets of judgment results: the first three joint axes and the last three joint axes.
[0028] If the final judgment result is a Boolean value of 1, it means that the robot's current joint coordinate position is at the reference position;
[0029] Otherwise, it means that the robot's current joint coordinate position is not at the reference position.
[0030] This invention also proposes a robot reference position verification device, which is used to verify whether the current joint position of the robot is within the reference position of the robot reference position extension method described in the above embodiments; the device includes the following modules:
[0031] Module S1: Obtain the position register number, value register number, and digital output port number, and verify their validity range;
[0032] Module S2: Reads the current joint coordinate position of the robot; obtains the reference position stored in the corresponding position register in the form of the target joint coordinate position according to the position register number;
[0033] Module S3: Converts the current joint coordinate position and the target joint coordinate position into real number arrays respectively;
[0034] Module S4: By comparing the absolute value of the deviation of each joint angle in the real number array with a given tolerance threshold, it determines whether the robot's current joint coordinate position is at the reference position.
[0035] Module S5: Based on the judgment result, writes a status flag (1 or 0) to the value register corresponding to the value register number, and controls the pulse signal output of the digital output port.
[0036] If it is determined that the robot's current joint coordinate position is at the reference position, then write status flag 1 to the numerical register and trigger the digital output port corresponding to the digital output port number to output a 1-second pulse signal;
[0037] Otherwise, write status flag 0 to the value register and do not trigger the pulse signal of the digital output port.
[0038] The present invention also proposes a computer device comprising: a processor and a memory, the memory being used to store executable instructions of the processor, the processor being configured to execute the robot reference position verification method described in any of the above embodiments by executing the executable instructions.
[0039] The present invention also proposes a computer storage medium storing a computer program, wherein when the computer program is executed, the robot reference position verification method described in any one of the above embodiments is performed.
[0040] The present invention also proposes a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the robot reference position verification method described in any of the above embodiments.
[0041] The present invention has the following beneficial effects:
[0042] 1. The robot reference position expansion method described in this invention reuses the functions of the position register to store reference positions, allowing users to easily create more than 10 (10→300) custom reference positions, greatly enhancing the flexibility and adaptability of robot operation and meeting complex process requirements.
[0043] 2. The robot reference position expansion method described in this invention uses a graphical user interface of a teach pendant and simple keyboard operation, enabling users who do not know programming to quickly add new reference positions, making FANUC robots easier to use.
[0044] 3. The robot reference position expansion method described in this invention is compatible with existing hardware architectures and can expand the number of reference positions without the need for additional expansion modules, thus saving hardware costs.
[0045] 4. The robot reference position verification method described in this invention is based on the Karel language, adopts a joint angle-based tolerance verification method, and uses array-based data processing to improve computational efficiency.
[0046] The robot reference position extension and verification method described in this invention are applicable to the extension and verification of the reference position of FANUC robots. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0048] Figure 1 This is a flowchart illustrating the reference position expansion method implemented via a teach pendant in one embodiment of the present invention.
[0049] Figure 2 This is a flowchart illustrating a robot reference position verification method in one embodiment of the present invention. Detailed Implementation
[0050] To make the technical solutions and advantages of the present invention clearer, the specific embodiments of the present invention will be described in further detail and completely below with reference to the accompanying drawings. The various embodiments described below are only some preferred embodiments of the present invention, and not all of them; the various embodiments described below are intended to explain the present invention and should not be construed as limiting the present invention; reasonable combinations of the technical features defined in the various embodiments of the present invention, as well as all other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort, are all within the scope of protection of the present invention.
[0051] Implementation Method 1: A robot reference position extension method, the method comprising the following steps:
[0052] A position register is used to store the reference position. One position register stores one reference position. The reference position is stored in the position register in the form of the target joint coordinate position, thereby realizing the expansion of the reference position.
[0053] In this embodiment, the position register is also called the PR register.
[0054] In this embodiment, the reference position extension method is applicable to FANUC robots.
[0055] In this embodiment, the FANUC Karel has 300 built-in PR registers, with one PR register storing one reference position, thus solving the problem of insufficient reference positions.
[0056] In this embodiment, the reference position expansion method is implemented using a teach pendant:
[0057] Press the DATA key on the teach pendant keyboard, select the type in the teach pendant's operation interface, and select the location register from the pop-up options.
[0058] At this point, the teach pendant's interface will display the configuration storage status of the position register;
[0059] Let the position register be numbered PRNo. If any position register:
[0060] The display shows PR[PRNo] = R, indicating that the location register contains data;
[0061] The display shows PR[PRNo] = *, indicating that the position register has no data recorded.
[0062] Position the robot joint in the reference position that you want to record. In the teach pendant's interface, use the arrow keys to move to select the position register that has no data to record. Hold down the shift key on the teach pendant's keyboard and select the position memory button in the teach pendant's interface to record the current reference position of the robot joint into the corresponding position register.
[0063] At this point, the teach pendant's interface will display the corresponding prompt: The current position is recorded in PR[PRNo], and the reference position extension method is complete.
[0064] Implementation Method 2: A robot reference position verification method, wherein the method is used to verify whether the current joint position of the robot is within the reference position in the robot reference position extension method described in the above implementation method; the method includes the following steps:
[0065] Step S1: Obtain the position register number, value register number, and digital output port number, and verify their validity range;
[0066] Step S2: Read the robot's current joint coordinate position; obtain the reference position stored in the corresponding position register in the form of the target joint coordinate position according to the position register number;
[0067] Step S3: Convert the current joint coordinate position and the target joint coordinate position into real number arrays respectively;
[0068] Step S4: Based on the real number array, compare the absolute value of the deviation of each joint angle between the current joint coordinate position and the target joint coordinate position with the given tolerance threshold to determine whether the robot's current joint coordinate position is at the reference position.
[0069] Step S5: Based on the judgment result, write a status flag (1 or 0) to the value register corresponding to the value register number, and control the pulse signal output of the digital output port:
[0070] If it is determined that the robot's current joint coordinate position is at the reference position, then write status flag 1 to the numerical register and trigger the digital output port corresponding to the digital output port number to output a 1-second pulse signal;
[0071] Otherwise, write status flag 0 to the value register and close the digital output port corresponding to the digital output port number.
[0072] In this embodiment, the robot reference position verification method is written into a KAREL source file; the KAREL source file generates a PC file, which is used to be called and executed by the TP program.
[0073] In this embodiment, by adding the KAREL source file to the FANUC robot simulation software ROBOTGUIDE, the control logic can be verified and optimized in a virtual environment. Then, after verification confirms there are no issues, a PC file is generated based on the KAREL source file.
[0074] In this embodiment, the digital output port is connected to the PLC. When the digital output port outputs a pulse signal, it can trigger the PLC to control the robot to perform corresponding actions.
[0075] In this embodiment, in actual use: a FANUC robot is used, the PC program is imported into the robot, and a TP program is created in the robot. The PC program is called in the created TP program. The robot is moved to the target position via the teach pendant and recorded in the position register PR. The position register number and digital output port number of the target position are input into the PC program. When the robot's actual position reaches within ±0.2 degrees (given tolerance threshold) of PR (position register index number), the robot's digital output port outputs a pulse signal to the PLC. In this way, the number of reference positions can reach 300.
[0076] In this embodiment, the numerical register is also called the R register.
[0077] In this embodiment, a status flag (1 or 0) is written to the numerical register (R[RNo]) based on the judgment result, and the binary flag (1 / 0) provides intuitive feedback on whether the robot's current position has reached the reference position.
[0078] A status flag of 1 indicates that the deviation between the current joint position and the target position is within the tolerance threshold (verification passed), which can be used to trigger subsequent automated actions (such as gripping, welding, or assembly).
[0079] A status flag of 0 indicates that the deviation exceeds the tolerance threshold (verification failed), which may trigger an alarm or relocation process.
[0080] Synchronous control of hardware devices can be achieved by combining the pulse signal of the digital output port (DO[DONo]). For example, when the verification passes (R[RNo]=1), the conveyor belt or cylinder is started through the DO port to achieve linkage control.
[0081] Additionally, the status flags of the value register (or R register) can be used for visualization:
[0082] In conjunction with the HMI interface, the state of the R register is mapped to visual signals (such as indicator light color changes). For example, a green indicator light (R=1) indicates readiness, while red (R=0) indicates the need for manual intervention.
[0083] During the debugging phase, by forcibly modifying the value of the R register (e.g., manually setting it to 1), the verification step can be skipped and subsequent processes can be tested directly.
[0084] In addition, the status flags of the value register (or R register) reflect compatibility and scalability:
[0085] The value of the R register can be transmitted to the host computer or PLC via communication protocols (such as ProfiBus or Profinet), supporting cross-system collaboration. For example, after the PLC reads R[RNo] = 1, it starts the external processing equipment.
[0086] The numerical support of R registers can be combined with mathematical operations to implement complex logic. For example, multiple state conditions can be expressed by combining the flag bits of multiple R registers (such as R1+R2).
[0087] In summary, the status flag written to R[RNo] is a crucial link in the robot control system, which not only realizes the digital expression of position verification results, but also promotes the closed-loop operation of the automation process through hardware linkage and logic control. Its design meets the core requirements of real-time performance, reliability and maintainability in the field of industrial automation.
[0088] In another embodiment, in step S1, the GET_TPE_PRM function is used to obtain the position register number, the value register number, and the digital output port number.
[0089] In the GET_TPE_PRM function, the value of the returned parameter Status determines whether the data retrieval was successful. If Status <> 0, the data retrieval failed.
[0090] In another embodiment, in step S2, the CURJPOS(0,0) function is used to obtain the current joint coordinate position of the robot.
[0091] In another embodiment, in step S2, the GET_JPOS_REG function is used to obtain the reference position stored in the form of the target joint coordinate position.
[0092] In the GET_JPOS_REG function, the value of the returned parameter Status determines whether the data retrieval was successful. If Status <> 0, the data retrieval failed.
[0093] In another embodiment, in step S3, the CHV_JPOS_REL function is used to convert the robot's current joint coordinate position and the target joint coordinate position into real number arrays respectively.
[0094] In the CHV_JPOS_REL function, the value of the returned parameter Status determines whether the data conversion was successful. If Status <> 0, the data conversion failed.
[0095] Implementation method 3: The given tolerance threshold is 0.1° to 0.3°.
[0096] In another embodiment, the given tolerance threshold is 0.2°.
[0097] Implementation method 4: In step S1:
[0098] The valid range for the location register number is 1 to 300;
[0099] The valid range for the numerical register number is 1 to 200;
[0100] The valid range for digital output port numbers is 1 to 1024.
[0101] Implementation Method 5: In step S3, the CHV_JPOS_REL function is used to convert the current joint coordinate position and the target joint coordinate position, which are represented by the JOINTPOS type, into real number arrays containing 6 joint axes.
[0102] In this embodiment, in step S3, the CHV_JPOS_REL function is used to convert the current joint coordinate position and the target joint coordinate position, which are represented by the JOINTPOS type, into real number arrays containing 6 joint axes respectively; then the first element in the real number array represents the first joint axis, the second element represents the second joint axis, and so on.
[0103] For example, let the real number array be Array_Apos, which contains 6 elements, namely Array_Apos[1], Array_Apos[2], Array_Apos[3], Array_Apos[4], Array_Apos[5] and Array_Apos[6], then:
[0104] Array_Apos[1] corresponds to the first joint axis;
[0105] Array_Apos[2] corresponds to the second joint axis;
[0106] Array_Apos[3] corresponds to the 3rd joint axis
[0107] Array_Apos[4] corresponds to the 4th joint axis
[0108] Array_Apos[5 corresponds to the 5th joint axis]
[0109] Array_Apos[6] corresponds to the 6th joint axis.
[0110] Implementation method 6: In step S4:
[0111] Determine whether the absolute value of the deviation between the current joint coordinate position and the joint angle corresponding to the first 3 joint axes of the target joint coordinate position is less than the given tolerance threshold: if it is less than the given tolerance threshold, the result is assigned a Boolean value of 1; otherwise, it is assigned a Boolean value of 0.
[0112] Determine the absolute value of the deviation between the current joint coordinate position and the target joint coordinate position for the last three joint axes and whether it is less than the given tolerance threshold. If it is, assign a Boolean value of 1 to the result; otherwise, assign a Boolean value of 0.
[0113] The final judgment result consists of two sets of judgment results: the first three joint axes and the last three joint axes.
[0114] If the final judgment result is a Boolean value of 1, it means that the robot's current joint coordinate position is at the reference position;
[0115] Otherwise, it means that the robot's current joint coordinate position is not at the reference position.
[0116] In this embodiment, each element of the real number array represents each joint axis; correspondingly, axis-by-axis comparison and judgment are performed by comparing each element of the real number array corresponding to the robot's current joint coordinate position and the real number array corresponding to the target joint coordinate position. For example:
[0117] Let the array of real numbers corresponding to the current joint coordinate position of the robot be Array_Apos, which includes 6 elements, namely Array_Apos[1], Array_Apos[2], Array_Apos[3], Array_Apos[4], Array_Apos[5] and Array_Apos[6];
[0118] Let the real number array corresponding to the target joint coordinate position be Array_Cpos, which includes 6 elements, namely Array_Cpos[1], Array_Cpos[2], Array_Cpos[3], Array_Cpos[4], Array_Cpos[5], and Array_Cpos[6];
[0119] The per-axis comparison and judgment of the first 3 joint axes can be expressed as follows:
[0120] Result123 = (ABS(Array_Apos[1] - Array_Cpos[1]) < Delta) AND (ABS(Array_Apos[2] - Array_Cpos[2]) < Delta) AND (ABS(Array_Apos[3] - Array_Cpos[3]) < Delta), and the result of Result123 is a boolean value;
[0121] The per-axis comparison and judgment of the last 3 joint axes can be expressed as follows:
[0122] Result456 = (ABS(Array_Apos[4] - Array_Cpos[4]) < Delta) AND (ABS(Array_Apos[5] - Array_Cpos[5]) < Delta) AND (ABS(Array_Apos[6] - Array_Cpos[6]) < Delta), and the result of Result456 is a boolean value;
[0123] The final judgment result is Result, which is the logical AND operation of the two sets of judgment results of Result123 and Result456:
[0124] Result = Result123 AND Result456.
[0125] In this embodiment: The first 3 joint axes (J1 - J3) and the last 3 joint axes (J4 - J) are compared separately and a logical AND operation is used: If the tolerance ranges of axes 1 - 3 and axes 4 - 6 are inconsistent, the tolerance value can be increased for separate judgment to ensure the flexibility of the program.
[0126] Embodiment 7: A robot reference position verification device, which is used to verify whether the current joint position of the robot is at the reference position in the robot reference position extension method described in the above embodiment; the device includes the following modules:
[0127] Module S1: Obtain the position register number, value register number, and digital output port number, and verify their validity range;
[0128] Module S2: Reads the current joint coordinate position of the robot; obtains the reference position stored in the corresponding position register in the form of the target joint coordinate position according to the position register number;
[0129] Module S3: Converts the current joint coordinate position and the target joint coordinate position into real number arrays respectively;
[0130] Module S4: By comparing the absolute value of the deviation of each joint angle in the real number array with a given tolerance threshold, it determines whether the robot's current joint coordinate position is at the reference position.
[0131] Module S5: Based on the judgment result, writes a status flag (1 or 0) to the value register corresponding to the value register number, and controls the pulse signal output of the digital output port.
[0132] If it is determined that the robot's current joint coordinate position is at the reference position, then write status flag 1 to the numerical register and trigger the digital output port corresponding to the digital output port number to output a 1-second pulse signal;
[0133] Otherwise, write status flag 0 to the value register and do not trigger the pulse signal of the digital output port.
[0134] Implementation Method 8: A computer device comprising: a processor and a memory, the memory for storing executable instructions of the processor, the processor being configured to execute the robot reference position verification method according to any one of the above embodiments by executing the executable instructions.
[0135] Implementation Method 9: A computer storage medium storing a computer program, wherein when the computer program is executed, the robot reference position verification method described in any one of the above implementation methods is performed.
[0136] Implementation Method 10: A computer program product, comprising a computer program / instructions, which, when executed by a processor, implements the steps of the robot reference position verification method described in any of the above embodiments.
[0137] This embodiment provides a computer device or system. The hardware device in this part is a general model and is not shown in the figure. The system includes a processor and a memory, wherein the processor and the memory can be connected by a bus or other means. The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs and modules, as well as corresponding program instructions / modules. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions and modules stored in the memory, so as to realize the data quality enhancement method for data space entity parsing in the above method embodiment.
[0138] The memory may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, mobile communication networks, and combinations thereof.
[0139] One or more modules are stored in the memory. When the processor executes, it performs the method steps in the embodiments. In this way, the invention objective can be achieved through the method, apparatus and process of the present invention. The specific details of the computer device described above can be understood by referring to the relevant descriptions and effects in the embodiments, and will not be repeated here.
[0140] Those skilled in the art will understand that implementing all or part of the processes in the above embodiments can be accomplished by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.
[0141] Implementation Method 11: The program content of the KAREL source file for the robot reference position verification method is as follows:
[0142]
[0143]
[0144]
[0145]
[0146]
[0147] In this embodiment, the program content of the aforementioned KAREL source file is explained as follows:
[0148] Part 1: Program Declaration and Configuration.
[0149] (1) `PROGRAM CheckPos`
[0150] Define the program name as CheckPos.
[0151] (2)`%NOPAUSE=ERROR+COMMAND+TPENABLE`
[0152] Ignore error pauses, command pauses, and requests ignored when TP is enabled.
[0153] Part Two: Declaration of Constants and Variables.
[0154] (3)`CONST Delta=0.2`
[0155] The tolerance threshold for joint angles is defined as 0.2 degrees (for subsequent position determination).
[0156] (4) Variable declaration section:
[0157] • `PRNo, RNo, DONo: INTEGER`: Stores the location register number (RP register, which contains the reference position), the value register number (R register), and the digital output port number, respectively.
[0158] • `Status:INTEGER`: Used to store the function execution status (0 indicates success).
[0159] · `Result123 / Result456 / Result:BOOLEAN`: A Boolean variable used to store the joint angle comparison results.
[0160] • `JApos / JCpos:JOINTPOS`: Stores the current joint position and the target joint position.
[0161] ·`Array_Apos / Array_Cpos:ARRAY[6]OF REAL`: Converts joint positions into a real number array.
[0162] Part Three: Initialization and Parameter Acquisition.
[0163] (5) Array initialization
[0164] Initialize all elements of `Array_Apos` and `Array_Cpos` to 0.0 to prepare for storing joint data later.
[0165] (6) Calling the `GET_TPE_PRM` function
[0166] The parameters input by the user are obtained through three separate calls:
[0167] • `PRNo`: The location register (RP register) number that stores the reference position.
[0168] • `RNo`: The register number where the result is stored.
[0169] ·`DONo`: Digital output signal port number.
[0170] If the parameter is invalid (e.g., out of range), an error will be reported and the program will terminate.
[0171] Part Four: Location Data Acquisition and Conversion.
[0172] (7) `JApos=CURJPOS(0,0)`
[0173] Obtain the robot's current joint coordinates (JOINTPOS format).
[0174] (8) `JCpos=GET_JPOS_REG(PRNo,Status)`
[0175] Read the target joint coordinate position (i.e., reference position) from the specified position register (PR[PRNo]).
[0176] (9) CNV_JPOS_REL function call
[0177] Convert the joint coordinates (JOINTPOS) into an array of real numbers:
[0178] • `Array_Apos`: Array of current joint angles.
[0179] • `Array_Cpos`: Array of target joint angles.
[0180] Part 5: Position Comparison Logic
[0181] (10) Calculate Result123 and Result456
[0182] Check whether the joint angle differences of the first 3 axes (1 - 3) and the last 3 axes (4 - 6) are within the tolerance threshold (Delta = 0.2):
[0183] Result123 = (ABS(Array_Apos[1] - Array_Cpos[1]) < Delta) AND... (first 3 axes)
[0184] Result456 = (ABS(Array_Apos[4] - Array_Cpos[4]) < Delta) AND... (last 3 axes)
[0185] Result = Result123 AND Result456 # All axes meet the conditions
[0186] Part VI: Output control.
[0187] (11) Conditional branch
[0188] · If `Result = True` (the current position is close to the target, i.e., the reference position):
[0189] · `SET_INT_REG(RNo, 1, Status)`: Write 1 to R[RNo]; RNo is the numerical register number.
[0190] · `PULSE DOUT[DONo] FOR 1000`: Trigger DO[DONo] to output a 1 - second pulse; DONo is the digital output port.
[0191] · If `Result = False`:
[0192] · `SET_INT_REG(RNo, 0, Status)`: Write 0 to R[RNo].
[0193] · `DOUT[DONo] = FALSE`: Force - close the output signal.
[0194] Part VII: Program termination.
[0195] (12) `END CheckPos`: End of the program.
[0196] The above program content implements the following functions:
[0197] (1) Parameter verification: Check whether the register number and port number entered by the user are legal.
[0198] (2) Position comparison: Determine whether the current position is close to the target position (i.e., the reference position) by the difference in joint angles.
[0199] (3) Result output: The result is fed back through numerical registers and digital signals, which is suitable for position verification scenarios in automated processes.
[0200] In this implementation, the KAREL source file is a source code file written in the Karel language (usually with the extension .KL or .PC). Its features include: support for complex logic (such as mathematical operations, conditional branches, and loops); and direct access to the robot's underlying hardware (such as registers and I / O signals).
[0201] In this embodiment, Karel is a high-level programming language specifically designed for FANUC industrial robots, designed for the development of robot control systems. It combines structured programming features with low-level access to robot hardware, and is one of the core tools for FANUC robot programming.
[0202] In this embodiment, the simulation software ROBOTGUIDE is an offline robot programming and simulation platform officially provided by FANUC. The simulation software ROBOTGUIDE can simulate the working environment of a real robot (including robotic arm models, tools, workpieces, etc.), and can be used to write and debug robot programs (including TP programs and Karel programs), thereby verifying motion trajectories, collision detection, cycle time analysis, and finally generating program files that can be directly imported into a real robot controller.
[0203] A reference position verification program based on the Karel language was developed and verified using the simulation software ROBOTGUIDE. After ensuring the correctness of the logic, it was deployed to the actual robot.
[0204] In this embodiment, the PC file is an executable file (with the extension .PC) generated by compiling the Karel source file.
[0205] PC file generation process:
[0206] Complete the Karel program writing in ROBOTGUIDE; compile the .KL file into a binary .PC file using the built-in compiler; the compilation process includes syntax checking, symbol resolution, and code optimization.
[0207] The generated PC file converts the logic code into instructions that the robot controller can directly execute for actual control.
[0208] In this embodiment, the TP program is an application program (with the extension .TP) written using a teach pendant.
[0209] Features of TP program: Uses simple instructions (such as JP[1]100% FINE); supports graphical teaching (manually moves the robot to record points).
[0210] The TP program is used to call the compiled PC file to achieve the integration of extended functions and basic control.
[0211] In this embodiment, the following specific environments can be used for setup:
[0212] Hardware environment setup:
[0213] Use the FANUC R-30iB controller to connect to the R-2000IC / 165F robot body;
[0214] The PLC communicates with the robot controller via the Profinet protocol, and the DO signal is transmitted via the Profinet protocol.
[0215] Software configuration:
[0216] ROBOGUIDE V9.40 simulation software;
[0217] Siemens S7-1500 PLC (firmware version V2.8).
[0218] Implementation process:
[0219] Virtual environment setup: Create a robot workstation model in ROBOTGUIDE and configure hardware parameters (such as robot model, tool load, and workbench layout) that are consistent with the actual production line.
[0220] Karel Development: Create a new Karel source file (e.g., CheckPRPos.KL) and write the core logic:
[0221] Simulation Verification: Run the simulation in ROBOTGUIDE, setting multiple test cases (such as PR index exceeding limits, joint deviations, etc.). Monitor the DO signal output to ensure it meets expectations. Confirm the robot's motion trajectory is collision-free using 3D visualization.
[0222] Compilation and Deployment: Compile the verified Karel source files into a PC file (e.g., CheckPRPos.PC). Transfer the PC file to the actual robot controller (e.g., R-30iB) via USB or network.
[0223] TP program integration: Create a TP program (such as MAIN.TP) on the teach pendant and call the PC file; manually teach the target location through the teach pendant and store it in the PR register (such as PR
[23] ).
[0224] In summary, by ensuring algorithm reliability through ROBOTGUIDE simulation, implementing hardware-level control using Karel source code, generating PC files to provide executable code, and integrating the TP program into the production system, this complete chain enables the configuration and expansion of reference positions (from 10 to 300). This solution embodies the typical "simulation development - low-level programming - system integration" technical path in the field of industrial robots and is a model of collaborative innovation between software and hardware.
[0225] The above description of several specific embodiments further details the technical solution provided by the present invention in order to highlight the advantages and benefits of the technical solution provided by the present invention. However, the above-described specific embodiments are not intended to limit the present invention. Any reasonable modifications and improvements to the present invention, reasonable combinations of embodiments, and equivalent substitutions based on the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A robot reference position verification method, characterized by, The method includes the following steps: A position register is used to store the reference position, with one position register storing one reference position. The reference position is stored in the position register in the form of the target joint coordinate position, thereby expanding the reference position. The method is used to verify whether the current joint position of the robot is at the reference position; the method includes the following steps: Step S1: Obtain the position register number, value register number, and digital output port number, and verify their validity range; Step S2: Read the robot's current joint coordinate position; obtain the reference position stored in the corresponding position register in the form of the target joint coordinate position according to the position register number; Step S3: Convert the current joint coordinate position and the target joint coordinate position into real number arrays respectively; Step S4: Based on the real number array, compare the absolute value of the deviation of each joint angle between the current joint coordinate position and the target joint coordinate position with the given tolerance threshold to determine whether the robot's current joint coordinate position is at the reference position. Step S5: Based on the judgment result, write a status flag to the value register corresponding to the value register number, and control the pulse signal output of the digital output port: If it is determined that the robot's current joint coordinate position is at the reference position, then write status flag 1 to the numerical register and trigger the digital output port corresponding to the digital output port number to output a 1-second pulse signal; Otherwise, write status flag 0 to the value register and close the digital output port corresponding to the digital output port number; In step S4: Determine whether the absolute value of the deviation between the current joint coordinate position and the joint angle corresponding to the first 3 joint axes of the target joint coordinate position is less than the given tolerance threshold: if it is less than the given tolerance threshold, the result is assigned a Boolean value of 1; otherwise, it is assigned a Boolean value of 0. Determine the absolute value of the deviation between the current joint coordinate position and the target joint coordinate position for the last three joint axes and whether it is less than the given tolerance threshold. If it is, assign a Boolean value of 1 to the result; otherwise, assign a Boolean value of 0. The final judgment result consists of two sets of judgment results: the first three joint axes and the last three joint axes. If the final judgment result is a Boolean value of 1, it means that the robot's current joint coordinate position is at the reference position; Otherwise, it means that the robot's current joint coordinate position is not at the reference position.
2. The robot reference position verification method according to claim 1, wherein, The given tolerance threshold is 0.1° to 0.3°.
3. The robot reference position verification method of claim 1, wherein, In step S1: The valid range for the location register number is 1 to 300; The valid range for the numerical register number is 1 to 200; The valid range for digital output port numbers is 1 to 1024.
4. The robot reference position verification method of claim 1, wherein, In step S3, the CHV_JPOS_REL function is used to convert the current joint coordinate position and the target joint coordinate position, which are represented by the JOINTPOS type, into real number arrays containing 6 joint axes.
5. A robot reference position verification apparatus, characterized by The device is used to verify whether the current joint position of the robot is at the reference position in the robot reference position verification method of claim 1; the device includes the following modules: Module S1: Obtain the position register number, value register number, and digital output port number, and verify their validity range; Module S2: Reads the current joint coordinate position of the robot; obtains the reference position stored in the corresponding position register in the form of the target joint coordinate position according to the position register number; Module S3: Converts the current joint coordinate position and the target joint coordinate position into real number arrays respectively; Module S4: By comparing the absolute value of the deviation of each joint angle in the real number array with a given tolerance threshold, it determines whether the robot's current joint coordinate position is at the reference position. Module S5: Based on the judgment result, writes a status flag to the value register corresponding to the value register number, and controls the pulse signal output of the digital output port. If it is determined that the robot's current joint coordinate position is at the reference position, then write status flag 1 to the numerical register and trigger the digital output port corresponding to the digital output port number to output a 1-second pulse signal; Otherwise, write status flag 0 to the value register and do not trigger the pulse signal of the digital output port.
6. A computer device comprising: A processor and a memory, characterized in that the memory is used to store executable instructions of the processor, the processor being configured to perform the robot reference position verification method according to any one of claims 1-4 by executing the executable instructions.
7. A computer storage medium, characterized in that The storage medium stores a computer program, which, when executed, performs the robot reference position verification method according to any one of claims 1-4.
8. A computer program product comprising computer programs / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps of the robot reference position verification method according to any one of claims 1-4.