Brushless motor control

Hi guys,

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.

#include <Wire.h>
#include<I2Cdev.h>
#include<MPU6050.h>
 
MPU6050 mpu;
 
int16_t ax, ay, az;
int16_t gx, gy, gz;
 
#define pin1 3
#define pin2 5
 
void setup(){
 Serial.begin(9600);
 Serial.println("Initialize MPU");
 mpu.initialize();
 //Serial.println(mpu.testConnection() ? "Connected" : "Connection failed"); pinMode(pin1,OUTPUT);
 pinMode(pin2,OUTPUT);
 
}
 
void loop(){
 mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
 
 ax = map(ax, -17000, 17000, -1500, 1500);
 
 //Serial.println(ax);

 if(ax<0){
  if(ax>-200){
  Serial.println(ax);
  analogWrite(pin1, 255);
 }
 else{
  Serial.println(ax);
  analogWrite(pin1, 0);
 }
 }
 delay(10);
}

If you need any more information please let me know.

Note: The analog write within the code acts as a stop function for the motor if it begins moving to quickly.

The RC type ESCs are driven from the Arduino by using the Servo library. It is the easiest and simplest way.

You can drive a brushless motor with 3 H-bridge motor drivers but it's a lot of work.

MorganS:
The RC type ESCs are driven from the Arduino by using the Servo library. It is the easiest and simplest way.

Agreed. Just don't use the servo library's default endpoints. I think using a range of 900us to 2100us would be likely to keep the ESCs happy.

Also note that ESCs usually require an arming sequence for safety reasons (at least the aircraft ones do).

MorganS:
The RC type ESCs are driven from the Arduino by using the Servo library. It is the easiest and simplest way.

You can drive a brushless motor with 3 H-bridge motor drivers but it's a lot of work.

can you share the example of the code?

For which one? The direct control of brushless motors is very complex and very different depending on what you are doing with the motor.

What do you want to do with your motor?

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.

This is an old post that a new person has replied to. The original requester is long gone.

That again... didn't notice last night.