The present disclosure relates to a simulation device, a simulation method, and a program.
In a Factory Automation (FA) field, various automatic control techniques are widely used. At a stage of designing or considering a system to which the automatic control techniques are applied, evaluation of performance of the system is previously required. A method for performing the evaluation based on data obtained by simulating the motion of the evaluation target has been proposed related to such needs.
For example, PTL 1 (Japanese Patent Laying-Open No. 2015-176340) discloses a PLC (Programmable Logic Controller) support device capable of checking whether there is an error in a user program by executing a virtual device program that simulates an actual device instead of the actual device even when all the actual devices are not connected to a PLC.
PTL 1: Japanese Patent Laying-Open No. 2015-176340
When the simulation estimating a behavior of a drive device driving a control target is performed like the simulation of a PLC program of an actual machine, for example, a user performs operation of setting related to an IO program in order to generate or update IO data (input and output data) corresponding to the actual device instead of the actual device connected to the PLC. In recent years, the number of types of devices connected to the PLC tends to increase. Accordingly, it is desired to provide an environment that enables easy operation related to the above setting operation.
Japanese Patent Laying-Open No. 2015-176340 discloses that the virtual device program is executed instead of the actual device, but does not propose an environment that meets the above needs.
An object of the present disclosure is to provide an environment in which the user can easily implement the simulation estimating the behavior of the system including the control device controlling the target.
In one aspect of the present disclosure, provided is a simulation device that estimates a behavior of a system including a control device that controls a target, the simulation device includes: program execution means configured to execute a simulation program estimating the behavior; three-dimensional virtualization means configured to virtually construct the system in a three-dimensional virtual space; setting means configured to execute setting generating or updating data referred to during the execution of the simulation program; and reception means configured to receive a user operation to the simulation device. The setting means selectively executes setting based on a position in the three-dimensional virtual space or setting based on an operating condition according to the user operation.
According to the present disclosure, the setting means selectively executes the setting generating or updating the data referred to by the simulation program according to the user operation as the setting based on the position in the three-dimensional virtual space or the setting based on the operation condition. Thus, an environment in which the device simulates the behavior of the real system connected to the control device can be easily implemented by the user operation.
In the above disclosure, the system includes a sensor that performs a detection operation for the control, and the setting based on the position in the three-dimensional virtual space includes a setting generating or updating data associated with an object corresponding to the sensor arranged in the three-dimensional virtual space.
According to the disclosure, the setting in which the data referred to during the execution of the simulation program is generated or updated using the data associated with the object corresponding to the sensor disposed on the virtual space can be executed.
In the above disclosure, the three-dimensional virtualization means generates drawing data for visualizing the object corresponding to the sensor disposed in the three-dimensional virtual space in the three-dimensional virtual space and drawing the object on a display.
According to this disclosure, when the setting means executes the above setting, the object corresponding to the sensor disposed in the three-dimensional virtual space can be visualized and presented to the user.
In the above disclosure, the system includes: a sensor that performs a detection operation for the control; and a peripheral device that operates in association with the control, the detection operation of the sensor is linked with the operation of the peripheral device, and the operation condition includes a condition based on the detection operation of the sensor linked with the operation of the peripheral device.
According to this disclosure, the data referred to during the execution of the simulation program can include the data according to the condition based on the detection operation of the sensor linked with the operation of the peripheral device related to the control.
In the above disclosure, the setting generating or updating the data executed by the setting means includes a program corresponding to a parameter received by the user operation.
According to this disclosure, the generation or update of the data referred to during the execution of the simulation program can be implemented by the execution of the program corresponding to the parameter received by the user operation.
In the above disclosure, the three-dimensional virtualization means generates drawing data for visualizing the motion of the target during the execution of the simulation program in the three-dimensional virtual space and drawing the motion on the display.
According to this disclosure, when the simulation program is executed, the behavior of the system estimated by the execution can be visualized and presented in the three-dimensional virtual space.
In another aspect of the present disclosure, provided is a simulation method executed by a computer that estimates a behavior of a system including a control device that controls a target, the simulation method includes: virtually constructing the system in a three-dimensional virtual space; and executing setting generating or updating data referred to during execution of a simulation program. In executing the setting, setting based on a position in the three-dimensional virtual space or setting based on an operating condition is selectively executed according to a user operation to the computer.
According to the present disclosure, in the setting step, the setting for generating or updating the data referred to by the simulation program is selectively executed according to the user operation as the setting based on the position in the three-dimensional virtual space or the setting based on the operation condition. Thus, an environment in which the device simulates the behavior of the real system connected to the control device can be easily implemented by the user operation.
In still another aspect of the present disclosure, a program causing a computer to execute the simulation method is provided.
By implementing the program, the setting for generating or updating the data referred to by the simulation program is selectively executed according to the user operation as the setting based on the position in the three-dimensional virtual space or the setting based on the operation condition. Thus, an environment in which the device simulates the behavior of the real system connected to the control device can be easily implemented by the user operation.
An embodiment of the present disclosure will be described in detail with reference to the drawings. The same or equivalent portion in the drawings is denoted by the same reference numeral, and the description will not be repeated.
An example of a scene to which the present invention is applied will be described. With reference to
In the following description, a “workpiece” handled by the system may be any product such as a final product or a part thereof, or an intermediate product or a part thereof as long as a position thereof can be tracked.
Simulation device 100 is a device that supports preparation required for controlling the target by control device 200. Specifically, simulation device 100 estimates the behavior of control system 1 by executing the simulation program and outputs a simulation result. In addition, simulation device 100 provides an environment in which a setting operation related to the IO data by the user is supported as an environment in which the user is supported to execute the simulation program. Simulation device 100 can further provide a setting environment related to a task executed by control device 200, a monitor screen of an execution status of the task in control device 200, and the like.
In the following description, the IO data includes data referred to by the simulation program during the execution of the simulation program.
Control device 200 controls the operation of control system 1. In the embodiment, for example, the operation controlled by control device 200 includes a “pick and place operation”. The “pick and place operation” represents a series of operations of gripping, conveying, and disposing by a robot 210, in which when a workpiece 232 conveyed on a conveyor 230 reaches a predetermined tracking area 231, robot 201 grips workpiece 232 in tracking area 231, conveys gripped workpiece 232 to a conveyor 240, and disposes workpiece 232 in a tracking area 235 on conveyor 240. In the embodiment, for example, a suction mechanism is used to grip workpiece 232. A robot tool for sucking workpiece 232 is attached to a distal end of a robot arm 214 of robot 210. For example, the robot tool is a pneumatic suction device, and grips workpiece 232 by generating negative pressure. For example, robot 210 grips workpiece 232 on the conveyance surface of conveyor 230 and releases the suction of workpiece 232 by the robot tool above the conveyance surface of conveyor 240 on a place side. The workpiece lands on the conveyance surface of conveyor 240 by gravity and is conveyed as it is.
Control system 1 further connects a peripheral device that executes operation related to the operation of control device 200. For example, the peripheral device includes an air cylinder 8 installed in association with conveyor 230. Control system 1 further connects an IO device that executes a detection operation for control. The IO devices include a sensor 6, a limit switch 7 associated with air cylinder 8, an encoder 236 installed in association with conveyor 230, an encoder 238 installed in association with conveyor 240, a pressure switch 9 installed in association with robot arm 214, and the like.
Encoder 236 outputs a detection value 237 corresponding to a movement amount of conveyor 230 by detecting a rotation amount of a drive roller 234 of conveyor 230, and similarly encoder 238 outputs a detection value 239 corresponding to a movement amount of conveyor 240 by detecting a rotation amount of a drive roller 244 of conveyor 240. Detection values 237, 239 are based on a pulse signal corresponding to the movement amount of the conveyor. Control device 200 counts a pulse indicated by detection value 237, calculates (detects) the value indicating the moving amount and/or the value indicating a moving speed of conveyor 230 based on the count value, similarly counts the pulse indicated by detection value 239, and calculates (detects) the value indicating the moving amount and/or the value indicating the moving speed of conveyor 240 based on the count value.
Pressure switch 9 detects the suction and the subsequent suction release according to a change in pressure applied to robot arm 214, and outputs a detection value 91.
From a box 221 provided on the downstream side of conveyor 230, workpiece 232 is supplied onto the conveyance surface of conveyor 230 through an opening of box 221. When workpiece 232 in the middle of conveyance on conveyor 230 reaches the position where air cylinder 8 is disposed, workpiece 232 is disposed at a predetermined position in a width direction of the conveyance surface of conveyor 230 by retracting or extrusion operation of a piston of air cylinder 8. For example, the predetermined position is based on a position where robot arm 214 of robot 210 can grip workpiece 232. Limit switch 7 outputs a detection value 71 that changes from OFF to ON when the position of air cylinder 8 becomes a retracting or extrusion position. Sensor 6 has a detection range in which workpiece 232 can be detected, and outputs a detection value 61 when detecting workpiece 232. The detection range of sensor 6 is based on a range in which sensor 6 can detect that workpiece 232 in the middle of conveyance approaches tracking area 231.
Control device 200 causes robot 210 to execute the pick and place operation by referring to the detection values from the IO devices to execute a predetermined control program. Specifically, when detecting that workpiece 232 approaches tracking area 231 from detection value 61 of sensor 6, control device 200 outputs a control instruction 211 to execute the “pick and place operation” to robot 210. When generating control instruction 211 for robot 210, control device 200 refers to a state value 222 of robot 210 in addition to detection values 61, 71, 91 from the IO devices described above.
When control system 1 that enables the “pick and place operation” as illustrated in
Specifically, simulation device 100 estimates the behavior of control system 1 including control device 200 that controls the target (that is, conveyor 230, 240, robot 210, peripheral devices, and the like). Simulation device 100 executes the simulation program estimating the behavior of control system 1 in what is called an offline state in which communication with each unit of control system 1 including the control device 200 is not conducted (R1). As a typical use case, the simulation program is executed in a situation where the control system cannot be actually assembled. When the simulation program is executed, simulation device 100 virtually constructs the system in the three-dimensional virtual space (R2), and generates drawing data drawing the motion of control system 1 estimated by the simulation in the constructed three-dimensional virtual space on a display 38 as illustrated in
Simulation device 100 executes the setting in order to generate or update data to be referred to during the execution of the simulation program (R3). In this setting, the setting based on the position in the three-dimensional virtual space or the setting based on the operation condition is selectively executed according to the user operation for the simulation device.
For example, the selective setting is executed based on the type of the IO device that supplies the data. For example, the setting based on the IO device including sensor 6 such as a photoelectric sensor that detects workpiece 232 is executed. For example, an IO stub that outputs the data associated with an object such as an image representing a detection range related to a sensor set in the three-dimensional virtual space is executed when the simulation program is executed. The IO stub includes a program or an instruction code. For example, the data associated with the object includes data indicating whether workpiece 232 is detected in the detection range. Thus, when the simulation program is executed, the data to be referred to by the simulation program, for example, the data from sensor 6 that detects workpiece 232 can be generated or updated.
On the other hand, limit switch 7 that is an example of the IO device is linked with the operation of air cylinder 8 that is the peripheral device. Accordingly, the setting is executed based on the IO device of limit switch 7. For example, the IO stub is executed based on the operation condition representing the link. Because the IO stub is also executed during the execution of the simulation program, the data to be referred to by the simulation program, for example, the data from limit switch 7 linked with the operation of air cylinder 8 can be generated or updated during the execution of the simulation program.
Referring to
In the three-dimensional virtual space of
The three-dimensional virtual space of
Control device 200 includes an arithmetic unit 13 that executes main arithmetic processing, at least one IO unit 14, and a special unit 17. These units are configured to be able to exchange data with each other through a system bus 81, and power is supplied from a power supply unit 12. Simulation device 100 is connected to arithmetic unit 13.
IO unit 14 is a unit related to general input and output processing, and manages the input and output of binarized data. Specifically, IO unit 14 collects the detection values such as detection values 61, 71, 91, 237, 239 from the IO devices including sensor 6, limit switch 7, pressure switch 9, encoders 236, 238, and the like. In the collection, the detection value from each IO device is set (written) to, for example, the corresponding bit of the memory included in IO unit 14. Arithmetic unit 13 executes the arithmetic operation of the control program using the value collected by IO unit 14, and sets (writes) the value of the arithmetic result to the corresponding bit of IO unit 14. The peripheral device or the IO device operates by referring to the value of each bit of IO unit 14. As described above, control device 200 can control robot 210 or conveyors 230, 240 as the control target while exchanging the data with the IO device and the peripheral device through IO unit 14.
Special unit 17 has functions, such as the input and output of analog data, temperature control, and communication by a specific communication method, which are not supported by IO unit 14.
Field network 2 transmits various data exchanged with arithmetic unit 13. Typically, various kinds of industrial Ethernet (registered trademark) can be used as field network 2. For example, EtherCAT (registered trademark), Profinet IRT, MECHATROLINK (registered trademark)-III, Powerlink, SERCOS (registered trademark)-III, and CIP Motion are known as Industrial Ethernet (registered trademark), and any of these may be adopted. Furthermore, a field network other than Industrial Ethernet (registered trademark) may be used. For example, when motion control is not performed, DeviceNet, and CompoNet/IP (registered trademark) may be used.
Remote IO terminal 5 is further connected to field network 2. Basically, remote IO terminal 5 executes the processing related to the general input and output processing similarly to IO unit 14. More specifically, remote IO terminal 5 includes a communication coupler 52 performing processing related to data transmission in field network 2 and at least one IO units 53. These units are configured to be able to exchange the data with each other through a remote IO terminal bus 51.
Servomotor drivers 531, 532 are connected to arithmetic unit 13 through field network 2, and drives servomotors 41, 42 according to an instruction value from arithmetic unit 13. Servomotors 41, 42 control a servo mechanism included in air cylinder 8 and drive rollers 234, 244. Specifically, servo motor drivers 531, 532 receive instruction values such as a position instruction value, a speed instruction value, and a torque instruction value from control device 200 in a constant period such as a control period. In addition, servomotor drivers 531, 532 acquires actual measurement values related to the operations of servomotors 41, 42, such as the position, the speed, and the torque, from a detector such as a position sensor (rotary encoder) or a torque sensor connected to shafts of servomotors 41, 42, and adjusts current in order to drive servomotors 41, 42. Limit switch 7 that is one of the IO devices described above corresponds to the position sensor connected to the shaft of servomotor 41 of air cylinder 8.
(c1. Cooperation Between Robot and Conveyor)
In control system 1, robot 210 and conveyors 230, 240 move workpiece 232 in cooperation with each other. At this point, in order to simplify the description, the movement of workpiece 232 will be described, but the description is not limited to the movement. For example, machining of workpiece 232 by robot 210 on the stage may be performed.
In
Robot controller 310 drives servomotor 43 of robot 210. An encoder (not illustrated) is disposed on a rotation shaft of servomotor 43. The encoder outputs data corresponding to state value 222 such as the position (rotation angle), the rotation speed, and the cumulative rotation speed of the servomotor to robot controller 310 as a feedback value of servomotor 43.
Similarly, servomotor driver 532 drives servomotor 42 of conveyors 230, 240. Encoder 236, 238 disposed on the rotation shaft of servomotor 42 outputs detection values 237, 239 as a feedback value of servomotor 42.
The control of robot 210 and conveyors 230, 240 in control system 1 will be described. Robot 210 has a movable unit movable by a plurality of drive shafts. Each of these drive shafts is driven by servomotor 43. Specifically, robot 210 includes a plurality of robot arms 214 driven by rotation of servomotor 43. Servomotor 43 rotates to drive robot arm 214. Robot controller 310 controls the drive of servomotor 43, so that robot arm 214 moves three-dimensionally. The movement of robot arm 214 implements the motion of robot 210. Similarly, conveyors 230, 240 also move by the rotation of servomotor 42. The movement amount (direction of movement, movement distance) of robot 210 or conveyors 230, 240 is determined by the rotation amount (direction of rotation, angle) of the servo motor.
In the embodiment, virtual axes are associated with robot arm 214 of robot 210, and the motion of robot 210 is determined from the position of the corresponding axis. Control device 200 stores the target position of the axis of robot 210. This target position changes in time series such that the motion of robot 210 indicates a target motion (hereinafter, also referred to as a target operation).
Robot controller 310 receives control instruction 211 of the target position from control device 200, determines the rotation amount of each servomotor based on the received target position, and outputs the instruction value designating the determined rotation amount to servomotor 43.
In addition, control device 200 calculates the position in the three-dimensional virtual space of the axis corresponding to each robot arm 214 of robot 210 from state value 222 from robot controller 310. Thus, for example, a three-dimensional coordinate P (x, y, z) that is the position in the three-dimensional virtual space of the axis of robot arm 214 that grips workpiece 232 can be calculated.
Similarly to robot 210, conveyors 230, 240 can change the moving speeds of conveyors 230, 240 such that the motion of conveyors 230, 240 indicates the target operation (for example, the moving speed).
Control device 200 can convert the position (tracking position) that changes in time series of workpiece 232 on the conveyor into a three-dimensional coordinate Q (x, y, 0) in the same three-dimensional virtual space as robot 210 by performing the arithmetic operation using a predetermined function on detection values 237, 239 of encoders 236, 238. The time-series change in the three-dimensional coordinates Q (x, y, 0) can indicate the motion of workpiece 232 in the three-dimensional virtual space.
At this point, because conveyors 230, 240 indicate the motion in a plane, the z-axis of the three-dimensional coordinate Q is fixed at a value of zero, but may have another fixed value.
Simulation device 100 is a computer system that includes a central processing unit (CPU) 2 and a storage that stores a program and data, and operates according to the program. The storage includes a read only memory (ROM) 3, a random access memory (RAM) 4, and a hard disk drive (HDD) 5. Simulation device 100 further includes a universal serial bus (USB) controller 16 and an input and output (I/O) interface 27. In addition, simulation device 100 includes a keyboard 37 and a display 38. Keyboard 37 receives input including an instruction from the user to simulation device 100. In order to receive the input, simulation device 100 may include another device such as a mouse. Simulation device 100 includes a reader and writer (R/W) device 93 to which an external storage medium 92 is detachably attached, R/W device 93 reading and writing a program and/or data from and to attached storage medium 92.
A USB controller 16 is an interface to which simulation device 100 communicates with an external device including control device 200. For example, USB controller 16 is configured to be connectable to a communication cable 80.
An I/O interface 27 is an interface input to simulation device 100 or output from simulation device 100. As illustrated in
With reference to
Offline system 20 includes a program and data, and CPU 2 executes the program according to the instruction from controller 10, thereby implementing offline system 20. Furthermore, when the result of the processing by offline system 20 is displayed on display 38, the processing result is converted into display control data and output to display driver 39. Display driver 39 drives display 38 according to the image data according to the display control data. Thus, the images representing the processing results of simulation device 100 and offline system 20 are displayed on the screen of display 38.
(e1. Configuration of Offline System 20)
A configuration of offline system 20 will be described. The program and data implementing each unit of offline system 20 are stored in a storage 300 including, for example, ROM 3, RAM 4, and HDD 5. Controller 10 (CPU 2) may execute a necessary program to execute processing of offline system 20 including the simulation. The program may be stored in storage 300. When controller 10 executes the necessary program, the target program stored in storage 300 is developed in RAM 4. The program developed in RAM 4 is interpreted and executed by CPU 2, and each component of offline system 20 is controlled.
Referring to
Offline system 20 further includes a display controller 15 that generates the display control data, a period generation unit 18 including a timer that outputs a virtual time, and a tool execution unit 34. Display controller 15 generates the display control data from drawing data or the like, and outputs the display control data to display driver 39. Display driver 39 drives display 38 according to the display control data. Thus, an image according to the drawing data is displayed on the screen.
Period generation unit 18 includes a virtual time generation program 29 that generates a signal ST indicating the virtual time to output generated signal ST to each unit of offline system 20. Each unit operates in synchronization with a period in which the virtual time indicated by signal ST is used as a scale. In the embodiment, the period in which the virtual time is used as the scale includes the control period that is an execution period of PLC simulator 260. Period generation unit 18 includes an arithmetic instruction unit 136 that generates an arithmetic instruction 280 according to the instruction from controller 10 and outputs the arithmetic instruction 280 to program execution unit 31.
With reference to
IO setting support program 361 is a program supporting the setting by the user regarding the data referred to during the simulation executed by program execution unit 31, and includes an IO stub generation program 362 and a setting table editing program 363. 3D visualization program 28 includes a trajectory calculation program 303 that calculates a trajectory of the movement of the object in the three-dimensional virtual space. Parameter table 370 has a parameter indicating a specification of the operation of each device for the device including the peripheral device controlled by PLC program 371.
Tool execution unit 34 includes a PLC program editor 32, an IO setting support tool 33 including an IO stub generation tool 36, and a builder 35. PLC program editor 32 supports the user to edit the program by editing the PLC program 371 according to the user operation received through the input reception unit 11.
PLC program 371 of the embodiment is what is called a variable program. That is, PLC program 371 is configured such that input data, output data, internal calculation data, and the like referred to by the program during the execution can be utilized using an input variable, an output variable, a temporary variable, and the like for each data. The values of the input variable and the output variable include a value corresponding to each bit of IO unit 14.
IO setting support tool 33 supports the user to perform the setting by performing the setting generating or updating the data referred to during the execution of the program by program execution unit 31 according to the user operation received through input reception unit 11.
Builder 35 builds PLC program 371, IO setting support program 361, and 3D visualization program 28, thereby generating PLC simulator 260, IO setting support tool 33, and 3D visualizer 270 that are constructed with an executable code. When building PLC program 371, builder 35 incorporates and builds IO stub 393 associated with PLC program 371 to generate PLC simulator 260. When building 3D visualization program 28, builder 35 generates 3D visualizer 270 by incorporating and building the IO stubs 273 associated with 3D visualization program 28.
The environment for the support provided by IO setting support tool 33 described above, IO map 391 that can be provided or set through IO setting support tool 33, setting table 392, and the like will be described later.
Offline system 20 in
(e2. Simulation by Program Execution Unit)
Program execution unit 31 corresponds to the main constituent that executes PLC simulator 260 and 3D visualizer 270, namely, an execution engine. Referring to
PLC simulator 260 is a program estimating the behavior of robot 210 and conveyors 230, 240, and corresponds to a simulation program having the plurality of instructions included in PLC program 371. The plurality of instructions include an instruction group 371A including a motion instruction and a motion arithmetic instruction to control the behavior of conveyors 230, 240 included in PLC program 371, an instruction group 381A including a plurality of robot instructions to control the behavior of robot 210 included in PLC program 371, and an instruction of at least one peripheral device FB (Function Block) 391A generating the control instruction to control the peripheral device. Furthermore, the simulation program of PLC simulator 260 includes an instruction of IO stub 393 associated with peripheral device FB 391A. These instructions include instructions of a different linguistic system, such as instructions in a cyclic-executable language (for example, a ladder language) and instructions of a sequential-executable language (for example, an interpreted language). Program execution unit 31 includes an execution engine capable of executing programs of different languages.
Every time each instruction of PLC simulator 260 is executed based on input data 146 of IO map 391, instruction value V1 for servo motor drivers 531, 532 or robot controller 310 is generated and stored in IO map 391 as output data 145. As described above, input data 146 indicates data referred to (read) by PLC simulator 260 during the execution of the instruction, and output data 145 indicates data in which the execution result of the instruction is set. IO stub 393 includes the instruction code estimating the behavior of the IO device in conjunction with the operation of the peripheral device corresponding to peripheral device FB 391A. IO stub 393 is executed using the execution result (instruction) of the instruction of peripheral device FB 391A, thereby estimating the behavior of the IO device according to the instruction, generating the detection value based on the estimated behavior, and storing the detection value in IO map 391 as input data 146.
3D visualizer 270 includes an instruction group of IO stub 273 estimating drawing data generation unit 19 and the behavior of the IO device. Drawing data generation unit 19 includes a trajectory arithmetic operation 271 calculating the position of robot 210 and the position of the three-dimensional virtual space of conveyors 230, 240 based on output data 145 of IO map 391. IO stub 273 includes an interference detection arithmetic operation 272. When executed, trajectory arithmetic operation 271 detects (calculates) the position of the object in the three-dimensional virtual space. In the embodiment, trajectory arithmetic operation 271 includes an arithmetic instruction calculating the position of the three-dimensional virtual space of workpiece 232 on the conveyance surface of conveyors 230, 240 from the position information of conveyors 230, 240. Trajectory arithmetic operation 271 corresponds to an executable code of trajectory calculation program 303.
Interference detection arithmetic operation 272 of IO stub 273 detects the presence or absence of interference (collision, contact, and the like) between the objects from the position calculated by trajectory arithmetic operation 271. Specifically, interference detection arithmetic operation 272 compares the calculated position of workpiece 232 in the three-dimensional virtual space with the position of detection range 314 of sensor 6, and outputs detection value V2 based on the comparison result. For example, detection value V2 indicates “1” when the comparison result indicates that the position of workpiece 232 is within the detection range 314 (that is, with interference), and indicates “0” when the comparison result does not indicate that the position is within detection range 314 (that is, with no interference.). IO stub 273 sets detection value V2 to input data 146 of IO map 391 as detection value 61 of sensor 6.
In the next period, controller 10 refers to input data 146 including detection value 61 of sensor 6 to execute PLC simulator 260. Thus, in the next period, when sensor 6 detects that workpiece 232 reaches detection range 314, the arithmetic instruction estimating the behavior of the “pick and place operation” is started.
By periodically executing the simulation in this manner, input data 146 of IO map 391 is generated or updated by IO stubs 393, 273.
(e3. Generation of Drawing Data)
Drawing data generation unit 19 generates the data of the three-dimensional virtual space as illustrated in
(e4. Synchronization Processing)
Period generation unit 18 executes virtual time generation program 29 that generates signal ST. Period generation unit 18 outputs generated signal ST to other units. Each unit executes the processing or the program in synchronization with the period in which signal ST is output from period generation unit 18. Thus, the processing or the program of each unit of offline system 20 is executed in the period of signal ST or in synchronization with the period. The period of signal ST corresponds to a communication period of field network 2 of control system 1 in
Referring to
Simulation control program 21 of controller 10 outputs a start instruction to period generation unit 18 (step T3). Period generation unit 18 starts virtual time generation program 29 according to the start instruction. When activated, virtual time generation program 29 starts the output of signal ST and outputs the start instruction to PLC simulator 260 (step T4).
Program execution unit 31 starts PLC simulator 260 according to the start instruction. Thus, instruction value arithmetic processing 40 is performed (repetition processing SB1). Instruction value arithmetic processing 40 calculates the detection value by the calculation of instruction value V1 and the execution of IO stub 393. As indicated by “one-time loop=one control period” in
Referring to
In drawing update processing 50, drawing data generation unit 19 generates drawing data 301, and outputs the drawing data to display 38.
At this point, in the embodiment, drawing update processing 50 is performed in the period synchronized with the control period. Furthermore, in the embodiment, 3D visualizer 270 is started independently of (regardless of) the start of simulation control program 21. When receiving a start notification instruction notifying that PLC simulator 260 is started from program execution unit 31, 3D visualizer 270 starts an operation for receiving output data 145 including instruction value V1 from PLC simulator 260 through IO map 391 in order to generate drawing data 301. In addition, when receiving an end instruction notification notifying that PLC simulator 260 ends the simulation from program execution unit 31, 3D visualizer 270 ends the above receiving operation.
Drawing data generation unit 19 acquires instruction value V1 of each axis calculated by PLC simulator 260 from output data 145 of IO map 391 in the period synchronized with the control period based on signal ST (step SS3). Drawing data generation unit 19 calculates trajectory data 251, 252 by executing the trajectory calculation instruction using acquired instruction value V1, and generates the position of each object in the three-dimensional virtual space from calculated trajectory data 251, 252 and image data 253, 254 and drawing data 301 in order to draw the object based on the position. At this point, the interference between the objects in the three-dimensional virtual space is detected by executing IO stub 273 to execute interference detection arithmetic operation 272. For example, the presence or absence of the interference based on the position in the three-dimensional virtual space of the object of workpiece 232 on conveyor 230 and the object of detection ranges 314, 315 of sensor 6 is detected, and IO stub 273 sets detection value 61 (detection value V2) based on the detection result to input data 146 of IO map 391. Drawing data generation unit 19 outputs drawing data 301 to display controller 15 in order to update the image on display 38 (step SS4).
In
Processing of IO setting support tool 33 of the embodiment will be described.
With reference to
When IO setting support tool 33 is started, controller 10 executes IO setting support program 361. When IO setting support program 361 is executed, IO setting support tool 33 analyzes PLC program 371, extracts the IO variable (step S3), generates IO map 391 configured to be able to store the variable name and the data corresponding to each input variable of input data 146 in the extracted IO variables and the variable name and the data corresponding to each output variable of output data 145 in the extracted IO variables, and stores generated IO map 391 (step S5). IO setting support tool 33 starts IO stub generation tool 36 to execute the IO stub generation processing using IO map 391 (step S7). Controller 10 executes IO stub generation program 362 to implement IO stub generation tool 36.
(g1. IO Stub Generation Processing)
With reference to
IO stub generation tool 36 determines whether to receive the request for automatic IO stub generation based on the user operation from input reception unit 11 (step S15). When the request is not received (NO in step S15), the processing of step S15 is repeated. When the request is received (YES in step S15), IO stub generation tool 36 switches the screen of display 38 from the list screen in
The screen of
The screen in
In addition, the screen in
An example of a viewlist 390 is further illustrated on the right side of
IO stub generation tool 36 receives the designation of the type of the IO stub of each input variable from the user operation through the icon in
Three-dimensional virtualization processing for virtually constructing control system 1 in the three-dimensional virtual space is executed in step S20. Specifically, 3D visualizer 270 produces the data representing the three-dimensional virtual space in
When determining that button 661 is operated, IO stub generation tool 36 starts setting table editing program 363. Using setting table editing program 363, IO stub generation tool 36 edits setting table 392 according to the user operation, and stores edited setting table 392 (step S21).
IO stub generation tool 36 generates IO stub 393 of the designated input variable based on the information about setting table 392, and stores generated IO stub 393 (steps S23 and S25).
(g1-1. Exemplary Setting Table)
With reference to
Referring to
Menu 397 includes types of a plurality of editing operations (addition, pasting, display setting, and the like) and an identifier (3D disposition, no 3D disposition) of the table of the editing target as items. For example, when the user performs the designation operation on an item 3931 of menu 397, IO stub generation tool 36 receives the designation operation of item 3931, reads setting table 392 of “3D disposition” from the storage based on the received operation, and displays the content of read setting table 392 of “3D disposition” in area E2 of display 38.
For example, setting table 392 in
IO stub generation tool 36 causes 3D visualizer 270 to generate a 3D image 396 based on the content of the setting item corresponding to each input variable of setting table 392, and causes display 38 to display generated 3D image 396.
In
Referring to
For example, setting table 392 in
For example, operation condition 3911 has a waiting time 3927 and a detection condition 3928. For example, waiting time 3927 is based on a required time from the start of gripping of workpiece 232 by robot arm 214 to the completion of the suction. Detection condition 3928 includes a parameter value for detecting the suction completion or the suction release and a conditional expression. Detection condition 3928 and the operation of IO stub 393 in
(Position.Z≤290) and (Trig1=TRUE). A variable Position.Z indicates the position (more specifically, the position of robot arm 214) of robot 210, and a variable Trig1 indicates, for example, an instruction value indicating the start of the gripping. Accordingly, when IO stub 393 of pressure switch 9 is executed and when it is determined that condition 3928 is satisfied, the output (corresponding to detection value 91) indicating arrival (suction release) is derived from IO stub 393 after time indicated by waiting time 3927 elapses.
On the screen in
(g1-2. Editing of Setting Table)
Editing processing when editing button 398 is operated will be described. IO setting support tool 33 provides an environment in which setting table 392 can be edited to the user. With reference to
IO setting support tool 33 determines whether the instruction to display the setting table is received from the user based on the output of input reception unit 11 (step S31).
While the display instruction is not received (NO in step S31), IO setting support tool 33 repeats the processing in step S31. When determining that the display instruction is received (YES in step S31), IO setting support tool 33 displays setting table 392 of storage 300 on display 38 as illustrated in
IO setting support tool 33 determines whether the user operates editing button 398 based on the output from input reception unit 11 (step S35). When determining that the operation of editing button 398 is not received (NO in step S35), IO setting support tool 33 determines whether the operation instructing the end of the editing is received from input reception unit 11 (step S39). When determining that the operation instructing the end of the editing is not received (NO in step S39), IO setting support tool 33 returns to the processing of step S35. When determining that the instruction of the editing end is received (YES in step S39), IO setting support tool 33 ends the editing processing.
When determining in step S35 that the operation of editing button 398 by the user is received (YES in step S35), IO setting support tool 33 edits setting table 392 according to the user operation received from input reception unit 11 (step S37). When the editing is performed, the processing returns to step S33, and IO setting support tool 33 displays the content of edited setting table 392. At this point, IO setting support tool 33 may control 3D visualizer 270 and display 38 so as to display 3D image 396 based on the content of edited setting table 392 (step S34).
In step S37, for example, when editing button 398 related to operation condition 3911 is operated by the user, IO setting support tool 33 displays a window 399 in
In
IO setting support tool 33 executes the setting in order to generate or update the data referred to during the execution of PLC simulator 260. Specifically, in the IO stub generation processing (step S23 in
The IO device that can set (generate) corresponding IO stub 393 based on operation condition 3911 belongs to second group 142. Second group 142 includes a group 143 of the IO devices in which the application is linked with the operation of the peripheral device and a group 144 of other IO devices. For example, group 143 includes air cylinder 8 as the peripheral device and limit switch 7 linked with the operation of an air chuck associated with air cylinder 8.
Group 144 includes the IO device in which the application switches ON and OFF from an invisible phenomena such as pressure or force magnitudes or an inspection result of workpiece 232. Examples of the IO device include pressure switch 9, a force sensor, and a smart sensor. Group 144 may also include the IO device such as a label peeling machine and an automatic screw feeder that switch ON and OFF depending on a supply state of the workpiece handled by the device.
In the embodiment, the IO devices are classified into groups 141, 143, and 144 due to a difference in detection operation, and each of the IO stub implementation methods (1) to (3) is provided for each group. The type of the IO device or the peripheral device belonging to each group is not limited thereto.
(h-1. IO Stub Implementation Method (1))
A method for implementing IO stub 273 will be described. IO stub 273 can be set (generated) based on the position in the three-dimensional virtual space. Specifically, when IO stub 273 is executed, IO stub 273 performs the setting for generating or updating the data associated with, for example, the object (object in detection ranges 314, 315) corresponding to sensor 6 disposed in the three-dimensional virtual space.
According to setting table 392 in
(h-2. IO Stub Implementation Method (2))
A method for implementing the setting generating or updating the data referred to during the execution of the simulation program by executing the setting based on operation condition 3911 will be described below.
A timing chart in
An example of IO stub 393 generated by the IO stub implementation method (2) will be described.
(h-3. IO Stub Implementation Method (3))
Another method implemented based on operation condition 3911 as the setting generating or updating the data referred to during the execution of the simulation program will be described below.
After conveyance instruction 1136 is output, an instruction code 1143 of IO stub 393 in
A detection duration time indicated by a parameter 202 in
According to the embodiment, IO setting support tool 33 executes the setting generating input data 146 referred to during the execution of PLC simulator 260, namely, during the execution of the simulation of the PLC program 371 or updating input data 146 in each control period, for example, the generation of IO stubs 273, 393. Accordingly, during the execution of the simulation, the setting based on the position on the three-dimensional virtual space or the setting based on the operating condition such as operation condition 3911 is selectively executed according to IO stub type 383 (“3D disposition”, “no 3D disposition”, “link”) in
In the embodiment, offline system 20 may provide an environment in which PLC program 371 is debugged. Specifically, tool execution unit 34 reads PLC program 371 from storage 300, and displays the read program on display 38 through display controller 15. The user can perform debugging by editing PLC program 371 displayed on display 38. For example, the debugging includes the editing of PLC program 371 based on the simulation result.
This simulation result can be made different depending on the IO data including input data 146 referred to during the simulation. Input data 146 is generated or updated when IO stubs 273, 393 are executed during the simulation. Accordingly, the user can easily change the simulation result by changing the value of detection range 3926 or operation condition 3911 through IO setting support tool 33. The user can edit or debug PLC program 371 based on each simulation result such that PLC program 371 becomes optimal for control system 1.
Furthermore, in the embodiment, by changing the value (values of “link”, “3D disposition”, “no 3D disposition”, “link”, and the like) of IO stub type 383, the user can selectively switch the setting generating or updating input data 146 referred to during the execution of the simulation program between the setting based on the position on the three-dimensional virtual space by IO stub 273 and the setting based on operation condition 3911 by IO stub 393.
In addition, when IO stubs 273, 393 are generated, the user only needs to perform the operation for setting the parameter such as detection range 3926 indicating the operation of the IO device corresponding to IO stubs 273, 393 or operation condition 3911 in the environment provided by IO setting support tool 33.
Accordingly, man-hours for producing the program debugging PLC program 371 can be reduced by providing the IO setting support tool 33.
Although the configuration in which CPU 2 of simulation device 100 executes the program to provide the function has been exemplified in
In addition, simulation device 100 may include a plurality of processors such as CPU 2. In this case, each unit in
Offline system 20 includes CPU 2, ROM 3, and RAM 4, and controls each component according to information processing. For example, the storage that stores the program of each component is an auxiliary storage device such as HDD 5 or a solid state drive, and stores PLC simulator 260 and 3D visualizer 270 executed by program execution unit 31, virtual time generation program 29, simulation control program 21, and the like.
Storage medium 92 is a medium that accumulates information such as the program by electrical, magnetic, optical, mechanical, or chemical action such that a computer, other devices, a machine, or the like can read the information such as the recorded program. CPU 2 of simulation device 100 may acquire each program of storage 300 described above from storage medium 92.
The present disclosure includes the following technical ideas.
(Configuration 1)
A simulation device (200) that estimates a behavior of a system (1) including a control device (200) that controls a target (230, 240, 210), the simulation device including:
program execution means (31) configured to execute a simulation program (260) estimating the behavior;
three-dimensional virtualization means (270) configured to virtually construct the system in a three-dimensional virtual space;
setting means (31, 273, 393) configured to execute setting generating or updating data (146) referred to during the execution of the simulation program; and
reception means (11) configured to receive a user operation to the simulation device,
wherein the setting means selectively executes setting based on a position (3926) in a three-dimensional virtual space or setting based on an operating condition (3911) according to the user operation.
(Configuration 2)
The simulation device described in the configuration 1, wherein the system includes a sensor (6) that performs a detection operation for the control, and
the setting based on the position in the three-dimensional virtual space includes a setting generating or updating data associated with an object (3961, 3962) corresponding to the sensor arranged in the three-dimensional virtual space.
(Configuration 3)
The simulation device described in the configuration 2, wherein the three-dimensional virtualization means generates drawing data (301) for visualizing the object corresponding to the sensor disposed in the three-dimensional virtual space in the three-dimensional virtual space and drawing the object on a display (38).
(Configuration 4)
The simulation device described in any one of the configurations 1 to 3, wherein the system includes: a sensor (7) that performs a detection operation for the control; and
a peripheral device (8) that operates in association with the control,
the detection operation of the sensor is linked with the operation of the peripheral device, and
the operation condition includes a condition (3928) based on the detection operation of the sensor linked with the operation of the peripheral device.
(Configuration 5)
The simulation device described in any one of the configurations 1 to 3, wherein the setting generating or updating the data executed by the setting means includes a program (273, 393) corresponding to a parameter (3917, 3927, 3937) received by the user operation.
(Configuration 6)
The simulation device described in any one of the configurations 1 to 5, wherein the three-dimensional virtualization means generates the drawing data (301) for visualizing motion of the target during the execution of the simulation program in the three-dimensional virtual space and drawing the motion on the display (38).
(Configuration 7)
A simulation method executed by a computer (100) that estimates a behavior of a system (1) including a control device that controls a target, the simulation method including:
virtually constructing the system in a three-dimensional virtual space (S20); and
executing setting generating or updating data referred to during execution of a simulation program (S23),
wherein in executing the setting, setting based on a position in the three-dimensional virtual space or setting based on an operating condition is selectively executed according to a user operation to the computer.
(Configuration 8)
A program (361) causing a computer (100) to execute the simulation method described in the configuration 7.
It should be considered that the disclosed embodiment is an example in all respects and not restrictive. The scope of the present invention is defined by not the description above, but the claims, and it is intended that all modifications within the meaning and scope of the claims are included in the present invention.
Number | Date | Country | Kind |
---|---|---|---|
2019-092669 | May 2019 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2020/009128 | 3/4/2020 | WO |