Hi, I'm trying to make a small brushless motor and controller using an arduino nano board. My problem is in understanding how to detect the back emf from the motor. Currently, I have the motor spinning relatively fast, too fast to measure it by eye, but I'd say 100-150 rpm. I've looked at some articles1 online for measuring back emf with arduino and some of them use a voltage divider connected to each of the three motor phases and then connected to the analog pins of the arduino. The article I linked uses the arduino as a comparator, but I don't really understand how negative voltage into the pins is prevented? Or why the resistors used in the voltage dividers have such high resistance (33k)?
Code
#define A_POW 2
#define B_POW 3
#define C_POW 4
#define A_GND 5
#define B_GND 6
#define C_GND 7
int time_delay = 10; //Milliseconds
int transistor_delay = 10; //Microseconds
void allOff() {
digitalWrite(A_POW, LOW);
digitalWrite(B_POW, LOW);
digitalWrite(C_POW, LOW);
digitalWrite(A_GND, LOW);
digitalWrite(B_GND, LOW);
digitalWrite(C_GND, LOW);
}
void pulsePhase(int power, int ground) {
digitalWrite(ground, HIGH);
digitalWrite(power, HIGH);
delay(time_delay);
digitalWrite(power, LOW);
digitalWrite(ground, LOW);
delayMicroseconds(transistor_delay);
}
void setup() {
pinMode(A_POW, OUTPUT);
pinMode(B_POW, OUTPUT);
pinMode(C_POW, OUTPUT);
pinMode(A_GND, OUTPUT);
pinMode(B_GND, OUTPUT);
pinMode(C_GND, OUTPUT);
}
void loop() {
allOff();
pulsePhase(A_POW, B_GND);
pulsePhase(C_POW, B_GND);
pulsePhase(C_POW, A_GND);
pulsePhase(B_POW, A_GND);
pulsePhase(B_POW, C_GND);
pulsePhase(A_POW, C_GND);
}
Additionally, I notice that when I reduce by time_delay and transistor_delay lower that the above values, the motor just vibrates. Even at the values above, I have to spin the motor manually to start it. I think this is because I don't have BEMF sensing yet, but is there another reason?
Additional Details:
The motor has 4 rotor poles and 12 stator poles arranged in the following pattern:
ABC(A-)(B-)(C-)ABC(A-)(B-)(C-).
The three output wires come from the A+, B-, and C+ ends of the coils.
I've attached my circuit diagram. The mosfet model number is IRLB8748PbF.
Data Sheet: https://www.infineon.com/dgdl/irlb8748pbf.pdf?fileId=5546d462533600a401535660665b2595
1 https://simple-circuit.com/arduino-sensorless-bldc-motor-controller-esc/