I will try and lay this out as easily as possible.
Currently i prototyped a circuit to control a DC motor with an analog input from an IMU (MPU6050) through a motor controller (L293D) as shown below.
I know there will need to be hardware changes, but what is the feasibility of integrating this type of circuit with an 18V brushless motor? The most obvious change i know is that i will not be able to use the L293D and it will require a more powerful ESC.
Below is the code i am using. If it is possible could you nudge me in the direction of an applicable ESC as the ones i am finding mainly require radio input for RC cars.
The image you post (yes I know, horrible unreliable and often highly misleading Fritzy - but you do have a single H-bridge controller which supports this) suggest your motor has just two leads. For a BLDC that means the control software is inside the motor, and you don't have any external control beyond on/off. Not even direction.
If you have a BLDC that allows such control you should to have more connections: the windings and the sensors that tell you the rotor's position.