robot restarting in mid loop

hi, I am working on a school project. I am using an Arduino Uno with an adafruit motor shield v2 in order to control 2 steppers that I am using to spin the wheels of the robot and 3 servos to control a robotic arm.
My robot is restarting the code in the middle of the loop (always at the same point). It seems like the Arduino is restarting but I don’t know what is really happening. I read that it could be a noise problem or a memory problem or maybe a current issue.
I have added my code as an attachment.
Thank you for your help

code .txt (12.2 KB)