Measuring the Speed of a Brushless Motor using an Arduino

Hello everyone,

I was wondering if anybody knew how to measure the speed of a BLDC using an Arduino or similar. I have a BLDC connected to an ESC, and I would like to know the angular speed (not the amount of throttle).

I measured the output of my ESC with an oscilloscope, and I have found that things like the duty cycle, Vrms, and Vavg correlate to the throttle, not the actual speed. I don't need a full solution, just someone to tell me if this is possible and point me in the right direction.

Thank you!

Since the coils are continually being switched, you may be able to put a small
magnetic sensor near the casing (particularly if plastic) and get a small voltage from the leakage ac field
from those coils, or the spinning rotor which has permanet magnet poles.

Haven't tried this but since you've got a scope, use a linear hall effect device, or a small coil
of many turns of thin wire as a pickup and see what you get . You may need an amplifier.

I'd be interested to hear the results

regards.

Oh I could do that. But I was wondering if this were possible by analyzing the voltage or current through the three wires of the BLDC. The thing is, this is for an electric skateboard, and I don't want to put anything on the motor, on near it.

(I have some hall-effect sensors and I could use them, that would mean there would be more parts that could potentially break)

Hi,
You could place one of the wires to the BLDC over one of your hall-effect sensors and see if you get any output due to the AC current in the wire.

Tom.... :slight_smile:

AFAIK a BLDC motor turns with exactly the frequency of the coil or sensor signals. So it's a matter of connecting one of these signals to the Arduino, with pulse shaping to obtain proper slopes in the allowed digital input range (0-Vcc). This could be achieved with an opto coupler in parallel to a coil, with a diode and a current limiting resistor.

My worry about using the current in the drive wires to the motor as the signal source is that the OP may well be using PWM to get speed control.

Any commutation signal from the motor would be smothered by the PWM.

Of course , if he's just turning it on and off there'd be no problem.

regards

Allan.

just a minute.... 3 wires to the motor! so it's a 3-phase!
Don't these controllers output a three phase signal at the correct speed, and expect the motor to stay pretty closely locked to that? if this is the case ( and I'm not sure - corrections invited ) you just measure the frequency on one of the drive lines...

Allan.

DrDiettrich:
AFAIK a BLDC motor turns with exactly the frequency of the coil or sensor signals. So it's a matter of connecting one of these signals to the Arduino, with pulse shaping to obtain proper slopes in the allowed digital input range (0-Vcc). This could be achieved with an opto coupler in parallel to a coil, with a diode and a current limiting resistor.

Yes, but that's at 100% duty cycle I think (or max speed). I want to know the speed as it varies from 0 to full.

allanhurst:
just a minute.... 3 wires to the motor! so it's a 3-phase!
Don't these controllers output a three phase signal at the correct speed, and expect the motor to stay pretty closely locked to that? if this is the case ( and I'm not sure - corrections invited ) you just measure the frequency on one of the drive lines...

Again, that's at 100% duty cycle, and when the motor has no load.

Well - back to the drawing board and old fashioned techniques...

1/ Tachogenerator coupled to the shaft
2/ Optical shaft encoder ditto

they'll work!

regards

Allan

As the motor receives power, torque builds up to overcome startup load. as actual motor speed increases, the motor then has to fight to overcome the load. so,,,, as the electronic 'speed' is set to a level, the motor may lag in speed as it fights load.

You either need to be able to measure mechanical speed by optical, mechanical, or magnetic means if you want the true speed of the motor.

Hall sensor to catch the fields of the magnets,, yeah, maybe.
Mechanical tach,,, no, he doesn't want anything attached to the motor (good luck).
Optical, count reflective vs. non-reflective areas on the rotor, but he doesn't want anything attached to the motor.......

Bottom line is that if you want accuracy, don't use energizing signals to the motor,,, otherwise, just use the PWM ratio.

Darn. I really wanted a solution that was minimally intrusive. It's not a problem for me to put a magnet on the motor and a hall-effect sensor, but I thought it would be possible by looking at the state of the three wires/coils. Oh well, thank you everone!

Please understand how ESC for a BLDC motor works. In #4 I've described a possible isolated feedback circuit.

Measuring the Speed of a Brushless Motor using an Arduino

speed you mean "rotation per minute" ?

If yes, you can use/build a infra red sensor, put a black/white tape on your motor put the IR leds to
face the motor/tape and speed up the motor, on your serial monitor you will get thru the code you
will write the rotation per minute.

DrDiettrich:
Please understand how ESC for a BLDC motor works. In #4 I've described a possible isolated feedback circuit.

I'm using a sensorless motor. If your method works with a sensorless motor, could you please expand? I understand that I could just read the existing hall-effect sensors, but I want to look at the voltages of the three wires and read the angular speed from there.

Domino60:
speed you mean "rotation per minute" ?

If yes, you can use/build a infra red sensor, put a black/white tape on your motor put the IR leds to
face the motor/tape and speed up the motor, on your serial monitor you will get thru the code you
will write the rotation per minute.

I wrote "angular speed", meaning I want to know the RPM, or degrees/sec, or rad/sec, or something along those lines. I realize that I can just use an existing odometer solution. I want to read the three wires leading to the motor and figure out the speed from there.

I wrote "angular speed", meaning I want to know the RPM, or degrees/sec, or rad/sec, or something along those lines. I realize that I can just use an existing odometer solution. I want to read the three wires leading to the motor and figure out the speed from there.

Why to do it the hard way when you can do it the easy way?

Using a 2 IR leds TX/RX on a breadboard with resistors and a 10min code you can find out the
RPM of your motor really easy, I don't see the point wasting more time in this topic if you just
want to find the RPM of your motor.

There is hundreds of links how to make one under 15min easy and fast, if you got experience with IR
leds you will understand what you need to do if not just follow the tutorials.

Why to do it the hard way when you can do it the easy way?

Using a 2 IR leds TX/RX on a breadboard with resistors and a 10min code you can find out the
RPM of your motor really easy, I don't see the point wasting more time in this topic if you just
want to find the RPM of your motor.

That's not the point. I'm trying to make a device that could be inserted into any electric skateboard in order to measure the speed, without relying on adding a mechanical or optical component (aka. by using the signals on the three wires). That way, the system is not obtrusive, and nothing new needs to be mounted outside the electronics compartment.

Right this very moment I have an optical tachometer on my desk. If I wanted to, I could figure out the speed of my motor... but I want to figure it out through electronics. (I've also made the circuit you described before).

You could always stick a tiny magnet on a wheel and sense it with a hall effect device...

regards

Allan

I'm trying to make a device that could be inserted into any electric skateboard in order to measure the speed, without relying on adding a mechanical or optical component (

Find out how a Computer CPU cooler detects the speed on your PC Bios or OS software, if you find
how that works you will solve the problem and this topic.

Your welcome :smiley:

I see what you did there! :wink:

The OP is refusing to listen to advice there is no direct relationship between the motor drive pulses and the output shaft speed under varying loads. Until that gets through, the topic is dead in the water.

When I looked back at the original post, the OP claims to have a BLDC motor and an ESC, whose output does not correspond to the motor rotation. Can anybody tell me, how this can happen in real life?

Hi,

123Splat:
As the motor receives power, torque builds up to overcome startup load. as actual motor speed increases, the motor then has to fight to overcome the load. so, as the electronic ‘speed’ is set to a level, the motor may lag in speed as it fights load.

You either need to be able to measure mechanical speed by optical, mechanical, or magnetic means if you want the true speed of the motor.

Hall sensor to catch the fields of the magnets, yeah, maybe.
Mechanical tach, no, he doesn’t want anything attached to the motor (good luck).
Optical, count reflective vs. non-reflective areas on the rotor, but he doesn’t want anything attached to the motor…

Bottom line is that if you want accuracy, don’t use energizing signals to the motor, otherwise, just use the PWM ratio.

From the attached Microchip Doc

CONSTRUCTION AND OPERATING PRINCIPLE BLDC motors are a type of synchronous motor. This means the magnetic field generated by the stator and the magnetic field generated by the rotor rotate at the same frequency. BLDC motors do not experience the “slip” that is normally seen in induction motors.

So monitoring one of the phase currents will be proportional to motor speed.
The OP syas

I measured the output of my ESC with an oscilloscope, and I have found that things like the duty cycle, Vrms, and Vavg correlate to the throttle, not the actual speed.

Did you check the frequency of the pulses in the OUTPUT wires going to the motor.
Can you post a picture of the scope trace of the signal on one of the three motor wires with respect to gnd at different speeds.
Thanks … Tom… :slight_smile:

00885a.pdf (718 KB)