Control device, control method, and control program
The control device uses a state machine to manage the execution of user programs with different formats, simplifying programming by determining processes based on events, thus reducing complexity and enhancing efficiency.
Patent Information
- Application Number
- JP2021015577
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-02-03
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-02-03
AI Technical Summary
Existing control devices struggle with facilitating programming of multiple types of programs with different execution formats, leading to complex and inefficient programming efforts due to the need for distributing processing contents among programs with varying execution formats.
A control device with a state machine-based execution management unit that transitions in response to events, determining user-defined processes to be executed, allowing for easier programming of programs with different execution formats by managing the execution of first and second user programs independently.
This configuration reduces the complexity of programming by allowing for easier setting and execution of user-defined processes, improving the efficiency and ease of managing control operations across different execution formats.
Smart Images

Figure 0007593154000001 
Figure 0007593154000002 
Figure 0007593154000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a control device, a control method, and a control program. [Background technology]
[0002] Factory automation (FA) technology using control devices such as programmable controllers (PLCs) is becoming widespread in various production sites. With the recent advances in information and communication technology (ICT), control devices are now capable of controlling not only conventional sequence control, but also robots, machine tools, and the like.
[0003] For example, Japanese Patent Application Laid-Open No. 2019-036043 (Patent Document 1) discloses a configuration in which control calculations according to multiple types of programs with different execution formats are realized by a single control device. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2019-036043 A Summary of the Invention [Problem to be solved by the invention]
[0005] When multiple types of programs with different execution formats as described above are executed on a common control target, it is necessary to design them so that the processing content to be executed can be appropriately shared among the programs. One of the objectives of the present invention is to provide a technology that makes it easy to program multiple types of programs with different execution formats. [Means for solving the problem]
[0006] According to one aspect of the present invention, there is provided a control device for controlling a control target. The control device includes a first program execution unit that executes a first user program including sequence instructions at a predetermined cycle, a second program execution unit that sequentially interprets and executes a second user program written in a predetermined programming language, and an execution management unit that manages the execution of a first user-defined process defined as the first user program and a second user-defined process defined as the second user program in response to transitions of a state machine having a plurality of states. The execution management unit transitions the state machine in response to the occurrence of one or more predetermined events, and when a transition occurs in the state machine, determines a user-defined process to be executed that is associated with the transition.
[0007] According to this configuration, the execution management unit determines the user-defined processes to be executed in the first program execution unit and the second program execution unit, respectively, which reduces the effort required to write complex processes such as interlocks in the first user program and the second user program themselves. This makes it easier to program multiple types of programs with different execution formats.
[0008] Any user-defined process may be set in association with each of the transitions that can occur in the state machine. With this configuration, any process corresponding to the control target can be easily set without modifying the program.
[0009] The user-defined processes associated with each of the transitions that can occur in the state machine may be set via a user interface screen. With this configuration, the user-defined processes associated with the transitions can be easily set.
[0010] The execution management unit may execute the user-defined process according to a predetermined execution form. The execution form may be selected from candidates including at least one of a first execution form that is executed only once when transitioning to the corresponding state, a second execution form that is continuously executed during the period in which the corresponding state exists, and a third execution form that is executed only once when transitioning from the corresponding state to another state. With this configuration, it is possible to set the execution form of the user-defined process according to the control target.
[0011] The execution management unit may wait for completion of execution of the corresponding user-defined process before transitioning the state machine even when the condition for transitioning the state machine is satisfied. With this configuration, even if there is a user-defined process that is executed over a predetermined period, it is possible to reduce the possibility that the user-defined process will affect a new state.
[0012] The state machine may include states that transition in response to the acquisition and release of control rights over the control object. This configuration can reduce the effort of programming related to the acquisition and release of control rights over the control object.
[0013] The state machine may be defined in association with a state machine corresponding to an operating state of the controlled object. With this configuration, a required user-defined process can be set according to the operating state of the controlled object.
[0014] According to another aspect of the present invention, there is provided a control method executed by a control device for controlling a control target. The control method includes the steps of managing a state machine having a plurality of states, managing the execution of a first user-defined process defined as a first user program including sequence instructions and a second user-defined process defined as a second user program written in a predetermined programming language in response to a transition of the state machine, executing the first user-defined process at predetermined intervals, and interpreting and executing the second user-defined process sequentially. The step of managing the state machine includes the step of transitioning the state machine in response to the occurrence of one or more predetermined events. The step of managing the execution includes the step of determining, when a transition occurs in the state machine, a user-defined process to be executed that is associated with the transition.
[0015] A control program according to yet another aspect of the present invention causes a control device for controlling a control target to execute the steps of managing a state machine having a plurality of states, managing the execution of a first user-defined process defined as a first user program including sequence instructions and a second user-defined process defined as a second user program written in a predetermined programming language in response to a transition of the state machine, executing the first user-defined process at predetermined intervals, and interpreting and executing the second user-defined process sequentially. The step of managing the state machine includes a step of transitioning the state machine in response to the occurrence of one or more predetermined events. The step of managing the execution includes a step of determining, when a transition occurs in the state machine, a user-defined process to be executed that is associated with the transition. Effect of the Invention
[0016] According to the present invention, it is possible to facilitate programming of a plurality of types of programs with different execution formats. [Brief description of the drawings]
[0017] [Figure 1] 1 is a schematic diagram showing an example of a system configuration of a control system according to an embodiment of the present invention; [Diagram 2] 1 is a diagram illustrating an application example of a control device according to an embodiment of the present invention. [Diagram 3] 2 is a schematic diagram illustrating an example of a hardware configuration of a control device that constitutes the control system according to the present embodiment. FIG. [Figure 4] FIG. 2 is a schematic diagram illustrating an example of a hardware configuration of a support device that constitutes the control system according to the present embodiment. [Diagram 5] FIG. 2 is a schematic diagram showing a configuration related to a program execution environment in the control device according to the present embodiment. [Figure 6] 10 is a diagram for explaining an example of a processing procedure when common processing is implemented in an IEC program in the control device according to the present embodiment. FIG. [Figure 7] 2 is a diagram for explaining an overview of execution management of a user program in the control device according to the present embodiment. FIG. [Figure 8] 2 is a schematic diagram showing an example of a state machine for managing the execution of a user program in the control device according to the present embodiment; FIG. [Figure 9] 5 is a schematic diagram showing an example of a user interface screen for defining a user-defined process setting in the control device according to the present embodiment. FIG. [Figure 10] 5 is a flowchart showing a processing procedure relating to execution management of a user program in the control device according to the present embodiment. [Figure 11] 5 is a time chart showing an example of a processing sequence relating to the execution of a user program in the control device according to the present embodiment. [Figure 12] 5 is a time chart showing an example of a processing sequence relating to the execution of a user program in the control device according to the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0018] Embodiments of the present invention will be described in detail with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals and their description will not be repeated.
[0019] <A. Application Example> First, a system configuration example of the control system 1 according to the present embodiment will be described.
[0020] FIG. 1 is a schematic diagram showing a system configuration example of the control system 1 according to the present embodiment. Referring to FIG. 1, the control system 1 includes a control device 100 for controlling a control target, a robot controller 250 network-connected to the control device 100 via a field network 10, and a servo controller 350.
[0021] The control device 100 periodically exchanges data with devices connected to the field network 10 and executes processing as described later. The control device 100 may typically be realized by a PLC (Programmable Logic Controller).
[0022] A teaching pendant 400 is connected to the control device 100. The teaching pendant 400 is used for an operator to manually operate and teach the position of the robot 200.
[0023] The robot controller 250 is in charge of controlling the robot 200. More specifically, the robot controller 250 functions as an interface with the robot 200, outputs a command for driving the robot 200 according to a command from the control device 100, and acquires the state information of the robot 200 and outputs it to the control device 100.
[0024] As the robot 200, for example, any robot such as a vertical articulated robot, a horizontal articulated (scalar) robot, a parallel link robot, or an orthogonal robot can be adopted.
[0025] The servo controller 350 is responsible for controlling the servo motor 300. More specifically, the servo controller 350 drives and rotates the servo motor 300 in accordance with commands from the control device 100, and also acquires status information of the servo motor 300 and outputs it to the control device 100.
[0026] The servo motor 300 is mechanically coupled to any mechanism or robot and drives the mechanism or robot by rotating. The servo motor 300 is not limited to the name of a servo motor, and any of an induction motor, a synchronous motor, a permanent magnet motor, and a reluctance motor may be used, and not only a rotary motor but also a linear motor may be used.
[0027] EtherCAT (registered trademark) or EtherNet / IP, which are protocols for industrial networks, can be used for the field network 10. When EtherCAT is adopted as the protocol, data can be updated between the control device 100 and devices connected to the field network 10 at regular intervals of, for example, several hundred microseconds to several milliseconds.
[0028] The control device 100 may be connected to the display device 600 and the server device 700 via a higher-level network 20. For the higher-level network 20, a protocol for industrial networks such as EtherNet / IP can be used.
[0029] A support device 500 may be connected to the control device 100 for installing user programs (an IEC program 150 and an application program 160, which will be described later) executed by the control device 100 and for performing various settings.
[0030] Fig. 2 is a diagram showing an application example of the control device 100 according to the present embodiment. Referring to Fig. 2, the control device 100 includes an IEC program execution unit 130 that executes an IEC program 150 at predetermined intervals, and an application program execution unit 134 that sequentially interprets and executes an application program 160.
[0031] The IEC program 150 includes one or more user-defined processes 152. Also, the application program 160 includes one or more user-defined processes 162.
[0032] The control device 100 includes an execution management unit 132 that selects the IEC program 150 (user-defined process 152) and the application program 160 (user-defined process 162) and causes them to be executed in the IEC program execution unit 130 and the application program execution unit 134.
[0033] The execution management unit 132 has a state machine 180 including a plurality of states. The execution management unit 132 transitions the state machine 180 in response to the occurrence of one or more predetermined events, and when a transition of the state machine 180 occurs, determines the user-defined processes 152, 162 to be executed associated with the transition.
[0034] In this way, since the execution management unit 132 selects the user-defined processes (programs) to be executed in the IEC program execution unit 130 and the application program execution unit 134 respectively, the labor of describing complex processes such as interlocks in the IEC program 150 and the application program 160 themselves can be reduced. As a result, programming of a plurality of types of programs with different execution formats can be facilitated.
[0035] <B. Hardware Configuration Example> Next, a hardware configuration example of the main devices constituting the control system 1 shown in FIG. 1 will be described.
[0036] (b1: Control Device 100) Fig. 3 is a schematic diagram showing an example of a hardware configuration of a control device 100 constituting a control system 1 according to the present embodiment. Referring to Fig. 3, the control device 100 includes a processor 102, a main memory 104, a storage 110, a memory card interface 112, a host network controller 106, a field network controller 108, a local bus controller 116, and a USB controller 120 providing a USB (Universal Serial Bus) interface. These components are connected via a processor bus 118.
[0037] The processor 102 corresponds to an arithmetic processing unit that executes control calculations, and is composed of a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), etc. Specifically, the processor 102 reads out a program stored in the storage 110, expands it in the main memory 104, and executes it to realize control calculations for a control target.
[0038] The main memory 104 is configured with a volatile storage device such as a dynamic random access memory (DRAM) or a static random access memory (SRAM). The storage 110 is configured with a non-volatile storage device such as a solid state drive (SSD) or a hard disk drive (HDD).
[0039] The storage 110 stores a system program 111 for implementing basic functions, and user programs (IEC program 150 and application program 160) created according to the object to be controlled.
[0040] The IEC program 150 includes instructions for implementing main controls other than the control of the robot 200 in the control system 1. The IEC program 150 may typically include sequence instructions and motion instructions. The IEC program 150 may be written in any language defined in IEC 61131-3 established by the International Electrotechnical Commission (IEC). However, the IEC program 150 may include a program written in a manufacturer-specific language other than the language defined in IEC 61131-3.
[0041] The application program 160 includes instructions for controlling the operation of the robot 200. The application program 160 may include instructions written in a predetermined programming language (for example, a programming language for robot control such as V+ language, or a programming language related to NC control such as G-code). Note that the application program 160 is not limited to applications for controlling the operation of the robot 200, and can also be used for applications for controlling, for example, a machine tool that is NC-controlled or any mechanism. For ease of explanation, the following mainly illustrates a case where the application program 160 controls the robot 200.
[0042] The memory card interface 112 accepts a memory card 114, which is an example of a removable storage medium. The memory card interface 112 is capable of reading and writing any data from and to the memory card 114.
[0043] The upper network controller 106 exchanges data with any information processing device (such as the display device 600 and the server device 700 shown in FIG. 1) via the upper network 20.
[0044] The field network controller 108 exchanges data with each device via the field network 10. In the example system configuration shown in FIG.
[0045] The local bus controller 116 exchanges data with any functional unit 124 included in the control device 100 via the local bus 122. The functional unit 124 may be, for example, an analog I / O unit responsible for input and / or output of analog signals, a digital I / O unit responsible for input and / or output of digital signals, a counter unit that receives pulses from an encoder, etc.
[0046] The USB controller 120 exchanges data with any information processing device (such as the support device 500) via a USB connection.
[0047] (b2: Robot Controller 250) The robot controller 250 includes, as its main components, a network controller that exchanges data with the control device 100, a processing circuit that executes the calculations required to drive the robot 200, and an interface circuit that exchanges data with the robot 200.
[0048] (b3: Servo controller 350) The servo controller 350 includes, as its main components, a network controller for exchanging data with the control device 100, a processing circuit for executing the calculations required to drive the servo motor 300, and a drive circuit for generating power to be supplied to the servo motor 300.
[0049] (b4: Teaching Pendant 400) The teaching pendant 400 mainly includes an interface for exchanging data with the control device 100, an input unit for receiving operations for the robot 200, and a display unit for displaying various information.
[0050] (b5: Support device 500) The support device 500 constituting the control system 1 according to the present embodiment may be realized, for example, by using a general-purpose personal computer.
[0051] Fig. 4 is a schematic diagram showing an example of a hardware configuration of a support device 500 constituting the control system 1 according to the present embodiment. With reference to Fig. 4, the support device 500 includes a processor 502 such as a CPU or an MPU, a main memory 504, an input unit 506, a display unit 508, a storage 510, a network controller 516, a USB controller 518, and an optical drive 520. These components are connected via a bus 524.
[0052] The processor 502 reads various programs stored in the storage 510, expands them in the main memory 504, and executes them to provide processing such as the development of user programs (IEC program 150 and application program 160) to be executed by the control device 100.
[0053] The storage 510 is composed of, for example, a non-volatile storage device such as an SSD or HDD. The storage 510 typically stores an OS 512 and a development program 514 for creating a user program to be executed in the control device 100, debugging the created user program, defining a system configuration, setting various parameters, and the like. The storage 510 may store necessary programs other than the programs shown in FIG.
[0054] The input unit 506 is configured with a keyboard, a mouse, etc., and receives user operations. The display unit 508 is configured with a display, various indicators, a printer, etc., and outputs the processing results from the processor 502, etc.
[0055] A network controller 516 controls data transfer to and from other devices over any network. A USB controller 518 controls data transfer to and from the control device 100 over a USB connection.
[0056] The support device 500 has an optical drive 520, and a program stored therein is read from a recording medium 522 (e.g., an optical recording medium such as a DVD (Digital Versatile Disc)) that non-transiently stores a computer-readable program, and the program is installed in storage 510, etc.
[0057] Various programs executed by the support device 500 may be installed via a computer-readable recording medium 522, or may be installed by downloading from a server device on a network. In addition, the functions provided by the support device 500 according to this embodiment may be realized by using some of the modules provided by the OS 512.
[0058] (b6:Display device 600) The display device 600 constituting the control system 1 according to the present embodiment may be realized, for example, by using a general-purpose personal computer. A basic hardware configuration example of the display device 600 is well known, so a detailed description will not be given here.
[0059] (b7: server device 700) The server device 700 constituting the control system 1 according to the present embodiment may be realized by using a general-purpose personal computer, for example. A basic hardware configuration example of the server device 700 is well known, so a detailed description will not be given here.
[0060] (b8: Other forms) Although FIGS. 3 and 4 show a configuration example in which one or more processors provide necessary functions by executing a program, some or all of these provided functions may be implemented using dedicated hardware circuits (for example, ASIC (Application Specific Integrated Circuit) or FPGA (Field-Programmable Gate Array), etc.).
[0061] <Execution of C.IEC program and application program> Next, the execution of user programs (IEC program 150 and application program 160) in the control device 100 according to the present embodiment will be described.
[0062] FIG. 5 is a schematic diagram showing a configuration related to a program execution environment in the control device 100 according to the present embodiment. Referring to FIG. 5, the control device 100 includes an IEC program execution unit 130, an application program execution unit 134, a data management unit 142, and an execution management unit 132.
[0063] The IEC program execution unit 130 executes the IEC program 150, which is a user program including sequence instructions, at a predetermined cycle. Note that the IEC program 150 includes motion instructions in addition to sequence instructions.
[0064] The application program execution unit 134 sequentially interprets and executes the application program 160, which is a user program described in a predetermined programming language. The application program 160 typically includes instructions for controlling the robot 200. The application program execution unit 134 includes an interpreter 136, a cache 138, and a command generation unit 140.
[0065] The interpreter 136 sequentially interprets the application program 160 to generate intermediate code. The generated intermediate code is queued (enqueued) in the cache 138. The command generation unit 140 refers to the intermediate code queued in the cache 138 each time and transmits a command to the target robot 200.
[0066] The data management unit 142 holds the data necessary for program execution. The data held by the data management unit 142 is refreshed (updated) at a predetermined cycle. The data management unit 142 includes an IO data area 144 for holding input / output data, and an internal data area 146 and a shared area 148 for holding working data used inside the control device 100. In the shared area 148, data that can be commonly referred to by the IEC program execution unit 130 and the application program execution unit 134 is stored. The data management unit 142 may manage data in the form of variables.
[0067] The execution management unit 132 manages the execution of user programs in the IEC program execution unit 130 and the application program execution unit 134. Details of the execution management unit 132 will be described later.
[0068] <D. Problem> Next, problems that may occur in the execution of the user program shown in FIG. 5 will be described.
[0069] The control device 100 according to the present embodiment can execute the IEC program 150 and the application program 160 in parallel. Each user program can be assigned roles as follows, for example.
[0070] That is, the application program 160 may be programmed to realize predetermined operations such as assembly and processing on the robot 200, and the IEC program 150 may be programmed to realize operations in conjunction with peripheral devices, sensors, actuators, etc. related to the operation of the robot 200.
[0071] On the other hand, since the IEC program 150 and the application program 160 have different execution formats, common processing of the system and robot, such as behavior when an abnormality occurs (e.g., stopping operation or evacuation operation), behavior when a task is completed (e.g., moving to a waiting position), and behavior when a signal is detected, must also be programmed according to the execution format.
[0072] Therefore, by consolidating the common processing into one of the programs, the effort of having to write the common processing into each program can be reduced; however, this can result in another problem in that the programs themselves become more complex.
[0073] FIG. 6 is a diagram for explaining an example of a processing procedure in the case where common processing is implemented in the IEC program 150 in the control device 100 according to the present embodiment.
[0074] 6, when an event occurs that requires execution of a common process, application program 160 executes a process for releasing the control right for target robot 200 (step S1).
[0075] Then, the IEC program 150 is notified that the control right has been released (step S2). The application program 160 waits for the completion of the processing in the IEC program 150 (step S3).
[0076] In response to the notification from the application program 160, the IEC program 150 executes a process to acquire the control right (step S4). Then, the IEC program 150 executes a common process (step S5). After the common process is executed, the control right is released (step S6), and the application program 160 is notified that the control right has been released (step S7).
[0077] Then, in the application program 160, a process of acquiring control authority is executed (step S8), and the process resumes (step S9).
[0078] As shown in FIG. 6, when the common process is implemented together in one program, it is necessary to acquire and release control authority for the robot 200 to be controlled, interlock between programs, adjust timing, etc., which complicates the program itself and reduces reusability.
[0079] <E. Solution means> Next, a configuration for solving the above-described problems will be described.
[0080] FIG. 7 is a diagram for explaining an outline of execution management of a user program in the control device 100 according to the present embodiment. Referring to FIG. 7, the execution management unit 132 has a state machine 180, and manages the execution of the user-defined process 152 defined as the IEC program 150 and the user-defined process 162 defined as the application program 160 according to the transition of the state machine 180. The execution management unit 132 is provided with a user-defined process setting 133 that defines the correspondence between the transition of the state machine 180 and the user-defined process to be executed.
[0081] The user-defined process 152 may be defined as one of a plurality of programs included in the IEC program 150, or may be defined as a part of the programs included in the IEC program 150. Similarly, the user-defined process 162 may be defined as one of a plurality of programs included in the application program 160, or may be defined as a part of the programs included in the application program 160.
[0082] <F. State machine 180> Next, an example of the state machine 180 for performing execution management of the user program will be described.
[0083] FIG. 8 is a schematic diagram showing an example of a state machine 180 for managing the execution of a user program in the control device 100 according to the present embodiment.
[0084] 8 includes an operation management state and a program execution management state. The operation management state corresponds to a state machine corresponding to the operation state of a control target (for example, the entire system including the robot 200).
[0085] More specifically, the operation management states include an operating state 182 , a deceleration / stopping state 183 , a stopping state 184 , an invalid state 185 , an error deceleration / stopping state 186 , and a teaching pendant control state 187 .
[0086] The moving state 182, the decelerating and stopping state 183, and the stopping state 184 occur when the control device 100 has acquired the control authority (the control authority acquired state 181).
[0087] Here, the control right for a controlled object (for example, the robot 200) means the right to send a command to the controlled object. In the control system 1, the robot 200 can be controlled from either the control device 100 or the teaching pendant 400. In other words, when a user operates the teaching pendant 400 to control the robot 200, a command value or a command according to the user's operation is given priority. Also, in the control device 100, the robot 200 can be controlled from either the IEC program 150 or the application program 160. Therefore, management using the control right is performed to exclusively determine a single entity that controls the robot 200.
[0088] The operating state 182 means that the robot 200 is operating, the decelerating and stopping state 183 means that the robot 200 is decelerating to a stopped state, and the stopping state 184 means that the robot 200 is stopped. The robot 200 is controlled by commands written in the application program 160 to enter any one of these states.
[0089] The invalid state 185 refers to a process of exchanging control rights, and occurs in a process in which the control device 100 acquires or releases control rights, and in a process in which the teaching pendant 400 acquires or releases control rights. In addition, the initial state immediately after power-on corresponds to the invalid state 185.
[0090] The error deceleration / stopping state 186 means that some abnormality has occurred and the robot 200 is decelerating to a stop.
[0091] The teaching pendant control state 187 means a state in which the user is operating the teaching pendant 400 to control the robot 200 .
[0092] In association with such operation management states, the following program execution management states are defined.
[0093] More specifically, the state machine 180 includes, as program execution management states, a control right acquisition state 191, a control right release state 192, a control right acquisition (TP) state 193, a control right release (TP) state 194, and an abnormality cancellation state 195. Note that "TP" stands for a teaching pendant.
[0094] The execution management unit 132 of the control device 100 transitions the program execution management state of the state machine 180 in response to the occurrence of one or more predetermined events.
[0095] The control right acquired state 191 and the control right acquired (TP) state 193 are included in the invalid state 185, and occur in the process in which the control device 100 and the teaching pendant 400 acquire the control right, respectively. More specifically, a transition to the control right acquired state 191 occurs when the execution of a command for acquiring the control right included in the IEC program 150 or the application program 160 is completed. Also, a transition to the control right acquired (TP) state 193 occurs when the user changes the mode of the teaching pendant 400 from "Auto" to "Manual."
[0096] In the control right acquisition state 191, when the execution of a preset user-defined process is completed, the state transitions to the stopped state 184. Also, in the control right acquisition (TP) state 193, when the execution of a preset user-defined process is completed, the state transitions to the teaching pendant control state 187.
[0097] The control right released state 192 is included in the stopped state 184, and occurs in the process in which the control device 100 releases the control right. More specifically, a transition to the control right released state 192 occurs when the execution of a command for releasing the control right, which is included in the IEC program 150 or the application program 160, is completed. In the control right released state 192, a transition to the disabled state 185 occurs when the execution of a preset user-defined process is completed.
[0098] The control released (TP) state 194 is included in the teaching pendant controlling state 187, and occurs in the process in which the teaching pendant 400 releases the control. More specifically, a transition to the control released (TP) state 194 occurs when the user changes the mode of the teaching pendant 400 from "Manual" to "Auto." In the control released (TP) state 194, when execution of a preset user-defined process is completed, a transition to the invalid state 185 occurs.
[0099] Thus, the state machine 180 includes, as program execution management states, states that transition in response to the acquisition and release of control rights over a control object.
[0100] The abnormality cleared state 195 is included in the error deceleration stopped state 186, and occurs in the process of clearing the abnormality that occurred. More specifically, when the clearing of the abnormality that occurred is completed, the state transitions to the abnormality cleared state 195. When the execution of a preset user-defined process is completed in the abnormality cleared state 195, the state transitions to the invalid state 185.
[0101] As shown in FIG. 8, for the program execution management states (control authority acquisition state 191, control authority release state 192, control authority acquisition (TP) state 193, control authority release (TP) state 194, and abnormality release state 195), even if the conditions for transitioning the state machine 180 are met, the transition is made after waiting for completion of the execution of the corresponding user-defined process.
[0102] The operation management states are not limited to the states shown in Fig. 8, and other states may be added, or some states may be omitted. The program execution management states are not limited to the states shown in Fig. 8, and any state may be defined. The conditions for causing a transition are not limited to the conditions shown in Fig. 8, and any condition may be added or set. If a user-defined process that is a condition for a transition is not set, the transition may occur without waiting for completion of execution of the user-defined process.
[0103] In the control device 100, any user-defined process can be set in association with each transition (transition of program execution management state) that can occur in the state machine 180. The user-defined process can include both the IEC program 150 and the application program 160. The setting contents of the user-defined process are defined in the user-defined process setting 133.
[0104] The execution management unit 132 of the control device 100 refers to the user-defined process setting 133, and when a transition occurs in the state machine 180, determines the user-defined process to be executed that is associated with the transition.
[0105] Furthermore, the execution management unit 132 of the control device 100 executes the user-defined process according to a predetermined execution form. The execution form of the user-defined process may be selectable from three possible types: (1) entry, (2) do, and (3) exit. More specifically, (1) entry is an execution form that is executed only once when transitioning to the corresponding state. (2) do is an execution form that continues to be executed during the period in which the corresponding state exists. (3) exit is an execution form that is executed only once when transitioning from the corresponding state to another state.
[0106] It should be noted that the execution form candidates for the user-defined process may include at least one of the above (1) to (3). In other words, it is not necessary to include all of the above (1) to (3) in the execution form candidates for the user-defined process.
[0107] In this manner, the control device 100 according to the present embodiment can execute any user-defined process when the control right is acquired or released, and when an event such as an abnormality occurs.
[0108] Fig. 9 is a schematic diagram showing an example of a user interface screen 550 for defining the user-defined process setting 133 in the control device 100 according to the present embodiment. The user interface screen 550 shown in Fig. 9 is typically output to the display unit 508 of the support device 500 by the processor 502 of the support device 500 executing the development program 514.
[0109] Referring to FIG. 9, user interface screen 550 includes a program execution settings table 560 .
[0110] The program execution setting table 560 includes a state column 571 , an execution mode column 572 , an IEC program column 573 , and an application program column 574 .
[0111] The state column 571 includes a control authority acquisition row 561, a control authority release row 562, a control authority acquisition (TP) row 563, a control authority release (TP) row 564, and an abnormality clearance row 565, which correspond to the control authority acquisition state 191, the control authority release state 192, the control authority acquisition (TP) state 193, the control authority release (TP) state 194, and the abnormality clearance state 195, respectively.
[0112] In the execution mode column 572, three types of execution modes, an entry line 566, a do line 567, and an exit line 568, are defined in association with each state.
[0113] The user sets a program for implementing a user-defined process in the IEC program column 573 and / or the application program column 574 in association with a desired state and execution form.
[0114] 9, in association with an entry line 566 of the control right acquisition line 561, "program1" is set as the IEC program 150, and "program100" is set as the application program 160. In addition, in association with a do line 567 of the control right acquisition line 561, "program2" is set as the IEC program 150.
[0115] In the above setting example, when a transition to the control rights acquisition state 191 occurs, "program1" and "program100" are executed only once, and "program2" is executed every cycle while in the control rights acquisition state 191.
[0116] The setting content for the program execution setting table 560 in FIG. 9 is stored as the user-defined process setting 133. In this way, the user-defined process associated with each of the possible transitions in the state machine 180 is set via the user interface screen 550.
[0117] Note that FIG. 9 illustrates the user-defined processes executed in accordance with the transitions of the state machine 180. Usually, however, there are also arbitrary user programs (IEC program 150 and application program 160) that are executed when certain fixed or predefined conditions are satisfied, regardless of the transitions of the state machine 180. That is, the user-defined processes shown in FIG. 9 are assumed to be executed in addition to the execution processes of normal user programs.
[0118] <G. Processing Procedure> Next, the processing procedure related to the execution management of the user program in the control device 100 according to the present embodiment will be described.
[0119] FIG. 10 is a flowchart showing the processing procedure related to the execution management of the user program in the control device 100 according to the present embodiment. Each step shown in FIG. 10 is typically realized by the processor 102 of the control device 100 executing the system program 111.
[0120] Referring to FIG. 10, when a new control cycle arrives (YES in step S100), the control device 100 outputs the command value calculated in the previous control cycle (step S102) and acquires the input value to be used in the current control cycle (step S104).
[0121] The control device 100 determines whether an event that can cause a transition of the state machine 180 has occurred (step S106).
[0122] When an event occurs that may cause a transition of the state machine 180 (YES in step S106), the control device 100 determines whether a user-defined process of the application program 160 is set in association with the current state "exit" (step S108).
[0123] If a user-defined process of the application program 160 is set in association with the current state "exit" (YES in step S108), the control device 100 starts the set user-defined process (application program 160) (step S110).
[0124] If no user-defined process of the application program 160 has been set in association with the current state "exit" (NO in step S108), the process of step S110 is skipped.
[0125] Next, the control device 100 judges whether or not a user-defined process of the IEC program 150 is set in association with the current state "exit" (step S112).
[0126] If a user-defined process of the IEC program 150 is set in association with the current state "exit" (YES in step S112), the control device 100 executes the set user-defined process (IEC program 150) (step S114).
[0127] If no user-defined process of the IEC program 150 has been set in association with the "exit" of the current state (NO in step S112), the process of step S114 is skipped.
[0128] On the other hand, if no event that may cause a transition of the state machine 180 has occurred (NO in step S106), or after step S114, the control device 100 determines whether or not a user-defined process associated with "exit" is being executed (step S116). If a user-defined process associated with "exit" is being executed (YES in step S116), the control device 100 determines whether or not the user-defined process associated with "exit" has been executed (step S118). If the user-defined process associated with "exit" has not been executed (NO in step S118), the control device 100 waits for the arrival of the next control cycle.
[0129] If the user-defined process associated with "exit" has been completed (YES in step S118), the control device 100 transitions the state machine 180 to a new state (step S120). Note that even if there is no user-defined process associated with "exit", the process of step S120 is executed. In this manner, the control device 100 executes the process of managing the state machine 180 having a plurality of states.
[0130] On the other hand, if the user-defined process associated with "exit" is not being executed (NO in step S116), the processes in steps S118 and S120 are skipped.
[0131] Next, the control device 100 determines whether a transition to a new state has occurred in the state machine 180 (step S122).
[0132] If a transition to a new state has occurred in the state machine 180 (YES in step S122), the control device 100 determines whether or not a user-defined process of the application program 160 has been set in association with the "entry" of the new state (step S124).
[0133] If a user-defined process of the application program 160 has been set in association with the new state "entry" (YES in step S124), the control device 100 starts the set user-defined process (application program 160) (step S126).
[0134] If no user-defined process of the application program 160 has been set in association with the "entry" of the new state (NO in step S124), the process of step S126 is skipped.
[0135] Next, the control device 100 judges whether or not a user-defined process of the IEC program 150 is set in association with the new state "entry" (step S128).
[0136] If a user-defined process of the IEC program 150 has been set in association with the new state "entry" (YES in step S128), the control device 100 executes the set user-defined process (IEC program 150) (step S130).
[0137] If no user-defined process of the IEC program 150 has been set in association with the "entry" of the new state (NO in step S128), the process of step S130 is skipped.
[0138] Then, the control device 100 waits for the next control cycle to arrive. On the other hand, if no transition to a new state has occurred in the state machine 180 (NO in step S122), the control device 100 determines whether or not a user-defined process of the application program 160 has been set in association with the current state "do" (step S132).
[0139] If a user-defined process of the application program 160 is set in association with the current state "do" (YES in step S132), the control device 100 starts the set user-defined process (application program 160) (step S134).
[0140] If a user-defined process of the application program 160 has not been set in association with the current state "do" (NO in step S132), the process of step S134 is skipped.
[0141] Next, the control device 100 judges whether or not a user-defined process of the IEC program 150 is set in association with the current state "do" (step S136).
[0142] If a user-defined process of the IEC program 150 has been set in association with the current state "do" (YES in step S136), the control device 100 executes the set user-defined process (IEC program 150) (step S138).
[0143] If no user-defined process of the IEC program 150 has been set in association with the current state "do" (NO in step S136), the process of step S138 is skipped.
[0144] Then, the control device 100 waits for the next control cycle to arrive. By the above-mentioned process, it is possible to realize the execution management of any user-defined process according to the state. That is, the control device 100 manages the execution of the user-defined process defined as the IEC program 150 and the user-defined process defined as the application program 160 according to the transition of the state machine 180 (steps S106, S108, S112, S116, S124, S128, S132, S136).
[0145] The control device 100 then executes the user-defined processes defined as the IEC program 150 at predetermined intervals (S114, S130, S138), and also sequentially interprets and executes the user-defined processes defined as the application program 160 (S110, S126, S134).
[0146] Next, the processing order and the like relating to the execution of the above-mentioned user-defined processes will be described. 11 and 12 are time charts showing an example of a processing sequence for executing a user program in the control device 100 according to this embodiment. Fig. 11 shows an example of executing a user-defined process in association with "entry", and Fig. 12 shows an example of executing a user-defined process in association with "do".
[0147] 11, the control device 100 repeatedly executes a periodic execution task 170 at each control period T1. The periodic execution task 170 is set as a high-priority task. The periodic execution task 170 includes an input / output refresh process 171, an application input process 172, a transition monitoring process 173, an IEC program execution process 174, and an application output process 175.
[0148] The input / output refresh process 171 includes a process of outputting a command value calculated in the previous control cycle, and a process of acquiring an input value to be used in the current control cycle.
[0149] The application input process 172 includes a process for acquiring input values required for the execution of the application program 160 .
[0150] The transition monitoring process 173 monitors whether or not an event that causes any transition included in the state machine 180 occurs.
[0151] The IEC program execution process 174 includes a process for executing the IEC program 150 . The application output process 175 includes a process for calculating a command value by executing the application program 160. Note that the application output process 175 mainly includes a calculation process according to an intermediate code generated by sequentially interpreting the application program 160.
[0152] The application program 160 is executed in parallel with the periodic execution task 170. The application program 160 is executed sequentially over a period longer than the control period T1. Therefore, the execution process of the application program 160 may be temporarily interrupted during the execution of the periodic execution task 170.
[0153] One or more programs may be executed in parallel as the application program 160. For example, assume that there is an application program 177 for causing the robot 200 to execute basic operations, and an application program 178 for defining behavior when an abnormality occurs.
[0154] 11, when an event that causes a transition is detected in the transition monitoring process 173 in the control period T1 that starts at time t2, the user-defined process 176 (IEC program 150) associated with "entry" is executed. In this case, the time required for the IEC program execution process 174 is extended by the time required for the user-defined process 176 to be executed.
[0155] Also, the application program 178 associated with "entry" is started. It may take a period of multiple control periods T1 until the started application program 178 is completed. In this case, when the execution of the application program 178 is completed, a transition to a new state is made.
[0156] In the example shown in FIG. 12, when an event that causes a transition is detected in the transition monitoring process 173 during a control period T1 that starts at time t2, a transition to a new state may occur.
[0157] Then, the user-defined process 176 (IEC program 150) associated with "do" is repeatedly executed every control cycle T1. In this case, only the execution time of the user-defined process 176 will extend the time required for the IEC program execution process 174.
[0158] Also, the application program 178 associated with "do" is started. It may take the time of a plurality of control cycles T1 until the execution of the started application program 178 is completed, but it may be restarted again after completion as long as the conditions are satisfied.
[0159] <H. Supplementary Note> The present embodiment as described above includes the following technical ideas.
[0160] [Configuration 1] A control device (100) for controlling a control target, A first program execution unit (130) that executes a first user program (150) including sequence instructions at a predetermined cycle, A second program execution unit (134) that sequentially interprets and executes a second user program (160) described in a predetermined programming language, An execution management unit (132) that manages the execution of a first user-defined process (152) defined as the first user program and a second user-defined process (162) defined as the second user program in accordance with the transition of a state machine (180) having a plurality of states, The execution management unit, Transitions the state machine in response to the occurrence of one or more predetermined events, A control device that, when a transition occurs in the state machine, determines the user-defined process to be executed associated with the transition.
[0161] [Configuration 2] 2. The control device according to configuration 1, wherein any user-defined process can be set in association with each of the transitions that can occur in the state machine (133).
[0162] [Configuration 3] The control device according to configuration 2, wherein the user-defined actions associated with each of the transitions that can occur in the state machine are set via a user interface screen (550).
[0163] [Configuration 4] 4. The control device according to any one of configurations 1 to 3, wherein the execution management unit executes a user-defined process in accordance with a predetermined execution form.
[0164] [Configuration 5] The control device according to configuration 4, wherein the execution form is selected from candidates including at least one of a first execution form that is executed only once when transitioning to the corresponding state, a second execution form that continues to be executed during the period in which the corresponding state exists, and a third execution form that is executed only once when transitioning from the corresponding state to another state.
[0165] [Configuration 6] 6. The control device according to any one of configurations 1 to 5, wherein the execution management unit waits for completion of execution of a corresponding user-defined process before causing the state machine to transition even when a condition for causing the state machine to transition is satisfied.
[0166] [Configuration 7] 7. The control device according to any one of configurations 1 to 6, wherein the state machine includes states (191, 192, 193, 194) that transition in response to acquisition and release of control rights for the control object.
[0167] [Configuration 8] 8. The control device according to any one of configurations 1 to 7, wherein the state machine is defined in association with a state machine (182, 183, 184, 185, 186, 187) corresponding to an operating state of the controlled object.
[0168] [Configuration 9] A control method executed by a control device (100) for controlling a controlled object, comprising: Managing a state machine having a plurality of states (S120); managing the execution of a first user-defined process defined as a first user program including sequence instructions and a second user-defined process defined as a second user program written in a predetermined programming language in response to a transition of the state machine (S106, S108, S112, S116, S124, S128, S132, S136); A step of executing the first user-defined process at predetermined intervals (S114, S130, S138); and sequentially interpreting and executing the second user-defined process (S110, S126, S134); The step of managing the state machine includes a step of causing the state machine to transition in response to occurrence of one or more predetermined events; The step of managing the execution includes a step of determining, when a transition occurs in the state machine, a user-defined process to be executed that is associated with the transition.
[0169] [Configuration 10] A control program (111) for controlling a control object, the control program (100) including: Managing a state machine having a plurality of states (S120); managing the execution of a first user-defined process defined as a first user program including sequence instructions and a second user-defined process defined as a second user program written in a predetermined programming language in response to a transition of the state machine (S106, S108, S112, S116, S124, S128, S132, S136); A step of executing the first user-defined process at predetermined intervals (S114, S130, S138); executing steps (S110, S126, S134) of sequentially interpreting and executing the second user-defined process; The step of managing the state machine includes a step of transitioning the state machine in response to the occurrence of one or more predetermined events. The step of managing the execution includes a step of determining a user-defined process to be executed associated with the transition when a transition occurs in the state machine, and is a control program.
[0170] <I. Advantages> In the control system 1 according to the present embodiment, the state of the control device 100 is managed using a state machine, and when any transition occurs in the state machine, any user-defined process associated with the transition can be executed. Therefore, the necessity of implementing processes such as interlock between programs can be reduced, and thereby programming can be facilitated.
[0171] The embodiments disclosed this time should be considered to be illustrative in all respects and not restrictive. The scope of the present invention is shown not by the above description but by the claims, and it is intended that all modifications within the meaning and scope equivalent to the claims are included.
Description of Reference Numerals
[0172] 1 control system, 10 field network, 20 upper network, 100 control device, 102, 502 processor, 104, 504 main memory, 106 upper network controller, 108 field network controller, 110, 510 storage, 111 system program, 112 memory card interface, 114 memory card, 116 local bus controller, 118 processor bus, 120, 518 USB controller, 122 local bus, 124 functional unit, 130 IEC program execution unit, 132 execution management unit, 133 user-defined processing setting, 134 application program execution unit, 136 interpreter, 138 cache, 140 command generation unit, 142 data management unit, 144 data area, 146 internal data area, 148 shared area, 150 IEC program, 152, 162, 176 user-defined processing, 160, 177,178 application program, 170 periodic execution task, 171 input / output refresh processing, 172 application input processing, 173 transition monitoring processing, 174 IEC program execution processing, 175 application output processing, 180 state machine, 181 control authority acquired state, 182 operating state, 183 deceleration stop state, 184 stopped state, 185 invalid state, 186 error deceleration stop state, 187 teaching pendant control state, 191 control authority acquired state, 192 control authority released state, 193 control authority acquired (TP) state, 194 control authority released (TP) state, 195 error release state, 200 robot, 250 robot controller, 300 servo motor, 350 servo controller, 400 teaching pendant, 500 support device, 506 input section, 508 display section, 512 OS, 514 Development program, 516 network controller, 520 optical drive, 522 recording medium, 524 bus, 550 user interface screen, 560 program execution setting table, 561 control authority acquisition row, 562 control authority release row, 563 control authority acquisition (TP) row, 564 control authority release (TP) row, 565 abnormality release row, 566 entry row, 567 do row, 568 exit row, 571 state column, 572 execution form column, 573 IEC program column, 574 application program column, 600 display device, 700 server device, T1 control period.
Claims
1. A control device for controlling a control target, a first program execution unit that executes a first user program including a sequence command at predetermined intervals; a second program execution unit that sequentially interprets and executes a second user program written in a predetermined programming language, wherein in each predetermined cycle, the second user program is executed during a period in which the first user program is not executed, an execution management unit that manages the execution of a first user-defined process defined as the first user program and a second user-defined process defined as the second user program in response to a transition of a state machine having a plurality of states; The execution management unit is Transitioning the state machine in response to occurrence of one or more predetermined events; A controller that, when a transition occurs in the state machine, determines a user-defined operation to be performed that is associated with the transition.
2. The control device according to claim 1 , wherein any user-defined process can be set in association with each of the transitions that can occur in the state machine.
3. The control device according to claim 2 , wherein the user-defined actions associated with each of the transitions that can occur in the state machine are set via a user interface screen.
4. 4. The control device according to claim 1, wherein the execution management unit executes a user-defined process in accordance with a predetermined execution form.
5. 5. The control device according to claim 4, wherein the execution form is selected from candidates including at least one of a first execution form that is executed only once when transitioning to the corresponding state, a second execution form that continues to be executed during the period in which the corresponding state exists, and a third execution form that is executed only once when transitioning from the corresponding state to another state.
6. The control device according to any one of claims 1 to 5, wherein the execution management unit waits for completion of execution of a corresponding user-defined process before transitioning the state machine even if a condition for transitioning the state machine is met.
7. The control device according to claim 1 , wherein the state machine includes a state that transitions in response to acquisition and release of control rights for the controlled object.
8. The control device according to any one of claims 1 to 7, wherein the state machine is defined in association with a state machine corresponding to an operating state of the controlled object.
9. A control method executed by a control device for controlling a controlled object, comprising: managing a state machine having a plurality of states; managing the execution of a first user-defined process defined as a first user program including sequence instructions and a second user-defined process defined as a second user program written in a predetermined programming language in response to a transition of the state machine; executing the first user-defined process at predetermined intervals; and a step of sequentially interpreting and executing the second user-defined process, wherein in each predetermined cycle, the second user program is executed during a period in which the first user program is not executed, The step of managing the state machine includes a step of causing the state machine to transition in response to occurrence of one or more predetermined events; The step of managing the execution includes a step of determining, when a transition occurs in the state machine, a user-defined process to be executed that is associated with the transition.
10. A control program for controlling a control object, comprising: managing a state machine having a plurality of states; managing the execution of a first user-defined process defined as a first user program including sequence instructions and a second user-defined process defined as a second user program written in a predetermined programming language in response to a transition of the state machine; executing the first user-defined process at predetermined intervals; and executing a step of sequentially interpreting and executing the second user defined process, wherein in each predetermined cycle, the second user program is executed during a period in which the first user program is not being executed, The step of managing the state machine includes a step of causing the state machine to transition in response to occurrence of one or more predetermined events; The step of managing the execution includes a step of determining, when a transition occurs in the state machine, a user-defined process to be executed that is associated with the transition.
Citation Information
Patent Citations
Personal computer nc, programmable controller with personal computer and software developing tool for programmable controller
JP2003177806A
Multi-sequence type sequence control device
JP2004259010A
Robot device, information processing system, information processing method, and computer program
JP2005321954A
Control device
JP2019036043A
Cloud-Based Integration Rule Engine to Enable Plug and Play Device for Building Automation Systems
US20180341241A1
