ESC

I've never seen anyone using a relay to switch power to an ESC. On a drone it would just be adding extra weight and failure points. What's the reason for doing that? What is the specification of that relay?

Sorry but you have far too much code that is commented out making it seriously difficult to work out what's going on. You really need to write (and post here inline so it's easier to read) a simple test program with just the motor running code and which shows the problem.

Your arming sequence is like nothing I've ever seen before but if you're getting the correct beeps from the motor then I guess it must be o.k.

Steve