As manufacturing intelligence continues to advance, the deployment of industrial robots has expanded rapidly across a wide range of production scenarios. Among the many available platforms, FANUC robots are widely adopted due to their high degree of automation, powerful functionality, and convenient programming. These industrial robots are used in spot welding, material handling, arc welding, painting, laser processing, adhesive dispensing, and many other applications. However, an industrial robot is a complex mechanical system that operates under continuous stress. Over long production cycles, problems such as oil leakage, cable protection sleeve wear, loose external bolts, abnormal vibration and noise, reduced accuracy, and low battery voltage in the robot本体 battery can occur. These issues can disrupt normal production and increase unplanned downtime. Therefore, regular inspection and preventive maintenance are essential to preserve equipment performance, reduce unexpected failures, and improve overall production efficiency.
The flexibility of an industrial robot is largely derived from its programming capability. KAREL is a built-in dedicated language for FANUC robots. Its structure is relatively simple, and it integrates a variety of functional routines that can be called directly. By combining multiple functions, complex behaviors can be implemented. KAREL source files with the .KL extension are compiled using FANUC’s dedicated simulation platform, ROBOGUIDE, to generate .PC programs that the robot controller can recognize and execute. Previous research has demonstrated the use of KAREL for data exchange between robots and external devices, open control system design, and real-time speed adjustment. In this work, I designed and developed a maintenance reminder function based on KAREL to prompt users to perform regular inspection and maintenance. I conducted requirement analysis, functional design, routine design, and experimental testing. The reminder function was successfully implemented, and it has been installed and used on actual industrial robots.

1. Requirement Analysis
Industrial robots often operate in harsh environments characterized by high temperatures, dust, and harmful gases. They perform repetitive, high-intensity tasks, and their introduction has reduced the health risks to human workers. However, long-term operation in such conditions places higher demands on the stability of the industrial robot. Regular and planned inspection and maintenance can keep the robot’s performance in a stable state, thereby reducing unplanned downtime and manual intervention. Table 1 lists important inspection and maintenance items along with their maintenance intervals.
| Maintenance Item | Maintenance Period (Operating Hours) |
|---|---|
| Control cabinet vent cleaning | 960 |
| Motor and other exposed cable connection looseness check | 3840 |
| Mechanical body external damage and paint peeling check | 960 |
| Base and flange connection bolt tightening check | 3840 |
| Cable protection sleeve damage check | 960 |
| Cooling fan operation confirmation | 3840 |
| Balance cylinder bearing wear check | 960 |
| Balance cylinder bearing lubrication | 3840 |
| Robot water stain removal | 960 |
| Encoder battery replacement | 3840 |
| Control cabinet and mechanical body cable damage check | 3840 |
| Joint lubricant replacement | 11520 or 3 years of natural time |
| Mechanism moving cable damage check | 3840 |
The maintenance intervals for these items are relatively long, typically three months or more. Users often focus on urgent production tasks and may forget the maintenance work when the interval is approaching. This increases the risk to safe and stable operation of the equipment. Therefore, it is necessary to design and develop a maintenance reminder function. When the maintenance period is approaching, a pop-up warning should remind the user to perform maintenance work at an appropriate time, thereby improving the safety and stability of the industrial robot.
Based on the requirements, the maintenance reminder function must satisfy several key conditions. The user must be able to view the remaining time for each maintenance item on the robot teach pendant. The remaining time must be updated in real time. The function must not interfere with the normal operation of the industrial robot. During maintenance, a secondary confirmation must be provided to prevent accidental reset. In addition, the interface should support multiple languages, and the installation should be simple and quick.
2. Overall Functional Design
To meet the requirements, I decomposed the maintenance reminder function into three main parts: interface design, routine design, and installation program design. Figure 1 shows the overall functional design. The interface design includes a primary language interface and an English interface. Since the FANUC robot does not support the display of certain languages in an English environment, the interface design must account for language differences. The entire interface is implemented using .FTX files. After compiling the .FTX files on the ROBOGUIDE simulation platform, .TX, .KL, and .VR files are automatically generated. These files are loaded onto the robot, and the interface display routines call the .TX and .VR files to provide an intuitive interface for the user. The designed interface contains the content of each maintenance item and the remaining time for each item.
The routine design includes an interface display routine, a background calculation routine, and an auto-start routine. The interface display routine handles calling the interface and switching between languages. The background calculation routine performs real-time calculation of the remaining time for each maintenance item. The auto-start routine enables the monitoring program to start automatically when the robot is powered on. The installation program design refers to the writing of an installation program that helps the user perform a one-click installation of the maintenance reminder function, avoiding complex operations such as robot software updates.
3. Interface Design
I used dictionary and form files to display the interface on the FANUC robot teach pendant. The maintenance items were divided into three categories: 960-hour maintenance, 3840-hour maintenance, and 11520-hour or 3-year natural time maintenance. This reduced the number of remaining time calculations required, lowered the data storage requirements, and saved cache space on the robot controller. A portion of the interface design program is shown below. The dictionary file defines the form and the text fields. The form includes fields for the remaining hours and the maintenance items.
The form file begins with a dictionary definition that specifies the form name, such as MTRM.ftx. The form is defined as unnumbered and without clearing the screen. The first line sets the home position and the title. The title is displayed in the primary language, followed by a new line. Then the first maintenance category is displayed with blue foreground color. The remaining hours are shown using a format specifier, and the maintenance items are listed. The same pattern is repeated for the 3840-hour category and the 11520-hour or 3-year category. The form ends with a function key definition.
The interface display routine includes initialization of interface parameters, calling the interface, selecting the language, and associating interface variables. Table 2 lists some of the interface display routines.
| Routine Name | Function |
|---|---|
| MAIN_SCREEN | Calls the interface |
| VALUE_ARRAY | Associates interface with variables |
| INITVARS | Initializes interface variables |
| FORM_SELECT | Selects primary or English interface |
The MAIN_SCREEN routine calls the KAREL function DISCTRL_FORM() to display the interface. The VALUE_ARRAY routine associates the interface display content with the corresponding variables. The INITVARS routine initializes and assigns values to the variables bound to the interface. The FORM_SELECT routine uses the KAREL built-in function ADD_DICT() to select the appropriate language interface based on the robot’s current language setting.
4. Background Calculation Routine Design
The background calculation routine must run continuously in the background to monitor and obtain the current time. The maintenance remaining time is expressed by Equation (1):
$$LT = MT – (CT – RT) \tag{1}$$
where \(LT\) represents the maintenance remaining time, \(MT\) represents the maintenance period, \(CT\) represents the current time, and \(RT\) represents the maintenance record time. The first maintenance record time is set to the installation time of the maintenance reminder function. Subsequent maintenance record times are recorded during actual maintenance. The current time is obtained by the background program, and the maintenance period is preset according to the different categories of maintenance content.
When the maintenance remaining time is insufficient, the robot teach pendant displays a pop-up window to remind the user that the necessary maintenance items need to be performed. At the same time, to avoid affecting the normal operation of the industrial robot, the background monitoring program cycle is set to 1 hour. Every time equipment maintenance is performed, a password must be entered for secondary confirmation to prevent accidental operation. The current time is then recorded as the maintenance record time, thereby resetting the maintenance remaining time. Table 3 lists some of the background calculation routines and their functions.
| Routine Name | Function |
|---|---|
| INIT_LOCALVARS | Initializes parameters |
| GET_SRV_TIME | Obtains current operating time |
| GET_CUR_TIME | Obtains current natural time |
| CHECK_SRV_TIME | Checks remaining time |
| USER_ALARM | Pop-up reminder |
| RESET_STATUS | Maintenance reset |
The INIT_LOCALVARS routine initializes and assigns values to the parameters related to background calculation. The GET_SRV_TIME routine uses the KAREL function GET_VAR() to obtain the robot operating time system variable $SYSTEM_TIME[1].SRV_TOT. The GET_CUR_TIME routine uses the KAREL function GET_TIME() to obtain the robot’s current natural time. The CHECK_SRV_TIME routine calculates the maintenance remaining time. The USER_ALARM routine calls the KAREL function DB_PROMPT() to implement the pop-up reminder. The RESET_STATUS routine resets the maintenance remaining time.
In addition to Equation (1), I also defined several auxiliary formulas. The remaining percentage is calculated as:
$$P = \frac{LT}{MT} \times 100\% \tag{2}$$
The alarm condition is triggered when:
$$Alarm = (LT \leq 0) \tag{3}$$
For the 3-year natural time maintenance, the remaining years are calculated as:
$$LT_{3y} = (Y_{install} + 3) – Y_{current} \tag{4}$$
where \(Y_{install}\) is the installation year and \(Y_{current}\) is the current year. The password verification for reset is:
$$Valid = (Input == Password) \tag{5}$$
The background loop cycle is:
$$T_{cycle} = 3600 \text{ s} \tag{6}$$
The total operating time is obtained from the system variable:
$$CT = SRV\_TOT \tag{7}$$
These formulas form the core of the maintenance reminder logic and ensure accurate tracking of maintenance intervals.
5. Auto-Start Routine Design
The auto-start routine enables the background program to execute automatically when the robot is restarted. I set the robot system variables $PWR_NORMAL and $PWR_SEMI to the name of the background program. When the robot is restarted, the background calculation routine is executed automatically. This ensures that the maintenance reminder function is always active without requiring manual intervention.
6. Installation Program Design
Users can install the maintenance reminder function using a USB flash drive or other portable storage device. No robot software refresh is required, making the installation convenient and quick. The robot executes statements such as FRCOPY and PCLOAD to load the interface .TX and .VR files and the .PC programs onto the robot controller. A portion of the installation program is shown below. The program first prints a separator line, then sets system variables. It enables KAREL by setting $KAREL_ENB to 1. It sets the custom menu title and program name. It sets the auto-start variables. Then it copies the .VR and .TX files to the robot file system. Finally, it loads the .PC programs.
The installation program uses the following system variables:
| System Variable | Value | Purpose |
|---|---|---|
| $KAREL_ENB | 1 | Enables KAREL execution |
| $CUSTOMMENU[11].$TITLE | “MTRM” | Sets custom menu title |
| $CUSTOMMENU[11].$PROG_NAME | “MTRM_IF” | Sets custom menu program |
| $PWR_NORMAL | “MTRM_AUTOBOOT” | Sets auto-start program for normal mode |
| $PWR_SEMI | “MTRM_AUTOBOOT” | Sets auto-start program for semi mode |
The installation program also copies the following files: mtrmch.vr, mtrm.vr, 00mtrmch.tx, and 00mtrmeg.tx. It loads the following .PC programs: MTRM_LIB.PC, MTRM_IF.PC, MTRM_BG.PC, MTRM_VAR.PC, and MTRM_AUTOBOOT.PC.
7. Experimental Testing
ROBOGUIDE is the simulation software that accompanies FANUC robots. The internal system of the simulated robot is identical to that of a real robot. Compared with a real robot, ROBOGUIDE makes it easier to observe problems, has lower debugging costs, and improves programming efficiency. I used the ROBOGUIDE simulation platform to experimentally verify the functional design and to test the correctness and completeness of the entire function.
The ROBOGUIDE simulation verification was carried out in the following steps. First, I established a simulation cell and configured the system. The simulated robot used the V9.xx system. Second, I imported the programs. Using the installation program, I imported the maintenance reminder function programs into the simulated robot controller and restarted the simulated robot. Third, I checked the simulation results. I verified whether the interface display and the remaining maintenance time were normal.
The simulation experiment window showed that the maintenance reminder function interface on the simulated controller displayed correctly. When the reset key was pressed, a password was required for secondary confirmation, and only then was the remaining time reset. The simulation confirmed that the interface design, background calculation, and reset logic operated as intended.
For real machine verification, I used a FANUC LR-10iA/10 test platform equipped with the latest V9 system. The entire experimental process was similar to the simulation. The interface displayed normally. When the robot operating time exceeded the maintenance period, a pop-up prompt appeared, verifying the completeness and correctness of the maintenance reminder function. Therefore, the experiment successfully completed the maintenance reminder function test. The interface display, maintenance reminder pop-up, and password secondary confirmation all functioned normally.
| Test Item | Simulation Result | Real Machine Result |
|---|---|---|
| Interface display | Normal | Normal |
| Remaining time calculation | Correct | Correct |
| Pop-up reminder | Triggered correctly | Triggered correctly |
| Password confirmation | Required | Required |
| Reset function | Successful | Successful |
| Auto-start on power-up | Successful | Successful |
Table 5 summarizes the test results. The simulation and real machine tests were consistent. The maintenance reminder function performed reliably in both environments.
8. Results and Discussion
In this work, I designed a maintenance reminder function for FANUC industrial robots using the built-in KAREL language. Through requirement analysis, overall design, routine design, and experimental verification, I demonstrated that the designed maintenance reminder function is effective, practical, and complete. The function successfully implements a pop-up reminder when the maintenance period of the industrial robot expires. This work can improve the stability of FANUC industrial robots, reduce production and usage costs for enterprise users, and improve production efficiency. The function has been installed and used on actual industrial robots.
The use of KAREL provided several advantages. First, KAREL is natively supported by the robot controller, so no external hardware is required. Second, the language integrates many built-in functions for file operations, variable access, and user interface management. Third, the compiled .PC programs are efficient and can run in the background without significantly affecting robot performance. The maintenance reminder function operates with a background cycle of one hour, which is sufficient for maintenance intervals measured in hundreds or thousands of hours. The use of three maintenance categories simplified the calculation logic and reduced storage requirements.
The interface design was a critical component. By using .FTX files, I was able to create a structured form with dynamic fields for remaining hours. The dictionary file allowed the same form to be used for different languages. The language selection routine automatically chooses the appropriate language based on the robot’s current setting. This makes the function usable in diverse production environments. The password confirmation for reset prevents accidental or unauthorized resetting of maintenance timers, which is important for maintaining the integrity of the maintenance schedule.
One limitation of the current implementation is that the background cycle is fixed at one hour. For maintenance items with very short intervals, this might introduce a small delay in the reminder. However, since the shortest maintenance interval is 960 hours, a one-hour cycle is more than adequate. Another limitation is that the remaining time is based on operating hours, not on actual calendar time for the 3-year item. I addressed this by separately calculating the remaining years using Equation (4). In the future, the function could be extended to include predictive maintenance capabilities, where sensor data is used to adjust maintenance intervals dynamically. Integration with cloud-based maintenance management systems could also be explored. Additionally, the interface could be enhanced to show the remaining percentage and to provide more detailed maintenance instructions.
9. Conclusion
I designed and implemented a maintenance reminder function for FANUC industrial robots based on the KAREL language. The function provides a real-time display of remaining maintenance time, a pop-up reminder when maintenance is due, and a password-protected reset mechanism. The design was verified through both simulation and real machine testing. The results confirmed that the function is effective, practical, and complete. The maintenance reminder function improves the stability of the industrial robot, reduces unplanned downtime, and enhances production efficiency. The function has been successfully applied to actual industrial robots. This work demonstrates the potential of KAREL as a powerful tool for developing custom robot applications that address real-world maintenance challenges.
In summary, the key contributions of this work include: (1) a requirement analysis for maintenance reminders on industrial robots; (2) a modular functional design comprising interface, background calculation, and auto-start routines; (3) a set of formulas for calculating remaining maintenance time and triggering alarms; (4) an installation program that enables one-click deployment; and (5) experimental validation through simulation and real machine testing. The maintenance reminder function is a practical solution that can be adapted to other robot brands and maintenance scenarios. As industrial robots become more prevalent in smart manufacturing, such functions will play an increasingly important role in ensuring equipment reliability and operational efficiency.
