This is an open access article under the CC BY license: Al-Khwarizmi Engineering Journal Al-Khwarizmi Engineering Journal ISSN (printed): 1818 – 1171, ISSN (online): 2312 – 0789 Vol. 20, No. 3, September, (2024), p.p. 51-58 A Proposed Control Algorithm for Automated Storage and Retrieval System Ali R. Hameed* and Osamah F. Abdulateef ** *,** Automated Manufacturing Engineering Department, Al-Khwarizmi College of Engineering, University of Baghdad, Baghdad, Iraq *Email: ali_mfcstd@kecbu.uobaghdad.edu.iq (Corresponding Author) **Email: drosamah@kecbu.uobaghdad.edu.iq (Received 30 May 2023; Revised 30 August 2023; Accepted 28 September 2023; Published 1 September 2024) https://doi.org/10.22153/kej.2024.09.002 Abstract This paper introduces an algorithm that enhances open-loop stepper motor motion systems. The objective is to close the loop with fewer hardware requirements, increasing flexibility in speed and weight capacity for storage and retrieval (S/R) machines and reducing cost. The method involves integrating the algorithm into a distributed control system, minimizing hardware, processing power, and maintenance shutdowns. The results highlight the algorithm’s effectiveness. Adjusting torque/speed parameters mitigates motor stalling in S/R machines successfully, leading to improved efficiency. Unlike commercial S/R machines, this revolutionizes closed-loop stepper systems, making them more efficient, relatively cost-effective as well as practical for educational purposes. Keywords: ASRS; S/R machine; automated storage system; closed-loop control; stepper motors; single deep 1. Introduction Automation plays an important role in the development of an industrial society [1]. Different types of automation systems have been utilized in the industrial sector, indicating the handiness and the ability to improve the different manufacturing processes as stated in [2-4]. One of the most common applications that utilize different automation techniques is the storage and retrieval machine [5]. A storage and retrieval machine (S/R) is one that performs the action of transporting goods between pre-defined locations (storage keeping units,) inside a multi-storage system or between storage locations and unloading/loading areas. The instructions for these actions are given by a human through a certain interface or smart storage management system [6]. Automated storage systems are widely used in many applications, including warehouses, stores, ports and pharmacies [6]. Many benefits can be obtained from the automation of AS/RS systems, such as savings in terms of labour costs and floor space, the ease and the speed of handling items and improved throughput level[7]. Some trends to accomplish this system have been documented in the literature. These trends include the main drawbacks registered in the system, which are the high initial cost and low flexibility in terms of layout and size as stated in [8]. This system is also considered a complex system in terms of management and design considerations for safety, durability, throughput and robustness. Applications of S/R machines must have closed-loop motion systems that prevent any damage that may be caused by an external effector or overweight object, system fault or cumulative position error. In these cases, severe damage may also be caused to the system’s mechanism, and the carried part may be affected, resulting in losses in maintenance cost and shutdown times [9,10]. Many studies have focused on the control of automated storage and retrieval systems. For example, Ekren et al. [11] suggested an analytical file:///C:/Users/IRAQ/Desktop/ali_mfcstd@kecbu.uobaghdad.edu.iq mailto:drosamah@kecbu.uobaghdad.edu.iq https://doi.org/10.22153/kej.2024.09.002 Ali R. Hameed Al-Khwarizmi Engineering Journal, Vol. 20, No.3, P.P. 51- 58(2024) 52 model for first-in-first-out-based scheduling rules to calculate the mean and variation of shuttle and elevator running times and assess storage system performance. Wang et al. [12] presented a mathematical model for time sequences based on the movement traits of shuttles and elevators. The shuttle and elevator task scheduling problem is converted into an assembly line parallel job problem to create the scheduling task queue model within the given time frame through the study of the mathematical model. The job scheduling problem’s multi-objective optimization function is also solved using the Pareto optimization approach based on an elitist, non-dominated sorting genetic algorithm. Yang et al. [13] examined access and placement allocation scheduling problems for products. Two related models (integer programming model and dynamic programming model) are used to address this issue to maximize the operational efficiency of the system. In a similar AS/RS, Yang et al. [14] used a hybrid genetic algorithm-based on polychromatic sets theory to resolve the scheduling issue of storage and retrieval. The results of the trials demonstrate that this hybrid genetic algorithm has certain benefits in dealing with the scheduling issue of storage and retrieval. This hybrid approach considerably decreases the computing time needed to identify the running path in addition to reducing cycle times. Yan et al. [15] introduce a multi- objective scheduling optimization model for multi- aisle AS/RS systems, improving upon previous models. They presents an innovative NSABC algorithm, combining NSGA-II and ABC techniques, with customized solution methods. Extensive testing shows that NSABC outperforms other algorithms in AS/RS scheduling optimization. Kang [16] focuses on optimizing an autonomous vehicle-based storage and retrieval system with transfer robots in automated warehouses. The goal is to reduce reshuffling, which occurs when a retrieved bin is deep in a stack, by planning an efficient order-picking sequence. Rather than exhaustively exploring all possible sequences, the study introduces a greedy algorithm that provides a heuristic solution. Alnahhal et al. [17] examine the effect of the input/output area location on ASRS total travel time and suggest a two-step preparation strategy. They verified their work using a simulation model, which resulted in an enhancement of throughput by 21% to 28%, depending on storage height and order quantity. Ecem et al. [18] studied the flexible travel of autonomous mobile robots (AMRs) and developed intelligent deadlock and collision prevention algorithms on agent-based modelling that AMR agents can make smart decisions when interacting, resulting in improvement of up to 39% in the storage system flexibility compared to a non- flexible design. This paper introduces a closed-loop algorithm designed to enhance the load capacity versatility of the S/R machines. The algorithm achieves this by automatically determining speed and acceleration levels, effectively addressing the issue of stalling and guaranteeing the attainment of the desired position. The primary focus of the algorithm lies in optimizing the Y-axis controller, given its significant load-bearing role in the transportation of goods between storage racks and the loading/unloading area. 2. Proposed Control Algorithm The proposed algorithm is applied on a single deep S/R machine, which depends on three cartesian axes, X, Y and Z (horizontal, vertical and depth, respectively), as shown in Fig. 1. Fig. 1. S/R machine prototype. The designed AS/RS system efficiently converts the rotational motion of three motors into precise linear movements along the X, Y and Z axes, enabling seamless material retrieval, relocation, and storage based on specific data inputs. For rapid X and Z-axis movements, the system relies on belt pulley mechanisms, while the Y-axis, prioritizing precision and load-lifting strength, employs a lead screw mechanism. The AS/RS system has compact dimensions of 1000 x Ali R. Hameed Al-Khwarizmi Engineering Journal, Vol. 20, No.3, P.P. 51- 58(2024) 53 1000 x 500 mm, making it highly portable and space efficient. The frames of the AS/RS system are constructed using carbon steel, ensuring durability and stability, while the cart frame utilizes lightweight aluminium to enhance its mobility. A distributed control system (DCS) is utilized in which a separated microcontroller is used to control each of the axes because of the slow processing capabilities of the controllers used. The vertical movement is done by a NEMA 23 bipolar hybrid stepper motor with 3.6N.m holding torque. The voltage supplied is 48-volt DC and draws 3.5 Amp per phase. The motor is indirectly coupled with a timing belt to a leadscrew-nut mechanism. During the operation of the machine, the stepper motor may stall (i.e. synchronization is lost between the motors’ rotor and stator by one step or more) when lifting a higher weight (i.e. goods) with a specific set speed. The algorithm can deal with a range of goods weights without an identification process either manually or measuring it using weight sensors in which the algorithm automatically adjusts the speed and acceleration along with the item weight to alter motor torque/speed output as needed according to the following equation: 𝑃 = 𝑇 × 𝜔 where 𝜔 = 𝜋 30 ∙ 𝑛 , where P is mechanical power, ω is the angular frequency of the motor shaft and n is the rotational speed of the motor’s rotor. The algorithm engages the controller which is responsible for controlling the actuators (i.e., motion axis) and receives instructions and feedback axis current states to a main controller. The overall process of the S/R machine used in this article is illustrated in Fig. 2. First, the process initialises by obtaining input from a graphic user interface (GUI) application. Next, it transfers the coordinates of the target position to the X- and Y- axes controller via a USB interface, then the actuators start to move towards the target. Finally, when the target is reached, the controllers returns feedback to the GUI to begin the pick or drop process. A GUI was written using C-Sharp programming language in which the parameter of the desired storage keeping unit (SKU)) has been set and the required process involved has occurred as shown in Fig. 3. Fig. 2. S/R Machine overall process flow. The position of the desired SKU was identified, in which each SKU has its own (X-Y) position and item depth (Z coordinate). Each sub-controller for the X-Y axis has its own control path to attain the required level and is demonstrated in Fig. 4. After receiving the required position from the main controller, the sub-controller starts calculating the required speed, acceleration and number of pulses to reach the setpoint. The number of pulses required (np) is calculated according to the following formula: 𝑛𝑝 = 𝑛𝑠𝑥𝑟𝑔 𝑝 , where ns represents the number of pulses per revolution of the motor, x is the relative linear position required, is the gear ratio or the number of motor turns for every single turn of the screw and p is the pitch of the screw. Feedback information for the carriage position is fed through a buffer circuit attached to a quadrature encoder. A Ali R. Hameed Al-Khwarizmi Engineering Journal, Vol. 20, No.3, P.P. 51- 58(2024) 54 pulse train of the calculated parameters is fed to the stepper driver through which the stepper starts to rotate accordingly while the encoder captures the motion and the buffer keeps updating the real position value while the sub controller updates the error between the target and real position to compensate the error by generating control signals according to the error until it is eliminated. Fig. 3. Graphic User Interface for the S/R machine Fig. 4. Control path of the proposed system. The algorithm requires a series of sequential steps. Initially, data, which include information regarding the desired position, are collated. Subsequently, the microcontroller commences calculating the required number of pulses and compares the collected data with the current reference position. The positional error obtained from the feedback signal (shown in Fig. 5-a) is then determined as the disparity between the calculated pulses and the initial position. The pulses that represent the error are subsequently transmitted to the stepper driver as shown in Fig. 5-b. The generated pulse frequency determines the motor revolutions per minute (rpm), and a higher frequency leads to a higher rpm. The rate at which the frequency changes represent the motor acceleration. Speed is divided into four zones, each with a certain speed different from the others. The first zone operates with a speed of 350 rpm and an acceleration of 500 rev/min2 and can lift 0.8kg of goods. The second zone has a speed of 320 rpm and an acceleration of 250 rev/min2 and can handle up to 2kg. The third zone works in 190 rpm and an acceleration 100 rev/min2 and can handle up to 3.75kg . The last zone has the slowest speed of 100 rpm and an acceleration of 50 rev/min2 and can handle up to 7.5kg. The algorithm designed to shift the working zone automatically depending on the error in position measured by the encoder buffer circuit. When the error exceeds half the value of the required target position after the first motion command fails to reach the target, the zone is shifted to the next zone and a new command is sent. The shifting process continues until the target Direction Pulse train Quadrature encoder Buffer counte r µController calculates:  error  Speed  Acceleratio Stepper driver Stepper Motor carriage position Position Pulse Target position Ali R. Hameed Al-Khwarizmi Engineering Journal, Vol. 20, No.3, P.P. 51- 58(2024) 55 position is reached. In case the target is not obtained after the fourth zone because the weight exceeds the limit or due to mechanical malfunction, the algorithm feedback alarm signals the main controller to stop the process and solve the problem. 3. Results and Discussion The proposed algorithm provides a low-cost solution for the stalling issue that occurs when loading a stepper motor with a higher weight at a specific speed. In real applications, this machine may deal with a range of goods with different weights, and speed is negatively proposed to the output torque. The algorithm solved this issue automatically without the need to add a weight sensor or adjust the speed of the motor manually. The positional error successfully indicates the stall when it occurs. Fig. 5. Voltage-time signals for a motion command captured with a digital analyzer, (a) feedback from encoder (b) calculated pulse train. The algorithm was applied to the vertical axis Y to transport different goods weights (0.4 to 7.5 kg) from the loading/unloading area to three randomly chosen SKUs ( 3,5, and 8). The storage layout is shown in Fig. 6. Fig. 6. Layout of the storage racks used for obtaining results for the current algorithm. The path of motion to reach SKU 3 with a 5-kg payload is shown in Fig.7 as an example. The SKU height is the red line, and the path shows the sequence to drop (a) and pick (b) an item for the store and retrieve operations. The results are shown in Table 1. A specific colour was designated for each zone: pink, blue, yellow and green correspond to Zones 1 to 4, respectively. The weights being transported are listed in the left column, while the time taken for each weight to be delivered to the various SKUs is recorded in the remaining three columns. The transport time for SKU 8 is short compared to SKU 5 and 3 because of the relatively short vertical distance. The effect of weight change does not appear to be significant because the distance is too short to allow the stepper to reach the maximum speed of the current zone. Thus, it does not need to proceed to the next zone because of acceleration, the same result is supposed to appear in all SKUs with the same storage level. Ali R. Hameed Al-Khwarizmi Engineering Journal, Vol. 20, No.3, P.P. 51- 58(2024) 56 Table 1, Experimental results of different weights being transformed from loading/unloading unit to SKU 3, 5 and 8 with zones and consumed time. Object Weight (Kg) The time interval for SKU 8 (Sec) The Time interval for SKU 5 (Sec) The time interval for SKU 3 (Sec) 0.4 10.58 14 20 0.8 12.36 18.23 22.8 0.9 12.41 18.5 22.9 1.2 12.89 18.72 23.4 2 13.22 18.89 24.2 2.5 13.52 18.92 24.8 3.75 15.2 19.2 28.5 5 16.1 19.4 32.8 6.25 16.8 23.55 34.8 7.5 18.2 32 38.2 For SKU 5 and 3, the effect of the weight appears to be significant because the motor reaches the maximum speed of the current zone, causing the stall to occur. Thus, the algorithm proceeds to the next zone with less speed and more torque along with the associated weight range and completes the task successfully. The disadvantage of this algorithm is represented as an instability in the storage system throughput because of the change in goods weight that becomes obvious when comparing the time consumed to transport different goods weight for the same SKU. Fig. 7. motion path to reach SKU 3 in a) Store, b) Retrieve cycles. 4. Conclusion Different goods weights are transported between storage racks in most applications of the S/R machines. Thus, an open loop stepper motor system that drives the linear axis of the machine is exposed to stall during speed increase at the beginning of motion, particularly when carrying weight at certain speeds that exceed the feasible region of the torque speed curve of the stepper motor. These stalls may cause severe damage to the machine mechanism and increase system downtime. The proposed algorithm addressed the issue automatically without a weight sensor. It successfully prevented the effect by closing the loop with a position sensor and manipulating the working speed and acceleration of the stepper as needed rather than fixing their values and dividing them into four zones. Therefore, the proposed algorithm has the ability to handle a range of weights without stalling. This algorithm can be applied to any application that uses a stepper motor and the best zones with the appropriate hardware size and permissible load range. However, this method affects the throughput prediction of the AS/RS because the weight is changed. Ali R. Hameed Al-Khwarizmi Engineering Journal, Vol. 20, No.3, P.P. 51- 58(2024) 57 5. Reference [1] S. S. Khaleel, M. Y. Salloom, and A. M. Shammari, "Arduino-Based Controller for Sequence Development of Automated Manufacturing System," Al-Khwarizmi Engineering Journal, vol. 16, no. 3, pp. 22-33, 2020, doi: 10.22153/kej.2020.07.001. [2] I. K. K. Nayyef and A. Z. M. Shammari, "Cloud Manufacturing framework for controlling and monitoring of machines," Al- Khwarizmi Engineering Journal, vol. 16, no. 4, pp. 11-18, 2020, doi: 10.22153/kej.2020.09.002 [3] F. F. Mustafa, O. Hussein, O. F. Fakhri, and A. H. Sabri, “Design and development of high-accuracy machine for wire bending”, Eastern-European Journal of Enterprise Technologies, vol. 5, no. 1 (107), pp. 29–35, 2020. https://doi:10.15587/1729- 4061.2020.202184. [4] W. T. Abbood, O. I. Abdullah, and E. A. Khalid, "A real-time automated sorting of robotic vision system based on the interactive design approach," International Journal on Interactive Design and Manufacturing (IJIDeM), vol. 14, no. 1, pp. 201-209, 2020/03/01 2020, doi: 10.1007/s12008-019- 00628-w. [5] M. Vasili, S. H. Tang, and M. Vasili, "Automated storage and retrieval systems: a review on travel time models and control policies," Warehousing in the Global Supply Chain: Advanced Models, Tools and Applications for Storage Systems, pp. 159- 209, 2012. [6] B. Y. Ekren and S. S. Heragu, "A new technology for unit-load automated storage system: Autonomous vehicle storage and retrieval system," in Warehousing in the Global Supply Chain: Advanced Models, Tools and Applications for Storage Systems: Springer, 2012, pp. 285-339 [7] H. M. Hameed, K. A. Al Amry, and A. T. Rashid, "The automatic storage and retrieval system: an overview," International Journal of Computer Applications, vol. 975, p. 8887, 2019. [8] X. Fu and Y. Bai, "Operation Management Framework Recovery of a Failed Autonomous-Steerable-Vehicle Storage and Retrieval System," 2016 8th International Conference on Intelligent Human-Machine Systems and Cybernetics (IHMSC), Hangzhou, China, 2016, pp. 330-334, doi: 10.1109/IHMSC.2016.29. [9] R. Sharma, S. Navtake, and P. Chaudhari, "Automatic Material Storage and Retrieval System using PLC and SCADA," vol, vol. 13, pp. 1361-1365, 2017. [10] J. Q. Zhang, F. M. Bao, and M. H. Li, "PLC Control System Design for Automated Storage and Retrieval System," Applied Mechanics and Materials, vol. 128, pp. 950- 955, 2012 [11] B. Y. Ekren, A. Akpunar, Z. Sari, and T. Lerher, "A tool for time, variance and energy related performance estimations in a shuttle- based storage and retrieval system," Applied Mathematical Modelling, vol. 63, pp. 109- 127, 2018. [12] Y. Wang, S. Mou, and Y. Wu, "Task scheduling for multi-tier shuttle warehousing systems," International Journal of Production Research, vol. 53, no. 19, pp. 5884-5895, 2015. [13] P. Yang, L. Miao, Z. Xue, and L. Qin, "An integrated optimization of location assignment and storage/retrieval scheduling in multi- shuttle automated storage/retrieval systems," Journal of Intelligent Manufacturing, vol. 26, pp. 1145-1159, 2015. [14] Z. Yang, L. Wang, Y. Cai, and K. Kimie, "A polychromatic sets theory based algorithm for the input/output scheduling problem in AS/RSs," Evolutionary Intelligence, vol. 12, pp. 333-340, 2019. [15] X. Yan, Z. Zhang, Q. Liu, C. Lv, L. Zhang, and S. Li, "An NSABC algorithm for multi- aisle AS/RS scheduling optimization," Computers & Industrial Engineering, vol. 156, p. 107254, 2021. [16] C. Kang, "An order picking algorithm for vertically stacked and top-retrieval storage systems," ICIC Express Letters, vol. 15, no. 9, pp. 991-997, 2021. [17] M. Alnahhal, B. Salah, and R. Ahmad, "Increasing Throughput in Warehouses: The Effect of Storage Reallocation and the Location of Input/Output Station," Sustainability, vol. 14, no. 8, p. 4611, 2022. [18] E. E. Turhanlar, B. Y. Ekren, and T. Lerher, "Autonomous mobile robot travel under deadlock and collision prevention algorithms by agent-based modelling in warehouses," International Journal of Logistics Research and Applications, pp. 1-20, 2022 https://doi:10.15587/1729-4061.2020.202184 https://doi:10.15587/1729-4061.2020.202184 (2024) 51-58، صفحة 3، العدد20مجلة الخوارزمي الهندسية المجلدعلي رشاد 58 سيطرة مقترحة لمنظومة الخزن واالسترداد المؤتمتةخوارزمية علي رشاد*، اسامة فاضل عبد اللطيف** *،**قسم هندسة التصنيع المؤتمت/ كلية الهندسة الخوارزمي/ جامعة بغداد/ العراق ali_mfcstd@kecbu.uobaghdad.edu.iq*البريد االلكتروني: drosamah@kecbu.uobaghdad.edu.iq**البريد االلكتروني: المستخلص ق من خالل اغال لمفتوحةاتقدم هذه الورقة البحثية خوارزمية مبتكرة تهدف الى تحسين أداء نظام حركة المحرك ذو الخطوات الذي يعمل بنظام الحلقة ها ألجهزة بلمسموح الحلقة باستخدام أجهزة ذات كلفة معقولة، تحقق الخوارزمية المقترحة مستوى اعلى من المرونة من حيث السرعة ومدى االوزان ا المستخدم. من خالل ، حيث تعمل وحدات تحكم متعددة معا لتلبية متطلبات(DCS)الخزن/االسترداد. تم تصميم الخوارزمية للعمل ضمن نظام تحكم موزع ن حيث خدام وفعال ماالست هلتقليل متطلبات األجهزة وقوة المعالجة والتوقف المحتمل بسبب األعطال و تكاليف الصيانة. توفر الخوارزمية المقترحة حال س آلت الطاقة في ا استهالكالتكلفة. باإلضافة الى ذلك تعالج الخوارزمية النسبة بين عزم الدوران/ السرعة للتعويض عن مشاكل الوزن الزائد المحتملة و ركة ذات مل أنظمة الحعي طريقة بإمكانية احداث ثورة فالخزن/االسترداد وبالتالي تحسين كفاءتها االجمالية. بفضل ميزاتها الفريدة، تتمتع هذه الخوارزمية .المحركات ذات الخطوات التي تعمل بنظام الحلقة المفتوحة، مما يجعلها اكثر كفاءة وفعالية من حيث التكلفة file:///C:/Users/IRAQ/Desktop/ali_mfcstd@kecbu.uobaghdad.edu.iq mailto:drosamah@kecbu.uobaghdad.edu.iq 1. Introduction 2. Proposed Control Algorithm 3. Results and Discussion 4. Conclusion 5. Reference