Implementation of a neural network in overhead crane control

. This work is aimed at proecting an automated control system for an overhead crane based on a neural network, which will replace the operator, but it is possible to transfer this control back to the operator. The paper considers an approach to the development of the necessary software for the correct operation of the crane, the choice of equipment suitable for the task. The final part describes the program blocks necessary for operation, as well as locks.


Introduction
In recent years, the development of neural networks has led to significant achievements in control systems for various industrial applications. One such application is the control of overhead cranes, which are widely used in factories, warehouses, and ports for loading and unloading operations. An overhead crane is a type of bridge crane that consists of a bridge that spans the area to be covered and a hoist that moves along the bridge to lift and move heavy loads.
Traditionally, the control of overhead cranes was done manually or semi-automatically. However, these methods have several limitations, such as the need for skilled operators, the possibility of human error, and the inability to adapt to changing operating conditions. To overcome these limitations, researchers have developed control systems for overhead cranes based on neural networks.
In this article, we will discuss the development of a neural network that controls an overhead crane. We will start by introducing the basic concepts of neural networks and their applications in control systems. Then, we will discuss the design of a neural network for the control system of an overhead crane, including input and output variables, the architecture of the neural network, as well as the training and validation process. We will also present experimental results demonstrating the effectiveness of the neural network-based control system compared to traditional control methods [1][2][3].
Working with bridge cranes without the use of neural networks can still be effective and safe, but there are some drawbacks to consider: Lack of automation: Without the use of neural networks, a trained operator must manually control the bridge crane. This requires a high level of skill and attention to detail, which can be challenging to maintain over a long period of time. Neural networks can automate some aspects of crane operation, providing smoother and more efficient work.
Limited accuracy: Although experienced crane operators can maneuver loads with great accuracy, maintaining such a level of precision over a long period of time can be challenging. This can lead to slower work processes and increased risk of damage or accidents.
Difficulty in performing complex tasks: Bridge cranes can be used to perform a wide range of tasks, some of which may be more complex than others. Without the use of neural networks, it may be difficult to automate these more complex tasks, which may require a higher level of precision and coordination [4][5][6].
Increased technical maintenance costs: Bridge cranes require regular technical maintenance to keep them in good working condition. Without the use of neural networks, this maintenance may be more frequent and time-consuming, leading to higher maintenance costs over time.
Neural networks can be used in bridge crane operation to improve its efficiency and safety. A bridge crane is a complex system that involves the interaction of many physical components, such as the crane's movement, the load it carries, and the environment in which it operates. Using a neural network can help optimize crane movement and prevent accidents. [7][8][9].
One way to use a neural network in bridge crane operation is to use it to predict the behavior of the lifted load. By analyzing data such as the weight and size of the load, as well as environmental factors such as wind and temperature, the neural network can determine the optimal trajectory of crane movement and the best speed at which it should move.
Another way to use a neural network is to increase the accuracy and speed of crane movement. By training the neural network on data collected during previous crane movements, it can learn to make more precise and efficient movements. This can lead to faster and more accurate loading and unloading of the load, which can increase productivity and reduce costs.
Overall, the use of neural networks in bridge crane operation can increase safety, efficiency, and productivity, making it a valuable tool for many industrial sectors that rely on cranes in their work. [10][11][12].

Methods
There are several methods of training neural networks used for artificial neural network learning. Some of the most commonly used methods are: Backpropagation ( Figure 1): This is the most widely used method of training a neural network. It involves calculating the error between the predicted output and the desired output, and then adjusting the network's weights to reduce this error.  The formula for calculating the output signal for backpropagation: (1) (2) where: -the weight of the connection from the j-th neuron of layer l-1 to the i-th neuron of layer l; -bias; -activation potential; σ -sigmoid activation function; -output signal. Stochastic gradient descent (SGD) ( Figure 2): This method involves updating the weights of the network after presenting each training example. The learning rate is adjusted in such a way that the weights move in the direction of the steepest descent of the error function.
The formula for finding the minimum step of the function is applied as follows: where i-th weight value; i-th height value; , model weights; a small constant for the step. The Conjugate Gradient ( Figure 3): This method uses the conjugate gradient algorithm to find the minimum of the error function. It involves computing the direction of steepest descent and then using that information. The essence of the conjugate gradient in general is calculated as: where: -a continuously differentiable function in Rn; -coefficient of approximation; -basic vector; -convergence coefficient. During the training of the neural network, one method will be used as the most suitable for finding the optimal solution.

Development of optimal crane control
Development of optimal control for a bridge crane using a neural network can provide several advantages, including: Increased efficiency: Neural networks can optimize crane movements, reducing the time required to complete tasks and increasing overall efficiency.
Increased safety: A well-designed neural network can enhance safety by detecting potential hazards and adjusting crane movements accordingly. For example, if the network detects an object in the path of the crane, it can automatically adjust the crane's movement to avoid a collision [13][14][15].
Reduced maintenance costs: By optimizing crane movements, a neural network can help reduce component wear and tear, which over time will lead to lower maintenance costs.
Increased flexibility: A neural network can be trained to adapt to changing operating conditions, allowing the crane to operate more efficiently in various environments and scenarios.
To develop optimal control for a bridge crane using a neural network, the following steps can be taken: Data collection: To train the neural network, data on crane movements and operating conditions must be collected. This data can come from sensors on the crane, historical operational data, or simulation models.
Neural network design: The architecture of the neural network must be designed to process the collected data and generate optimal control signals for the crane. The design must consider the specific operating conditions and crane requirements [16][17][18].
Training and testing: The neural network must be trained on the collected data and tested to ensure it generates optimal control signals for the crane in various operating conditions. Implementation: Once the neural network is trained and tested, it can be integrated into the crane control system. Ongoing monitoring and optimization may be required to ensure the network continues to generate optimal control signals over time.

Computer vision
The LiDAR system can be used in the management of a gantry crane to detect obstacles and control the positioning of the crane.
One of the most important elements in controlling a gantry crane is accurate cargo positioning. The LiDAR system can be used to measure the distance to the cargo and determine its location. This allows for precise control of the position of the crane and cargo, and helps to avoid collisions with other objects in the area.
In addition, the LiDAR system can be used to detect obstacles in the crane's path. With the help of LiDAR sensors, a 3D map of the surrounding area can be created, allowing the crane to automatically detect obstacles and avoid them while moving.
Thus, using the LiDAR system in the management of a gantry crane can improve the safety of the crane's operation and increase its efficiency and precision of control [19][20][21].

Development of the given task
First of all, it is necessary to create an interface of the SCADA system, which will be located in front of the operator and will transmit all of their actions directly to the controller [22][23][24].
It is also important to create a program that will interact with artificial intelligence. TIA Portal is a software suite that includes WinCC, Step 7, Startdrive, and other tools used for creating and configuring the controller. Therefore, WinCC was chosen, which allows programming and configuring controllers within the HMI setup program or even within one project. It should also be noted that the SIMATIC -PCS7 system will be used to fully unleash the potential of the controller.

Creating SCADA system for main screens
On the main page, the first tab contains a section called "Mechanism Status"(see Fig. 4), which displays information about the state of various components of the system. This section shows the readiness of the main hoist, the readiness of the lifting mechanism, the readiness of the main contactor, the state of the electrical network, the controller status, crane movement, equipment readiness for crane movement, the state of the cargo trolley, and the readiness of the cargo trolley mechanism [25][26][27]. Next on the main page is the section "Emergency Stop Circuit" (see Fig. 5), which displays information about whether the system is ready for operation, as well as the status of emergency buttons and switches, and whether the signal lamp indicating an emergency stop and circuit break is on. On the next tab is information about the temperature readiness of the cabinets (see Fig.  6). This tab contains information about the temperature of the cabinets, which is important for monitoring the temperature at the height of the crane [28][29][30]. Here you can control the power of the cooling system and determine when it is necessary to perform maintenance on the equipment inside the cabinets to clean it of dust. To provide communication between frequency converters, the ProfiNet communication standard will be used. This protocol provides high-speed data transfer comparable to Ethernet. In this section of the SCADA system, information about the readiness of drives, motors, controllers, and remote signal connection stations is displayed. In addition, there is a panel here that can be used to display diagnostic data when the system is in operation (see Fig. 7).

Fig. 7. Display diagnostic.
This section displays the readiness of various mechanisms, including contractors, necessary for the operation of crane equipment. To activate the main contractor, all the required readiness from the left side of the block diagram must be available. The readiness of the rectifier is also shown in the lower part of the section [31][32][33]. Parameters of the electrical network: This section is designed for a quick check of the input and output voltage in the electrical network. Frequency converters are protected against overcurrent and voltage drops. If the voltage in the direct current circuit decreases by more than 20%, the frequency converters switch to emergency stop mode until the malfunction is eliminated. This section displays the parameters of the electrical network, such as line voltage, current, power, and frequency.

Lifting Mechanism
The first screen is the "Lifting mechanism" (see Figure 8), which includes the overall readiness of the lifting mechanism, the position and state of the hook in space, the overall readiness of the lifting mechanism, and a chart that shows the current moment generated by the engines during operation. The "Lifting mechanism readiness" section (see Figure 9) contains a diagram of the readiness of various components related to the lifting mechanism that must be assembled to achieve the final readiness for operation. This mechanism is one of the main components of the crane and includes several other devices. For each of the components, such as liftinglowering engines, separate readiness is collected, including power circuit control automatics, contractors, absence of malfunctions, and others. Only after all the readiness is collected, a single signal is formed, allowing the lifting mechanism to be ready for operation. In addition, since the engines are subjected to high mechanical and thermal loads, the engine thermostat is included in the readiness, which triggers in case of overheating and forms an emergency until it is eliminated. Fig. 9. Lifting mechanism readiness.
Section "Limit Switches" (see Fig. 10). This section pertains to checking the limit switches of the crane that are located at the working or home positions. The check confirms the functionality of the switches. An important indicator in this section is the "Load Weight", which is measured in tons and kilograms. This value is used to permit or prohibit the use of the crane with a load, especially when working with an operator. Additionally, based on the state of the limit switches, locks are formed, which can cause the crane to stop in case of an emergency until the problem is resolved. The functional diagram presented here (see Fig. 11) describes the logic of controlling the lifting-lowering mechanism. It shows how input data, such as the desired speed, is processed using a set of data arrays and compared with the actual position of the lifting mechanism. The diagram also shows how commands from the controller or operator are incorporated into the control logic [34][35]. One of the key functions of the diagram is to ensure consistency in speed settings for both lifting motors. To achieve this, the diagram includes a comparison mechanism and adjusts the speed settings to a common value.
Overall, the functional diagram provides a clear visualization of how the lifting-lowering mechanism is controlled and helps operators and programmers understand the basic logic of the system.
The calibration process involves adjusting the sensors for accurate measurement of the load position during lifting and lowering. The operator will need to follow specific instructions on the screen to complete the calibration process. After completing the calibration, the operator can confirm the calibration results and save them in the system. It is important to note that only authorized personnel should have access to the calibration screen and password lock to prevent unauthorized access or interference.

Cargo trolley
The SCADA system includes a section for the parameters of the cargo trolley, which is similar to the section for the lifting mechanism. It includes subsections related to the movement of the trolley, the presence of mechanisms, brake readiness, mechanical readiness, anti-theft trolley locks, limit switches, functional circuit operation, and sensor calibration. The "Trolley Movement" subsection contains information about the speed and direction of movement, as well as the position of the trolley. The "Presence of Mechanisms" subsection indicates whether the trolley drive motor, trolley movement motor, and trolley brakes are ready for operation. The "Brake Readiness" subsection contains information about the state of the trolley brakes, while the "Mechanical Readiness" subsection indicates whether the mechanical components of the trolley are ready for use. The anti-theft locks for cargo vehicles subsection contains information about the status of the anti-theft system, while the limit switch subsection indicates whether the limit switches are installed. Some of the sections will be discussed below.

Fig. 13. Mechanical Readiness.
This section is dedicated to the mechanism for moving the cargo trolley and contains information about the readiness of the movement system, the actual position and load on the trolley, and overall readiness for movement.
The "Movement Mechanism Readiness" section includes checking the readiness of the control chains of the converters, the engine thermostats for overheating, the electrical readiness of the engines for moving the trolley, and the mechanical and network readiness of the trolley movement drive. This is displayed in the corresponding section of the SCADA system (see Figure 14). Mechanical readiness relates to the readiness of the mechanical components of the cargo trolley movement system (see Figures 15 and 16). This section relates to checking the readiness of the braking system and anti-theft locks for the crane. The braking system is a key element for moving the trolley, and if the system is not ready, the system will issue an alarm message until zthe problem is resolved. Anti-theft lock readiness includes anti-theft lock automata, lock engine thermostats, limit switches, a button for applying locks, and the parking position status of the trolley. Limit switches can automatically apply anti-theft locks to restrict the work of the operating crew.  The functional diagram (see Figure 17) for setting the trolley speed includes detailed information about several key aspects, such as initial speed, speed setting after filtering, the effect of joystick commands on speed, current engine working moments, and engine operating status. By gathering all the necessary information about engine readiness, the system can determine the optimal speed for the trolley, and operators can control the movement of the trolley using a joystick.

Creating and Training a Neural Network
For calculations of the control of an overhead crane, correspondences were taken based on the mathematical part of the overhead crane, namely: 1) Equivalent load: Where is the maximum calculated load, N; is a coefficient that takes into account the variability of the load over time.
2) Calculation of the number of mechanism switches: (10) Where is the operating time of the mechanism, s; is the operating time of the mechanism for the crane cycle, s. 3) Load mode of the mechanism, related to the load distribution coefficient: Where is the average duration of using the mechanism at frequent load levels , s; is the total duration at all partial load levels, s; is the values of partial loads, W; is the value of the greatest load, W. 4) Inertial force, in translational motion of the mass: Where m is the mass, kg; is the linear acceleration, m/s2. It was decided to use a convolutional neural network in the Python programming language for recognizing three objects on the overhead crane: a person, a box, and a forklift. The input to the neural network will be data with different variations of these objects for recognition, and a positive result will be obtained at the output. The neural network will be trained using backpropagation on unannotated data to obtain annotated data for further supervised learning. The initial dataset will be directed to the fully connected layer of the convolutional neural network.
After the first input of data into the convolutional neural network, its weights will be initialized, and the first intermediate layer -the convolutional layer -will be created. This layer is created based on the input data and the specified characteristics of the convolutional layer. During training, this layer examines all of its segments and calculates functions that help recognize objects in images. Then, the output from this layer is passed to the fully connected layer, where the final classification of objects is performed. During training, the neural network changes its weights to maximize the accuracy of predictions. Thus, the training of the convolutional neural network consists of selecting optimal weights that will best recognize objects in images.
Convolutional layers are often accompanied by pooling layers, which reduce the size of the image by pooling pixels together through a subsampling operation. The subsampling operation is performed by summing the values of pixels in blocks with a certain sampling size and step size, which determines the number of pixels to shift the rectangular grid to perform the operation. This reduces the size of the image and makes it easier for subsequent layers to work with a large amount of data.
When developing code for a neural network, it is necessary to consider activation functions and protection against overfitting. One such function is ReLu (Rectified Linear Unit) -a popular activation function for deep learning. This function returns zero for negative arguments and the number itself for positive ones. ReLu has advantages such as fast derivative calculation and sparsity of layer activation. However, it has a disadvantage -the possibility of stopping training and changing weights in some cases. To prevent this, other gradient descent functions or an improved Leaky ReLu, which has a sloping line for negative values, can be used. However, calculating the derivative of this function is difficult. To solve this problem, the tanh activation function can be used in addition to ReLu.
Two activation functions for artificial neural networks are used in this article: ReLu and tanh. ReLu is used for weight approximation, and tanh is used for better approximation at bends. The domain of the tanh function is centered around zero, which helps in calculating the gradient when moving in a certain direction and leads to improved results in model training [36][37].

Comparison of Maintenance Work Frequency Indicators
The average indicators of maintenance work on overhead cranes can vary depending on a number of factors, including the type and condition of the crane, the intensity of its use, the quality of the technical maintenance, etc.
However, on average, the following data can be provided: Frequency of maintenance work: Cranes usually require regular maintenance and technical inspections to prevent emergency situations and reduce the need for repairs. Depending on the load and operating mode, it is recommended to carry out technical maintenance and inspection of overhead cranes from one to four times a year [38][39][40][41][42].
Duration of maintenance work: The duration of maintenance work can vary depending on the type of work, the condition of the crane, and the availability of the necessary spare parts. Usually, repair work can take from several hours to several days.
Cost of maintenance work: The cost of maintenance work on overhead cranes can also vary depending on the type of work, the level of damage, the spare parts used, and other factors. On average, the cost of repairing overhead cranes can range from several thousand to tens of thousands of dollars.
The average indicators of the ratio between the causes of breakdowns of overhead cranes can vary depending on several factors, such as the type of crane, its age, operating conditions, and the history of technical maintenance. However, some common causes of breakdowns of overhead cranes are: 1) Electrical malfunctions: Electrical malfunctions such as engine failures, faulty wiring, are a significant cause of overhead crane breakdowns. Electrical malfunctions account for about 40% of all crane breakdowns.
2) Mechanical malfunctions: Mechanical malfunctions such as worn gears, bearings, and brakes can cause crane breakdowns. Mechanical malfunctions account for about 25% of all crane breakdowns.
3) Operator error: Operator error is another common cause of crane breakdowns. Improper use of the crane, exceeding the weight limit, and failure to follow safety rules can lead to breakdowns. Operator error accounts for about 15% of all crane breakdowns. 4) Environmental factors: Environmental factors such as extreme weather conditions. By implementing a neural network into the crane control system, it is possible to achieve accurate calculation of the necessary parameters for crane control, based on the network's training with a database prepared by a specific organization. This means that the neural network control will not overload the crane's electrical components, significantly reducing the need for maintenance and repair work. With more accurate calculation of cargo weight, rotation speed, and precise destination, the mechanical components of the crane will experience less stress. The operator will only need to timely report the crane's condition, and work will be suspended only for technical maintenance and inspection, greatly reducing the duration of repair work. For example, minor repair work such as replacement of drive belts, light bulbs, and repair of pneumatic and hydraulic systems, usually takes a few days or less. However, more extensive work such as replacement of the main bearing, long bridge beams, motors, and other major components may take several weeks. Therefore, major repair work that stops the operation of the bridge crane will be reduced by 70% due to timely detection of the crane's condition and replacement of prolonged work with short-term work to maintain the overall condition of the crane. From an economic point of view, it can be said that the cost of work will be 37% lower because the repair team's working time will be measured in days rather than weeks, significantly reducing labor costs. 80% of all work will be associated only with the replacement of small components, and only 3% with major repairs, which will be necessary due to engine wear. The rest of the work will be carried out during planned inspections and technical maintenance of the crane.

Conclusion
In conclusion, the development of a neural network for managing a bridge crane is an important step in automating and optimizing industrial processes. This allows for increased efficiency and safety in crane operations, reduced operation time, and decreased likelihood of operator errors. The neural network developed in this article demonstrates high accuracy in crane management and adapts to changing operating conditions. It can be used in various industries and is an important example of the application of modern technology in production processes. However, it is important to consider that neural networks require significant computational power and are quite complex to develop and configure. Therefore, thorough testing and evaluation of its effectiveness in specific operating conditions is necessary before implementing this technology.