WO2018186358A1 - 制御装置、制御方法および制御プログラム - Google Patents

制御装置、制御方法および制御プログラム Download PDF

Info

Publication number
WO2018186358A1
WO2018186358A1 PCT/JP2018/014142 JP2018014142W WO2018186358A1 WO 2018186358 A1 WO2018186358 A1 WO 2018186358A1 JP 2018014142 W JP2018014142 W JP 2018014142W WO 2018186358 A1 WO2018186358 A1 WO 2018186358A1
Authority
WO
WIPO (PCT)
Prior art keywords
control
task
priority
time
execution
Prior art date
Application number
PCT/JP2018/014142
Other languages
English (en)
French (fr)
Inventor
隆宏 徳
Original Assignee
オムロン株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from JP2018048152A external-priority patent/JP6406466B1/ja
Application filed by オムロン株式会社 filed Critical オムロン株式会社
Priority to DE112018001886.5T priority Critical patent/DE112018001886T5/de
Priority to CN201880017192.3A priority patent/CN110402430B/zh
Priority to US16/495,113 priority patent/US11301294B2/en
Publication of WO2018186358A1 publication Critical patent/WO2018186358A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • G06F9/4887Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues involving deadlines, e.g. rate based, periodic
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/15Plc structure of the system
    • G05B2219/15079Multitasking, real time multitasking
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/25Pc structure of the system
    • G05B2219/25343Real time multitasking

Definitions

  • This technology relates to a control device, a control method, and a control program for controlling an object.
  • FA Vectory Automation
  • PLC programmable controller
  • the PLC of Patent Document 1 Japanese Patent Publication No. 2013-506911
  • the PLC of Patent Document 1 includes one or more processors assigned to each of the PLC functions, and at least two of these PLC functions operate in parallel. I am letting.
  • a control device such as a PLC has predetermined control tasks for controlling equipment including a sequence program for realizing sequence control of equipment provided at a production site and a motion program for realizing motion control. By executing every cycle, real-time control of the equipment is realized.
  • Patent Document 1 At least two of the PLC functions are operated in parallel, but a control task for performing real-time control of a target and a non-control task are executed so as to guarantee real-time control of the target. No specific configuration for this is proposed.
  • This technology provides a control device, a control method, and a control program for executing a control task for real-time control of an object and a non-control task so as to guarantee real-time control of the object.
  • a plurality of control devices that control a target, including a control task for performing real-time control of the target and a non-control task for performing related processing related to real-time control
  • a processor that executes a plurality of tasks, a multi-task execution unit that causes a processor to execute a plurality of tasks according to an order based on a priority associated with each task of a plurality of tasks, and a scheduler that variably sets the priority of a non-control task And the priority of the control task is set to the highest priority.
  • the scheduler sets the first priority when the execution start condition of the non-control task is satisfied, and the time from the start of execution of the non-control task during the first time for executing the related processing in real time Priority switching that maintains the priority of the non-control task at the first priority, and then switches the priority of the non-control task to the second priority when the time from the start of execution becomes longer than the first time.
  • the first time is set to be variable.
  • the priority switching unit further switches the priority of the non-control task to the first priority when the time from the start of execution of the non-control task of the second priority becomes longer than the second time. .
  • the second time is set to be variable.
  • the related processing uses a feature amount generation process for generating a feature amount suitable for detecting an abnormality that occurs in the target from data related to the target, and a feature amount generated by the feature amount generation process.
  • the related processing includes calculation processing for calculating a control amount for estimation of the target using a command value output from the control device to the target and a predetermined predictive control model, and a control amount calculated by the calculation processing.
  • the control task includes a control calculation task for calculating a command value for the object in accordance with the calculated correction value.
  • the related processing includes calculation processing for calculating a target control amount output to the target from the control device and a predetermined predictive control model, and control calculated by the calculation processing.
  • a correction value calculation process for calculating a correction value based on the amount is included, and the control task includes a control calculation task for calculating a command value for the object in accordance with the calculated correction value.
  • the correction value calculation process includes a process of calculating a correction value that is compensated so that the control amount falls within a predetermined range.
  • the non-control task includes a collection unit that collects information related to the execution of the non-control task including the execution time, and the information collected by the collection unit is output to the outside.
  • the collected information includes the number of times of switching the priority of the non-control task.
  • the contents of the related process are set variably.
  • the processor includes a plurality of processor cores, and further includes a core information storage unit for storing core information for designating a processor core for executing a non-control task, and the scheduler further includes the core information or each processor.
  • a core switching unit that determines a processor core that executes a non-control task based on the utilization rate of the core is included.
  • the core information includes information specifying a processor core that executes the non-control task based on the priority of the non-control task.
  • a control method in a control device that controls an object includes a processor that executes a plurality of tasks including a control task for performing a target real-time control and a non-control task for performing a related process related to the real-time control, and each task of the plurality of tasks.
  • a multitask execution unit that causes the processor to execute the plurality of tasks according to an order based on the associated priority, and the priority of the control task is set to the highest priority.
  • the control method sets the first priority when the execution start condition of the non-control task is satisfied, and the time from the start of execution of the non-control task is during the first time for executing the related process in real time. , Maintaining the priority of the non-control task at the first priority, and then, when the time from the start of execution becomes longer than the first time, the priority of the non-control task is set to the second priority. Switching to lower.
  • a program for causing a computer to execute the above control method is provided.
  • control task for controlling the target in real time and the non-control task can be executed so as to guarantee the real-time control of the target.
  • FIG. 12 is a diagram illustrating priority switching of a related processing task 143 in association with FIG. 11. It is a figure which shows the example which sets a priority and a threshold value to the some related processing task which concerns on this Embodiment.
  • a task is a unit of processing executed by a processor, and a task includes one or more programs.
  • the real-time property of a task indicates that the execution is completed within a predetermined time from the start of the execution of the task.
  • Control task is a task for real-time control of a target to be controlled in the field device group.
  • the “non-control task” is not directly involved in the real-time control, but is a task that requires real-time property and is a task for performing the processing related to the real-time control described above. .
  • the “priority” of a task indicates the relative order in which the task is executed by the processor before other tasks. If the priority is high, the execution order is first, and if the priority is low, the execution order is later.
  • the scheduler of the control device variably sets the priorities of a plurality of tasks including a control task and a non-control task.
  • the priority of the control task among the plurality of tasks is set highest.
  • the scheduler sets the first priority when the execution start condition of the non-control task is satisfied, and does not control during the first time for executing the related processing in real time from the start of execution of the non-control task.
  • the priority of the task is maintained at the first priority (high priority) and then the execution time, which is the elapsed time from the start of execution, becomes longer than the first time, the priority of the non-control task is set to the second priority. Switch to lower (low priority).
  • the related processing can be executed while maintaining the real time property, and for example, real time control of the target using the result of the related processing can be realized.
  • the execution time becomes longer than the first time, other tasks can be executed preferentially by lowering the priority of non-control tasks, so other tasks execute processing that contributes to real-time control. If it is, real-time control of the target using the execution results of other tasks becomes possible. Therefore, it is possible to realize real-time execution of related processing by the non-control task while guaranteeing real-time control of the target by the control task.
  • FIG. 1 is a schematic diagram showing an example of the overall configuration of a control system 1 according to the present embodiment.
  • a control system 1 according to the present embodiment includes, as main components, a control device 100 that controls an object to be controlled and a support device 200 connected to the control device 100.
  • the control device 100 may be embodied as a kind of computer such as a PLC (programmable controller).
  • the control device 100 is connected to the field device group 10 via the first field network 2 and is connected to one or a plurality of display devices 400 via the second field network 4. Further, the control device 100 is connected to the data logging device 300 via the local network 6.
  • the control device 100 exchanges data with a connected device via each network.
  • the data logging device 300 and the display device 400 are optional configurations and are not essential configurations of the control system 1.
  • the control device 100 has a function of executing various operations for controlling facilities and machines such as production sites, and data measured by the field device group 10 and transferred to the control device 100 (hereinafter referred to as “input data”). And a monitoring function for monitoring the collected input data. By implementing these functions in the control device 100, it is possible to monitor a phenomenon occurring in the target.
  • an internal database 130 implemented in the control device 100 provides a part of the collection function described above, and an abnormality detection program implemented in the control device 100. (Described below) provides a monitoring function.
  • the field device group 10 includes a device that collects input data from an object to be controlled by the control device 100 or a manufacturing device or a production line related to the control (hereinafter also collectively referred to as “field”). As an apparatus for collecting such input data, an input relay, various sensors, and the like are assumed.
  • the field device group 10 further includes a device that gives some action to the field based on a command generated by the control device 100 (hereinafter also referred to as “output data”). As an apparatus that gives some action to such a field, output relays, contactors, servo drivers and servo motors, and other arbitrary actuators are assumed.
  • These field device groups 10 exchange data including input data and output data with the control device 100 via the first field network 2.
  • the field device group 10 includes a remote I / O (Input / Output) device 12, a relay group 14, an image sensor 18 and a camera 20, a servo driver 22, a servomotor 24 and I. / O unit 16 is included.
  • the field device group 10 is not limited to these, and any device that can collect input data or any device that can perform some action based on output data may be adopted.
  • the remote I / O device 12 includes a communication coupler that performs communication via the first field network 2 and an input / output unit (hereinafter also referred to as “I / O unit”) for acquiring input data and outputting output data. .).
  • I / O unit an input / output unit
  • FIG. 1 shows an example in which digital signals are exchanged as input data and output data via the relay group 14.
  • the I / O unit may be directly connected to the fieldbus.
  • FIG. 1 shows an example in which an I / O unit 16 is directly connected to the first field network 2.
  • the image sensor 18 performs image measurement processing such as pattern matching on the image data captured by the camera 20, and transmits the processing result to the control device 100.
  • Servo driver 22 drives servo motor 24 in accordance with output data from control device 100.
  • data is exchanged between the control device 100 and the field device group 10 via the first field network 2.
  • the period T indicates a predetermined unit time for performing real-time control of the field device group 10, and has, for example, several hundred ⁇ sec order to several tens msec order. Note that such exchange processing of data is sometimes referred to as “I / O refresh processing”.
  • the display device 400 connected to the control device 100 via the second field network 4 receives an operation from the user and transmits a command or the like according to the user operation to the control device 100.
  • the calculation result at 100 is displayed graphically.
  • the data logging device 300 is connected to the control device 100 via the local network 6, and exchanges necessary data with the control device 100.
  • the data logging device 300 collects, for example, event logs generated by the control device 100 in time series.
  • the support device 200 is a device that supports preparations necessary for the control device 100 to control the target.
  • the support device 200 includes a development environment (program creation / editing tool, parser, compiler, etc.) of a user program executed by the control device 100, parameters of various devices connected to the control device 100 and the control device 100 ( A setting environment for setting (configuration), a function of transmitting a generated user program to the control device 100, a user program executed on the control device 100, etc., which is modified or changed online (or offline), which will be described later 227 (described later).
  • a development environment program creation / editing tool, parser, compiler, etc.
  • FIG. 2 is a block diagram illustrating a hardware configuration example of the control device 100 configuring the control system 1 according to the present embodiment.
  • control device 100 includes timer 101 for measuring various times including period T, processor 102 such as a CPU (Central Processing Unit) or MPU (Micro-Processing Unit), and a chip set.
  • processor 102 such as a CPU (Central Processing Unit) or MPU (Micro-Processing Unit)
  • main storage device 106 main storage device 106, secondary storage device 108, local network controller 110, USB (Universal Serial Bus) controller 112, memory card interface 114, internal bus controller 122, and field bus controllers 118 and 120.
  • I / O units 124-1, 124-2 are examples of I 124-1, 124-2,.
  • the secondary storage device 108 is configured by, for example, a nonvolatile storage device such as an HDD (Hard Disk Drive) or an SSD (Solid State Drive).
  • the main storage device 106 includes a volatile storage device such as a DRAM (Dynamic Random Access Memory) and an SRAM (Static Random Access Memory).
  • the processor 102 reads out various programs stored in the secondary storage device 108, develops them in the main storage device 106, and executes them, thereby performing control according to the target of the field device group 10, and various types as described later. Realize processing.
  • the chip set 104 realizes processing as the entire control apparatus 100 by controlling the processor 102 and each component.
  • the secondary storage device 108 stores various programs such as a user program 150 executed by the processor 102 and an internal DB 130.
  • the local network controller 110 controls data exchange with other devices via the local network 6.
  • the network controller 110 is typically implemented by using a dedicated circuit such as an application specific integrated circuit (ASIC) or a field-programmable gate array (FPGA).
  • ASIC application specific integrated circuit
  • FPGA field-programmable gate array
  • the USB controller 112 controls data exchange with the support device 200 via the USB connection.
  • the USB controller 112 is typically realized using a dedicated circuit such as an ASIC or FPGA.
  • the memory card interface 114 is configured so that the memory card 116 can be attached and detached, and can write data to the memory card 116 and read various data (such as user programs or trace data) from the memory card 116. ing.
  • the internal bus controller 122 is an interface for exchanging data with the I / O units 124-1, 124-2,.
  • the internal bus controller 122 is typically implemented using a dedicated circuit such as an ASIC or FPGA.
  • the fieldbus controller 118 controls data exchange with other devices via the first field network 2.
  • the fieldbus controller 118 is typically realized by using a dedicated circuit such as an ASIC or FPGA, but may be realized by software implementation.
  • the fieldbus controller 118 is mainly composed of a processor 102, a main storage device 106, a storage, and the like.
  • the processor 102 reads a system program (firmware) stored in the storage, and the like. Necessary processing is realized by expanding and executing in the storage device 106.
  • the fieldbus controller 120 controls data exchange with other devices via the second field network 4.
  • the fieldbus controller 120 is also typically implemented using a dedicated circuit such as an ASIC or FPGA, but may be implemented by software implementation.
  • the fieldbus controller 120 is mainly composed of a processor 102, a main storage device 106, a storage, and the like.
  • the processor 102 reads a system program (firmware) stored in the storage, and the like. Necessary processing is realized by expanding and executing in the storage device 106.
  • control device 100 of FIG. 2 may be installed via a recording medium such as a computer-readable memory card 116, but may be downloaded from a server device or the like on a network. You may make it install in 108. Further, the function provided by the control device 100 according to the present embodiment may be realized by using a part of a module provided by an OS (Operating System) 190 described later.
  • OS Operating System
  • FIG. 2 shows a configuration example in which necessary functions are provided by the processor 102 executing the above-described program. However, some or all of the provided functions are transferred to dedicated hardware circuits (for example, an ASIC or FPGA may be used. Or you may implement
  • dedicated hardware circuits For example, an ASIC or FPGA may be used. Or you may implement
  • a plurality of OSs having different applications may be executed in parallel using a virtualization technique, and necessary applications may be executed on each OS.
  • the support device 200 is realized by executing a program using hardware (for example, a general-purpose personal computer) according to a general-purpose architecture.
  • hardware for example, a general-purpose personal computer
  • FIG. 3 is a block diagram illustrating a hardware configuration example of the support device 200 configuring the control system 1 according to the present embodiment.
  • the support device 200 includes a processor 202 such as a CPU or MPU, an optical drive 204, a main storage device 206, a secondary storage device 208, a USB (Universal Serial Bus) controller 212, a local A network controller 214, an input unit 216, and a display unit 218 are included. These components are connected via a bus 220.
  • a processor 202 such as a CPU or MPU
  • an optical drive 204 such as a main storage device 206, a secondary storage device 208, a USB (Universal Serial Bus) controller 212, a local A network controller 214, an input unit 216, and a display unit 218 are included.
  • USB Universal Serial Bus
  • the processor 202 reads out various programs stored in the secondary storage device 208, develops them in the main storage device 206, and executes them, thereby realizing various processes as described later.
  • the secondary storage device 208 includes, for example, an HDD (Hard Disk Drive) or an SSD (Flash Solid State Drive).
  • the secondary storage device 208 typically includes a development program 222 for creating a user program 150, defining a system configuration, setting various parameters, and a parameter setting tool 224 for specifying various variables.
  • a data mining tool 226 for extracting target information from data collected by the control device 100, a debugging tool 227 for task scheduling, and collection information 228 may be stored.
  • the collected information 228 is information that can be used for debugging, and is a collection of information collected when a task is executed in the control device 100. Details of the debug tool 227 and the collection information 228 will be described later.
  • the secondary storage device 208 may store an OS and other necessary programs.
  • the support device 200 includes an optical drive 204, and from a recording medium 205 (for example, an optical recording medium such as a DVD (Digital Versatile Disc)) that temporarily stores a computer-readable program.
  • a recording medium 205 for example, an optical recording medium such as a DVD (Digital Versatile Disc)
  • the stored program may be read and installed in the secondary storage device 208 or the like.
  • the various programs executed by the support device 200 may be installed via the computer-readable recording medium 205, but may be installed by downloading from a server device on the network.
  • the function provided by the support device 200 according to the present embodiment may be realized by using a part of a module provided by the OS.
  • the USB controller 212 controls data exchange with the control device 100 via the USB connection.
  • the local network controller 214 controls data exchange with other devices via an arbitrary network.
  • the input unit 216 includes a keyboard and a mouse, and accepts user operations.
  • the display unit 218 includes a display, various indicators, a printer, and the like, and outputs a processing result from the processor 202 and the like.
  • FIG. 3 shows a configuration example in which a necessary function is provided by the processor 202 executing a program. However, a part or all of the provided function is transferred to a dedicated hardware circuit (for example, an ASIC). Alternatively, it may be implemented using an FPGA or the like.
  • a dedicated hardware circuit for example, an ASIC.
  • FPGA field-programmable gate array
  • FIG. 4 is a flowchart of schematic processing according to the present embodiment.
  • the overall process performed by control system 1 is first a task execution process (step ST1) performed in control device 100 and a process of collecting information acquired during task execution (step ST1). ST2). Furthermore, it includes statistical processing (step ST3) of the collection information 228 performed in the support device 200 and display processing (step ST4) based on the collection information 228. Furthermore, the process of the control system 1 includes a debug process (step ST5) by the debug tool 227 and a process (step ST6) for executing the task (program) again in the control device 100 based on the debug result.
  • the support device 200 performs statistical processing, image display processing based on the collected information 228, and debugging processing (steps ST3 to ST5). However, these processing may be performed by the control device 100.
  • FIG. 5 is a diagram schematically illustrating functions provided in the control device 100 according to the present embodiment.
  • the scheduler 151 of the control device 100 is shown in association with the storage contents of the secondary storage device 108.
  • the main storage device 106 includes a work area E1 for the processor 102 to expand and execute the program.
  • the secondary storage device 108 stores an internal DB 130, a log 135 indicating information collected during task execution, and a user program 150.
  • the user program 150 is a program that can be created by the user using the support device 200, and is basically executed by the processor 102 (FIG. 2) of the control device 100.
  • the user program 150 is a primary fixed-cycle program (control input program 161, control output program 162, and high-priority control executed every fixed cycle T in order to perform real-time control of a specified target in the field device group 10. Program 163). Further, the user program 150 includes a low priority control program 164, an associated processing program 165 and a system service program 166.
  • the control input program 161 and the control output program 162 correspond to the function of I / O refresh processing. Specifically, the control input program 161 and the control output program 162 write an instruction to write data (input data and output data) exchanged with the field device group 10 as a variable of the internal DB 130 or to read a variable. Including. In the control device 100, a unique variable name is assigned to each of the input data and the output data, and data exchanged with the field device group 10 can be expressed using each variable name.
  • the high priority control program 163 typically includes a sequence / motion program (sequence program and / or motion program).
  • the sequence / motion program reads a variable in the internal DB 130, performs a logical operation and / or numerical operation for real-time control of an object to be controlled in the field device group 10 based on the variable, and writes the result in the variable. Include instructions.
  • the variable indicating the calculation result by the high priority control program 163 is output to the field device group 10 via the control output program 162 and used for controlling the target of the field device group 10.
  • the low-priority control program 164 is a program that requires real-time characteristics regarding the control of the field device group 10, and includes a program that has lower priority than the high-priority control program but requires real-time characteristics.
  • the low priority control program 164 includes, for example, a trajectory generation program for generating trajectory data to be provided to the motion program described above.
  • the related processing program 165 is a program that requires real-time processing for performing processing related to real-time control of the target of the field device group 10, and includes, for example, a feature amount generation program and an abnormality detection program.
  • the feature amount generation program is executed by the processor 102.
  • the feature quantity generation program includes a command for generating a feature quantity using a designated variable among variables in accordance with a feature quantity generation method designated in advance.
  • the feature value generation program can generate a feature value suitable for detecting an abnormality that occurs in the object from data related to the object in the field device group 10.
  • the anomaly detection program includes a command for executing an anomaly detection process using the feature amount generated by the feature amount generation program.
  • the abnormality detection program detects the presence / absence of abnormality in the target based on the abnormality detection model set by machine learning and the feature amount generated by the feature amount generation program, and internally detects the presence / absence of abnormality as a learning result.
  • the learning result can be transmitted to the outside and output to an external device.
  • the system service program 166 is executed by the processor 102.
  • the system service program 166 includes a program for executing processing different from the control of the field device group 10 without requiring real-time performance.
  • the system service program 166 includes, for example, instructions such as communication with external devices (such as the support device 200, the data logging device 300, and the display device 400) of the control device 100, or data writing to a file.
  • the system service program 166 is, for example, a program that is not executed periodically and may be executed in response to an event such as an interrupt.
  • an OS 190 is also installed in order to provide an environment for the processor 102 to execute the program.
  • the OS 190 includes a multitask execution unit 191.
  • the multitask execution unit 191 implements multitask control for causing the processor 102 to execute the user program 150 in units of tasks according to the order based on the priority of each task.
  • the tasks executed by the processor include a high priority control task 141, a low priority control task 142, a related processing task 143, and a service task 144.
  • the high priority control task 141 and the low priority control task 142 correspond to “control tasks” for performing real-time control of the target of the field device group 10.
  • the related processing task 143 is not directly related to the target real-time control, but corresponds to a “non-control task” for executing the processing related to the real-time control.
  • the low priority control task 142 and the service task 144 are different tasks from the “control task” and the “non-control task”.
  • the control input program 161, the control output program 162, and the high priority control program 163 are assigned to the high priority control task 141, and the low priority control program 164 is assigned to the low priority control task 142.
  • the related processing program 165 is assigned to the related processing task 143, and the system service program 166 is assigned to the service task 144.
  • the control device 100 further includes task control information 131, system variables, threshold values 152A, and priority information 152B that the multitask execution unit 191 refers to (reads) in order to execute a task. These pieces of information are stored in the main storage device 106. Further, the control device 100 includes core information 136 used in a multi-core operation mode described later. Details of the core information 136 will be described later.
  • System variables include various variables including task status variables for controlling task execution.
  • the task state variable includes a state flag FL indicating an execution state of the task according to a state transition described later of each task.
  • the state flag FL is a value written by the multitask execution unit 191. For example, according to the task state transition, '00' (pre-execution state), '01' (execution state and executing), '10' ( The execution state and one of the values of “suspend” (execution interruption) and “11” (execution completion state) is written. The task state transition will be described later with reference to FIG.
  • the task control information 131 includes a task name 132, a priority 133, and a program name 134 of a program assigned to the task corresponding to each task.
  • the threshold value 152A includes a first time T1 and a second time T2 (> first time T1).
  • the first time T1 corresponds to an execution time limit for executing the related processing program 165 of the related processing task 143 in real time.
  • the priority information 152B includes the high priority PH and the low priority PL (priority lower than the high priority) that are the priorities of the related processing task 143.
  • the scheduler 151 is realized by a program including an instruction for variably setting the priority of each task, that is, the execution order of the task by the processor 102.
  • the program of the scheduler 151 is stored in the secondary storage device 108.
  • the processor 102 reads the program of the scheduler 151 from the secondary storage device 108, develops the read program in the main storage device 106, and executes it.
  • the multitask execution unit 191 executes a task while transitioning the task into three states: an execution state, a pre-execution state, and an execution completion state.
  • the execution state indicates a state in which resources such as the processor 102 are allocated to the task and the task is being executed.
  • the pre-execution state is a state of a task before transitioning to the execution state, and specifically indicates an executable state in which execution can be started if resources are allocated.
  • the execution completion state is a state in which the execution of the task is completed, and the task waits for some event for making a transition to the executable state.
  • the multitask execution unit 191 allocates the resources of the processor 102 (processor core) at a certain point in time and is in an execution state.
  • the multitask execution unit 191 selects a task to which resources are allocated next from tasks in the pre-execution state, and transitions the selected task to the execution state. This selection is performed according to the priority of each task.
  • the scheduler 151 starts execution for instructing start of execution of the priority switching unit 153 including the counter 153 ⁇ / b> B, the task information setting unit 154 including an instruction for setting the task control information 131, and the related processing task 143.
  • An execution instruction unit 157 including an instruction for outputting an instruction to the multitask execution unit 191 is provided.
  • the counter 153B measures the execution time of the related processing task 143 by performing a counting operation in synchronization with the output of the timer 101.
  • the scheduler 151 includes a collection unit 155 including an instruction for collecting information such as the number of times the priority of the related processing task 143 is switched and an execution time based on the monitor information 153A from the priority switching unit 153, and a threshold 152A.
  • the scheduler 151 includes a core switching unit 156 that activates a multi-core operation mode to be described later. These units of the scheduler 151 are realized by programs, and the processor 102 executes these programs.
  • the priority switching unit 153 of the scheduler 151 switches (adjusts) the priority of a non-control task according to the execution time of the task.
  • the related processing task 143 is exemplified as a non-control task for which such priority adjustment is performed, but the related processing task 143 is not limited thereto.
  • the priority of the high priority control task 141 that is the “control task” is set to the highest priority.
  • the priority of the low priority control task 142, the “non-control task” and the service task 144 is set lower than the priority of the high priority control task 141.
  • the priority of the related processing task 143 can be set to either the high priority PH corresponding to the “first priority” or the low priority PL corresponding to the “second priority”.
  • the priority switching unit 153 compares the execution time of the related processing task 143 measured by the counter 153B with the threshold 152A, and changes the priority to one of the high priority PH and the low priority PL based on the comparison result ( Instruction).
  • FIG. 6 is a diagram schematically showing the state transition of the related processing task 143 according to the present embodiment.
  • the multitask execution unit 191 can transition the related processing task 143 from the pre-execution state to the execution state in synchronization with a fixed-cycle trigger (Trigger).
  • the OS 190 outputs a fixed period trigger (Trigger) in synchronization with the start of the period T.
  • the priority switching unit 153 compares the measured execution time with the first time T1.
  • the priority switching unit 153 changes the priority 133 corresponding to the related processing task 143 in the task control information 131 from the high priority PH to the low priority. Rewrite to PL.
  • the priority switching unit 153 compares the measured execution time with the second time T2. If the comparison result is (execution time> second time T2), the priority switching unit 153 changes the priority 133 corresponding to the related processing task 143 in the task control information 131 from the low priority PL to the high priority. Rewrite to PH.
  • the priority of the related processing task 143 can be switched based on the time (execution time) required to execute the related processing task 143 in the previous execution state.
  • FIG. 7 is a diagram schematically showing the configuration of the related processing program 165 according to the present embodiment.
  • an abnormality detection program and a feature quantity generation program are shown in parallel, and a contact CN is shown corresponding to each program.
  • the contact CN designates whether or not the corresponding program is executed.
  • the execution instruction unit 157 outputs an execution start instruction to the multitask execution unit 191 when determining that the execution start condition for starting the execution of the related processing task 143 is satisfied.
  • FIG. 7 shows a state in which, for example, when another task (not shown) is executed, a contact corresponding to the feature amount generation program is selected by an instruction instruction output from the other task.
  • the execution instruction unit 157 of the scheduler 151 outputs an instruction to start execution of the related processing task 143 to the multitask execution unit 191 when receiving the above instruction instruction when receiving a periodic trigger (Trigger).
  • Trigger a periodic trigger
  • the execution instruction unit 157 may include the periodic trigger (Trigger) shown in FIG. 6, an instruction instruction from the control program, an automatic instruction based on an event based on a variable value, or a combination thereof.
  • Trigger periodic trigger
  • the instruction is accepted, it is determined that the execution start condition for the related processing task 143 is satisfied.
  • the multitask execution unit 191 transitions the related processing task 143 to the execution state. Specifically, the multitask execution unit 191 reads the program name 134 corresponding to the related processing task 143 from the task control information 131. The multitask execution unit 191 reads the related processing program 165 from the secondary storage device 108 based on the read program name 134, and expands the read related processing program 165 to the main storage device 106, whereby the related processing program 165. Can be started. As a result, the related processing task 143 transitions from the pre-execution state to the execution state.
  • the multitask execution unit 191 sets a state flag FL corresponding to the related process task 143 when the related process task 143 is transitioned from the pre-execution state to the execution state. Specifically, when the related processing task 143 transitions to the execution state, if the processor 102 is not executing another task, the multitask execution unit 191 causes the processor 102 to immediately execute the related processing task 143. Thus, the status flag FL is set from '00' to '01'.
  • the multitask execution unit 191 causes the processor 102 to execute the related processing task 143 and sets the status flag FL corresponding to the related processing task 143 to “10” ⁇ “ Set to 01 '.
  • both tasks can maintain the execution state.
  • the multitask execution unit 191 shifts the related process task 143 from the execution state to the execution completed state, and sets the state flag FL corresponding to the related process task 143 to '11. Set to '.
  • the value of the state flag FL of the related processing task 143 can indicate whether the related processing task 143 is in a pre-execution state, an execution state (during execution or execution interruption), or an execution completion state.
  • the counter 153B measures the execution time of the related processing task 143 by measuring the time during which the status flag FL of the related processing task 143 is “01” or “10”.
  • Task information settings In the present embodiment, for each task, the user can set or change the priority and the program assigned to the task.
  • FIG. 8 is a diagram showing a user interface for setting priorities for tasks according to the present embodiment.
  • FIG. 9 is a diagram showing a user interface for assigning a program to a task according to the present embodiment.
  • the user interface shown in FIGS. 8 and 9 is provided as a display screen of the display unit 218 of the support device 200.
  • the high priority control task 141 has the highest priority (the execution order is first) among the tasks of the user program 150, and the high priority control task 141 The priority is fixed.
  • the priority of each other task of the user program 150 can be variably set so as to be lower than that of the high priority control task 141.
  • the user can set priorities of tasks other than the high priority control task 141 via the user interface of FIG.
  • the user operates the input unit 216 for each item of “task type and priority”, “task name”, “trigger cycle”, and “presence / absence of over-cycle detection”. Can be set.
  • the default (fixed value) is set so that, for example, the high-priority control task 141, which is the primary periodic task, is executed every 1 msec with the priority “4”. Is set.
  • the user can arbitrarily set other tasks except for “control task”.
  • the user sets “8” as the high priority PH and “18” as the low priority PL, sets “10 msec” as the trigger cycle,
  • '2 msec' is set as the first time T1 and '10 msec 'is set as the second time T2.
  • the first time T1 and the second time T2 are not limited to these values.
  • the user sets the first time T1 and the second time T2 according to the real-time property required for the related processing task 143 (execution is completed within a predetermined time after the task is started), It can be set as an allowable range of the predetermined time (for example, an upper limit value and a lower limit value).
  • the user can set a program to be assigned to each task.
  • one program is basically assigned to a task, but two or more programs may be assigned.
  • related programs Program0, Program1, and Program2 are assigned to the task RTS1 that is the related processing task 143.
  • the support device 200 transfers the information set by the user interface of FIGS. 8 and 9 to the control device 100.
  • the setting unit 152 of the control device 100 sets the values of the high priority PH and the low priority PL corresponding to the related processing task 143 among the information received from the support device 200 in the priority information 152B.
  • the task information setting unit 154 sets a task name 132, a priority 133, and a program name 134 corresponding to each task of the task control information 131 based on the information received from the support device 200.
  • the control device 100 has a single-core operation mode and a multi-core operation mode, and manages task execution in each operation mode.
  • the processor 102 has one or more core processors.
  • the single core operation mode indicates a mode in which a task is executed using one core processor
  • the multi-core operation mode indicates a mode in which a task is executed using two or more core processors.
  • the operation mode of the control device 100 can be switched. First, the single core operation mode will be described.
  • FIG. 10 is a flowchart showing processing for managing execution of related processing tasks according to the present embodiment.
  • the management process PR for managing the execution of the related process task 143 by the scheduler 151 is shown in association with the process for controlling the execution of the high priority control task 141 and the related process task 143 by the multitask execution unit 191. .
  • the processing for controlling the execution of the high priority control task 141 and the related processing task 143 by the multitask execution unit 191 is stored in the main storage device 106 as a program including a part of the OS 190.
  • the management process PR by the scheduler 151 is stored in the secondary storage device 108 as a program.
  • the processor 102 reads these programs from the main storage device 106 or the secondary storage device 108 and executes them. In the present embodiment, the processor 102 periodically executes the management process PR program.
  • the processor 102 executes the high priority control task 141 having the highest priority 133 among the tasks of the task control information 131.
  • the control input program 161 of the high priority control task 141 sets data input from the field device group 10 as an input variable of the internal DB 130 (steps S1 and S2).
  • the high priority control program 163 executes a calculation based on the data of the input variable of the internal DB 130 and writes control data for controlling the target of the field device group 10 to the output variable of the internal DB 130 (Steps S3 and S2).
  • the control output program 162 reads out the control data indicated by the output variable set in step S2, and outputs it to control the target (step S5).
  • the initial value is set by the task information setting unit 154. Specifically, for example, when the execution instruction unit 157 first determines that the execution start condition of the related processing task 143 is satisfied after the system is initialized (more specifically, the control device 100 is initialized), the task The information setting unit 154 performs the initial value setting.
  • the execution instruction unit 157 confirms that the execution start condition is satisfied when the execution instruction is received. Judgment is made (step 21).
  • the scheduler 151 starts state management of the related processing task 143 (step S23).
  • This execution instruction includes an instruction instruction from the process of the high priority control task 141 (step S3) or an automatic instruction from the event process (step S7) based on the variable value by the high priority control task 141.
  • the scheduler 151 determines whether or not the related process task 143 is in an execution state based on the state flag FL (step S25). At this time, since the related processing task 143 is not executed, the status flag FL indicates “00”.
  • step S25 If the scheduler 151 determines that the related processing task 143 is not in an execution state based on the state flag FL (NO in step S25), the execution instruction unit 157 outputs an execution start instruction to the multitask execution unit 191 (step S27). When the execution start instruction is output to the multitask execution unit 191, the counter 153B starts measuring the execution time of the related processing task 143 (step S29). Thereafter, the scheduler 151 completes the management process PR (step S31) and returns to step S23.
  • the multitask execution unit 191 When the multitask execution unit 191 receives an execution start instruction from the scheduler 151, the multitask execution unit 191 is based on the priority 133 corresponding to the related processing task 143 in the task control information 131 (this priority indicates “high priority PH”). Then, the related process task 143 is selected as a task to start execution, and the related process task 143 is changed from the pre-execution state to the execution state. That is, the multitask execution unit 191 changes the status flag FL corresponding to the related processing task 143 from “00” to “01” (step S41). The processor 102 executes the related processing task 143 selected by the scheduler 151. Specifically, the related process program 165 indicated by the program name 134 corresponding to the related process task 143 is executed based on the task control information 131 (step S45).
  • the priority switching unit 153 determines the related process task measured by the counter 153B.
  • the execution time of 143 is compared with the time of the threshold value 152A (step S33).
  • the priority switching unit 153 determines a time to be compared between the first time T1 and the second time T2 of the threshold 152A based on the priority 133 of the related processing task 143.
  • the priority 133 of the related processing task 143 indicates the high priority PH. Therefore, the priority switching unit 153 determines the first time T1, and compares the execution time of the related processing task 143 with the first time T1.
  • the priority switching unit 153 determines that the condition (execution time> first time T1) is satisfied based on the result of the comparison, that is, the execution time is longer (exceeded) than the first time ( In step S33, YES), the priority switching unit 153 outputs an excess notification indicating that the execution time has exceeded the first time T1 to the multitask execution unit 191, and performs priority switching processing (step S35). .
  • the priority switching unit 153 changes the priority 133 of the related processing task 143 of the task control information 131 to the low priority PL of the priority information 152B. Thereafter, the management process PR is completed (step S31), and the process returns to step S23.
  • the priority switching unit 153 determines that the above condition (execution time> first time T1) is not satisfied (NO in step S33), that is, determines that the execution time does not exceed the first time T1. If so, the process is completed (step S31), and the process returns to step S23.
  • the multitask execution unit 191 causes the related process task 143 to transition from the execution state to the execution completion state. That is, the status flag FL of the related processing task 143 is reset from “01” to “11” (step S49). Further, the related processing task 143 sets the processing result (execution result of the feature amount generation program or the abnormality detection program) as the learning result of the internal DB 130 (steps S47 and S2).
  • the multitask execution unit 191 When the multitask execution unit 191 receives the above-described excess notification from the priority switching unit 153, the multitask execution unit 191 performs an excess notification handling process (step S43), and proceeds to step S45.
  • the excess notification handling process the multitask execution unit 191 performs, for example, a determination process as to whether or not to stop the execution of the related process task 143. Note that the content of the excess notification handling process is not limited to this determination process.
  • this “low priority PL” is the next highest priority after the priority of the high priority control task 141. Further, it is assumed that the priority 133 (low priority PL) of the related processing task 143 is the same as the priority 133 of the low priority control task 142.
  • the scheduler 151 receives the execution instruction of the related processing task 143 and determines that the execution start condition is satisfied (steps S21 and S23). Next, the scheduler 151 determines that the related processing task 143 is not in an execution state based on the state flag FL (NO in step S25), and the execution instruction unit 157 outputs an execution start instruction to the multitask execution unit 191 (step S25). S27). When the multitask execution unit 191 receives the execution start instruction, the multitask execution unit 191 causes the processor 102 to execute the related processing task 143.
  • the multitask execution unit 191 selects the related processing task 143 and the low priority control task 142 in accordance with the priority 133 of the task control information 131, and transits both from the pre-execution state to the execution state.
  • 153B starts measuring the execution time of the related processing task 143 (steps S41, S45, S29). Thereafter, when the execution of the related process task 143 is completed, the state flag FL of the related process task 143 is reset (step S49) and the execution result of the related process task 143 is processed (step S47).
  • two tasks that is, the low-priority control task 142 and the related processing task 143 are alternately executed, but the counter 153B interrupts execution in the alternating execution based on the value of the state flag FL of the related processing task 143.
  • the execution time of the related processing task 143 including the (suspend) time is measured.
  • the priority switching unit 153 compares the execution time of the related processing task 143 measured by the counter 153B with the time of the threshold 152A (step S33). Specifically, the priority switching unit 153 determines a time to be compared between the first time T1 and the second time T2 of the threshold 152A based on the priority 133 of the related processing task 143. Here, the priority 133 of the related processing task 143 indicates the low priority PL. Therefore, the priority switching unit 153 determines the second time T2, and compares the execution time of the related processing task 143 with the second time T2.
  • the priority switching unit 153 determines that the condition (execution time> second time T2) is satisfied based on the result of the comparison, that is, the execution time is longer (exceeded) than the second time T2. (YES in step S33), the priority switching unit 153 outputs an excess notification indicating that the execution time has exceeded the second time T2 to the multitask execution unit 191, and performs the priority switching process (step S35). ). In the priority switching process, the priority switching unit 153 changes the priority 133 of the related processing task 143 of the task control information 131 to the high priority PH of the priority information 152B. Thereafter, the management process PR is completed (step S31), and the process returns to step S23.
  • the priority switching process is performed when the execution time exceeds the first time T1 or the second time T2 (step S35), but the time of execution is not limited to this.
  • the priority switching process may be performed when the execution start condition of the related process task 143 is satisfied.
  • the priority switching unit 153 determines that the execution start condition of the related processing task 143 is satisfied thereafter.
  • the priority 133 of the related processing task 143 of the task control information 131 is set to the high priority PH or the low priority PL of the priority information 152B.
  • the high priority PH is maintained while the execution time of the related process task 143 does not exceed the first time T1. Accordingly, the related processing can be executed while maintaining the real time property, and for example, it is possible to realize real time control of the target using the result of the related processing (abnormality detection processing or the like) obtained for each execution time. . Further, when the execution time exceeds the first time T1, the priority of the related processing task 143 is lowered, so that other tasks, for example, the low priority control task 142 which is another control task can be preferentially executed.
  • the execution time of the related processing task 143 exceeds the threshold 152A as a result of the alternate execution with other tasks having the same priority, the priority of the related processing task 143 is changed. Can be avoided, and the execution of the related processing task 143 can be completed within an execution time that does not exceed the threshold. Also, the execution time of other tasks is shortened by eliminating (avoiding) the alternate execution. Thus, if the other task is, for example, the low priority control task 142, real-time control of the target using the execution result (motion control trajectory data) can be more reliably realized.
  • the scheduler 151 increases the priority of the related processing task 143 from the low priority PL to the high priority PH. By completing the task 143 early, resources can be released (allocated) to other tasks such as the low priority control task 142 at an early stage.
  • the scheduler 151 lowers the priority of the related processing task 143 from high priority PH to low priority PL, thereby increasing the priority. Free up resources for other high tasks.
  • the other task is the low priority control task 142 for the trajectory calculation of motion control, it becomes possible to quickly output the trajectory data to the motion program of the high priority control task 141. Real-time control can be more reliably performed.
  • FIGS. 11A and 11B are diagrams showing a scheduling model of the related processing task 143 according to the present embodiment.
  • FIG. 12 is a diagram illustrating priority switching of the related processing task 143 in association with FIG. The vertical axis in FIG. 11 indicates the priority of the task, and the horizontal axis indicates the time set as the nth cycle T, the (n + 1) th cycle T, the (n + 2) th cycle, the (n + 3) th cycle,. Show progress.
  • the high priority PH of the related processing task 143 can be lower than the priority of other tasks such as the low priority control task 142.
  • FIG. 11A shows a case where the high priority PH of the related processing task 143 is the same as the priority of the low priority control task 142.
  • the low priority PL of the related processing task 143 can be higher than the priority of other tasks such as the low priority control task 142.
  • FIG. 11B shows the cases of Example (1) and Example (2) when the priority of the related processing task 143 is the low priority PL.
  • 11B is a case where the low priority PL of the related processing task 143 indicates a value between the priority of the low priority control task 142 and the priority of the service task 144.
  • the example (2) is a case where the low priority PL of the related processing task 143 is lower than the priority of the low priority control task 142 and is the same as the priority of the service task 144.
  • each cycle T starts in response to a cycle start signal synchronized with the output of timer 101.
  • the priority of each task is set in the task control information 131 as shown in FIG.
  • the high priority control task 141 control input program 161, control output program 162, and high priority control program 163 having the highest priority is first executed, and thereafter, FIG.
  • the multitask execution unit 191 alternately executes the low priority control task 142 and the related processing task 143 having the same priority 133.
  • the execution time t (see FIG. 11A) of the related processing task 143 is measured including the execution interruption time in the alternate execution (that is, the time during which the low priority control task 142 is being executed).
  • the priority switching unit 153 performs the priority switching process. As a result, the priority 133 of the related processing task 143 returns to the original high priority indicated by the task control information 131 in FIG.
  • the high priority control task 141 is first executed, and then other tasks are executed.
  • the priority of the low priority control task 142 is higher than the priority of the related processing task 143, and the priority of the related processing task 143 is that of the service task 144.
  • the multitask execution unit 191 executes the low priority control task 142 and then alternately executes the related processing task 143 and the service task 144 having the same priority.
  • Example (2) if the execution time t of the related processing task 143 is (t> second time T2), the priority switching unit 153 performs the priority switching process. As a result, the priority 133 of the related processing task 143 is switched back to the original high priority indicated by the task control information 131 in FIG.
  • the related process task 143 described above is assigned a feature quantity generation process and an abnormality detection process as processes related to the high priority control task 141 for real-time control.
  • the process assigned to the related process task 143 is a control device.
  • Communication processing performed within 100 is also included. Specifically, this communication process may include a process of communicating data related to the feature generation process or the abnormality detection process with various apparatuses including the secondary storage device 108.
  • the data related to the feature quantity generation process or the abnormality detection process includes raw data received from the field device group 10 to generate a feature quantity, a result of the feature quantity generation process (generated feature quantity, etc. ), Including the results of anomaly detection, but not limited thereto.
  • the communication process of the result of the feature generation process and the result of the abnormality detection is performed via the communication with the secondary storage device 108, the local network controller 110, the USB (Universal Serial Bus) controller 112, the memory card interface 114, and the like. Communication with an external device may be included.
  • the communication processing of the raw data and the result of abnormality detection is performed by an external device via the internal bus controller 122, the field bus controllers 118 and 120, the I / O units 124-1, 124-2,. Communication may be included.
  • FIG. 13 is a diagram showing an example of setting priorities and thresholds for a plurality of related processing tasks according to the present embodiment.
  • the setting unit 152 sets the priority information 152B and the threshold value 152A individually, but may be set in one table format as shown in FIG.
  • FIG. 13 shows a case where the related processing task 143 includes a plurality of tasks RTS1 and RTS2, for example.
  • the setting unit 152 sets the priority (high priority PH, low priority PL) and threshold (first time T1 and second time T2) in a table format corresponding to each task RTSi. .
  • FIG. 14 is a diagram showing a program allocation method for a plurality of related processing tasks according to the present embodiment.
  • the lower part of FIG. 14 shows an example of a screen as a user interface for allocating programs to related processing tasks.
  • the screen is displayed on the display unit 218 of the support device 200.
  • the development program 222 analyzes the structure of the related processing program 165, and extracts and displays a plurality of programs (a feature amount generation program and an abnormality detection program) included in the related processing program 165 based on the analysis result.
  • the user operates the input unit 216 to set a program to be assigned to the related processing task 143 from the screen of FIG. In the upper part of FIG. 14, when three tasks RTS1 to RTS3 can be set as the related processing task 143, the user assigns an abnormality detection program or a feature generation program corresponding to each task RTSi.
  • the state (with program name 134 set) is shown.
  • the program configuration information of the related processing program 165 shown in the lower part of FIG. 14 can be provided as support information for the user to determine a program to be assigned to each task RTSi.
  • the collection unit 155 records information related to scheduling as a log 135 when the related processing task 143 is executed.
  • the debug tool 227 generates information for supporting debugging based on the collected information 228 obtained by collecting the log 135, and provides the generated support information to the user.
  • “debug” is assigned to user setting information (first time T1, second time T2, priority (high priority PH and low priority PL) set by the user, and related processing task 143. Indicates the work to adjust or change the program contents (including program name and type). For example, the user performs debugging so as to approach a target for which real-time control can be reliably performed.
  • FIG. 15 is a view showing a display example of support information for debugging according to the present embodiment.
  • FIG. 16 is a diagram showing an example of the monitor information 153A and the log 135 according to the present embodiment.
  • FIG. 17 is a diagram showing an example of the collection information 228 according to the present embodiment.
  • the collection unit 155 receives the monitor information 153A output from the priority switching unit 153 during execution of the related processing task 143, and stores the received monitor information 153A as a log 135 in the secondary storage device 108.
  • the monitor information 153A is information related to execution scheduling of the related processing task 143, and includes, for example, the current measurement time and the current priority (either high priority PH or low priority PL) output by the counter 153B.
  • FIG. 16A shows an example of the monitor information 153A
  • FIG. 16B shows an example of the log 135.
  • the priority switching unit 153 outputs the monitor information 153A in FIG. FIG. 16B is recorded as 135.
  • the priority at the end of execution of the task RTS1 is “high priority”, and 0.2 msec has elapsed since the execution was started at this high priority. Indicates that the execution is complete.
  • the log 135 in FIG. 16B shows that the task RTS1 is switched between two times (ie, high priority ⁇ low priority ⁇ high priority) from the start of execution until the task RTS1 is completed. Indicates that a total of 12.2 msec was required.
  • the debug tool 227 of the support device 200 receives the log 135 from the control device 100 and generates collection information 228 based on the log 135.
  • the collection information 228 includes the task name 71, the execution count 82 that is the total execution count, the execution time representative values (minimum, average, maximum) 83 and the priority for the related processing task 143.
  • Statistical information such as a representative value (minimum, average, maximum) 84 of the degree switching number is included.
  • the representative value 83 of the execution time indicates the minimum value, the average value, and the maximum value among the execution times of 21103 task executions indicated by the execution count 82.
  • the representative value 84 of the priority switching number indicates the minimum value, the average value, and the maximum value among the priority switching times counted in each of 21103 executions indicated by the execution times 82.
  • the collection information 228 includes the information of FIG. FIG. 17B shows a breakdown of information related to the 21103 executions of FIG. Specifically, for the related processing task 143, for each set of information (that is, a set of high priority PH, low priority PL, first time T1 and second time T2), the task name 71 and the priority is “high”. It includes statistical information 96 and 97 when the execution is terminated at the “priority”, and statistical information 98 and 99 when the execution is terminated at the “low priority”.
  • the statistical information 96 indicates that the task RTS1 is executed when the task RTS1 is executed based on a specific set of information (a set of high priority, low priority, first time T1 and second time T2). A case where the priority is switched four times by the end and the execution is finished with “high priority” indicates that the total is 23 times.
  • the statistical information 97 indicates that the minimum value, average value, and maximum value of the execution time for the 23 task executions are 0.1 msec, 0.8 msec, and 1.9 msec, respectively.
  • the statistical information 98 is executed at the “low priority” by switching the priority five times from the start to the end of the execution.
  • the completed case indicates a total of 11 times.
  • the statistical information 99 indicates that the minimum value, the average value, and the maximum value of the execution time for the eleven task executions are 0.1 msec, 0.4 msec, and 0.5 msec, respectively.
  • J2 Debug tool
  • the debug support information generated by the debug tool 227 based on the collected information 228 is provided to the user as a screen of the display unit 218 shown in FIG. For example, an image based on the statistical information 96 and 97 of FIG. 17B is displayed on the upper part of the screen of FIG. 15, and an image based on the statistical information 98 and 99 of FIG.
  • the debug support information generated by the debug tool 227 based on the collected information 228 is provided to the user as a screen of the display unit 218 shown in FIG. For example, an image based on the statistical information 96 and 97 of FIG. 17B is displayed on the upper part of the screen of FIG. 15, and an image based on the statistical information 98 and 99 of FIG.
  • the debug support information generated by the debug tool 227 based on the collected information 228 is provided to the user as a screen of the display unit 218 shown in FIG. For example, an image based on the statistical information 96 and 97 of FIG. 17B is displayed
  • the user compares the collected information 228 on the screen of FIG. 15 with the target for real-time control, and based on the comparison result, the threshold 152A (first time T1 and second time T2) set in the task RTS1 or priority information It is possible to obtain a guideline for determining whether 152B (high priority PH, low priority PL) is appropriate for reliably performing the real-time control. The user can also obtain a guideline for determining whether the program assigned to the task RTS1 is appropriate from the result of the comparison.
  • the user uses, for example, the threshold value 152A (first time T1 and second time T2) or priority information 152B (high priority PH, low priority) set in the task RTS1 via the user interface of FIG. Degree PL).
  • the program assigned to the task RTS1 is changed via the user interface of FIG.
  • the number of times the task RTS1 is switched to the low priority is higher than the target, it can be estimated that the task RTS1 is alternately executed with other tasks, resulting in a longer execution time and a lower priority. It is. In this case, the user can reduce the number of times of switching to the low priority by changing the first time T1 to be longer or changing the value of the original high priority PH so that alternate execution can be avoided. There is a possibility.
  • the task RTS1 when the number of times the task RTS1 is switched to the high priority is higher than the target, the task RTS1 is alternately executed with other tasks, and as a result, the execution time becomes long and the task RTS1 is switched to the high priority. It can be estimated. In this case, the user can reduce the number of times of switching to the high priority by changing the second time T2 to be longer or changing the value of the original low priority PL so that the alternate execution can be avoided. There is a possibility.
  • the execution of the feature amount generation program is sent to the processor 102. It can be estimated that a high load is applied.
  • the feature quantity generation program may include a process with a large amount of computation (a long computation time) such as fast Fourier transform.
  • the user executes the development program 222 and changes the feature amount generation program. For example, the feature quantity generation program is changed so that the amount of calculation is reduced by changing or subtracting the type of feature quantity to be generated.
  • the support device 200 transmits the changed threshold value 152A, the changed priority information 152B, or the changed feature value generation program to the control device 100.
  • the scheduler 151 generates task control information 131 based on the changed information, and executes the task RTS again based on the task control information 131.
  • the debug tool 227 displays a monitor screen (FIG. 15) based on the collected information 228 acquired when it is executed again. This monitor screen ensures that real-time control is performed by changing the threshold value (first time T1, second time T2) or priority information (high priority PH, low priority PL) or a feature amount generation program by debugging. Support information is provided to the user to determine whether or not it was appropriate to implement.
  • the priority switching process (step S35 in FIG. 10) is performed when the execution time exceeds the first time T1 or the second time T2 (YES in step S33).
  • the condition for performing the switching process is not limited to the execution time exceeding the first time T1 or the second time T2.
  • the scheduler 151 counts the number of times that the execution time of the related processing task has exceeded the first time T1 or the second time T2. As a condition for executing the priority switching process, the scheduler 151 executes the priority switching process when the count value is equal to or greater than a predetermined N (N ⁇ 2) times.
  • N is a value that can be set by the user.
  • ⁇ L: Multi-core operation mode> a case has been described in which the control device 100 executes the related processing task 143 in one processor core of the processor 102 when the control device 100 is in the single-core operation mode. A multi-core operation mode using two or more processor cores will be described.
  • the scheduler 151 activates the core switching unit 156.
  • the processor core is composed of a combination of devices for executing tasks such as computing units and program counters. Therefore, in the multi-core operation mode, a plurality of tasks can be executed in parallel using a plurality of processor cores.
  • the processor 102 includes, for example, four processor cores, Core1 to Core4, as processor cores, but the number of processor cores may be two or more and is not limited to four. .
  • the four processor cores will be described using the core numbers Core1 to Core4 that are identifiers thereof.
  • FIG. 18 is a diagram showing the core information 136 according to the present embodiment.
  • the core information 136 indicates information related to the core processor that executes the related processing task 143 in the multi-core operation mode.
  • the support device 200 receives the core information 136 based on the user operation content from the input unit 216 and transmits the received core information 136 to the control device 100.
  • the processor 102 of the control device 100 stores the core information 136 received from the support device 200 in the secondary storage device 108. When executing a task, the processor 102 reads the core information 136 from the secondary storage device 108 and expands it in the main storage device 106.
  • core information 136 includes data of operation core designation 137 and allocation mode 138 for each task RTSi of related processing task 143.
  • the operation core designation 137 indicates information for designating a processor core for executing the corresponding task RTSi.
  • the allocation mode 138 executes data 139 that specifies whether the processor core that executes the task RTSi is switched to “dynamic” or “fixed”, and the task RTSi when “fixed” is specified.
  • Data 140 indicating the processor core to be included is included.
  • Core 2 and Core 3 are assigned to task “RTS1”, and the assignment mode indicates “dynamic”.
  • the processor core executing the task “RTS1” can be switched to either Core2 or Core3.
  • the task “RTS2” is executed, if the priority is high priority, it is executed in Core2, and if the priority is low priority, execution is specified in Core3.
  • the core switching unit 156 receives the CPU usage rate 159 from the OS 190.
  • the OS 190 measures the CPU usage rate 159.
  • the CPU usage rate 159 indicates, for example, the probability that each of the cores 1 to 4 is in an idle state in which the processor core is not used for task execution (ratio of idle state time per unit time: free rate E). .
  • the core switching unit 156 executes the related processing task 143 based on the core information 136 or based on both the CPU usage rate 159 and the core information 136. Contains instructions that determine the processor core to be performed.
  • the core switching unit 156 outputs a core designation command 158 indicating the determined processor core to the OS 190. This is also referred to as “multi-core scheduling” by the scheduler 151.
  • the OS 190 uses the processor core specified by the core specifying instruction 158 to execute the related processing task 143 that has transitioned to the execution state.
  • the multitask execution unit 191 first assigns the high priority control task 141, which is a primary periodic task, to one or more of Core1 to Core4. Run in the processor core.
  • FIG. 19 is a diagram illustrating an example in which one related processing task 143 is executed in the multi-core scheduling according to the embodiment.
  • FIG. 19 illustrates a case where first, a high priority related processing task 143 (hereinafter also referred to as a task RTS) is executed, and then a low priority task RTS is executed.
  • a high priority related processing task 143 hereinafter also referred to as a task RTS
  • a low priority task RTS is executed.
  • the operation mode M1 in FIG. 19A is a case where the core information 136 indicates “task 'RTS' is assigned Core2 and Core3, and the assignment mode is“ dynamic ””.
  • the core switching unit 156 based on the CPU usage rate 159 and the core information 136, has a processor core with a higher vacancy rate E (that is, more resources that can be allocated to the related processing task 143). Are determined as processor cores to execute the task RTS.
  • the core switching unit 156 determines that (the free rate E of Core3> the free rate E of Core2) from the CPU usage rate 159 before starting the execution of the task RTS. Accordingly, the core switching unit 156 determines the Core 3 with the larger vacancy rate E based on the determination, and outputs the core designation instruction 158 indicating the determined Core 3. As a result, the multitask execution unit 191 executes the high-priority task RTS in Core3.
  • the task RTS is executed in Core 3 and is switched from the high priority to the low priority by the priority switching unit 153.
  • the core switching unit 156 determines from the CPU usage rate 159 that (the free rate E of Core3> the free rate E of Core2). Core3 is determined, and a core designation command 158 indicating Core3 is output. As a result, the low priority task RTS is executed in Core3.
  • the core information 136 is “task 'RTS” is assigned Core2 and Core3, and the assignment mode is “fixed” (in the case of high priority, Core2; In the case of a low priority, this is a case indicating Core 3) ′ ”.
  • the core switching unit 156 determines a processor core on which the task RTS should be executed based on the core information 136 regardless of the CPU usage rate 159.
  • the core switching unit 156 outputs a core designation instruction 158 indicating Core2.
  • the core switching unit 156 determines Core3 based on the core information 136 and indicates Core3.
  • a core designation instruction 158 is output.
  • the multitask execution unit 191 executes the low-priority task RTS in Core3.
  • FIG. 20 is a diagram illustrating an example in which a plurality of related processing tasks 143 are executed in the multi-core scheduling according to the present embodiment.
  • one task RTS is executed.
  • the scheduler 151 schedules a plurality of tasks RTS.
  • the operation mode M3 in FIG. 20A is a case where the core information 136 indicates “Cores 2 and 3 are assigned to the tasks“ RTS1 to RTS3 ”, and the assignment mode is“ dynamic ””.
  • the core information 136 indicates that “tasks“ RTS1 to RTS3 ”are assigned to Core2 and Core3, and the assignment mode is fixed (Core2 for high priority, low priority). In the case of Core3) '”.
  • the core switching unit 156 has the highest vacancy rate E based on the CPU usage rate 159 in order to execute the tasks RTS1 to RTS3 having the same priority (high priority).
  • Core3 may be determined as a processor core on which tasks RTS1 to RTS are to be executed.
  • the core switching unit 156 determines that Core3 is a processor core that should execute the two tasks RTS1 and RTS2. Then, another processor core (that is, Core 2) is determined for the task RTS3. As a result, when a plurality of related processing tasks 143 are executed, the load is distributed among the processor cores, and the execution time of each related processing task 143 can be shortened.
  • the core switching unit 156 executes the tasks RTS1 to RTS3 on one processor core (that is, Core3) having a large vacancy rate E indicated by the CPU usage rate 159.
  • processor core that is, Core3
  • Processor core may be determined.
  • the core switching unit 156 uses Core2 as the task RTS1 according to the core information 136 regardless of the CPU usage rate 159. Determined as a processor core for executing RTS.
  • the scheduler 151 schedules the tasks to be executed in the order of task RTS1 ⁇ task RTS2 ⁇ task RTS3 in Core2.
  • the core switching unit 156 determines that Core3 is a processor core that executes the tasks RTS1 to RTS according to the core information 136 regardless of the CPU usage rate 159. .
  • the scheduler 151 schedules the tasks to be executed in the order of task RTS1 ⁇ task RTS2 ⁇ task RTS3 in Core3.
  • FIG. 21 is a diagram showing another example of executing a plurality of related processing tasks 143 in the multi-core scheduling according to the present embodiment.
  • the core switching unit 156 determines the processor core that executes the tasks RTS1 to RTS3 according to the CPU usage rate 159 and the core information 136.
  • the operation mode M6 in FIG. 21B shows a modification of the scheduling model of the operation mode M4 in FIG.
  • the scheduler 151 executes in order of task RTS1 ⁇ task RTS2 ⁇ task RTS3 in Core3 (or Core2). Therefore, the task RTS3 to be executed last waits until the execution of other tasks is completed, and the execution time of the task RTS3 becomes long.
  • the scheduler 151 schedules the tasks RTS1 to RTS3 to be executed in parallel (that is, alternately executed) in Core3 (or Core2). Thereby, the execution time about each task can be averaged.
  • the user designates operation mode M4 (see FIG. 20B) or operation mode M6 (see FIG. 20B) as a mode for executing a plurality of tasks according to core information 136. be able to.
  • FIG. 22 is a diagram showing still another example of executing a plurality of related processing tasks 143 in the multi-core scheduling according to the present embodiment.
  • the core information 136 is “task 'RTS” is assigned Core 2 and Core 3, and the assignment mode is fixed (Core 2 for high priority, Core 3 for low priority). This is a case indicating “”.
  • the core switching unit 156 determines the processor core that executes the tasks RTS1 to RTS3 having high priority as Core2, based on the core information 136, regardless of the CPU usage rate 159. Similarly, the core switching unit 156 determines the processor core that executes the tasks RTS1 to RTS3 having the low priority as Core3.
  • each task with high priority can shorten the execution time of the task executed by occupying the available resources of Core2 when the task is executed.
  • the core switching unit 156 follows the core information 136.
  • the processor core that executes the task RTS1 is determined to be Core3 (Case C2). In this case, the execution of the low priority task RTS1 in Core3 and the execution of the high priority task RTS2 in Core2 are performed in parallel.
  • the task RTS2 in the Core2 exceeds the first time T1 (however, the execution time of the task RTS1 in the Core3 does not exceed the second time T2)
  • the task RTS2 has the low priority. Is switched to.
  • the core switching unit 156 determines the processor core that executes the task RTS2 as Core3 according to the core information 136. Therefore, execution of task RTS1 and task RTS2 in Core3 and execution of high priority task RTS3 in Core2 are performed in parallel (case C3).
  • the core switching unit 156 determines the processor core that executes the task RTS1 as Core3 according to the core information 136. Therefore, tasks RTS1 to RTS3 are executed alternately in Core3 (Case C4).
  • the user when a plurality of tasks RTS1 to RTS3 are executed, the user can specify which of the operation modes M4, M6, and M7 described above is executed. .
  • FIG. 23 is a schematic diagram for explaining a modification of the related processing task 143 according to the present embodiment.
  • FIG. 24 is a diagram schematically illustrating an example of the predictive control model according to the present embodiment.
  • the abnormality detection program has been described as an example of the related processing task 143.
  • the related processing is not limited to the abnormality detection program.
  • the related processing task 143 described in (c2. Functional configuration) may include a prediction control program that controls a target controlled by the control device 100 (hereinafter referred to as a target 90) using a predictive control model.
  • the target 90 is, for example, a device provided in the field device group 10 of FIG.
  • the predictive control program includes a command for predicting a control amount of the target 90 using a command value given to the target 90 among the variables and outputting a correction value of the control parameter.
  • the correction value calculation process 1431 of FIG. 23 is realized.
  • the predictive control model is a model of a process applied to realize the optimization control of the target 90 while predicting the response of the target 90, for example.
  • command value and the controlled variable are indicated by variables stored in the internal DB 130 of FIG.
  • These command values and control amounts are the data (input data and data) exchanged with the field device group 10 in FIG. 1 when the control input program 161 and the control output program 162 in FIG. 5 perform the I / O refresh process. Output data) and set in a variable of the internal DB 130.
  • FIG. 23 shows a related processing task 143 executed by the control device 100 and a control calculation task 1411 which is an example of the high priority control task 141.
  • a command value 1516 is generated for each control cycle in accordance with a predetermined pattern 1511, the command value 1516 is output to the target 90, and a response value for the command value 1516 from the target 90.
  • a control amount 1517 that is (feedback value) is input.
  • the related processing task 143 uses the output from the control calculation task 1411 (that is, the current command value 1512 output from the control device 100 to the target 90) and the predictive control model 1434 to control the control amount of the target 90.
  • Calculation processing 1433 for calculating is included.
  • the command value 1512 and the control amount 1515 are the same values as the command value 1516 and the control amount 1517, respectively.
  • the control calculation task 1411 calculates a control output (command value 1516) for the object 90 according to the calculated correction value 1514.
  • the calculated command value 1516 is output for controlling the target 90.
  • the above predictive control model 1434 may be created in advance by machine learning based on the characteristics of the object 90, or may be created in advance by a user operation.
  • FIG. 24 schematically shows an example of the predictive control model 1434.
  • the predictive control model 1434 is shown as a graph representing the correlation between the command value 1512 (or control amount 1515) and the estimated control amount 1513. Therefore, in the prediction process 1432, the value Y of the estimated control amount 1513 can be estimated (calculated) from the value X of the command value 1512 (or control amount 1515) based on such a predictive control model 1434.
  • the predictive control model 1434 is not limited to such a correlation graph.
  • the estimated control amount 1513 estimated by the predictive control model 1434 is a future value (for example, a control cycle after the next control cycle) even if it is a current value (for example, a value corresponding to the current control cycle). It may be a value corresponding to.
  • the predictive control model 1434 when the predictive control model 1434 is created by machine learning, it may be created by machine learning using, for example, a neural network.
  • the difference between the estimated control amount 1513 output by the prediction process 1432 and the ideal control amount (target control amount) 1518 is calculated, and the calculated control is performed using a prediction control model (not shown).
  • the correction amount of the command value 1516 may be estimated (calculated) from the amount difference.
  • the control calculation task 1411 receives the correction value 1514, generates a command value 1516 obtained by feeding back the input correction value 1514, and outputs the command value 1516 to the target 90.
  • the predictive control model 1434 of FIG. 24 is created in advance with the estimated control amount 1513 as an objective variable and the command value 1512 as an explanatory variable. Therefore, in FIG. 23, the current command value 1512 (command value 1516) to be given to the target 90 is input to the predictive control model 1434, and the estimated control amount 1513 of the target 90 in the next control cycle is output. Next, a correction value 1514 is calculated by compensating the estimated control amount 1513 so that the difference from the ideal control amount 1518 (target control amount) is within a predetermined range, and a command is issued using the calculated correction value 1514. The value 1516 is rewritten.
  • the predictive control model 1434 of FIG. 24 may be created in advance with the estimated control amount 1513 as an objective variable and the control amount 1515 as an explanatory variable.
  • the current control amount 1515 (control amount 1517) to be given to the target 90 is input to the predictive control model 1434, and the estimated control amount 1513 of the target 90 in the next control cycle is output.
  • a correction value 1514 is calculated by compensating the estimated control amount 1513 so that the difference from the ideal control amount 1518 (target control amount) is within a predetermined range, and a command is issued using the calculated correction value 1514.
  • the value 1516 is rewritten.
  • the control amount of the target 90 is predicted using the command value 1512 given to the target 90, and the control parameter correction value 1514 is output. It is also possible to predict a correction value to be given to the object 90 by using the control amount 1515 of the object 90.
  • the correction value 1514 for compensating the estimated control amount 1513 so that the difference from the ideal control amount (target control amount) 1518 falls within a predetermined range is calculated. Is not limited to such a compensation method.
  • the calculation process 1433 may be a process of calculating the correction value 1514 according to the estimated control amount 1513 and a predetermined calculation.
  • a command value 1516 based on the correction value 1514 estimated (calculated) using the predictive control model 1434 is output to the target 90, but the output cycle of the command value 1516 is The control cycle is not limited.
  • the command value 1516 may be output with a period longer than the control period.
  • the target 90 is obtained by outputting a command value 1516 based on the correction value 1514 estimated (calculated) using the predictive control model 1434 to the target 90 for each cycle longer than the control cycle. .
  • the predetermined pattern 1511 may include a position pattern indicating a trajectory that the object 90 should move. In this case, it is possible to control the position of the target 90 according to the trajectory (the trajectory estimated that the target 90 should move) indicated by the command value 1516 based on the correction value 1514 generated using the predictive control model 1434. It becomes.
  • control calculation task 1411 generates the command value 1516 according to a predetermined pattern 1511. However, the control calculation task 1411 may generate the command value 1516 without using the pattern 1511.
  • the high priority PH is maintained while the execution time does not become longer (exceeds) the first time T1. Accordingly, the related processing can be executed while maintaining the real time property, and for example, real time control of the target using the result of the related processing obtained every execution time can be realized.
  • the priority of the related processing task 143 is lowered so that other tasks can be executed preferentially.
  • the high-priority control task 141 can perform real-time control of the target using the execution result. Therefore, it is possible to realize real-time related processing by the non-control task while ensuring real-time control of the target by the control task.
  • priority switching processing is performed for the related processing task 143 while preferentially executing the target control task in each processor core.
  • the priority switching process is performed for the plurality of related processing tasks 143 while the control task is preferentially executed by using two or more processor cores simultaneously.
  • the control device 100 that controls a target performs a control task (high priority control task 141) for performing real-time control of the target and related processing related to real-time control.
  • a control task high priority control task 141 for performing real-time control of the target and related processing related to real-time control.
  • the task control information 131 for storing the priority at which the task is executed by the processor, and the execution order of the non-control task according to the priority are adjusted And a scheduler 151.
  • the priority of the control task is set to the highest priority (that is, the priority of the non-control task is set to be lower than the priority of the control task).
  • the scheduler 151 decreases the priority of the non-control task when the execution time t of the non-control task is longer than the first time T1 for executing related processing in real time.
  • 153 includes a priority switching unit for switching (high priority PH ⁇ low priority PL).
  • the priority of the non-control task (related processing task 143) can be relatively high and executed in real time while maintaining the real time control. It is certain that the result is reflected in the target real-time control.
  • the priority is lowered to enable preferential resource allocation to other control tasks (for example, the low priority control task 142). This ensures that the results of processing by other control tasks are reflected in the target real-time control. As a result, it is possible to execute a control task for performing real-time control of the target and a non-control task so as to guarantee real-time control of the target.
  • the high priority PH indicates the priority of other tasks (for example, the low priority control task 142) or higher
  • the low priority PL indicates the priority of the other tasks or lower. This allows other tasks to be executed preferentially, and when other tasks provide real-time control data such as trajectory data to the control task, the target real-time control is more reliable. It becomes possible to carry out.
  • the first time T1 is set variably. Further, the low priority PL and the high priority PH can be variably set. Therefore, while adjusting the control task for performing real-time control of the target and the non-control task, the first time T1 that can guarantee the real-time control of the target and the high priority PH or the low priority PL Can be determined.
  • the priority switching unit 153 further increases the non-control task to the high priority PH when the execution time of the low-control PL non-control task is longer than the second time T2. Therefore, it is possible to adjust the execution time of the non-control task that can guarantee the real-time control of the target with the first time T1 and the second time T2 as a guide.
  • the second time T2 is variably set. Therefore, it is possible to determine the control task for performing real-time control of the target and the non-control task while adjusting the second time T2 so as to guarantee the real-time control of the target.
  • the related processing uses a feature amount generation process for generating a feature amount suitable for detecting an abnormality that occurs in the target from data related to the target, and a feature amount generated by the feature amount generation process.
  • the related process is calculated by a calculation process for calculating an estimated control amount 1513 of the target 90 using a command value 1512 output from the control device to the target and a predetermined predictive control model 1434, and a calculation process.
  • the control task 141 includes a control calculation task 1411 that calculates a control output (command value 1516) for the target in accordance with the calculated correction value 1514. .
  • the related processing includes a calculation process for calculating a control amount 1513 for target estimation using a control amount 1517 for the target 90 output from the control device to the target and a predetermined predictive control model 1434, and a calculation process. It includes a correction value calculation process 1431 for calculating a correction value 1514 based on the calculated control amount 1513, and the control task 141 includes a control calculation task 1411 for calculating a control output (command value 1516) for the target according to the calculated correction value. Including.
  • the correction value calculation process includes a process of calculating a correction value that is compensated so that the control amount falls within a predetermined range.
  • the correction value can be calculated by compensation so that the control amount falls within a predetermined range.
  • the non-control task includes a collection unit 155 that collects information related to the execution of the non-control task including the execution time, and the information collected by the collection unit is output to the outside.
  • information including the execution time of the non-control task can be provided to the user as support information for setting the first time T1 or the second time T2.
  • the collected information includes the number of times of switching the priority of the non-control task. Therefore, the number of times of switching the priority of the non-control task can be provided to the user as the support information.
  • the contents of the related process are set variably. Therefore, adjust the content of related processing (type of related processing program, content of arithmetic processing, etc.) so that control tasks for real-time control of the target and non-control tasks can guarantee real-time control of the target can do.
  • related processing type of related processing program, content of arithmetic processing, etc.
  • the processor 102 includes a plurality of processor cores (Core 1 to Core 4), and stores core information 136 that specifies a processor core that executes a non-control task.
  • the scheduler 151 further includes a core switching unit 156 that determines a processor core that executes a non-control task based on the core information 136 or the utilization rate 159 of each processor core.
  • the core information 136 includes information specifying a processor core that executes the non-control task based on the priority of the non-control task.

Abstract

対象を制御する制御タスクと非制御タスクを、リアルタイム制御を保証可能なように実行する。制御装置(100)は、制御タスク(141)および、リアルタイム制御の関連処理を実施する非制御タスク(142、143)を含む複数タスクを実行するプロセッサ(102)、各タスクの優先度(133)に基づく順序でタスクをプロセッサに実行させるマルチタスク実行部(191)、及びスケジューラ(151)を備える。制御タスクの優先度は最優先に設定される。スケジューラは、非制御タスクの実行開始条件が成立すると第1優先度に設定し、実行開始からの時間が関連処理をリアルタイムに実行するための第1時間の間は第1優先度に維持し、その後、第1時間より長くなると第2優先度に下げる。

Description

制御装置、制御方法および制御プログラム
 本技術は、対象を制御する制御装置、制御方法および制御プログラムに関する。
 様々な生産現場において、PLC(プログラマブルコントローラ)などの制御装置を用いたFA(Factory Automation)技術が広く普及している。
 PLCなどの制御装置は高性能が要求される。この要求に関して、例えば特許文献1(特表2013-506911号公報)のPLCは、PLC機能の各々に割当てられた1または複数のプロセッサを備えて、これらPLC機能のうち少なくとも2つは並列に動作させている。
特表2013-506911号公報
 PLCなどの制御装置は、生産現場に設けられた機器のシーケンス制御を実現するためのシーケンスプログラムおよびモーション制御を実現するためのモーションプログラムなどを含む機器を制御するための制御タスクを、予め定められた周期毎に実行することで、機器のリアルタイム制御を実現している。
 ところで、PLCなどの制御装置においては、各種の機能の追加に伴い、機器の制御に直接的には関与しない非制御タスクを上記のリアルタイム制御(定周期性)を維持しながら実行させたいという要求がある。
 この要求を実現するために、定周期内に終わらなかった非制御タスクを次周期に実行する方法も提案されている。しかし、この方法は、異常検知等の特定の非制御タスクについて適当ではない。具体的には、非制御タスクの実行結果に応じて、対象のリアルタイム制御の内容を変える等(例えば、機械を止める、異常によって不良が発生したワークを弾く、制御対象の機械が包装機であれば包装後はカッターを降ろさない等)が要求されている場合は、この方法では、制御タスクとの関係も考慮して決まった時間内に非制御タスクの実行を完了することができないとの課題が残る。
 特許文献1は、PLC機能のうち少なくとも2つを並列に動作させているが、対象をリアルタイム制御するための制御タスクと、非制御タスクとを、対象のリアルタイム制御を保証可能なように実行するための具体的な構成は提案していない。
 本技術は、対象をリアルタイム制御するための制御タスクと、非制御タスクとを、対象のリアルタイム制御を保証可能なように実行する制御装置、制御方法および制御プログラムを提供する。
 本開示のある局面によれば、対象を制御する制御装置であって、対象のリアルタイム制御を実施するための制御タスクおよび、リアルタイム制御に関連する関連処理を実施するための非制御タスクを含む複数のタスクを実行するプロセッサと、複数のタスクの各タスクに対応付けた優先度に基づく順序に従い複数のタスクをプロセッサにより実行させるマルチタスク実行部と、非制御タスクの優先度を可変に設定するスケジューラと、を備え、制御タスクの優先度は最優先に設定される。スケジューラは、非制御タスクの実行開始条件が成立すると第1優先度に設定するとともに、当該非制御タスクの実行開始からの時間が関連処理をリアルタイムに実行するための第1時間の間は、当該非制御タスクの優先度を第1優先度に維持し、その後、実行開始からの時間が第1時間よりも長くなると、当該非制御タスクの優先度を第2優先度に下げるよう切替える優先度切替部を含む。
 好ましくは、上記の第1時間は、可変に設定される。
 好ましくは、優先度切替部は、さらに、第2優先度の非制御タスクの実行開始からの時間が第2時間よりも長くなると、当該非制御タスクの優先度を第1優先度に上げるよう切替える。
 好ましくは、第2時間は、可変に設定される。
 好ましくは、関連処理は、対象に関連するデータから対象に生じる異常を検知するのに適した特徴量を生成する特徴量生成処理と、特徴量生成処理により生成される特徴量を用いて異常を検知する異常検知処理と、特徴量生成処理または異常検知処理のためのデータを、記憶装置を含む装置と通信する処理と、を含む。
 好ましくは、関連処理は、制御装置から対象に出力される指令値と予め定められた予測制御モデルとを用いて対象の推定の制御量を算出する算出処理と、算出処理により算出された制御量に基づき補正値を算出する補正値算出処理を含み、制御タスクは、算出される補正値に従って対象に対する指令値を算出する制御演算タスクを含む。
 好ましくは、関連処理は、制御装置から対象に出力される対象の制御量と予め定められた予測制御モデルを用いて対象の推定の制御量を算出する算出処理と、算出処理により算出された制御量に基づき補正値を算出する補正値算出処理を含み、制御タスクは、算出される補正値に従って対象に対する指令値を算出する制御演算タスクを含む。
 好ましくは、上記の補正値算出処理は、制御量が予め定められた範囲に収まるよう補償した補正値を算出する処理を含む。
 好ましくは、非制御タスクについて、実行時間を含む当該非制御タスクの実行に関する情報を収集する収集部を備え、収集部により収集される情報は、外部に出力される。
 好ましくは、収集される情報は、非制御タスクの優先度の切替え回数を含む。
 好ましくは、関連処理の内容は可変に設定される。
 好ましくは、プロセッサは、複数のプロセッサコアを含み、非制御タスクを実行するプロセッサコアを指定するコア情報を記憶するためのコア情報記憶部を、さらに備え、スケジューラは、さらに、コア情報または各プロセッサコアの利用率に基づき、非制御タスクを実行するプロセッサコアを決定するコア切替部を含む。
 好ましくは、コア情報は、非制御タスクの優先度に基づき当該非制御タスクを実行するプロセッサコアを指定する情報を含む。
 この技術の他の局面に従うと、対象を制御する制御装置における制御方法が提供される。制御装置は、対象のリアルタイム制御を実施するための制御タスクおよび、リアルタイム制御に関連する関連処理を実施するための非制御タスクを含む複数のタスクを実行するプロセッサと、複数のタスクの各タスクに対応付けた優先度に基づく順序に従い前記複数のタスクを前記プロセッサにより実行させるマルチタスク実行部と、を備え、制御タスクの優先度は最優先に設定される。
 制御方法は、非制御タスクの実行開始条件が成立すると第1優先度に設定するとともに、当該非制御タスクの実行開始からの時間が前記関連処理をリアルタイムに実行するための第1時間の間は、当該非制御タスクの優先度を第1優先度に維持するステップと、その後、前記実行開始からの時間が前記第1時間よりも長くなると、当該非制御タスクの優先度を第2優先度に下げるよう切替えるステップとを、含む。
 この技術の他の局面に従うと、上記の制御方法をコンピュータに実行させるためのプログラムが提供される。
 本技術によれば、対象をリアルタイム制御するための制御タスクと、非制御タスクとが、対象のリアルタイム制御を保証可能なように実行され得る。
本実施の形態に係る制御システム1の全体構成例を示す模式図である。 本実施の形態に係る制御システム1を構成する制御装置100のハードウェア構成例を示すブロック図である。 本実施の形態に係る制御システム1を構成するサポート装置200のハードウェア構成例を示すブロック図である。 本実施の形態に係る概略処理のフローチャートである。 本実施の形態に係る制御装置100が備える機能を模式的に示す図である。 本実施の形態に係る関連処理タスク143の状態遷移を模式的に示す図である。 本実施の形態に係る関連処理プログラム165の構成を模式的に示す図である。 本実施の形態に係るタスクに優先度を設定するためのユーザインターフェイスを示す図である。 本実施の形態に係るタスクにプログラムを割当てるユーザインターフェイスを示す図である。 本実施の形態に係る関連処理タスクの実行を管理する処理を示すフローチャートである。 (A)と(B)は、本実施の形態に係る関連処理タスク143のスケジューリングモデルを示す図である。 図11に関連付けて関連処理タスク143の優先度切替を例示する図である。 本実施の形態に係る複数の関連処理タスクに優先度と閾値を設定する例を示す図である。 本実施の形態に係る複数の関連処理タスクに対するプログラムの割当て方法を示す図である。 本実施の形態に係るデバッグのための支援情報の表示例を示す図である。 本実施の形態に係るモニタ情報153Aとログ135の一例を示す図である。 本実施の形態に係る収集情報228の一例を示す図である。 本実施の形態に係るコア情報136を示す図である。 実施の形態に係るマルチコアスケジューリングにおいて1つの関連処理タスク143を実行する例を示す図である。 本実施の形態に係るマルチコアスケジューリングにおいて複数の関連処理タスク143を実行する例を示す図である。 本実施の形態に係るマルチコアスケジューリングにおいて複数の関連処理タスク143を実行する他の例を示す図である。 本実施の形態に係るマルチコアスケジューリングにおいて複数の関連処理タスク143を実行する更なる他の例を示す図である。 本実施の形態に係る関連処理タスク143の変形例を説明する模式図である。 本実施の形態に係る予測制御モデルの一例を模式的に示す図である。
 本発明の実施の形態について、図面を参照しながら詳細に説明する。なお、図中の同一または相当部分については、同一符号を付してその説明は繰返さない。
 <用語の説明>
 本実施の形態での用語を説明する。
 「タスク」は、プロセッサにより実行される処理の単位であって、タスクは1つ以上のプログラムを含む。
 タスクの「リアルタイム性」は、タスクが実行開始されてから、予め定められた時間内に実行が終了することを示す。
 「制御タスク」は、フィールド装置群のうちの制御すべき対象をリアルタイム制御するためのタスクである。
 「非制御タスク」は、「制御タスク」とは異なり直接にリアルタイム制御に関与しないが、リアルタイム性が要求されるタスクであって、上記のリアルタイム制御に関連する処理を実施するためのタスクである。
 タスクの「優先度」は、当該タスクが他のタスクよりも先にプロセッサにより実行される相対的な順序を示す。優先度が高ければ実行順序は先となり、優先度が低ければ実行順序は後となる。
 <実施の形態の概要>
 本実施の形態では制御装置のスケジューラは、制御タスクおよび非制御タスクを含む複数のタスクの優先度を可変に設定する。本実施の形態では、複数のタスクのうち制御タスクの優先度は最も高く設定されている。スケジューラは、非制御タスクの実行開始条件が成立すると第1優先度に設定するとともに、当該非制御タスクの実行開始からの時間が関連処理をリアルタイムに実行するための第1時間の間は非制御タスクの優先度を第1優先度(高優先度)に維持し、その後、実行開始からの経過時間である実行時間が第1時間よりも長くなると、当該非制御タスクの優先度を第2優先度(低優先度)に下げるよう切替える。
 これにより、実行時間が第1時間を超えない間は、リアルタイム性を維持しながら関連処理を実行することができて、例えば関連処理の結果を用いた対象のリアルタイム制御を実現することが可能となる。また、実行時間が第1時間を超えて長くなると非制御タスクの優先度を低くすることで他のタスクが優先的に実行可能となるので、他のタスクがリアルタイム制御に寄与する処理を実行している場合には、他のタスクの実行結果を用いた対象のリアルタイム制御が可能となる。したがって、制御タスクによる対象のリアルタイム制御の実現を保証しながら、非制御タスクによる関連処理のリアルタイムな実行も実現することが可能となる。
 <A.制御システムの全体構成例>
 まず、本実施の形態に係る制御装置を含む制御システム1の全体構成例について説明する。
 図1は、本実施の形態に係る制御システム1の全体構成例を示す模式図である。図1を参照して、本実施の形態に係る制御システム1は、主たる構成要素として、制御すべき対象を制御する制御装置100と、制御装置100に接続されるサポート装置200とを含む。
 制御装置100は、PLC(プログラマブルコントローラ)などの、一種のコンピュータとして具現化されてもよい。制御装置100は、第1フィールドネットワーク2を介してフィールド装置群10と接続されるとともに、第2フィールドネットワーク4を介して1または複数の表示装置400と接続される。さらに、制御装置100は、ローカルネットワーク6を介してデータロギング装置300に接続される。制御装置100は、それぞれのネットワークを介して、接続された装置との間でデータを遣り取りする。なお、データロギング装置300および表示装置400はオプショナルな構成であり、制御システム1の必須の構成ではない。
 制御装置100は、生産現場などの設備や機械を制御するための各種演算を実行する機能と、フィールド装置群10にて計測され、制御装置100へ転送されるデータ(以下、「入力データ」とも称す。)を収集する収集機能と、収集した入力データを監視する監視機能とを備える。これらの機能が制御装置100に実装されることで、対象に生じている現象を監視することができる。
 具体的には、制御装置100に実装される後述する内部データベース(以下、「内部DB」とも記す。)130が上記の収集機能の一部を提供し、制御装置100に実装される異常検知プログラム(後述する)が監視機能を提供する。
 フィールド装置群10は、制御装置100の制御すべき対象または制御に関連する製造装置や生産ラインなど(以下、「フィールド」とも総称する。)から入力データを収集する装置を含む。このような入力データを収集する装置としては、入力リレーや各種センサなどが想定される。フィールド装置群10は、さらに、制御装置100にて生成される指令(以下、「出力データ」とも称す。)に基づいて、フィールドに対して何らかの作用を与える装置を含む。このようなフィールドに対して何らかの作用を与える装置としては、出力リレー、コンタクタ、サーボドライバおよびサーボモータ、その他任意のアクチュエータが想定される。これらのフィールド装置群10は、第1フィールドネットワーク2を介して、制御装置100との間で、入力データおよび出力データを含むデータを遣り取りする。
 図1に示す構成例においては、フィールド装置群10は、リモートI/O(Input/Output)装置12と、リレー群14と、画像センサ18およびカメラ20と、サーボドライバ22、サーボモータ24およびI/Oユニット16を含む。フィールド装置群10としては、これらに限られることなく、入力データを収集できるデバイス、または、出力データに基づく何らかのアクションができるデバイスであれば、どのようなものを採用してもよい。
 リモートI/O装置12は、第1フィールドネットワーク2を介して通信を行う通信カプラと、入力データの取得および出力データの出力を行うための入出力部(以下、「I/Oユニット」とも称す。)とを含む。このようなI/Oユニットを介して、制御装置100とフィールドとの間で入力データおよび出力データが遣り取りされる。図1には、リレー群14を介して、入力データおよび出力データとして、デジタル信号が遣り取りされる例が示されている。I/Oユニットは、フィールドバスに直接接続されるようにしてもよい。図1には、第1フィールドネットワーク2にI/Oユニット16が直接接続されている例を示す。
 画像センサ18は、カメラ20によって撮像された画像データに対して、パターンマッチングなどの画像計測処理を行って、その処理結果を制御装置100へ送信する。
 サーボドライバ22は、制御装置100からの出力データに従って、サーボモータ24を駆動する。
 上述のように、第1フィールドネットワーク2を介して、制御装置100とフィールド装置群10との間でデータが遣り取りされることになるが、本実施の形態では、これらの遣り取りされるデータは、例えば周期(=単位時間)T毎に更新されることになる。周期Tは、フィールド装置群10をリアルタイム制御するために予め定められた単位時間を示し、例えば数百μsecオーダ~数十msecオーダを有する。なお、このような遣り取りされるデータの更新処理を、「I/Oリフレッシュ処理」と称することもある。
 また、第2フィールドネットワーク4を介して制御装置100と接続される表示装置400は、ユーザからの操作を受けて、制御装置100に対してユーザ操作に応じたコマンドなどを送信するとともに、制御装置100での演算結果などをグラフィカルに表示する。
 データロギング装置300は、制御装置100とローカルネットワーク6を介して接続され、制御装置100との間で必要なデータを遣り取りする。データロギング装置300は、例えば、制御装置100が発生するイベントログなどを時系列に収集する。
 サポート装置200は、制御装置100が対象を制御するために必要な準備を支援する装置である。具体的には、サポート装置200は、制御装置100で実行されるユーザプログラムの開発環境(プログラム作成編集ツール、パーサ、コンパイラなど)、制御装置100および制御装置100に接続される各種デバイスのパラメータ(コンフィギュレーション)を設定するための設定環境、生成したユーザプログラムを制御装置100へ送信する機能、制御装置100上で実行されるユーザプログラムなどをオンライン(またはオフライン)で修正・変更する後述するデバッグツール227(後述する)、などを提供する。
 <B.各装置のハードウェア構成例>
 次に、本実施の形態に係る制御システム1を構成する主要な装置のハードウェア構成例について説明する。
 (b1:制御装置100のハードウェア構成例)
 図2は、本実施の形態に係る制御システム1を構成する制御装置100のハードウェア構成例を示すブロック図である。図2を参照して、制御装置100は、周期Tを含む各種の時間を計測するためのタイマ101と、CPU(Central Processing Unit)またはMPU(Micro-Processing Unit)などのプロセッサ102と、チップセット104と、主記憶装置106と、二次記憶装置108と、ローカルネットワークコントローラ110と、USB(Universal Serial Bus)コントローラ112と、メモリカードインターフェイス114と、内部バスコントローラ122と、フィールドバスコントローラ118,120と、I/Oユニット124-1,124-2,…とを含む。二次記憶装置108は、例えば、HDD(Hard Disk Drive)やSSD(Solid State Drive)などの不揮発性記憶装置などで構成される。主記憶装置106は、DRAM(Dynamic Random Access Memory)やSRAM(Static Random Access Memory)などの揮発性記憶装置などで構成される。
 プロセッサ102は、二次記憶装置108に格納された各種プログラムを読み出して、主記憶装置106に展開して実行することで、フィールド装置群10の対象に応じた制御、および、後述するような各種処理を実現する。チップセット104は、プロセッサ102と各コンポーネントを制御することで、制御装置100全体としての処理を実現する。
 二次記憶装置108には、プロセッサ102により実行されるユーザプログラム150等の各種のプログラムおよび内部DB130が格納される。
 ローカルネットワークコントローラ110は、ローカルネットワーク6を介した他の装置との間のデータの遣り取りを制御する。ネットワークコントローラ110は、典型的には、ASIC(Application Specific Integrated Circuit)やFPGA(Field-Programmable Gate Array)といった専用回路を用いて実現される。USBコントローラ112は、USB接続を介してサポート装置200との間のデータの遣り取りを制御する。USBコントローラ112は、典型的には、ASICやFPGAといった専用回路を用いて実現される。
 メモリカードインターフェイス114は、メモリカード116を着脱可能に構成されており、メモリカード116に対してデータを書込み、メモリカード116から各種データ(ユーザプログラムまたはトレースデータなど)を読出すことが可能になっている。
 内部バスコントローラ122は、制御装置100に搭載されるI/Oユニット124-1,124-2,…との間でデータを遣り取りするインターフェイスである。内部バスコントローラ122は、典型的には、ASICやFPGAといった専用回路を用いて実現される。
 フィールドバスコントローラ118は、第1フィールドネットワーク2を介した他の装置との間のデータの遣り取りを制御する。フィールドバスコントローラ118は、典型的には、ASICやFPGAといった専用回路を用いて実現されるが、ソフトウェア実装で実現してもよい。ソフトウェア実装を採用する場合には、フィールドバスコントローラ118は、主として、プロセッサ102、主記憶装置106、ストレージなどで構成され、プロセッサ102がストレージに格納されたシステムプログラム(ファームウェア)などを読出して、主記憶装置106に展開して実行することで、必要な処理を実現する。同様に、フィールドバスコントローラ120は、第2フィールドネットワーク4を介した他の装置との間のデータの遣り取りを制御する。フィールドバスコントローラ120も、典型的には、ASICやFPGAといった専用回路を用いて実現されるが、ソフトウェア実装で実現してもよい。ソフトウェア実装を採用する場合には、フィールドバスコントローラ120は、主として、プロセッサ102、主記憶装置106、ストレージなどで構成され、プロセッサ102がストレージに格納されたシステムプログラム(ファームウェア)などを読出して、主記憶装置106に展開して実行することで、必要な処理を実現する。
 図2の制御装置100で実行される各種プログラムは、コンピュータ読取可能なメモリカード116などの記録媒体を介してインストールされてもよいが、ネットワーク上のサーバ装置などからダウンロードする形で二次記憶装置108にインストールするようにしてもよい。また、本実施の形態に係る制御装置100が提供する機能は、後述するOS(Operating System)190が提供するモジュールの一部を利用する形で実現される場合もある。
 また、図2では、プロセッサ102が上記のプログラムを実行することで必要な機能が提供される構成例を示したが、これらの提供される機能の一部または全部を、専用のハードウェア回路(例えば、ASICまたはFPGAなど)を用いて実装してもよい。あるいは、制御装置100の主要部を、汎用的なアーキテクチャに従うハードウェア(例えば、汎用パソコンをベースとした産業用パソコン)を用いて実現してもよい。この場合には、仮想化技術を用いて、用途の異なる複数のOSを並列的に実行させるとともに、各OS上で必要なアプリケーションを実行させるようにしてもよい。
 (b2:サポート装置200のハードウェア構成例)
 次に、本実施の形態に係るサポート装置200は、一例として、汎用的なアーキテクチャに従うハードウェア(例えば、汎用パソコン)を用いてプログラムを実行することで実現される。
 図3は、本実施の形態に係る制御システム1を構成するサポート装置200のハードウェア構成例を示すブロック図である。図3を参照して、サポート装置200は、CPUまたはMPUなどのプロセッサ202と、光学ドライブ204と、主記憶装置206と、二次記憶装置208と、USB(Universal Serial Bus)コントローラ212と、ローカルネットワークコントローラ214と、入力部216と、表示部218とを含む。これらのコンポーネントはバス220を介して接続される。
 プロセッサ202は、二次記憶装置208に格納された各種プログラムを読み出して、主記憶装置206に展開して実行することで、後述するような各種処理を実現する。
 二次記憶装置208は、例えば、HDD(Hard Disk Drive)やSSD(Flash Solid State Drive)などで構成される。二次記憶装置208には、典型的には、ユーザプログラム150の作成、システム構成の定義、各種パラメータの設定などを行うための開発プログラム222と、各種変数を指定するためのパラメータ設定ツール224と、制御装置100で収集されるデータから目的の情報を抽出するためのデータマイニングツール226と、タスクのスケジューリングに関するデバッグツール227と、収集情報228とが格納されていてもよい。収集情報228は、デバッグのために利用可能な情報であり、制御装置100においてタスクが実行された場合に収集された情報をまとめたものである。デバッグツール227と収集情報228の詳細は後述する。また、二次記憶装置208には、OSおよび他の必要なプログラムが格納されてもよい。
 サポート装置200は、光学ドライブ204を有しており、コンピュータ読取可能なプログラムを非一過的に格納する記録媒体205(例えば、DVD(Digital Versatile Disc)などの光学記録媒体)から、その中に格納されたプログラムが読取られて二次記憶装置208などにインストールされてもよい。
 サポート装置200で実行される各種プログラムは、コンピュータ読取可能な記録媒体205を介してインストールされてもよいが、ネットワーク上のサーバ装置などからダウンロードする形でインストールするようにしてもよい。また、本実施の形態に係るサポート装置200が提供する機能は、OSが提供するモジュールの一部を利用する形で実現される場合もある。
 USBコントローラ212は、USB接続を介して制御装置100との間のデータの遣り取りを制御する。ローカルネットワークコントローラ214は、任意ネットワークを介した他の装置との間のデータの遣り取りを制御する。
 入力部216は、キーボードやマウスなどで構成され、ユーザ操作を受付ける。表示部218は、ディスプレイ、各種インジケータ、プリンタなどで構成され、プロセッサ202からの処理結果などを出力する。
 図3には、プロセッサ202がプログラムを実行することで必要な機能が提供される構成例を示したが、これらの提供される機能の一部または全部を、専用のハードウェア回路(例えば、ASICまたはFPGAなど)を用いて実装してもよい。
 <C.全体処理と機能構成例>
 制御システム1により実施される処理の概要と、制御装置100が有する機能の概要を説明する。
 (c1:全体の処理)
 図4は、本実施の形態に係る概略処理のフローチャートである。図4を参照して、制御システム1により実施される全体処理は、まず、制御装置100においてなされるタスクの実行処理(ステップST1)およびタスクの実行中に取得される情報を収集する処理(ステップST2)を含む。さらに、サポート装置200においてなされる収集情報228の統計処理(ステップST3)および収集情報228に基づく表示処理(ステップST4)を含む。さらに、制御システム1の処理は、デバッグツール227によるデバッグ処理(ステップST5)、およびデバッグ結果に基づきタスク(プログラム)を制御装置100において再度実行するための処理(ステップST6)を含む。
 なお、図4では、サポート装置200が統計処理、収集情報228に基づく画像の表示処理、およびデバッグ処理(ステップST3~ST5)を実行するが、これら処理は制御装置100により実行されてもよい。
 (c2:機能構成)
 図5は、本実施の形態に係る制御装置100が備える機能を模式的に示す図である。図5では、制御装置100のスケジューラ151が、二次記憶装置108の記憶内容と関連付けて示される。
 主記憶装置106は、プロセッサ102がプログラムを展開して実行するための作業領域E1を含む。また、二次記憶装置108は、内部DB130、タスク実行時に収集される情報を示すログ135、およびユーザプログラム150を格納する。ユーザプログラム150は、ユーザがサポート装置200を用いて作成可能なプログラムであり、基本的には、制御装置100のプロセッサ102(図2)により実行される。
 ユーザプログラム150は、フィールド装置群10のうちの指定された対象のリアルタイム制御を実施するために定周期T毎に実行されるプライマリ定周期プログラム(制御入力プログラム161、制御出力プログラム162および高優先制御プログラム163)を含む。さらに、ユーザプログラム150は、低優先制御プログラム164、関連処理プログラム165およびシステムサービスプログラム166を含む。
 制御入力プログラム161および制御出力プログラム162は、I/Oリフレッシュ処理の機能に相当する。具体的には、制御入力プログラム161および制御出力プログラム162はフィールド装置群10との間で遣り取りされるデータ(入力データおよび出力データ)を内部DB130の変数として書込む、または変数を読出す命令を含む。制御装置100では、これら入力データおよび出力データの各々に対してユニークな変数名が割り当てられており、それぞれの変数名を利用して、フィールド装置群10と遣り取りされるデータが表現され得る。
 高優先制御プログラム163は、典型的には、シーケンス/モーションプログラム(シーケンスプログラムおよび/またはモーションプログラム)を含む。シーケンス/モーションプログラムは、内部DB130の変数を読出し、変数に基づき、フィールド装置群10のうちの制御すべき対象をリアルタイム制御するための論理演算および/または数値演算を行い、その結果を変数に書込む命令を含む。高優先制御プログラム163による演算結果を示す変数は、制御出力プログラム162を介して、フィールド装置群10に出力されて、フィールド装置群10の対象の制御に用いられる。
 低優先制御プログラム164は、フィールド装置群10の制御に関するリアルタイム性が要求されるプログラムであって、高優先制御プログラムよりも優先度は低いがリアルタイム性が要求されるプログラムを含む。低優先制御プログラム164は、例えば、上記に述べたモーションプログラムに提供する軌道データを生成するための軌道生成プログラムを含む。
 関連処理プログラム165は、フィールド装置群10の対象のリアルタイム制御に関連した処理を実施するリアルタイム性が要求されるプログラムであって、例えば特徴量生成プログラムおよび異常検知プログラムを含む。
 特徴量生成プログラムは、プロセッサ102で実行される。特徴量生成プログラムは、予め指定された特徴量の生成手法に従って、変数のうちの指定された変数を用いて特徴量を生成する命令を含む。例えば、特徴量生成プログラムは、フィールド装置群10のうちの対象に関連するデータから対象に生じる異常を検知するのに適した特徴量を生成し得る。
 異常検知プログラムは、特徴量生成プログラムにより生成される特徴量を用いて異常検知の処理を実施する命令を含む。例えば、異常検知プログラムは、機械学習により設定される異常検知モデルと、特徴量生成プログラムにより生成される特徴量とに基づいて、対象における異常の有無を検出し、異常の有無を学習結果として内部DB130に格納する。また、学習結果は、外部送信されて、外部機器に出力され得る。
 システムサービスプログラム166は、プロセッサ102で実行される。システムサービスプログラム166は、リアルタイム性は要求されず、且つフィールド装置群10の制御とは異なる処理を実施するためのプログラムを含む。システムサービスプログラム166は、例えば、制御装置100の外部機器(サポート装置200、データロギング装置300、表示装置400など)との通信、またはファイルへのデータ書き込みなどの命令を含む。システムサービスプログラム166は、例えば、周期的には実行されないプログラムであって、割込みなどのイベントに応じて実行されるようなプログラムを含み得る。
 制御装置100には、プロセッサ102がプログラムを実行するための環境を提供するために、OS190もインストールされる。OS190は、マルチタスク実行部191を含む。マルチタスク実行部191は、ユーザプログラム150をタスク単位で、各タスクの優先度に基づく順序に従い、プロセッサ102に実行させるためのマルチタスク制御を実現する。
 本実施の形態では、プロセッサが実行するタスクは高優先制御タスク141、低優先制御タスク142、関連処理タスク143、およびサービスタスク144を含む。なお、タスクの種類はこれらに限定されない。高優先制御タスク141と低優先制御タスク142は、フィールド装置群10の対象をリアルタイム制御するための「制御タスク」に相当する。関連処理タスク143は、対象のリアルタイム制御には直接関係しないが、上記のリアルタイム制御に関連する処理を実行する「非制御タスク」に相当する。低優先制御タスク142およびサービスタスク144は、「制御タスク」および「非制御タスク」とは異なるタスクである。
 本実施の形態では、ユーザプログラム150のうち、例えば、制御入力プログラム161、制御出力プログラム162および高優先制御プログラム163を高優先制御タスク141に割当て、低優先制御プログラム164を低優先制御タスク142に割当てる。また、関連処理プログラム165を関連処理タスク143に割当て、システムサービスプログラム166をサービスタスク144に割当てる。
 制御装置100は、さらに、マルチタスク実行部191がタスクを実行するために参照(読出)するタスク制御情報131、システム変数、閾値152Aおよび優先度情報152Bを有する。これら情報は、主記憶装置106に格納される。また、制御装置100は、後述するマルチコア動作モードで用いられるコア情報136を含む。コア情報136の詳細は後述する。
 システム変数は、タスクの実行を制御するためのタスク状態変数を含む各種の変数を含む。タスク状態変数は、各タスクの後述する状態遷移に従い、当該タスクの実行状態を示す状態フラグFLを含む。状態フラグFLは、マルチタスク実行部191により書込まれる値であって、例えばタスクの状態遷移に従い、‘00’(実行前状態)、‘01’(実行状態且つ実行中)、‘10’(実行状態且つサスペンド(実行中断))および‘11’(実行完了状態)のいずれかの値が書込まれる。なお、タスクの状態遷移については、図6で後述する。
 タスク制御情報131は、各タスクに対応してタスク名132、優先度133および当該タスクに割当てられているプログラムのプログラム名134を含む。閾値152Aは、第1時間T1と第2時間T2(>第1時間T1)を含む。第1時間T1は、関連処理タスク143の関連処理プログラム165をリアルタイムに実行するための実行時間の制限時間に相当する。優先度情報152Bは、関連処理タスク143の優先度である高優先度PHと低優先度PL(高優先度よりも低い優先度)とを含む。
 スケジューラ151は、各タスクの優先度、すなわちプロセッサ102による当該タスクの実行順序を可変に設定する命令を含むプログラムにより実現される。スケジューラ151のプログラムは、二次記憶装置108に格納されている。プロセッサ102は二次記憶装置108からスケジューラ151のプログラムを読出し、読出したプログラムを主記憶装置106に展開し実行する。
 <D.タスクの状態遷移>
 本実施の形態では、マルチタスク実行部191は、タスクを、実行状態、実行前状態および実行完了状態の3つの状態に遷移させながら実行する。実行状態は、タスクにプロセッサ102などの資源が割当られており、タスクが実行中の状態を示す。実行前状態は、実行状態に遷移する前のタスクの状態であって、具体的には、資源の割当てがあれば、実行を開始できる実行可能状態を示す。実行完了状態は、タスクの実行が完了した状態であって、タスクは実行可能状態に遷移するための何らかの事象を待つ状態を示す。
 プロセッサ102が1つのプロセッサコアを有する場合に、マルチタスク実行部191により、ある時点でプロセッサ102(プロセッサコア)の資源が割当てられて実行状態となるタスクは1つである。マルチタスク実行部191は、実行前状態のタスクの中から次に資源を割当てるタスクを選択し、選択されたタスクを実行状態に遷移させる。この選択は、各タスクが有する優先度に従い実施される。
 図5に戻り、スケジューラ151は、カウンタ153Bを含む優先度切替部153、タスク制御情報131を設定する命令を含むタスク情報設定部154、および関連処理タスク143の実行開始を指示するための実行開始指示をマルチタスク実行部191に出力する命令を含む実行指示部157を備える。カウンタ153Bは、タイマ101の出力に同期したカウント動作をすることにより、関連処理タスク143の実行時間を計測する。また、スケジューラ151は、優先度切替部153からのモニタ情報153Aに基づき、関連処理タスク143の優先度が切替えられた回数および実行時間などの情報を収集する命令を含む収集部155、および閾値152A,優先度情報152Bを設定する命令を含む設定部152を備える。さらに、スケジューラ151は、後述するマルチコア動作モードを起動するコア切替部156を含む。スケジューラ151のこれら各部はプログラムにより実現されて、プロセッサ102がこれらプログラムを実行する。
 (d1:関連処理タスク143の優先度切替え)
 本実施の形態では、スケジューラ151の優先度切替部153は、非制御タスクについて、当該タスクの実行時間に応じた優先度の切替え(調整)を実施する。本実施の形態では、このような優先度の調整がなされる非制御タスクとして、関連処理タスク143を例示するが、関連処理タスク143に限定されない。
 実施の形態では、「制御タスク」である高優先制御タスク141の優先度は最優先に設定される。低優先制御タスク142、「非制御タスク」およびサービスタスク144の優先度は、高優先制御タスク141の優先度よりも低く設定される。例えば、関連処理タスク143の優先度は、「第1優先度」に対応する高優先度PHまたは「第2優先度」に対応する低優先度PLのいずれか一方に設定され得る。優先度切替部153は、カウンタ153Bが計測する関連処理タスク143の実行時間を閾値152Aと比較し、比較の結果に基づき優先度を、高優先度PHまたは低優先度PLの一方に変更する(切替する)命令を含む。
 図6は、本実施の形態に係る関連処理タスク143の状態遷移を模式的に示す図である。図6に示すように、マルチタスク実行部191は、定周期トリガ(Trigger)に同期して、関連処理タスク143を実行前状態から実行状態に遷移させることが可能である。OS190は、周期Tの開始に同期して定周期トリガ(Trigger)を出力する。
 優先度切替部153は、関連処理タスク143が実行状態にある時間を、すなわち関連処理タスク143に対応の状態フラグFLが実行状態を示す(FL=‘01’または‘10’)時間を、カウンタ153Bにより計測する。優先度切替部153は、関連処理タスク143の優先度133が‘高優先度PH’を示す場合は、計測された実行時間を第1時間T1と比較する。比較の結果が(実行時間>第1時間T1)である場合は、優先度切替部153は、タスク制御情報131における関連処理タスク143に対応の優先度133を、高優先度PHから低優先度PLに書換える。また、優先度切替部153は、関連処理タスク143の優先度133が‘低優先度PL’を示す場合は、計測された実行時間を第2時間T2と比較する。比較の結果が(実行時間>第2時間T2)である場合は、優先度切替部153は、タスク制御情報131における関連処理タスク143に対応の優先度133を、低優先度PLから高優先度PHに書換える。
 このように、関連処理タスク143の優先度は、前回の実行状態で関連処理タスク143の実行に要した時間(実行時間)に基づき切替えられ得る。
 (d2:関連処理タスク143の実行状態への遷移の指示)
 図7は、本実施の形態に係る関連処理プログラム165の構成を模式的に示す図である。図7では、関連処理プログラム165の構成として、異常検知プログラムおよび特徴量生成プログラムが並列に示されて、各プログラムに対応して接点CNが示される。接点CNは、対応のプログラムの実行の有無を指定する。
 実行指示部157は、関連処理タスク143の実行を開始するための実行開始条件が成立したと判断したとき、実行開始指示をマルチタスク実行部191に出力する。
 図7を参照し、上記の実行開始条件を説明する。図7は、例えば、図示しない他のタスクが実行されたときに、他のタスクから出力された命令指示により、特徴量生成プログラムに対応の接点が選択された状態が示される。スケジューラ151の実行指示部157は、定周期トリガ(Trigger)を受付けた場合に、上記の命令指示を受付けると、関連処理タスク143の実行開始指示を、マルチタスク実行部191に出力する。マルチタスク実行部191は、実行指示部157から実行開始指示を受付けると、関連処理タスク143を実行前状態から実行状態に遷移させる。
 このように、実行指示部157は、図6に示した定周期トリガ(Trigger)または、制御プログラムからの命令指示、または変数値をもとにしたイベントによる自動指示、またはこれらの組合せを含み得る指示を受付けたとき、関連処理タスク143の実行開始条件が成立したことを判断する。
 (d3:関連処理タスク143の実行状態への遷移と状態フラグFLの設定)
 マルチタスク実行部191は、実行指示部157から実行開始指示を受付けたとき、関連処理タスク143を実行状態へ遷移させる。具体的には、マルチタスク実行部191は、タスク制御情報131から、関連処理タスク143に対応のプログラム名134を読出す。マルチタスク実行部191は、読出されたプログラム名134に基づき二次記憶装置108から関連処理プログラム165を読出し、読出された関連処理プログラム165を主記憶装置106に展開することで、関連処理プログラム165の実行を開始することが可能となる。これにより、関連処理タスク143は、実行前状態から実行状態に遷移する。
 また、マルチタスク実行部191は、関連処理タスク143を実行前状態から実行状態に遷移させたとき、関連処理タスク143に対応の状態フラグFLをセットする。具体的には、関連処理タスク143が実行状態に遷移したときに、プロセッサ102が他のタスクを実行していなければ、マルチタスク実行部191は、プロセッサ102に関連処理タスク143をすぐに実行させて、状態フラグFLを‘00’→‘01’にセットする。
 一方、関連処理タスク143が実行状態に遷移したときに、プロセッサ102が他のタスクを実行中であれば、すなわち同じ優先度の他のタスクが実行中であるときは、マルチタスク実行部191は、関連処理タスク143の実行を中断(サスペンド)し、状態フラグFLを‘00’→‘10’にセットする。この場合、その後、当該他のタスクの実行が中断すると、マルチタスク実行部191は、プロセッサ102に関連処理タスク143を実行させて、関連処理タスク143に対応の状態フラグFLを‘10’→‘01’にセットする。このように、関連処理タスク143の優先度と同じ優先度である他のタスクが実行状態に遷移し得る場合には、両タスクについて予め定められた時間毎に交互に実行中→実行中断が繰返される(以下、交互実行ともいう)ことにより、両タスクは実行状態を維持することが可能となる。
 その後、関連処理タスク143の実行が完了した場合は、マルチタスク実行部191は、関連処理タスク143を実行状態から実行完了状態に遷移させるとともに、関連処理タスク143に対応の状態フラグFLを‘11’にセットする。
 このように、関連処理タスク143の状態フラグFLの値により、関連処理タスク143が実行前状態、実行状態(実行中または実行中断)および実行完了状態のいずれに在るかを示すことができる。カウンタ153Bは、関連処理タスク143の状態フラグFLが‘01’または‘10’である時間を計測することにより、関連処理タスク143の実行時間を計測する。
 <E.タスクに関する情報の設定>
 本実施の形態では、ユーザは、各タスクについて、優先度および当該タスクに割当てるプログラムを設定または変更することができる。
 図8は、本実施の形態に係るタスクに優先度を設定するためのユーザインターフェイスを示す図である。図9は、本実施の形態に係るタスクにプログラムを割当てるユーザインターフェイスを示す図である。図8と図9のユーザインターフェイスは、サポート装置200の表示部218の表示画面として提供される。
 本実施の形態では、タスクの優先度に関して、高優先制御タスク141は、ユーザプログラム150のタスクの中で最も高い優先度(最も実行順序が先である)を有し、高優先制御タスク141の優先度は固定である。ユーザプログラム150の他の各タスクの優先度は、高優先制御タスク141よりも低くなるように可変に設定することができる。ユーザは、図8のユーザインターフェイスを介して、高優先制御タスク141を除く他のタスクの優先度を設定することができる。
 図8の画面では、各タスクについて、ユーザは、「タスクのタイプと優先度」、「タスク名」、「トリガの周期」、および「周期オーバ検知有無」の各項目を、入力部216を操作して設定することができる。なお、本実施の形態では、図8に示すように、プライマリ定周期タスクである高優先制御タスク141については、例えば、優先度‘4’で1msec毎に実行されるようデフォルト(固定値)が設定されている。
 ユーザは、「制御タスク」を除く他のタスクについては任意に設定することができる。図8では、ユーザは、例えば、関連処理タスク143について、優先度として高優先度PHとして‘8’および低優先度PLとして‘18’を設定し、トリガ周期として‘10msec’を設定し、周期オーバ検知の欄では、第1時間T1として‘2msec’および第2時間T2として‘10msec’を設定する。なお、第1時間T1および第2時間T2は、これらの値に限定されない。例えば、ユーザは、第1時間T1および第2時間T2を、関連処理タスク143に要求されているリアルタイム性(タスクが実行開始されてから、予め定められた時間内に実行が終了する)に従い、当該予め定められた時間の許容範囲(例えば、上限の制限値と下限の制限値等)として設定することができる。
 また、図9では、ユーザは、各タスクに割当てるプログラムを設定することができる。本実施の形態では、タスクに対して基本的に1つのプログラムを割当てるが、2つ以上のプログラムを割当ててもよい。例えば、図9では、関連処理タスク143であるタスクRTS1に、関連性のあるプログラムProgram0、Program1、Program2(特徴量生成プログラム、異常検知プログラム等)が割当てられている。
 サポート装置200は、図8と図9のユーザインターフェィスにより設定された情報を、制御装置100に転送する。制御装置100の設定部152は、サポート装置200から受信した情報のうち、関連処理タスク143に対応の高優先度PHおよび低優先度PLの値を優先度情報152Bに設定する。また、タスク情報設定部154は、サポート装置200から受信した情報に基づき、タスク制御情報131の各タスクに対応したタスク名132、優先度133およびプログラム名134を設定する。
 <F.タスクの管理>
 本実施の形態に係る制御装置100は、シングルコア動作モードとマルチコア動作モードを有し、各動作モードにおいてタスクの実行を管理する。具体的には、プロセッサ102は1または複数のコアプロセッサを有する。シングルコア動作モードは、1つのコアプロセッサを用いてタスクを実行するモードを示し、マルチコア動作モードは2つ以上のコアプロセッサを用いてタスクを実行するモードを示す。制御装置100の動作モードは切替え可能である。まず、シングルコア動作モードを説明する。
 図10は、本実施の形態に係る関連処理タスクの実行を管理する処理を示すフローチャートである。図10では、スケジューラ151により関連処理タスク143の実行を管理するための管理処理PRが、マルチタスク実行部191による高優先制御タスク141と関連処理タスク143の実行を制御する処理と関連付けて示される。
 マルチタスク実行部191による高優先制御タスク141と関連処理タスク143の実行を制御する処理は、OS190の一部を含むプログラムとして主記憶装置106に格納されている。また、スケジューラ151による管理処理PRは、プログラムとして二次記憶装置108に格納されている。プロセッサ102は、これらプログラムを主記憶装置106または二次記憶装置108から読出し実行する。なお、本実施の形態では、プロセッサ102は、管理処理PRのプログラムを定期的に実行する。
 図10を参照して、周期Tが開始されると、プロセッサ102は、タスク制御情報131のタスクのうち、優先度133が最も高い高優先制御タスク141を実行する。具体的には、高優先制御タスク141の制御入力プログラム161はフィールド装置群10から入力するデータを内部DB130の入力変数に設定する(ステップS1、S2)。また、高優先制御プログラム163は内部DB130の入力変数のデータに基づく演算を実行し、フィールド装置群10の対象を制御するための制御データを内部DB130の出力変数に書込む(ステップS3、S2)。制御出力プログラム162は、ステップS2で設定された出力変数が示す制御データを読出し、対象を制御するために出力する(ステップS5)。
 (f1:関連処理タスク143の高優先度に基づく管理)
 上記に述べた高優先制御タスク141の実行が終了すると、スケジューラ151は、それ以外のタスクが優先度に従い実行されるようにスケジューリングを実施する。ここでは、タスク制御情報131では、関連処理タスク143に対応の優先度133には初期値として「高優先度PH」が設定されており、この「高優先度PH」は高優先制御タスク141の優先度の次に高い優先度であるとする。
 なお、この初期値の設定は、タスク情報設定部154により実施される。具体的には、例えばシステムが初期化(より特定的には制御装置100の初期化)された後に、実行指示部157が関連処理タスク143の実行開始条件の成立を最初に判断したとき、タスク情報設定部154は、上記の初期値の設定を実施する。
 管理処理PRにおいて、スケジューラ151は、周期Tに同期した定周期トリガの出力(ステップS6)を受付けた場合において、実行指示を受付けたとき実行指示部157は上記の実行開始条件が成立したことを判断する(ステップ21)。実行開始条件が成立したとき、スケジューラ151は、関連処理タスク143の状態管理を開始する(ステップS23)。この実行指示は、高優先制御タスク141の処理(ステップS3)からの命令指示、または高優先制御タスク141による変数値をもとにしたイベント処理(ステップS7)からの自動指示を含む。
 関連処理タスク143の状態管理が開始されると、スケジューラ151は、状態フラグFLに基づき関連処理タスク143が実行状態であるか否かを判断する(ステップS25)。この時点では、関連処理タスク143は実行されていないので状態フラグFLは‘00’を示す。
 スケジューラ151は、状態フラグFLに基づき関連処理タスク143は実行状態ではないと判断すると(ステップS25でNO)、実行指示部157は実行開始指示をマルチタスク実行部191に出力する(ステップS27)。実行開始指示がマルチタスク実行部191に出力されると、カウンタ153Bは関連処理タスク143の実行時間の計測を開始する(ステップS29)。その後、スケジューラ151は管理処理PRを完了し(ステップS31)、ステップS23に戻る。
 マルチタスク実行部191は、スケジューラ151からの実行開始指示を受付けたとき、タスク制御情報131における関連処理タスク143に対応の優先度133(この優先度は「高優先度PH」を示す)に基づき、関連処理タスク143を実行開始するべきタスクとして選択し、関連処理タスク143を実行前状態から実行状態に遷移させる。すなわち、マルチタスク実行部191は、関連処理タスク143に対応の状態フラグFLを‘00’→‘01’に変更する(ステップS41)。プロセッサ102は、スケジューラ151が選択した関連処理タスク143を実行する。具体的には、タスク制御情報131に基づき、関連処理タスク143に対応のプログラム名134が示す関連処理プログラム165を実行する(ステップS45)。
 管理処理PRに戻り、スケジューラ151は、状態フラグFLに基づき、関連処理タスク143は実行状態であると判断すると(ステップS25でYES)、優先度切替部153は、カウンタ153Bが計測する関連処理タスク143の実行時間と、閾値152Aの時間とを比較する(ステップS33)。具体的には、優先度切替部153は、閾値152Aの第1時間T1と第2時間T2のうち、比較されるべき時間を、関連処理タスク143の優先度133に基づき決定する。ここでは、関連処理タスク143の優先度133は、高優先度PHを示す。したがって、優先度切替部153は第1時間T1を決定し、関連処理タスク143の実行時間と第1時間T1とを比較する。
 優先度切替部153は、上記の比較の結果に基づき(実行時間>第1時間T1)の条件が成立する、すなわち実行時間が第1時間よりも長くなった(超過した)と判断したとき(ステップS33でYES)、優先度切替部153は、実行時間が第1時間T1を超えたことを示す超過通知をマルチタスク実行部191に出力するとともに、優先度切替処理を実施する(ステップS35)。優先度切替処理において、優先度切替部153は、タスク制御情報131の関連処理タスク143の優先度133を、優先度情報152Bの低優先度PLに変更する。その後、管理処理PRを完了し(ステップS31)、ステップS23に戻る。
 また、優先度切替部153は、上述の(実行時間>第1時間T1)の条件が成立しないと判断したとき(ステップS33でNO)、すなわち実行時間は第1時間T1を超えていないと判断したときは、処理を完了し(ステップS31)、ステップS23に戻る。
 マルチタスク実行部191は、プロセッサ102による関連処理タスク143の実行が終了すると、関連処理タスク143を実行状態から実行完了状態に遷移させる。すなわち、関連処理タスク143の状態フラグFLを‘01’→‘11’にリセットする(ステップS49)。また、関連処理タスク143は、処理結果(特徴量生成プログラムまたは異常検知プログラムの実行結果)を内部DB130の学習結果に設定する(ステップS47、S2)。
 マルチタスク実行部191は、優先度切替部153から上述の超過通知を受付けると、超過通知対処処理を実施し(ステップS43)、ステップS45に移行する。この超過通知対処処理では、マルチタスク実行部191は、例えば、関連処理タスク143の実行を中断するか否かの判断処理を実施する。なお、超過通知対処処理の内容は、この判断処理に限定されない。
 (f2:関連処理タスク143の低優先度に基づく管理)
 上記の高優先度に基づく処理が実施された後に、スケジューラ151が、次の定周期トリガを受付けた場合において、タスク制御情報131の関連処理タスク143に対応の優先度133が低優先度PLを示すケースを説明する。このケースは、例えば、上記に述べたステップS35において、優先度切替部153により関連処理タスク143の優先度133が低優先度PLに変更されたケースである。
 なお、この「低優先度PL」は高優先制御タスク141の優先度の次に高い優先度であるとする。また、関連処理タスク143の優先度133(低優先度PL)は、低優先制御タスク142の優先度133と同じであるとする。
 スケジューラ151は、関連処理タスク143の実行指示を受付けて実行開始条件が成立したことを判断する(ステップS21、S23)。次に、スケジューラ151は状態フラグFLに基づき関連処理タスク143が実行状態ではないと判断し(ステップS25でNO)、実行指示部157は、マルチタスク実行部191に実行開始指示を出力する(ステップS27)。マルチタスク実行部191は、実行開始指示を受付けると関連処理タスク143をプロセッサ102に実行させる。具体的には、マルチタスク実行部191は、タスク制御情報131の優先度133に従い、関連処理タスク143と低優先制御タスク142を選択し、両者を実行前状態から実行状態に遷移させるとともに、カウンタ153Bは関連処理タスク143の実行時間の計測を開始する(ステップS41、S45、S29)。その後、関連処理タスク143の実行が終了すると、関連処理タスク143の状態フラグFLのリセット(ステップS49)および関連処理タスク143の実行結果の処理(ステップS47)が行われる。
 ここでは、2つのタスク(すなわち、低優先制御タスク142と関連処理タスク143)が交互実行されるが、カウンタ153Bは、関連処理タスク143の状態フラグFLの値に基づき、交互実行において、実行中断(サスペンド)の時間を含めた関連処理タスク143の実行時間を計測する。
 ステップS33に戻る。優先度切替部153は、カウンタ153Bが計測する関連処理タスク143の実行時間を、閾値152Aの時間と比較する(ステップS33)。具体的には、優先度切替部153は、閾値152Aの第1時間T1と第2時間T2のうち、比較されるべき時間を、関連処理タスク143の優先度133に基づき決定する。ここでは、関連処理タスク143の優先度133は低優先度PLを示す。したがって、優先度切替部153は第2時間T2を決定し、関連処理タスク143の実行時間を第2時間T2と比較する。
 優先度切替部153は、上記の比較の結果に基づき(実行時間>第2時間T2)の条件が成立する、すなわち実行時間が第2時間T2よりも長くなった(超過した)と判断したとき(ステップS33でYES)、優先度切替部153は、実行時間が第2時間T2を超えたことを示す超過通知をマルチタスク実行部191に出力するとともに、優先度切替処理を実施する(ステップS35)。優先度切替処理において、優先度切替部153は、タスク制御情報131の関連処理タスク143の優先度133を、優先度情報152Bの高優先度PHに変更する。その後、管理処理PRを完了し(ステップS31)、ステップS23に戻る。
 なお、優先度切替処理は、図10では、実行時間が第1時間T1または第2時間T2を超えたときに実施される(ステップS35)が、実施の時期はこれに限定されない。例えば、関連処理タスク143の実行開始条件が成立したときに優先度切替処理が実施されてもよい。このケースでは、関連処理タスク143の実行時間が第1時間T1または第2時間T2を超えた場合は、その後に関連処理タスク143の実行開始条件が成立したときに、優先度切替部153は、タスク制御情報131の関連処理タスク143の優先度133を、優先度情報152Bの高優先度PHまたは低優先度PLに設定する。
 (f3:関連処理タスク143の優先度切替えによる利点)
 図10のスケジューラ151の管理処理PRによれば、関連処理タスク143の実行時間が第1時間T1を超えない間は、高優先度PHが維持される。したがって、リアルタイム性を維持しながら関連処理を実行することができて、例えば実行時間毎に得られる関連処理(異常検知処理等)の結果を用いた対象のリアルタイム制御を実現することが可能となる。また、実行時間が第1時間T1を超えると関連処理タスク143の優先度を低くすることで他のタスク、例えば、他の制御タスクである低優先制御タスク142が優先的に実行可能となるので、低優先制御タスク142の実行結果(モーション制御の軌道データ)を用いた対象の確実なリアルタイム制御が可能となる。したがって、制御タスクによる対象のリアルタイム制御の実現を保証しながら、非制御タスクによるリアルタイムな関連処理の実行も実現することが可能となる。
 また、同じ優先度の他のタスクと交互実行がなされた結果、関連処理タスク143の実行時間が閾値152Aを超える場合は、関連処理タスク143の優先度が変更されるので、その後は、交互実行を回避することが可能となり、閾値を超えない実行時間で、関連処理タスク143を実行完了させることが可能となる。また、交互実行が解消(回避)されることで他のタスクも実行時間が短くなる。これにより、他のタスクが例えば低優先制御タスク142であれば、その実行結果(モーション制御の軌道データ)を用いた対象のリアルタイム制御がより確実に実現可能となる。
 また、交互実行がなされない場合であっても、関連処理タスク143の実行時間が閾値152Aを超えるときは、関連処理タスク143の実行によりプロセッサ資源が比較的、長時間にわたり占有状態となり、他のタスクの実行が妨げられる。この点に関し、関連処理タスク143の実行時間が第2時間T2を超えるときは、スケジューラ151は、関連処理タスク143の優先度を低優先度PL→高優先度PHと高くすることで、関連処理タスク143を早く実行完了させて、他のタスクである例えば低優先制御タスク142に、早い時期に資源を開放する(割当てる)ことが可能となる。また、関連処理タスク143の実行時間が第1時間T1を超えるときは、スケジューラ151は、関連処理タスク143の優先度を高優先度PH→低優先度PLと低くすることで、より優先度の高い他のタスクに資源を開放することができる。これにより、例えば、他のタスクが、モーション制御の軌道計算のための低優先制御タスク142であれば、高優先制御タスク141のモーションプログラムに速やかに軌道データを出力することが可能となり、対象のリアルタイム制御をより確実に実施することが可能となる。
 <G.関連処理タスク143のスケジューリングモデル>
 図10の管理処理PRによる関連処理タスク143の実行の管理を、タスク実行のスケジューリングモデルを用いて、さらに説明する。図11(A)と(B)は、本実施の形態に係る関連処理タスク143のスケジューリングモデルを示す図である。図12は、図11に関連付けて関連処理タスク143の優先度切替を例示する図である。図11の縦軸は、タスクの優先度を示し、横軸はn番目の周期T、(n+1)番目の周期T、(n+2)番目の周期、(n+3)番目の周期・・・とした時間経過を示す。
 本実施の形態では、関連処理タスク143の高優先度PHは低優先制御タスク142等の他のタスクの優先度以下となり得る。例えば、図11(A)は、関連処理タスク143の高優先度PHが低優先制御タスク142の優先度と同じケースである。また、本実施の形態では、関連処理タスク143の低優先度PLは低優先制御タスク142等の他のタスクの優先度以上となり得る。例えば、図11(B)は、関連処理タスク143の優先度が低優先度PLである場合の例(1)と例(2)のケースを示す。図11(B)の例(1)は、関連処理タスク143の低優先度PLが、低優先制御タスク142の優先度とサービスタスク144の優先度との間の値を示すケースである。例(2)は、関連処理タスク143の低優先度PLが、低優先制御タスク142の優先度よりも低く、且つサービスタスク144の優先度と同じケースである。
 (g1:関連処理タスク143が高優先度の場合のスケジューリングモデル)
 図11(A)を参照して、各周期Tはタイマ101の出力に同期した周期開始信号に応じて開始する。このとき、タスク制御情報131には、図12(A)のように、各タスクの優先度が設定されているとする。周期Tが開始されると、まず、最も優先度の高い高優先制御タスク141(制御入力プログラム161、制御出力プログラム162および高優先制御プログラム163)が実行されて、その後に、図12(A)のタスク制御情報131の高優先度(=16)に従い、マルチタスク実行部191は、同じ優先度133である低優先制御タスク142と関連処理タスク143を交互実行する。関連処理タスク143の実行時間t(図11(A)参照)は、交互実行における実行中断の時間(すなわち、低優先制御タスク142が実行中の時間)も含んで計測されている。
 図11(A)の実行時間tが(t≦第1時間T1)である場合は、優先度切替部153は優先度切替処理を実施しないので、関連処理タスク143の優先度133は図12(A)の高優先度のままである。一方、図11(A)の実行時間tが(t>第1時間T1)である場合は、優先度切替部153は優先度切替処理を実施する。これにより、関連処理タスク143の優先度133は、図12(A)の優先度から図12(B)または図12(C)に示される低優先度(=48)に切替わる。
 (g2:関連処理タスク143が低優先度の場合のスケジューリングモデル)
 図11(B)の例(1)を参照して、図12(B)に示すように関連処理タスク143が低優先度PLの場合を説明する。図11(A)と同様に、まず、高優先制御タスク141が実行されて、その後に他のタスクが実行される。この場合、図12(B)のタスク制御情報131によれば、低優先制御タスク142の優先度は関連処理タスク143の優先度よりも高い。したがって、マルチタスク実行部191は、低優先制御タスク142を実行し、次に関連処理タスク143を実行する。
 例(1)では、実行時間tは(t>第2時間T2)であるとすれば、優先度切替部153は優先度切替処理を実施する。これにより、関連処理タスク143の優先度133は、図12(A)のタスク制御情報131が示す元の高優先度に戻る。
 図11(B)の例(2)を参照して、図12(C)に示すように関連処理タスク143が低優先度の場合を説明する。例(2)でも図11(A)と同様に、まず、高優先制御タスク141が実行されて、その後に他のタスクが実行される。この場合、図12(C)のタスク制御情報131によれば、低優先制御タスク142の優先度は関連処理タスク143の優先度よりも高く、且つ関連処理タスク143の優先度はサービスタスク144の優先度と同じである。したがって、マルチタスク実行部191は、低優先制御タスク142を実行し、次に、同じ優先度である関連処理タスク143とサービスタスク144を交互実行する。
 例(2)では、関連処理タスク143の実行時間tは(t>第2時間T2)であるとすれば、優先度切替部153は優先度切替処理を実施する。これにより、関連処理タスク143の優先度133は図12(A)のタスク制御情報131が示す元の高優先度に戻るように切替えられる。
 <H.関連処理タスク143の他の例>
 上記に述べた関連処理タスク143は、リアルタイム制御のための高優先制御タスク141に関連する処理として特徴量生成処理および異常検知処理が割当てられるが、関連処理タスク143に割当てられる処理は、制御装置100内において実施される通信処理も含まれる。この通信処理は、具体的には、特徴量生成処理または異常検知処理に関連するデータを、二次記憶装置108を含む各種装置と通信する処理を含み得る。
 また、上記の特徴量生成処理または異常検知処理に関連するデータは、特徴量を生成するためにフィールド装置群10から受付ける生(raw)データ、特徴量生成処理の結果(生成された特徴量など)、異常検知の結果などを含むが、これらに限定されない。特徴量生成処理の結果および異常検知の結果の通信処理は、二次記憶装置108との通信、およびローカルネットワークコントローラ110と、USB(Universal Serial Bus)コントローラ112と、メモリカードインターフェイス114などを介した外部装置との通信を含み得る。また、生(raw)データおよび異常検知の結果の通信処理は、内部バスコントローラ122と、フィールドバスコントローラ118,120と、I/Oユニット124-1,124-2,…などを介した外部装置との通信を含み得る。
 <I.タスクに関する情報の設定の他の例>
 図8と図9で述べたタスクに関する情報の設定の他の例を説明する。図13は、本実施の形態に係る複数の関連処理タスクに優先度と閾値を設定する例を示す図である。図5では、設定部152は、優先度情報152Bと閾値152Aを個別に設定したが、図13のように1つのテーブル形式で設定するとしてもよい。
 図13では、例えば、関連処理タスク143が複数のタスクRTS1とRTS2を含む場合が示される。図13では、設定部152により、各タスクRTSiに対応して、優先度(高優先度PH、低優先度PL)と閾値(第1時間T1と第2時間T2)がテーブル形式で設定される。
 図14は、本実施の形態に係る複数の関連処理タスクに対するプログラムの割当て方法を示す図である。図14の下段は、関連処理タスクへのプログラムの割当を実施するためのユーザインターフェイスとしての画面例を示す。画面は、サポート装置200の表示部218に表示される。開発プログラム222は、関連処理プログラム165の構造を解析し、解析の結果に基づき、関連処理プログラム165に含まれる複数のプログラム(特徴量生成プログラムおよび異常検知プログラム)を抽出して表示する。
 ユーザは、入力部216を操作して、図14の画面から、関連処理タスク143に割当てるプログラムを設定する。図14の上段では、関連処理タスク143として3つのタスクRTS1~RTS3を設定することが可能である場合に、各タスクRTSiに対応して、ユーザが、異常検知プログラムまたは特徴量生成プログラムを割当てた(プログラム名134を設定した)状態が示される。
 このように、図14の下段で示す関連処理プログラム165のプログラム構成情報を、ユーザが各タスクRTSiに割当てるプログラムを判断するための支援情報として提供することができる。
 <J.収集情報とデバッグ>
 本実施の形態では、収集部155は、関連処理タスク143の実行時にスケジューリングに関する情報をログ135として記録する。デバッグツール227は、このログ135を収集して得られる収集情報228に基づき、デバッグを支援するための情報を生成し、生成した支援情報をユーザに提供する。
 本実施の形態では、「デバッグ」とは、ユーザが設定したユーザ設定情報(第1時間T1、第2時間T2、優先度(高優先度PHおよび低優先度PL)、関連処理タスク143に割当てるプログラム内容(プログラム名、種類を含む))を、調整または変更する作業を示す。ユーザは、例えば、リアルタイム制御を確実に実施することが可能な目標に近づけるようにデバッグを行なう。
 図15は、本実施の形態に係るデバッグのための支援情報の表示例を示す図である。図16は、本実施の形態に係るモニタ情報153Aとログ135の一例を示す図である。図17は、本実施の形態に係る収集情報228の一例を示す図である。
 (J1:収集される情報)
 本実施の形態では、収集部155は、関連処理タスク143の実行中に優先度切替部153から出力されるモニタ情報153Aを受付けて、受付けたモニタ情報153Aをログ135として二次記憶装置108に格納する。モニタ情報153Aは、関連処理タスク143の実行のスケジューリングに関する情報であり、例えばカウンタ153Bが出力する現在の計測時間および現在の優先度(高優先度PHまたは低優先度PLのいずれか)を含む。
 図16(A)はモニタ情報153Aの一例を示し、図16(B)はログ135の一例を示す。例えば、関連処理タスク143であるタスクRTS1について、第1時間T1=2msecおよび第2時間T2=10msecと設定されていたケースを想定する。このケースにおいて、タスクRTS1は高優先度PHで実行が開始されて、実行が終了したときに、例えば優先度切替部153からは、図16(A)のモニタ情報153Aが出力されて、且つログ135として図16(B)が記録される。
 具体的には、図16(A)のモニタ情報153Aは、タスクRTS1の実行終了時の優先度は‘高優先度’であり、この高優先度で実行を開始してから0.2msecの経過で実行が終了したことを示す。また、図16(B)のログ135は、タスクRTS1は実行開始から完了するまでに優先度は2回の切替え(すなわち、高優先度→低優先度→高優先度)がなされて、実行時間として合計12.2msecが必要であったことを示す。
 サポート装置200のデバッグツール227は、制御装置100からログ135を受信し、ログ135に基づき収集情報228を生成する。図17(A)を参照して収集情報228は、関連処理タスク143について、タスク名71、実行された総回数である実行回数82、実行時間の代表値(最小、平均、最大)83および優先度切替数の代表値(最小、平均、最大)84等の統計情報を含む。実行時間の代表値83は、実行回数82が示す21103回のタスク実行の実行時間のうちの最小値、平均値および最大値を示す。また、優先度切替数の代表値84は、実行回数82が示す21103回の各実行においてカウントされた優先度の切替え回数のうちの最小値、平均値および最大値を示す。
 また、収集情報228は、図17(B)の情報を含む。図17(B)は、図17(A)の21103回の実行に関する情報の内訳を示す。具体的には、関連処理タスク143について、情報の組(すなわち高優先度PH、低優先度PL、第1時間T1および第2時間T2の組)毎に、タスク名71、優先度が‘高優先度’で実行終了した場合の統計情報96と97、および優先度が‘低優先度’で実行終了した場合の統計情報98と99を含む。
 統計情報96は、タスクRTS1について、特定の情報の組(高優先度、低優先度、第1時間T1および第2時間T2の組)に基づきタスクRTS1の実行がなされた場合において、実行開始から終了までに4回の優先度切替えがなされて‘高優先度’で実行終了したケースは、トータル23回であることを示す。また、統計情報97は、その23回のタスク実行について実行時間の最小値、平均値および最大値は、それぞれ、0.1msec、0.8msecおよび1.9msecであることを示す。
 同様に、統計情報98は、タスクRTS1について、上記の特定の情報の組に基づき実行がなされた場合において、実行開始から終了までに5回の優先度切替えがなされて‘低優先度’で実行終了したケースは、トータル11回であることを示す。また、統計情報99は、その11回のタスク実行について実行時間の最小値、平均値および最大値は、それぞれ、0.1msec、0.4msecおよび0.5msecであることを示す。
 (J2:デバッグツール)
 デバッグツール227が収集情報228に基づき生成するデバッグ支援情報は、図15に示す表示部218の画面としてユーザに提供される。例えば、図15の画面の上段には、図17(B)の統計情報96および97に基づく画像が表示されて、下段には図17(B)の統計情報98および99に基づく画像が表示される。
 ユーザは、図15の画面の収集情報228とリアルタイム制御のための目標とを比較し、比較の結果から、タスクRTS1に設定した閾値152A(第1時間T1および第2時間T2)または優先度情報152B(高優先度PH、低優先度PL)が、リアルタイム制御を確実に実施するために適当であったか否かを判断する指針を得ることができる。また、ユーザは、上記の比較の結果から、タスクRTS1に割当てたプログラムが適当であったかを判断する指針を得ることもできる。
 ユーザは、上記の判断に基づき、例えば図8のユーザインターフェイスを介して、タスクRTS1に設定した閾値152A(第1時間T1および第2時間T2)または優先度情報152B(高優先度PH、低優先度PL)を変更する。または、例えば図13のユーザインターフェイスを介してタスクRTS1に割当てたプログラムを変更する。
 例えば、タスクRTS1が低優先度に切替られる回数が目標よりも多い場合には、他のタスクと交互実行されて、結果として実行時間が長くなり、低優先度に切替えられていることが推定可能である。この場合は、ユーザは、第1時間T1を長くするよう変更する、または交互実行を回避できるよう元の高優先度PHの値を変更することで、低優先度に切替られる回数を減らすことができる可能性がある。
 また、例えば、タスクRTS1が高優先度に切替られる回数が目標よりも多い場合には、他のタスクと交互実行されて、結果として実行時間が長くなり、高優先度に切替えられていることが推定可能である。この場合は、ユーザは、第2時間T2を長くするよう変更する、または交互実行を回避できるよう元の低優先度PLの値を変更することで、高優先度に切替られる回数を減らすことができる可能性がある。
 また、タスクRTS1に特徴量生成プログラムを割当てていた場合に、タスク実行時間が目標よりも長いまたは低優先度への切替回数が目標よりも多いときは、特徴量生成プログラムの実行がプロセッサ102に高い負荷をかけていることが推定され得る。
 具体的には、特徴量生成プログラムは、高速フーリエ変換などの演算量が多い(演算時間が長い)処理を含み得る。ユーザは、上記の負荷を軽減するために、開発プログラム222を実行して特徴量生成プログラムを変更する。例えば、生成される特徴量の種類を変更または減じて演算量が少なくなるように、特徴量生成プログラムを変更する。
 サポート装置200は、上記の変更後の閾値152Aまたは変更後の優先度情報152Bまたは変更後の特徴量生成プログラムを、制御装置100に送信する。スケジューラ151は、これら変更後の情報に基づきタスク制御情報131を生成し、タスク制御情報131に基づき、タスクRTSを再度実行する。デバッグツール227は、再度実行される場合に取得された収集情報228に基づくモニタ画面(図15)を表示する。このモニタ画面は、閾値(第1時間T1、第2時間T2)または優先度情報(高優先度PH、低優先度PL)または特徴量生成プログラム等のデバッグによる変更内容が、リアルタイム制御を確実に実施するのに適切であったか否かを判断するための支援情報を、ユーザに提供する。
 <K:優先度切替の他の判断条件>
 上記の実施の形態では、優先度切替処理(図10のステップS35)は、実行時間が第1時間T1または第2時間T2を超過したときに(ステップS33でYES)実施されたが、優先度切替処理を実施するための条件は、実行時間が第1時間T1または第2時間T2を超過したことに限定されない。
 例えば、スケジューラ151は、関連処理タスクの実行時間が第1時間T1または第2時間T2を超過した回数をカウントする。スケジューラ151は、優先度切替処理を実施するための条件として、このカウント値が予め定められたN(N≧2)回以上となったときに、優先度切替処理を実施する。なお、Nは、ユーザが設定可能な値である。
 <L:マルチコア動作モード>
 上記の実施の形態では、制御装置100がシングルコア動作モードにおいて、スケジューラ151は、プロセッサ102の1つのプロセッサコアで関連処理タスク143を実行する場合を説明したが、ここでは、プロセッサ102が有する2つ以上のプロセッサコアを利用したマルチコア動作モードを説明する。制御装置100がマルチコア動作モードに切替えられた場合は、スケジューラ151はコア切替部156を起動する。
 プロセッサコアは、演算器、プログラムカウンタなどのタスクを実行するための機器を組合わせて構成される。したがって、マルチコア動作モードでは、複数のプロセッサコアを用いて、複数のタスクを並列に実行することができる。本実施の形態では、プロセッサ102は、例えばプロセッサコアとして4個のプロセッサコアであるCore1~Core4を備える場合を説明するが、プロセッサコアの数は2個以上であればよく、4個に限定されない。以下では、4個のプロセッサコアを、その識別子であるコア番号Core1~Core4を用いて説明する。
 (L1:コア情報の設定)
 図18は、本実施の形態に係るコア情報136を示す図である。コア情報136は、マルチコア動作モードにおいて、関連処理タスク143を実行するコアプロセッサに関する情報を示す。サポート装置200は、入力部216からのユーザの操作内容に基づき、コア情報136を受付けて、受付けたコア情報136を制御装置100に送信する。制御装置100のプロセッサ102は、サポート装置200から受信するコア情報136を二次記憶装置108に格納する。プロセッサ102は、タスクを実行時には、コア情報136を二次記憶装置108から読出し、主記憶装置106に展開する。
 図18を参照して、コア情報136は、関連処理タスク143の各タスクRTSiについて、動作コア指定137および割当モード138のデータを含む。動作コア指定137は、対応のタスクRTSiを実行するためのプロセッサコアを指定する情報を示す。割当モード138は、当該タスクRTSiを実行するプロセッサコアを‘動的’に切替える、または‘固定’にするかを指定するデータ139と、‘固定’と指定された場合の当該タスクRTSiを実行するべきプロセッサコアを示すデータ140を含む。
 図17を参照して、具体的には、タスク‘RTS1’には、Core2とCore3が割当られて、割当モードは‘動的’を示す。この場合、タスク‘RTS1’を実行するプロセッサコアはCore2またはCore3のいずれかに切替え可能であることを示す。これに対してタスク‘RTS2’には、Core2とCore3が割当られて、割当モードは‘固定(高=2、低=3)’を示す。この場合、タスク‘RTS2’を実行するときに、優先度が高優先度であればCore2で実行し、優先度が低優先度であればCore3で実行することを指定する。
 (L2:マルチコアスケジューリング)
 マルチコア動作モードにおいて、関連処理タスク143(タスクRTSi)を実行するためのスケジューリングを説明する。マルチコア動作モードでは、コア切替部156は、OS190からCPU利用率159を受け付ける。OS190は、CPU利用率159を計測する。CPU利用率159は、例えばCore1~Core4のそれぞれについて、当該プロセッサコアがタスクの実行などに使用されていないidle状態である確率(単位時間あたりのidle状態の時間の割合:空き率E)を示す。
 スケジューラ151が、関連処理タスク143を実行状態に遷移させる場合に、コア切替部156は、コア情報136に基づき、またはCPU利用率159およびコア情報136の両方に基づき、当該関連処理タスク143を実行するべきプロセッサコアを決定する命令を含む。コア切替部156は、決定したプロセッサコアを示すコア指定命令158を、OS190に出力する。これを、スケジューラ151による「マルチコアスケジューリング」ともいう。OS190は、コア指定命令158により指定されるプロセッサコアを用いて、実行状態に遷移した当該関連処理タスク143を実行する。
 マルチコアスケジューリングでは、以下に説明する動作モードM1~M7のいずれかが実施される。なお、動作モードM1~M7においては、上記のシングルコア動作モードと同様に、まずマルチタスク実行部191はプライマリ定周期タスクである高優先制御タスク141を、Core1~Core4のうちの1つ以上のプロセッサコアにおいて実行する。
 (L3:関連処理タスク143が1つの場合のスケジューリングモデル)
 図19は、実施の形態に係るマルチコアスケジューリングにおいて1つの関連処理タスク143を実行する例を示す図である。図19では、まず高優先度の関連処理タスク143(以下、タスクRTSとも称する)を実行し、次に低優先度のタスクRTSを実行するケースを説明する。
 図19(A)の動作モードM1は、コア情報136が「タスク‘RTS’には、Core2とCore3が割当られて、割当モードは‘動的’」を示すケースである。‘動的’と指示される場合、コア切替部156は、CPU利用率159およびコア情報136に基づき、より空き率Eの大きい(すなわち、関連処理タスク143に割当可能な資源が多い)プロセッサコアを、タスクRTSを実行するべきプロセッサコアとして決定する。
 図19(A)を参照して、タスクRTSを実行開始前のCPU利用率159から、コア切替部156は(Core3の空き率E>Core2の空き率E)と判断する。したがって、コア切替部156は、判断に基づき、空き率Eの大きい方のCore3を決定し、決定されたCore3を示すコア指定命令158を出力する。これにより、マルチタスク実行部191は、高優先度のタスクRTSをCore3において実行する。
 タスクRTSがCore3で実行されて、優先度切替部153により、高優先度から低優先度に切替えられた場合を説明する。低優先度のタスクRTSを実行する場合、コア切替部156は、CPU利用率159から(Core3の空き率E>Core2の空き率E)と判断し、判断に基づき、空き率Eの大きい方のCore3を決定し、Core3を示すコア指定命令158を出力する。これにより、低優先度のタスクRTSは、Core3において実行される。
 これに対して、図19(B)の動作モードM2は、コア情報136が「タスク‘RTS’には、Core2とCore3が割当られて、割当モードは‘固定(高優先度の場合はCore2、低優先度の場合はCore3)’」を示すケースである。
 したがって、コア切替部156は、CPU利用率159によらず、コア情報136に基づき、タスクRTSを実行するべきプロセッサコアを決定する。図19(B)を参照して、例えば、タスクRTSが高優先度であるときは、コア切替部156は、Core2を示すコア指定命令158を出力する。タスクRTSがCore2で実行されて、優先度切替部153により、高優先度から低優先度に切替えられた場合は、コア切替部156は、コア情報136に基づき、Core3を決定し、Core3を示すコア指定命令158を出力する。これにより、マルチタスク実行部191は、低優先度のタスクRTSを、Core3において実行する。
 (L4:関連処理タスク143が複数の場合のスケジューリングモデル)
 図20は、本実施の形態に係るマルチコアスケジューリングにおいて複数の関連処理タスク143を実行する例を示す図である。図19の動作モードM1とM2では、1つのタスクRTSを実行する場合であったが、図20の動作モードM3とM4では、スケジューラ151は複数のタスクRTSをスケジューリングする。図20を参照して、高優先度のタスクRTS1~RTS3を実行し、次に低優先度のタスクRTS1~RTS3を実行する場合を説明する。
 まず、図20(A)の動作モードM3は、コア情報136が「タスク‘RTS1~RTS3’には、Core2とCore3が割当られて、割当モードは‘動的’」を示すケースである。図20(B)の動作モードM4は、コア情報136が「タスク‘RTS1~RTS3’には、Core2とCore3が割当られて、割当モードは‘固定(高優先度の場合はCore2、低優先度の場合はCore3)’」を示すケースである。
 図20(A)の動作モードM3では、同じ優先度(高優先度)であるタスクRTS1~RTS3を実行するために、コア切替部156は、CPU利用率159に基づき、最も空き率Eの高いCore3を、タスクRTS1~RTSを実行するべきプロセッサコアとして決定し得る。
 この場合に、1つのプロセッサコア(すなわちCore3)において、3つのタスクRTS1~RTS3の並列実行(交互実行)がなされる。そのため、各タスクの実行時間は比較的長くなり得る。したがって、実行時間を短縮するために、例えば、Core3の空き率Eが閾値以上である場合には、コア切替部156は、Core3をタスクRTS1とRTS2の2つのタスクを実行するべきプロセッサコアと決定し、タスクRTS3のために他のプロセッサコア(すなわちCore2)を決定する。これにより、複数の関連処理タスク143を実行する場合に、プロセッサコアの間で負荷を分散させて、各関連処理タスク143の実行時間を短くすることが可能となる。
 また、タスクRTS1~RTS3が低優先度に切替えられた場合は、コア切替部156は、CPU利用率159が示す空き率Eの大きい1つのプロセッサコア(すなわちCore3)を、タスクRTS1~RTS3を実行するプロセッサコアと決定する。または、タスクRTS1とRTS2をCore3で実行しタスクRTS3を他のプロセッサコア(すなわちCore2)で実行すると決定してもよい。これにより、上記に述べたようなプロセッサコアの間の負荷分散と各タスクの実行時間の短縮が可能になる。
 図20(B)の動作モードM4では、同じ高優先度であるタスクRTS1~RTS3を実行するために、コア切替部156は、CPU利用率159によらず、コア情報136に従いCore2を、タスクRTS1~RTSを実行するプロセッサコアとして決定する。スケジューラ151は、Core2において、タスクRTS1→タスクRTS2→タスクRTS3と順番にタスクが実行されるようスケジューリングする。
 また、タスクRTS1~RTS3が低優先度に切替えられた場合は、コア切替部156は、CPU利用率159によらず、コア情報136に従いCore3を、タスクRTS1~RTSを実行するプロセッサコアと決定する。スケジューラ151は、Core3において、タスクRTS1→タスクRTS2→タスクRTS3と順番にタスクが実行されるようスケジューリングする。
 (L5:関連処理タスク143が複数の場合のスケジューリングモデル-2)
 図21は、本実施の形態に係るマルチコアスケジューリングにおいて複数の関連処理タスク143を実行する他の例を示す図である。
 図21(A)の動作モードM5は、図20(A)と同様に、コア切替部156は、CPU利用率159とコア情報136に従い、タスクRTS1~RTS3を実行するプロセッサコアを決定する。
 図21(B)の動作モードM6は、図20(B)の動作モードM4のスケジューリングモデルの変形例を示す。図20(B)では、スケジューラ151は、Core3(またはCore2)において、タスクRTS1→タスクRTS2→タスクRTS3と順番に実行する。そのため、最後に実行されるタスクRTS3は他のタスクの実行が終了するまで待つことになり、タスクRTS3の実行時間は長くなる。
 これに対して、図21(B)の動作モードM6では、スケジューラ151は、Core3(またはCore2)において、タスクRTS1~RTS3を並列に実行(すなわち交互実行)するようスケジューリングする。これにより、各タスクについての実行時間を平均化することができる。
 また、本実施の形態では、ユーザは、コア情報136に従い複数のタスクを実行するモードとして、動作モードM4(図20(B)参照)または動作モードM6(図20(B)参照)を指定することができる。
 (L6:関連処理タスク143が複数の場合のスケジューリングモデル-3)
 図22は、本実施の形態に係るマルチコアスケジューリングにおいて複数の関連処理タスク143を実行する更なる他の例を示す図である。図22の動作モードM7は、コア情報136が「タスク‘RTS’には、Core2とCore3が割当られて、割当モードは‘固定(高優先度の場合はCore2、低優先度の場合はCore3)’」を示すケースである。
 動作モードM7では、コア切替部156は、CPU利用率159によらず、コア情報136に基づき、高優先度であるタスクRTS1~RTS3を実行するプロセッサコアを、Core2と決定する。同様に、コア切替部156は、低優先度であるタスクRTS1~RTS3を実行するプロセッサコアを、Core3と決定する。
 動作モードM7によれば、高優先度の複数の関連処理タスク143が実行状態に遷移する場合に、各タスクのリアルタイム性を実現することが可能となる。具体的には、図21を参照して、高優先度のタスクRTS1~RTS3を実行する場合には、スケジューラ151は、Core2において、タスクRTS1→タスクRTS2→タスクRTS3と順番に実行する(図22のケースC1→ケースC2→ケースC3を参照)。したがって、高優先度の各タスクは、当該タスクが実行される場合に、Core2の利用可能な資源を占有して実行された、当該タスクの実行時間の短縮が可能となる。
 次に、高優先度のタスクRTS1がCore2で実行された場合に、実行時間が第1時間T1を超えたために低優先度に切替えられたときは、コア切替部156は、コア情報136に従い、タスクRTS1を実行するプロセッサコアを、Core3と決定する(ケースC2)。このケースでは、Core3における低優先度のタスクRTS1の実行と、Core2における高優先度のタスクRTS2の実行とが並行してなされる。
 次に、高優先のタスクRTS2のCore2における実行時間が第1時間T1を超えた(ただし、タスクRTS1のCore3における実行時間は第2時間T2を超えていない)ときは、タスクRTS2は低優先度に切替えられる。この場合は、コア切替部156は、コア情報136に従い、タスクRTS2を実行するプロセッサコアをCore3と決定する。したがって、タスクRTS1とタスクRTS2のCore3における実行と、高優先のタスクRTS3のCore2における実行とが並行してなされる(ケースC3)。
 次に、高優先のタスクRTS3のCore2における実行時間が第1時間T1を超えた(ただし、タスクRTS1とRTS2のCore3における実行時間は第2時間T2を超えていない)ときは、タスクRTS3の優先度は低優先度に切替えられる。この場合は、コア切替部156は、コア情報136に従い、タスクRTS1を実行するプロセッサコアをCore3と決定する。したがって、タスクRTS1~RTS3は、Core3において交互実行される(ケースC4)。
 最後に、低優先のタスクRTS1のCore3における実行時間が第2時間T2を超えた(ただし、タスクRTS2とRTS3のCore3における実行時間は第2時間T2を超えていない)ときは、タスクRTS1の優先度は高優先度に切替えられる(ケースC5)。この場合は、Core2におけるタスクRTS1の実行と、Core3におけるタスクRTS2およびRTS3の交互実行とが並行してなされる。
 本実施の形態に係るマルチコア動作モードでは、ユーザは、複数のタスクRTS1~RTS3を実行する場合に、上記に述べた動作モードM4、M6およびM7のいずれのモードで実行させるか指定することができる。
 <M.変形例>
 図23は、本実施の形態に係る関連処理タスク143の変形例を説明する模式図である。図24は、本実施の形態に係る予測制御モデルの一例を模式的に示す図である。上記の実施の形態では、関連処理タスク143の一例として異常検知プログラムを説明したが、関連処理は異常検知プログラムに限定されない。例えば、(c2.機能構成)で述べた関連処理タスク143は、制御装置100により制御される対象(以下、対象90と呼ぶ)を、予測制御モデルを用いて制御する予測制御プログラムを含んでもよい。対象90は、例えば、図1のフィールド装置群10に備えられる機器などである。予測制御プログラムは、変数のうち対象90に与える指令値を用いて、対象90の制御量を予測して、制御パラメータの補正値を出力する命令を含む。このような命令が実行されることにより、図23の補正値算出処理1431が実現される。
 本実施の形態では、予測制御モデルは、例えば対象90の応答を予測しながら対象90の最適化制御を実現するために適用されるプロセスのモデルである。
 なお、指令値および制御量は、図5の内部DB130に格納されている変数により示される。これら指令値および制御量は、図5の制御入力プログラム161および制御出力プログラム162がI/Oリフレッシュ処理を実施することにより図1のフィールド装置群10との間で遣り取りされるデータ(入力データおよび出力データ)であって、内部DB130の変数に設定される。
 図23では、制御装置100で実行される関連処理タスク143と、高優先制御タスク141の一例である制御演算タスク1411が示される。制御演算タスク1411は実行されると、予め定められたパターン1511に従って制御周期毎に指令値1516を生成し、対象90に指令値1516を出力し、また、対象90から、指令値1516に対する応答値(フィードバック値)である制御量1517を入力する。
 関連処理タスク143は、制御演算タスク1411からの出力(すなわち、制御装置100から対象90に対して出力される現在の指令値1512)と、予測制御モデル1434とを用いて、対象90の制御量の推定値である推定制御量1513を算出する予測処理1432、および推定制御量1513を、理想制御量1518(目標制御量)との差があらかじめ決められた範囲に収まるよう補償した補正値1514を算出する算出処理1433を含む。図23では、指令値1512と制御量1515は、それぞれ指令値1516と制御量1517と同様の値である。
 制御演算タスク1411は、算出される補正値1514に従って対象90に対する制御出力(指令値1516)を算出する。算出される指令値1516は、対象90を制御するために出力される。
 上記の予測制御モデル1434は、対象90の特性に基づく機械学習により予め作成される、またはユーザー操作により予め作成され得る。図24には、予測制御モデル1434の一例が模式的に示される。図24を参照して、例えば、予測制御モデル1434は、指令値1512(または制御量1515)と推定制御量1513の相関関係を表すグラフとして示される。したがって、予測処理1432では、このような予測制御モデル1434に基づいて、指令値1512(または制御量1515)の値Xから推定制御量1513の値Yを推定(算出)することができる。なお、予測制御モデル1434は、このような相関関係のグラフに限定されない。
 なお、予測制御モデル1434で推定される推定制御量1513は、現在の値(例えば、現在の制御周期に対応した値)であっても、将来の値(例えば、次の制御周期以降の制御周期に対応した値)であってもよい。
 また、機械学習により予測制御モデル1434を作成する場合、例えばニューラルネットワークを使用する機械学習で作成されてもよい。
 また、算出処理1433では、予測処理1432により出力される推定制御量1513と、理想制御量(目標制御量)1518との差を算出し、図示しない予測制御モデルを用いて、当該算出された制御量の差から指令値1516の修正量を推定(算出)してもよい。
 制御演算タスク1411は、補正値1514を入力し、入力した補正値1514をフィードバックした指令値1516を生成し、対象90に出力する。
 要約すると、図24の予測制御モデル1434は、推定制御量1513を目的変数、指令値1512を説明変数として予め作成されている。したがって、図23では、対象90に与える現在の指令値1512(指令値1516)を予測制御モデル1434に入力し、次の制御周期における対象90の推定制御量1513が出力される。次に、推定制御量1513を、理想制御量1518(目標制御量)との差があらかじめ決められた範囲に収まるよう補償した補正値1514が算出されて、算出された補正値1514を用いて指令値1516の書き換えがなされる。
 また、図24の予測制御モデル1434は、推定制御量1513を目的変数、制御量1515を説明変数として予め作成されてもよい。この場合は、図23では、対象90に与える現在の制御量1515(制御量1517)を予測制御モデル1434に入力し、次の制御周期における対象90の推定制御量1513が出力される。次に、推定制御量1513を、理想制御量1518(目標制御量)との差があらかじめ決められた範囲に収まるよう補償した補正値1514が算出されて、算出された補正値1514を用いて指令値1516の書き換えがなされる。
 このように、関連処理タスク143の補正値算出処理1431によれば、対象90に与える指令値1512を用いて、対象90の制御量を予測して、制御パラメータの補正値1514を出力することも可能であり、また、対象90の制御量1515を用いて、対象90に与える補正値を予測することも可能である。
 また、図23の算出処理1433では、推定制御量1513を、理想制御量(目標制御量)1518との差が予め定められた範囲に収まるよう補償する補正値1514を算出したが、補正値1514の算出方法は、このような補償による方法に限定されない。例えば、算出処理1433は、推定制御量1513と予め定められた演算に従い補正値1514を算出する処理であってもよい。
 また、図23では、制御周期毎に、予測制御モデル1434を用いて推定(算出)された補正値1514に基づく指令値1516が、対象90に出力されているが、指令値1516の出力周期は、制御周期に限定されない。例えば、対象90の特性によっては、制御周期よりも長い周期で指令値1516が出力されてもよい。その場合は、その場合は、対象90を、制御周期よりも長い周期毎に、予測制御モデル1434を用いて推定(算出)された補正値1514に基づく指令値1516が対象90に出力されて得る。
 また、予め定められたパターン1511は、対象90が移動すべき軌跡を示す位置パターンを含み得る。この場合、予測制御モデル1434を用いて生成された補正値1514に基づく指令値1516により示される軌跡(対象90が移動すべきと推定された軌跡)に従い、対象90の位置を制御することが可能となる。
 なお、図23では、制御演算タスク1411は予め定められたパターン1511に従って指令値1516を生成したが、制御演算タスク1411は当該パターン1511を用いずに、指令値1516を生成してもよい。
 <N.本実施の形態の効果>
 本実施の形態に係る優先度切替処理では、実行時間が第1時間T1よりも長くなる(超過する)ことがない間は、高優先度PHは維持される。したがって、リアルタイム性を維持しながら関連処理を実行することができて、例えば実行時間毎に得られる関連処理の結果を用いた対象のリアルタイム制御を実現することが可能となる。また、実行時間が第1時間T1よりも長くなる(超過する)と関連処理タスク143の優先度を低くすることで他のタスクが優先的に実行可能となるので、他のタスクが低優先制御タスク142等のようにリアルタイム制御に寄与する処理(モーション制御の軌道計算処理)を実行している場合には、高優先制御タスク141は実行結果を用いた対象のリアルタイム制御が可能となる。したがって、制御タスクによる対象のリアルタイム制御の実現を保証しながら、非制御タスクによるリアルタイムな関連処理の実行も実現することが可能となる。
 また、マルチコアスケジューリングにおいては、各プロセッサコアにおいて、対象の制御タスクを優先的に実行しながら、関連処理タスク143について、優先度切替処理を実施する。また、2つ以上のプロセッサコアを同時に用いて、制御タスクを優先的に実行しながら、複数の関連処理タスク143について、優先度切替処理を実施する。
 これにより、マルチコアスケジューリングによっても、制御タスクによる対象のリアルタイム制御の実現を保証しながら、複数の非制御タスクによるリアルタイムな関連処理の実行を実現することができる。
 <O.実施の形態の構成>
 上記に述べた実施の形態によれば、対象を制御する制御装置100は、対象のリアルタイム制御を実施するための制御タスク(高優先制御タスク141)および、リアルタイム制御に関連する関連処理を実施するための非制御タスクを含む複数のタスクの各タスクに対応付けて、当該タスクがプロセッサにより実行される優先度を記憶するためのタスク制御情報131と、優先度に従う非制御タスクの実行順序を調整するスケジューラ151と、を備える。制御タスクの優先度は最優先に設定される(すなわち、非制御タスクの優先度は、制御タスクの優先度よりも低くなるように設定される)。スケジューラ151は、非制御タスクについて、当該非制御タスクの実行時間tが関連処理をリアルタイムに実行するための第1時間T1よりも長くなる場合に、当該非制御タスクの優先度を低くなるように切替える(高優先度PH→低優先度PL)優先度切替部を153含む。
 上記の構成によれば、非制御タスクの実行時間がリアルタイム実行のための第1時間T1である間は高優先度PHを維持し、その後、第1時間T1を超えて長くなると、優先度が低優先度PLとなるように切替えられる。したがって、実行時間が第1時間内である間は、リアルタイム制御を維持しながら非制御タスク(関連処理タスク143)の優先度を比較的高くしてリアルタイムに実行することができて、関連処理の結果を対象のリアルタイム制御に反映することが確実となる。
 また、実行時間がリアルタイム実行のための第1時間を超えて長くなると優先度を低くして他の制御タスク(例えば低優先制御タスク142)に対する優先的な資源の割り当てを可能にする。これにより、他の制御タスクによる処理の結果を対象のリアルタイム制御に反映することが確実となる。これにより、対象をリアルタイム制御するための制御タスクと、非制御タスクとを、対象のリアルタイム制御を保証可能なように実行することが可能になる。
 好ましくは、高優先度PHは他のタスク(例えば低優先制御タスク142)の優先度以上を示し、且つ低優先度PLは当該他のタスクの優先度以下を示す。これにより他のタスクの実行が優先的に実行されることが可能となり、他のタスクが制御タスクに対し軌道データ等のリアルタイム制御に関するデータを提供する場合には、対象のアルタイム制御をより確実に実施することが可能となる。
 好ましくは、上記の第1時間T1は、可変に設定される。また、低優先度PLおよび高優先度PHは可変に設定され得る。したがって、対象をリアルタイム制御するための制御タスクと、非制御タスクとを、対象のリアルタイム制御を保証可能なような第1時間T1と、高優先度PHまたは低優先度PLとを、調整しながら決定することができる。
 好ましくは、優先度切替部153は、さらに、低優先度PLの非制御タスクについて、実行時間が第2時間T2よりも長くなる場合に、当該非制御タスクを高優先度PHに上げる。したがって、対象のリアルタイム制御を保証可能にするような非制御タスクの実行時間を、第1時間T1と第2時間T2を目安に調整することが可能となる。
 好ましくは、第2時間T2は、可変に設定される。したがって、対象をリアルタイム制御するための制御タスクと、非制御タスクとを、対象のリアルタイム制御を保証可能なように第2時間T2を、調整しながら決定することができる。
 好ましくは、関連処理は、対象に関連するデータから対象に生じる異常を検知するのに適した特徴量を生成する特徴量生成処理と、特徴量生成処理により生成される特徴量を用いて異常を検知する異常検知処理と、特徴量生成処理または異常検知処理のためのデータを、記憶装置を含む装置と通信する処理と、を含む。
 したがって、対象のリアルタイム制御を、非制御タスクのリアルタイム実行の結果である異常検知結果を用いて実施することが可能となる。
 好ましくは、関連処理は、制御装置から対象に出力される指令値1512と予め定められた予測制御モデル1434とを用いて対象90の推定の制御量1513を算出する算出処理と、算出処理により算出された制御量に基づき補正値1514を算出する補正値算出処理1431を含み、制御タスク141は、算出される補正値1514に従って対象に対する制御出力(指令値1516)を算出する制御演算タスク1411を含む。
 したがって、対象のリアルタイム制御を、非制御タスクの予測制御モデルを用いた処理結果を用いて実施することが可能となる。
 好ましくは、関連処理は、制御装置から対象に出力される対象90の制御量1517と予め定められた予測制御モデル1434を用いて対象の推定の制御量1513を算出する算出処理と、算出処理により算出された制御量1513に基づき補正値1514を算出する補正値算出処理1431を含み、制御タスク141は、算出される補正値に従って対象に対する制御出力(指令値1516)を算出する制御演算タスク1411を含む。
 したがって、対象のリアルタイム制御を、非制御タスクの予測制御モデルを用いた処理結果を用いて実施することが可能となる。
 好ましくは、上記の補正値算出処理は、制御量が予め定められた範囲に収まるよう補償した補正値を算出する処理を含む。
 したがって、制御量が予め定められた範囲に収まるよう補償により補正値を算出することができる。
 好ましくは、非制御タスクについて、実行時間を含む当該非制御タスクの実行に関する情報を収集する収集部155を備え、収集部により収集される情報は、外部に出力される。
 したがって、収集情報を出力することで、上記の第1時間T1または第2時間T2を設定するための支援情報として、非制御タスクの実行時間を含んだ情報を、ユーザに提供することができる。
 好ましくは、収集される情報は、非制御タスクの優先度の切替え回数を含む。
 したがって、ユーザに、上記の支援情報として、非制御タスクの優先度の切替え回数を提供することができる。
 好ましくは、関連処理の内容は可変に設定される。
 したがって、対象をリアルタイム制御するための制御タスクと、非制御タスクとを、対象のリアルタイム制御を保証可能となるように、関連処理の内容(関連処理プログラムの種類、演算処理等の内容)を調整することができる。
 好ましくは、プロセッサ102は、複数のプロセッサコア(Core1~Core4)を含み、非制御タスクを実行するプロセッサコアを指定するコア情報136を記憶する。スケジューラ151は、さらに、コア情報136または各プロセッサコアの利用率159に基づき、非制御タスクを実行するプロセッサコアを決定するコア切替部156を含む。
 したがって、空き率Eが高いことを示す利用率159を有したプロセッサコアを決定し、当該プロセッサコアに非制御タスクを実行させることができる。
 好ましくは、コア情報136は、非制御タスクの優先度に基づき当該非制御タスクを実行するプロセッサコアを指定する情報を含む。
 したがって、複数の非制御タスクがある場合に、優先度が高い非制御タスクから順にプロセッサコアを決定して当該プロセッサコアに当該非制御タスクを実行させることができる。
 今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は、上記した説明ではなく、請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。
 1 制御システム、10 フィールド装置群、100 制御装置、101 タイマ、102,202 プロセッサ、106,206 主記憶装置、108,208 二次記憶装置、131 タスク制御情報、133 優先度、134 プログラム名、135 ログ、136 コア情報、137 動作コア指定、138 割当モード、141 高優先制御タスク、142 低優先制御タスク、143 関連処理タスク、144 サービスタスク、150 ユーザプログラム、151 スケジューラ、152 設定部、152A 閾値、152B 優先度情報、153 優先度切替部、153A モニタ情報、153B カウンタ、154 タスク情報設定部、155 収集部、156 コア切替部、157 実行指示部、158 コア指定命令、159 利用率、161 制御入力プログラム、162 制御出力プログラム、163 高優先制御プログラム、164 低優先制御プログラム、165 関連処理プログラム、166 システムサービスプログラム、191 マルチタスク実行部、200 サポート装置、204 光学ドライブ、205 記録媒体、216 入力部、218 表示部、222 開発プログラム、224 パラメータ設定ツール、226 データマイニングツール、227 デバッグツール、228 収集情報、300 データロギング装置、400 表示装置、E 空き率、FL 状態フラグ、PH 高優先度、PL 低優先度、PR 管理処理、RTS,RTS1,RTS2,RTS3 タスク、T 周期、t 実行時間。

Claims (15)

  1.  対象を制御する制御装置であって、
     前記対象のリアルタイム制御を実施するための制御タスクおよび、前記リアルタイム制御に関連する関連処理を実施するための非制御タスクを含む複数のタスクを実行するプロセッサと、
     前記複数のタスクの各タスクに対応付けた優先度に基づく順序に従い前記複数のタスクを前記プロセッサにより実行させるマルチタスク実行部と、
     前記非制御タスクの優先度を可変に設定するスケジューラと、を備え、
     前記制御タスクの優先度は最優先に設定され、
     前記スケジューラは、
     前記非制御タスクの実行開始条件が成立すると第1優先度に設定するとともに、当該非制御タスクの実行開始からの時間が前記関連処理をリアルタイムに実行するための第1時間の間は、当該非制御タスクの優先度を第1優先度に維持し、その後、前記実行開始からの時間が前記第1時間よりも長くなると、当該非制御タスクの優先度を第2優先度に下げるよう切替える優先度切替部を含む、制御装置。
  2.  前記第1時間は、可変に設定される、請求項1に記載の制御装置。
  3.  前記優先度切替部は、さらに、
     前記第2優先度の前記非制御タスクの実行開始からの時間が第2時間よりも長くなると、当該非制御タスクの優先度を前記第1優先度に上げるよう切替える、請求項1または2に記載の制御装置。
  4.  前記第2時間は、可変に設定される、請求項3に記載の制御装置。
  5.  前記関連処理は、
     前記対象に関連するデータから前記対象に生じる異常を検知するのに適した特徴量を生成する特徴量生成処理と、
     前記特徴量生成処理により生成される特徴量を用いて前記異常を検知する異常検知処理と、
     前記特徴量生成処理または前記異常検知処理のためのデータを、記憶装置を含む装置と通信する処理と、を含む、請求項1から4のいずれか1項に記載の制御装置。
  6.  前記関連処理は、
     前記制御装置から前記対象に出力される指令値と予め定められた予測制御モデルとを用いて前記対象の推定の制御量を算出する算出処理と、
     前記算出処理により算出された制御量に基づき補正値を算出する補正値算出処理を含み、
     前記制御タスクは、算出される前記補正値に従って前記対象に対する指令値を算出する制御演算タスクを含む、請求項1から4のいずれか1項に記載の制御装置。
  7.  前記関連処理は、
     前記制御装置から前記対象に出力される前記対象の制御量と予め定められた予測制御モデルを用いて前記対象の推定の制御量を算出する算出処理と、
     前記算出処理により算出された制御量に基づき補正値を算出する補正値算出処理を含み、
     前記制御タスクは、算出される前記補正値に従って前記対象に対する指令値を算出する制御演算タスクを含む、請求項1から4のいずれか1項に記載の制御装置。
  8.  前記補正値算出処理は、前記制御量が予め定められた範囲に収まるよう補償した前記補正値を算出する処理を含む、請求項6または7に記載の制御装置。
  9.  前記非制御タスクについて、前記実行開始からの時間を含む当該非制御タスクの実行に関する情報を収集する収集部を備え、
     前記収集部により収集される情報は、外部に出力される、請求項1から8のいずれか1項に記載の制御装置。
  10.  前記収集される情報は、前記非制御タスクの前記優先度の切替え回数を含む、請求項9に記載の制御装置。
  11.  前記関連処理の内容は可変に設定される、請求項1から10のいずれか1項に記載の制御装置。
  12.  前記プロセッサは、複数のプロセッサコアを含み、
     前記非制御タスクを実行するプロセッサコアを指定するコア情報を記憶するためのコア情報記憶部を、さらに備え、
     前記スケジューラは、さらに、
     前記コア情報または各前記プロセッサコアの利用率に基づき、前記非制御タスクを実行するプロセッサコアを決定するコア切替部を含む、請求項1から11のいずれか1項に記載の制御装置。
  13.  前記コア情報は、
     前記非制御タスクの前記優先度に基づき当該非制御タスクを実行するプロセッサコアを指定する情報を含む、請求項12に記載の制御装置。
  14.  対象を制御する制御装置における制御方法であって、
     前記制御装置は、
     前記対象のリアルタイム制御を実施するための制御タスクおよび、前記リアルタイム制御に関連する関連処理を実施するための非制御タスクを含む複数のタスクを実行するプロセッサと、
     前記複数のタスクの各タスクに対応付けた優先度に基づく順序に従い前記複数のタスクを前記プロセッサにより実行させるマルチタスク実行部と、を備え、
     前記制御タスクの優先度は最優先に設定され、
     前記制御方法は、
     前記非制御タスクの優先度を可変に設定するステップを備え、
     前記可変に設定するステップにおいて、
     前記非制御タスクの実行開始条件が成立すると第1優先度に設定するとともに、当該非制御タスクの実行開始からの時間が前記関連処理をリアルタイムに実行するための第1時間の間は、当該非制御タスクの優先度を第1優先度に維持するステップと、その後、前記実行開始からの時間が前記第1時間よりも長くなると、当該非制御タスクの優先度を第2優先度に下げるよう切替えるステップとを、含む、制御方法。
  15.  請求項14に記載の制御方法をコンピュータに実行させるためのプログラム。
PCT/JP2018/014142 2017-04-07 2018-04-02 制御装置、制御方法および制御プログラム WO2018186358A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
DE112018001886.5T DE112018001886T5 (de) 2017-04-07 2018-04-02 Steuereinrichtung, Steuerverfahren und Steuerprogramm
CN201880017192.3A CN110402430B (zh) 2017-04-07 2018-04-02 控制装置、控制方法以及记录介质
US16/495,113 US11301294B2 (en) 2017-04-07 2018-04-02 Control device, control method, and control program

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
JP2017077015 2017-04-07
JP2017-077015 2017-04-07
JP2018-048152 2018-03-15
JP2018048152A JP6406466B1 (ja) 2017-04-07 2018-03-15 制御装置、制御方法および制御プログラム

Publications (1)

Publication Number Publication Date
WO2018186358A1 true WO2018186358A1 (ja) 2018-10-11

Family

ID=63713405

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2018/014142 WO2018186358A1 (ja) 2017-04-07 2018-04-02 制御装置、制御方法および制御プログラム

Country Status (2)

Country Link
US (1) US11301294B2 (ja)
WO (1) WO2018186358A1 (ja)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020061055A (ja) * 2018-10-12 2020-04-16 オムロン株式会社 制御システム、制御装置および制御方法
WO2020100548A1 (ja) * 2018-11-15 2020-05-22 オムロン株式会社 制御システムおよび制御装置
WO2021024555A1 (ja) * 2019-08-08 2021-02-11 株式会社日立製作所 制御システム

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6761158B1 (ja) * 2019-12-16 2020-09-23 株式会社安川電機 プログラム作成装置、プログラム作成方法、及びプログラム
CN111427694A (zh) * 2020-03-26 2020-07-17 北京金山云网络技术有限公司 任务执行方法、装置、系统和服务器
JP7380390B2 (ja) * 2020-03-31 2023-11-15 オムロン株式会社 制御装置、プログラムおよび制御方法
CN111866013B (zh) * 2020-07-29 2023-04-18 杭州安恒信息技术股份有限公司 一种云安全产品管理平台部署方法、装置、设备及介质
CN111984426B (zh) * 2020-10-09 2023-07-25 中国平安人寿保险股份有限公司 任务调度方法、装置、电子设备及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006004067A (ja) * 2004-06-16 2006-01-05 Denso Wave Inc 制御装置及びコンピュータプログラム
JP2007519060A (ja) * 2003-12-04 2007-07-12 松下電器産業株式会社 タスクスケジューリング装置、タスクスケジューリング方法、タスクスケジューリングプログラム、記録媒体、及び伝送媒体

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8347044B2 (en) 2009-09-30 2013-01-01 General Electric Company Multi-processor based programmable logic controller and method for operating the same

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007519060A (ja) * 2003-12-04 2007-07-12 松下電器産業株式会社 タスクスケジューリング装置、タスクスケジューリング方法、タスクスケジューリングプログラム、記録媒体、及び伝送媒体
JP2006004067A (ja) * 2004-06-16 2006-01-05 Denso Wave Inc 制御装置及びコンピュータプログラム

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020061055A (ja) * 2018-10-12 2020-04-16 オムロン株式会社 制御システム、制御装置および制御方法
JP7067406B2 (ja) 2018-10-12 2022-05-16 オムロン株式会社 制御システム、制御装置および制御方法
WO2020100548A1 (ja) * 2018-11-15 2020-05-22 オムロン株式会社 制御システムおよび制御装置
JP2020086481A (ja) * 2018-11-15 2020-06-04 オムロン株式会社 制御システムおよび制御装置
US11520302B2 (en) 2018-11-15 2022-12-06 Omron Corporation Control system and control device
WO2021024555A1 (ja) * 2019-08-08 2021-02-11 株式会社日立製作所 制御システム
JP2021026652A (ja) * 2019-08-08 2021-02-22 株式会社日立製作所 制御システム
JP7364388B2 (ja) 2019-08-08 2023-10-18 株式会社日立製作所 制御システム

Also Published As

Publication number Publication date
US20200019436A1 (en) 2020-01-16
US11301294B2 (en) 2022-04-12

Similar Documents

Publication Publication Date Title
JP6406466B1 (ja) 制御装置、制御方法および制御プログラム
WO2018186358A1 (ja) 制御装置、制御方法および制御プログラム
CN109557890B (zh) 控制装置
EP3379358B1 (en) Control system, control device, control program, and control method
JP6388050B1 (ja) 制御装置
JP6724847B2 (ja) 制御装置、制御プログラム、制御システム、および制御方法
US10877803B2 (en) Control apparatus, control method and non-transitory storage medium
US20190095246A1 (en) Support device and non-transitory storage medium
WO2018147058A1 (ja) 制御装置
US20220147021A1 (en) Control system, setting device and setting program
JP7067406B2 (ja) 制御システム、制御装置および制御方法
US20220221851A1 (en) Control system, support device, and support program
US20230359487A1 (en) Control device, non-transitory computer-readable medium, and control method
EP4036670A1 (en) Control device
WO2020255486A1 (ja) 制御装置
JP2020086481A (ja) 制御システムおよび制御装置
JP2021114019A (ja) データ処理方法
JP2023049531A (ja) 制御装置
JP2022136823A (ja) 情報処理装置およびプログラム
JP2023031000A (ja) プログラマブルコントローラ、制御方法およびプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18781020

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 18781020

Country of ref document: EP

Kind code of ref document: A1