The present disclosure relates to a control apparatus, a communication cycle adjustment method, and a program.
At factory automation (FA) sites, multiple devices communicate with one another through an industrial network as a system to control many devices. Communication for such control is to be performed in real time to control the devices in a coordinated manner. Communication schemes for integrating such an industrial network with a general-purpose information network that may not focus on real-time performance have been standardized and have received attention. An example of such communication schemes is IEEE 802.1 Time-Sensitive Networking (TSN). IEEE 802.1 TSN is hereafter referred to as the TSN standards.
A network under the TSN standards includes, in each communication cycle, time slots each corresponding to a communication type. The lengths of the time slots may be determined using a technique for determining time lengths for different types of communication (see, for example, Patent Literature 1).
Patent Literature 1 describes a bus management system in which multiple controller units are connected with a bus. In this bus management system, a bus manager calculates, based on information collected from the controller units, a cyclic communication time taken for transferring cyclic data and a transient communication time taken for transferring transient data. The controller units communicate based on the calculation results.
In the network under the TSN standards, the communication cycles are to be shortened to improve real-time performance. However, the technique described in Patent Literature 1 calculates the communication time based on communication cycles having the fixed length, and thus is not directed to adjustment of the communication cycles and does not improve the real-time performance. The real-time performance is to be improved in communication on the network including time slots corresponding to communication types.
Under the above circumstances, an objective of the present disclosure is to improve real-time performance in communication on a network including time slots corresponding to communication types.
To achieve the above objective, a control apparatus according to the present disclosure is a control apparatus that controls a control target device through a network and includes communication means for performing, in a communication cycle defined by a shared time shared with the control target device, in each of a plurality of time segments included in the communication cycle, a type of communication that corresponds to the time segment, measurement means for measuring a control time taken for controlling the control target device when a first type of communication is performed independently of the plurality of time segments, and adjustment means for adjusting, when a size of communication data transmitted or received to control the control target device in the first type of communication is smaller than a transmission capacity of data in a time segment that is included in the plurality of time segments included in the communication cycle included in the control time and that corresponds to the first type, a length of the communication cycle by shortening a length of the time segment corresponding to the first type from a current setting value.
In the structure according to the present disclosure, when the communication data size is smaller than the data transmission capacity in the time segment corresponding to the first type, the adjustment means adjusts the length of the communication cycle by shortening the length of the time segment corresponding to the first type. This shortens the communication cycle as well as the time slot as the time segment, thus improving real-time performance in communication on a network including time slots corresponding to communication types.
A control apparatus 10 according to an embodiment of the present disclosure is described in detail below with reference to the drawings.
As illustrated in
The control apparatus 10 and the devices 21 to 23 are connected to and communicate with one another through a network 30. The network 30 is an industrial network under a fieldbus standard.
The control apparatus 10 is a programmable logic controller (PLC) or an industrial personal computer (IPC) functioning as a master station on the network 30. The devices 21 to 23 function as slave stations managed by the master station. The device 21 is a camera that photographs a production line, and the device 22 is a sensor installed on the production line. The device 23 is a PLC including a network unit 231, a central processing unit (CPU) 232, and an input-output (I/O) unit 233 that are connected to one another with a system bus 234. The I/O unit 233 in the device 23 is connected to the device 239 with a signal line.
The control apparatus 10 controls the devices 21 to 23 and 239 to operate the control system 100. For example, the control apparatus 10 causes, based on an image output from the device 21, the device 239 being a robot connected to the device 23 to move the arm to transport a workpiece.
The processor 41 includes a CPU or a micro processing unit (MPU) that is an integrated circuit. The processor 41 executes a program 49 stored in the auxiliary storage 43 to implement various functions of the control apparatus 10 and perform processes described later.
The main storage 42 includes a random-access memory (RAM). The main storage 42 stores the program 49 loaded from the auxiliary storage 43. The main storage 42 is used as a work area for the processor 41.
The auxiliary storage 43 includes a nonvolatile memory such as an electrically erasable programmable read-only memory (EEPROM) and a hard disk drive (HDD). The auxiliary storage 43 stores, in addition to the program 49, various sets of data used for processing performed by the processor 41. The auxiliary storage 43 provides data usable by the processor 41 to the processor 41 as instructed by the processor 41, and stores data provided from the processor 41.
The clock 44 includes, for example, a clock generator including a quartz resonator, a silicon resonator, a quartz oscillator, or another oscillator circuit. The clock 44 generates a clock signal based on a clock generated by the clock generator, and outputs the clock signal. The clock signal includes a clock pulse and is used by the processor 41 to measure time by counting the number of times the clock pulse rises using a built-in hardware device or through software processing.
The input unit 45 includes input devices such as input keys and a pointing device. The input unit 45 acquires information input by a user of the control apparatus 10 and provides the acquired information to the processor 41.
The output unit 46 includes output devices such as a light-emitting diode (LED), a liquid crystal display (LCD), and a speaker. The output unit 46 presents various items of information to the user as instructed by the processor 41.
The communicator 47 includes a network interface circuit for transmitting or receiving an Ethernet frame to and from an external device. The communicator 47 receives a signal from the external device and outputs data indicated by the signal to the processor 41. The communicator 47 also transmits a signal indicating data output from the processor 41 to the external device.
Referring back to
The control apparatus 10 and the devices 20 are synchronized through the network 30. More specifically, each of the control apparatus 10 and the devices 20 shares the time with the other devices under a synchronous protocol. The synchronous protocol is used to synchronize devices on a communication network with high accuracy. For example, when IEEE 802.1 AS is used as the synchronous protocol, a grandmaster corresponding to one node on the network periodically distributes an accurate reference clock through the communication network. Data is transmitted between the grandmaster and a slave node to measure a communication delay. The slave node acquires a reference clock with the communication delay being corrected. This allows sharing of the time with the communication delay being corrected.
The time sharing and the synchronization among multiple devices refer to synchronization of clocks included in the respective devices. When the clocks in the respective devices indicate the equivalent time, the devices share the time with one another and are synchronized. The time shared between the devices is hereafter referred to as the shared time.
The control apparatus 10 and the devices 20 transmit or receive data based on a schedule predetermined with the shared time under a protocol defined in IEEE 802.1 Qbv. More specifically, as illustrated in
The communication cycles 51 and 52 are consecutive to each other. More specifically, the communication cycle 52 immediately follows the communication cycle 51, with the end time of the communication cycle 51 coinciding with the start time of the communication cycle 52. Although
The communication cycles 51 and 52 each include time slots TS1, TS2, TS3, . . . , and TS0 that are consecutive to one another. When the time slots TS1, TS2, TS3, . . . , and TS0 occur in this order in the communication cycle 51 as illustrated in
The time slots are time segments for different types of communication under predetermined protocols, channels, or formats. For example, the time slot TS1 is a time segment for cyclic transmission. The cyclic transmission is a communication scheme to synchronize, in each of consecutive cycles, data to be stored into the memories in devices by performing, in cycles, communication for storing the common data into the memories. The time slot TS2 is a time segment for communication under a synchronous protocol. The time slot TS3 is a time segment for communication under an open control network protocol published for control networks.
The time slots including the time slots TS1, TS2, TS3, and subsequent time slots other than the time slot TS0 are each a time segment used for communication under a control network protocol that involves punctuality. The control network protocol is a protocol that guarantees transmission of information within a predetermined time length due to transmission of data in each cycle and thus guarantees real-time information sharing between devices. The control network protocol corresponds to an example of a second type included in types of communication performed by the control apparatus 10.
The time slot TS0 is a time segment for communication under an information network protocol that may not involve punctuality. Unlike the control network protocol, under the information network protocol, information transmission may not be guaranteed within a predetermined time length. In the time slot TS0, for example, data is transmitted in a best-effort manner. The transmission thus takes a longer time when many devices transmit data in the time slot TS0, and the data may be lost when the transmission time exceeds the length of the time slot TS0. In the time slot TS0, additionally, data may not be transmitted in each cycle and may be transmitted as appropriate in any cycle. In the time slot TS0, for example, an Internet Protocol (IP) communication is performed. The information network protocol corresponds to an example of a first type included in types of communication performed by the control apparatus 10.
The time slot TS0 typically has a length set as, for example, a difference calculated by subtracting the length of the time slots TS1, TS2, TS3, and subsequent time slots corresponding to the control network protocol from a communication cycle determined based on specifications of each device on the network 30. However, the time slot TS0 set in this manner may be extra long for actual communication volume, and the communication cycle can be shortened. In contrast, the control apparatus 10 according to the present embodiment adjusts the communication cycle by shortening the time slot TS0 based on the actual communication volume.
The communicator 11 is mainly implemented by the processor 41, the clock 44, and the communicator 47 operating in cooperation. The communicator 11 communicates with the devices 20 through the network 30 under the TSN standards. More specifically, the communicator 11 as a grandmaster distributes, to the devices 20, the shared time using the time of the clock 44 as a reference, and shares the shared time with the devices 20. The communicator 11 may be a slave node that acquires the shared time distributed by another grandmaster. As illustrated in
The device information manager 12 is mainly implemented by the processor 41 and at least one of the main storage 42 or the auxiliary storage 43 operating in cooperation. The device information manager 12 collects, through the communicator 11, information for communicating with the devices 20 under the TSN standards, and writes the collected information into a device information table 121. The device information manager 12 also acquires, from the time slot setter 13, information indicating time slots set by the time slot setter 13, acquires, from the measurer 14, information indicating the results of measurement performed by the measurer 14, and writes the acquired information into the device information table 121. The device information manager 12 provides information in the device information table 121 to an external device.
As illustrated in
For example, the device component in the device information table 121 may indicate a model, a model number, or an address of each device 20. The device component of the device 23 being a PLC indicates the components of the PLC including all the units connected with the same bus and the device 239 connected to the I/O unit 233. In
Under the communication type in
The communication cycle tolerance indicates a different range for each control network protocol. The transport layer protocol indicates a transmission control protocol (TCP) or a user datagram protocol (UDP). The processing time is measured by each device 20 at the time of activation. For example, the processing time of the device 21 being a camera is a time taken from capturing an image to the end of execution of operation for conversion for outputting the image to an external device. The processing time of the device 23 being a PLC is a time taken for optimizing each unit connected with the bus and the device 239. The processing time is, for example, a time for the device 239 being a robot to end moving the arm after the network unit 231 receives an instruction for the device 239.
Information about the device component, the communication type, the communication attribute, the communication cycle tolerance, the transport layer protocol, and the processing time is collected from each device 20 and registered with the device information table 121 by the device information manager 12. In the control apparatus 10, the device information manager 12 corresponds to an example of acquisition means for acquiring, from the control target device, type information indicating types of communication to be performed. The type information corresponds to information including the communication type. Registration of the allocated time slot, the input data size, and the input data acquiring time with the device information table 121 is described later.
The time slot setter 13 is mainly implemented by the processor 41. The time slot setter 13 allocates, to the time slots, the types of communication performed by each device 20 based on the communication type and the communication attribute in the information collected from the device 20. In the control apparatus 10, the time slot setter 13 corresponds to an example of allocation means for allocating a type of the types of communication indicated by the type information to the plurality of time segments included in the communication cycle. The time slot setter 13 registers the allocated time slot with the device information table 121 as illustrated in
The time slot setter 13 sets an initial value of the length of the time slot TS0 based on the length of the time slot corresponding to the control network protocol predetermined by the user and on the initial value of the communication cycle. The initial value of the communication cycle may be determined by the device information manager 12 or the time slot setter 13 based on the communication cycle tolerance in the device information table 121.
When determining, based on the initial value of the length of the time slot TS0 and a measurement result of the measurer 14, that the initial value is extra long, the time slot setter 13 shortens the length of the time slot TS0 to adjust the communication cycle. The determination by the time slot setter 13 is described in detail later.
The measurer 14 is mainly implemented by the processor 41 and the clock 44 operating in cooperation. The measurer 14 measures the control time taken for the control apparatus 10 to control the devices 20 with the type of communication corresponding to the time slot TS0, and the size of communication data transmitted in the time slot TS0 to control the devices 20.
As illustrated in
The measurer 14 measures the times T11 and T13 based on information provided from the devices 21 and 23. As illustrated in
The method for measuring the time T11 is not limited to the example in
As illustrated in
The measurer 14 may acquire a measurement value of a time T14 by referring to the processing time in the device information table 121 illustrated in
The measurer 14 further measures the input data size. As illustrated in
Referring back to
The network monitor 16 is mainly implemented by the processor 41. The network monitor 16 monitors the state of the network 30 to learn the relationship between the operating state of the network 30 and a parameter for determining the length of the time slot TS0. With the network monitor 16 learning further, the length of the time slot TS0 is determined based on the state of the network 30 without measurement by the measurer 14. In the control apparatus 10, the network monitor 16 corresponds to an example of learning means for learning the state of communication on the network in the communication cycle adjusted by the time slot setter 13 as the adjustment means.
Initialization and communication cycle adjustment performed by the control apparatus 10 are now described with reference to
In the initialization, the control apparatus 10 performs link scan (step S1). More specifically, the device information manager 12 determines whether the devices 20 are connected to the control apparatus 10 through the network 30 (step S2).
When failing to determine the connection of the devices 20 in link scan (No in step S2), the control apparatus 10 repeats the processing in step S1. When determining the connection of at least one device 20 in link scan (Yes in step S2), the device information manager 12 generates the device information table 121 (step S3) and lists individual information about the device 20 determined to be connected in the device information table. More specifically, information under the device component in
The device information manager 12 then requests each device 20 determined to be connected to transmit device information (step S4). When receiving no response to the request (No in step S5), the device information manager 12 repeats the processing in step S4. When receiving a response to the request (Yes in step S5), the device information manager 12 records the device information into the device information table 121 (step S6). The communication type, the communication attribute, the communication cycle tolerance, the transport layer protocol, and the processing time in
Subsequently, the time slot setter 13 allocates, based on the device information, a communication type to the time slot with the control network protocol prioritized over the information network protocol (step S7). More specifically, in allocating a communication type to the time slot, the time slot setter 13 allocates the control network protocol to a time slot in priority to allocation of the information network protocol. When receiving the communication type and the communication attribute illustrated in
The time slot setter 13 then records the time slot allocated in step S7 into the device information table 121 (step S8). The time slots are thus associated with the types of communication performed by the devices 20 as illustrated in
The time slot setter 13 then calculates the initial values of the communication cycle and the time slot length. More specifically, the time slot setter 13 reads the communication cycle tolerance corresponding to the control network protocol recorded in the device information table 121. When the tolerances indicate the upper limits of the tolerance range as illustrated in
The time slot setter 13 also acquires a predetermined length of the time slot corresponding to the control network protocol recorded in the device information table 121. This time slot length may be determined by the control apparatus 10 with a predetermined procedure and stored into a memory, or specified by the user. The time slot setter 13 acquires the initial value of the length of the time slot TS0 corresponding to the information network protocol by subtracting the sum of the lengths of the time slots, each corresponding to the control network protocol, from the initial value of the communication cycle. More specifically, the time slot setter 13 calculates the initial value of TSL0 with a calculation expressed with Formula 1 below, where the lengths of the time slots TS1, TS2, . . . , and TS0 are denoted as TSL1, TSL2, . . . , and TSL0, n is an integer greater than or equal to 1, and the initial value of the communication cycle is PR0.
TSL0=PR0−Σ(TSLn) (1)
The time slot setter 13 then determines whether an initial value is acquired with the calculation (step S10). In other words, the time slot setter 13 determines whether an initial value can be set. For example, when the initial value of the communication cycle is small and many types of control network protocol are included, the initial value of the time slot TS0 is not calculated, and the result of determination in step S10 is negative.
When the result of determination in step S10 is negative (No in step S10), the control apparatus 10 notifies the user of an error (step S11) and ends the initialization. When the result of determination in step S10 is positive (Yes in step S10), the control apparatus 10 ends the initialization.
After the initialization, the control apparatus 10 starts the communication cycle adjustment in
When receiving no response to this request (No in step S202), the measurer 14 repeats the processing in step S201. When receiving a response to this request (Yes in step S202), the measurer 14 measures the size of the input data transmitted from the input device (step S203) and measures the time taken for acquiring the input data (step S204).
The measurer 14 then calculates the data transmission speed based on the input data size measured in step S203 and the input data acquiring time measured in step S204 (step S205). More specifically, the size of data transmitted per unit time is calculated by dividing the input data size by the acquiring time. A minimum value for transmission from the multiple devices 20 in a best-effort manner may be calculated as the transmission speed.
Subsequently, the device controller 15 processes the input data, and the measurer 14 measures the processing time taken for processing the input data (step S206). Transmission data to be transmitted to the control target device is then generated as a result of processing the input data, and the measurer 14 calculates a communication data size as the sum of the input data size and the transmission data size (step S208).
The communicator 11 then transmits the transmission data as the processing result to the control target device, and the measurer 14 measures the transmission time (step S209). More specifically, the measurer 14 may acquire the measurement value of the transmission time by multiplying the transmission data size by the transmission speed acquired in step S205. The measurer 14 may measure the transmission time based on the notification from the control target device as illustrated in
The measurer 14 then measures a state change time taken for the control target device to change the state based on the processing result (step S210). More specifically, the measurer 14 may acquire the measurement result by causing the control target device to measure the time taken for ending the actual operation based on the transmission data or may use the processing time collected from the device 20 as the control target device in the initialization as the state change time.
The measurer 14 then calculates the control time as the sum of the acquiring time acquired in step S204, the processing time acquired in step S206, the transmission time acquired in step S209, and the state change time acquired in step S210 (step S211). The measurement then ends. The measurer 14 corresponds to an example of measurement means for measuring the control time based on information provided from the input device and the control target device.
Referring back to
Subsequently, the time slot setter 13 determines whether the communication data size calculated in the measurement in step S208 is smaller than the transmission capacity of the time slots TS0 calculated in step S21 (step S22). More specifically, as illustrated on the right in
When a determination is made that the communication data size is not smaller than the transmission capacity (No in step S22), the processing by the control apparatus 10 advances to step S25. When determining that the communication data size is smaller than the transmission capacity (Yes in step S22), the time slot setter 13 determines that the current setting value indicating the lengths of the time slots TS0 is too large and adjusts the communication cycle by shortening the lengths of the time slots TS0 (step S23).
More specifically, as illustrated in
The time slot setter 13 reduces, based on the shortening of the time slot lengths, the size of a payload in data to be transmitted in each time slot TS0 from the current setting value (step S24). For example,
Referring back to
The control apparatus 10, as well as the devices 20, starts communication in the adjusted communication cycle (step S26). More specifically, the communicator 11 performs, in each time slot, the type of communication allocated to the time slot by the time slot setter 13 as the allocation means. To transmit communication data in a prioritized manner, the control apparatus 10 transmits other data to be transmitted in the time slots TS0 in a best-effort manner at a time at which no communication data is transmitted.
Subsequently, the network monitor 16 monitors the network 30 and repeatedly learns the operating state of the network 30 (step S27). More specifically, the network monitor 16 learns the correlation between the transmission volume of data including the communication data and other data in the time slots TS0 and the operating state of the network 30 at the time of data transmission. The operating state of the network 30 includes a parameter for determining at least one of the communication data size or the control time, and includes, for example, the structure of the control system 100, and operation conditions for data generation and transmission frequency during the operation of the control system 100. With the network monitor 16 learning repeatedly, the relationship between the data size and the time slot lengths in the operating state of the control system 100 is patterned, and information indicating the correlation is accumulated in a database. Thus, at the subsequent activation of the control apparatus 10, the control apparatus 10 can set an appropriate time slot lengths by simply identifying the connected devices 20 without measurement performed by the measurer 14.
The network monitor 16 may learn the volume of data transmitted in the time slots TS0 other than the communication data during the normal operation of the control system 100, and use, at the subsequent activation of the control apparatus 10, the learning result as the size of other data illustrated in
The network monitor 16 may record the structure of the control system 100, the input data size and the acquiring time acquired from each device 20, and the control time, and estimate, upon determining the connection of the devices 20, the lengths of the time slots TS0 based on these recorded pieces of information at every subsequent activation of the control apparatus 10. The network monitor 16 repeatedly compares such an estimation result and the lengths of the time slots TS0 set by the above processing at the activation to minimize an estimation error and improve the estimation accuracy. When the estimation accuracy is fully improved, the time slot setter 13 may set the lengths of the time slots TS0 based on the estimation without measuring the control time. This allows the control system 100 to reduce the time taken before starting the normal operation. The time slot setter 13 may adjust the time slot lengths by automatically selecting a protocol at the upper layer of IP communication such as TCP or UDP based on reliability of data. The time slot setter 13 may adjust the time slot lengths by automatically selecting a protocol at the upper layer of IP communication such as TCP or UDP based on reliability of data. The time slot setter 13 corresponds to an example of adjustment means for setting, based on the result of learning performed by the network monitor 16 as the learning means, the length of the time segment corresponding to the first type to a new setting value.
As described above, in the control apparatus 10 according to the present embodiment, the time slot setter 13 shortens the lengths of the time slots TS0 to adjust the length of the communication cycle when the communication data size is smaller than the transmission capacity of data in the time slots TS0. This shortens the communication cycle together with the time slots TS0. The real-time performance can thus be improved in communication on the network including the time slots corresponding to the communication types under the TSN standards.
In some embodiments, the control apparatus 10 may adjust the lengths of the time slots TS1, TS2, and subsequent time slots corresponding to the control network protocol in the above manner. For the time slots TS0 in particular, however, the initial value is typically used independently of the actual communication volume when the time slots TS0 may have extra lengths. The control apparatus 10 according to the present embodiment can effectively improve the real-time performance by reducing the lengths of the time slots TS0.
The time slot setter 13 changes the payload length of data transmitted in the time slot TS0. This avoids transmission of data with an extra long payload.
The device information manager 12 acquires information indicating the type of communication to be performed from the control target device, and the time slot setter 13 allocates the control network protocol to a time slot in priority to allocation of the information network protocol. This allows a high-priority protocol involving punctuality to be more reliably allocated to the time slots.
The control time includes the time taken for acquiring input data, the processing time taken for processing the input data, the time taken for transmitting transmission data as the processing result, and the state change time taken for the control target device to change the state based on the transmission data. The time taken for a series of control from the transmission of the input data to the completion of the state change of the control target device is thus acquired, allowing the calculation of the minimum transmission capacity for transmitting the communication data. In the above embodiment, the control time taken for one control operation is measured, but the average control time for one control operation or the control time for multiple control operations may be measured.
Although one or more embodiments of the present disclosure have been described above, the present disclosure is not limited to the above embodiments.
For example, the structure of the control system 100 is not limited to the example illustrated in
In the example, the control time includes four phases as illustrated in
The functions of the control apparatus 10 may be implemented by dedicated hardware or a general-purpose computer system.
For example, the program 49 executable by the processor 41 may be stored in a non-transitory computer-readable recording medium for distribution. The program 49 is installed in a computer to provide a device that performs the above processing. Examples of such a non-transitory recording medium include a flexible disk, a compact disc ROM (CD-ROM), a digital versatile disc (DVD), and a magneto-optical (MO) disk.
The program 49 may be stored in a disk device included in a server on a communication network, such as the Internet, and may be, for example, superimposed on a carrier wave to be downloaded to a computer.
The above processing may also be performed by the program 49 activated and executed while being transferred through a communication network.
The above processing may be performed by entirely or partially executing the program 49 on a server while a computer is transmitting and receiving information about the processing through a communication network.
In the system with the above functions implementable partially by the operating system (OS) or through cooperation between the OS and applications, portions implementable by applications other than the OS may be stored in a non-transitory recording medium that may be distributed or may be downloaded to a computer.
Means for implementing the functions of the control apparatus 10 is not limited to software. The functions may be partially or entirely implemented by dedicated hardware including circuits.
The foregoing describes some example embodiments for explanatory purposes. Although the foregoing discussion has presented specific embodiments, persons skilled in the art will recognize that changes may be made in form and detail without departing from the broader spirit and scope of the invention. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense. This detailed description, therefore, is not to be taken in a limiting sense, and the scope of the invention is defined only by the included claims, along with the full range of equivalents to which such claims are entitled.
The present disclosure is usable for a system including devices that communicate with one another in each time segment defined by the time shared between the devices.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2022/000087 | 1/5/2022 | WO |