• No results found

Chapter 5 Case studies

5.1 Study I: Single mobile robot control

5.1.2 Application development

The OPC tag definitions for the material handling application and the algorithm development are listed in Table 5. Since a single mobile robot was used in the system, the tags associated with the robot are prefixed by “r01_”, whilst the tags associated with task 1 and 2 are prefixed by “t01_” and “t02_” respectively. The x-y coordinate related tags pertain to 1) the robot’s current position and 2) the goal position of the task, either its source (input buffer) or destination (material storage) location. The r01_status tag was used to determine whether the robot is available for operation on a particular task, and the r01_tcurr tag informs the user program and SCADA application on the current task that the robot is working on.

The task related tags are split into three categories: input, output, and supply chain. The buffer levels are calculated as a percentage, defined by Equation 5.1, where x is the task number and the definitions of the variables being listed in Table 5.

𝑡𝑥𝑖𝐵𝐿 = 𝑡𝑥𝑖𝐵𝑀

𝑡𝑥𝑖𝐵𝐶 ∗ 100 (5.1)

The reason for including tags that pertain to the supply chain was to make the application more relevant to an actual scenario, where these variables do play a vital role in determining the type of product (or task) that is more crucial to a manufacturer at any particular time.

Table 5. OPC tag definitions for Case Study I.

OPC tag name Tag description Data type Unit

r01_xpos robot-01 x position decimal m r01_ypos robot-01 y position decimal m r01_status robot-01 idle, busy signal binary

r01_tcurr robot-01 current task number unsigned integer r01_currloc robot-01 current location unsigned

integer r01_prevloc robot-01 previous location unsigned

integer

r01_xgoal robot-01 x goal position decimal m r01_ygoal robot-01 y goal position decimal m r01_loadcap robot-01 load capacity unsigned

integer r01_load robot-01 current load unsigned

integer r01_loadstat robot-01 loading/offloading status

t01_iBM task-01 input buffer number of material unsigned integer

mat t01_iBL task-01 input buffer level unsigned

integer

% t01_iFr task-01 input fill rate decimal pr/hr t01_iBC task-01 input buffer capacity unsigned

integer

mat t01_qSM task-01 output buffer number of material unsigned

integer

mat t01_qSL task-01 output storage level unsigned

integer

pr t01_qFr task-01 output fill rate decimal pr/hr t01_qSC task-01 output storage capacity unsigned

integer

mat t01_sCDr task-01 supply chain consumer demand rate decimal pr/hr t01_sPPi task-01 supply chain profit per product index decimal

t01_sPD task-01 supply chain current product demand unsigned integer

pr t02_iBM task-01 input buffer number of material unsigned

integer

mat t02_iBL task-02 input buffer level unsigned

integer

pr t02_iFr task-02 input fill rate decimal pr/hr t02_iBC task-02 input buffer capacity unsigned

integer

pr t02_qSM task-02 output buffer number of material unsigned

integer

mat t02_qSL task-02 output storage level unsigned

integer

pr t02_qFr task-02 output fill rate decimal pr/hr t02_qSC task-02 output storage capacity unsigned

integer

mat t02_sCDr task-02 supply chain consumer demand rate decimal pr/hr t02_sPPi task-02 supply chain profit per product index decimal

t02_sPD task-02 supply chain current product demand unsigned integer

The Python application algorithm is represented by the block diagram shown in Figure 5.1, and the source code is documented in Appendix G1. The variables presented in the diagram are the OPC tags defined in Table 5, with the exception of the prefix text. The algorithm was executed at regular intervals for task 1 and task 2, hence the TWi output shown in the figure is the weighted value for each task. A task becomes a higher priority when its result becomes more negative than the other task(s). For example, if Tw1< Tw2 then task 1 will eventually be prioritised by the robot as soon as it has completed its current task. The algorithm was developed to consider the level of the input buffer and its capacity, the level of the output storage, the output fill rate and consumer demand rates, and the profit per product index.

Figure 5.1. Control algorithm to determine the robot task priority.

The control algorithm was executed within the matHand_algo.py program (Appendix G1), which also contains function calls for the robot motion commands for each task, the initialising and updating of local variables and tags, and the execution of a simulation program named matHand_sim.py (Appendix G2). The structure and interaction of the programs is explained through the flow diagram in Figure 5.2.

The purpose of the simulation program was to establish a plant replica system where the generated data can be used to test the algorithm and essentially, the functionality of the framework. The code functions in the simulation program were used to fill the input buffers at pre-defined fill rates, and empty them whenever the robot was at the source location to

load material. The output storage filled when the robot was at the destination location and material was being offloaded. This data is visualised by the SCADA mimic for the application, shown in Figure 5.3.

Figure 5.3. SCADA mimic for the material handling application of Case Study I.

The development of the application program involved the use of the mapping of local variables to OPC tags, a Python programming feature of the framework that was discussed in section 4.7.1. The program also includes the development of the recordData function, as shown in Figure 5.2, which stores the buffer levels and the robot’s x-y coordinate data for use in the presentation of the simulation results.

Finally, the robMotion function code sets the robot goal location coordinates, depending on the task number determined by the algorithm. The low-level motion commands are actually handled by ROS, so the end-user’s high-level Python program is modular, with the focus being on simulating artificial intelligent algorithms.