Brushless motor current measuring

Im trying to mesure the current drawn by a racerstar br2205 brushless motor with a ACS712 30A current sensor. The sensor is wired in series between the battery positive and esc (littlebee 30A). The problem is that I dont get any concievable pattern in analog read from the sensor when slowly spinning the motor up. When the motor is still (pwm 1ms) i get ~510 on analog read from the sensor. When the motor is spinning it gives both lower and higher numbers with no pattern that I can see. The analog read gives a maximum of about +-45 from the default (0A) 510 even on full motor power.

Is the current drawn by the motor a constant value?
Can I even mesure the current directly and in that case how?
Do I have to mesure voltage and resistance and calculare current?

Help appreciated! Im all out of ideas. :confused:

Im using an arduino uno

AlgotLin:
Im trying to mesure the current drawn by a racerstar br2205 brushless motor with a ACS712 30A current sensor. The sensor is wired in series between the battery positive and esc (littlebee 30A). The problem is that I dont get any concievable pattern in analog read from the sensor when slowly spinning the motor up. When the motor is still (pwm 1ms) i get ~510 on analog read from the sensor. When the motor is spinning it gives both lower and higher numbers with no pattern that I can see. The analog read gives a maximum of about +-45 from the default (0A) 510 even on full motor power.

Is the current drawn by the motor a constant value?
Can I even mesure the current directly and in that case how?
Do I have to mesure voltage and resistance and calculare current?

Help appreciated! Im all out of ideas. :confused:

Im using an arduino uno

Well, first, you have already answered your first question! If you are using PWM to the motor, then obviously, the current drawn by the motor is NOT and constant value.

If you want to measure the PWM current, you need to use an oscilloscope to see the trace at the time the motor is drawing current. Part of the time, there is no current because of the PWM signal.

Yes, measure the resistance and the peak voltage of the PWM to the motor and then you can calculate the current drawn by the motor when the PWM voltage is high. When the voltage is zero, the current is also zero.

Paul

If you are reading the current between the battery and the ESC input then the servo-like PWM signal really doesn't come into it. The current into the ESC is (relatively) constant and it should be possible to read it.

OTOH I've never used that sensor so I don't know how well it works. What circuit are you using and particularly what value of filter capacitor and how clean is the 5V supply to it? But you shouldn't be reading both + and - values there...the ESC does not feed current back into the battery.

Steve

Brushless motors and PWM don't sound like a good combination in the first place - unless that PWM signal goes to a dedicated motor control board.

Then brushless motors switch on and off their windings as the rotor turns, and that will also cause a non-constant current and noise. That may very well mess up your current sensor and your analog input port. Use a scope to see what signal you really get. You may need filtering caps to get a stable signal.

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

Right now im suspecting that the electromagnets in the motor mess with the hall sensor. I will romove the sensor from the battery lead and read its output without any current flowing through. If it freaks out when the motor is running i know that it is the electromagnets.

First you asked about a current sensor, now a hall sensor.

What are you really trying to do??

Hi.
Please read post #4, can you post a picture of your project so we can see your component layout?

Thanks.. Tom.. :slight_smile:

wvmarle:
First you asked about a current sensor, now a hall sensor.

What are you really trying to do??

Im trying to mesure the current using a hall effect sensor (should work for dc current) between the battery and esc. And im now sure that the electromagnets in the motor dont disturb the sensor.

Picture of the layout coming, doont have the time right now.

Hi,
I think the OP is saying HallEffect, when he means the ASC712 Hall Effect current board.

Tom.. :slight_smile:

Yes, that is what he said in his initial message where he also said it was connected between the battery and an ESC.

But it would still be interesting to know if he is just using the bare ASC712 30A chip or some board which includes it with other components and if so which one.

Steve

slipstick:
Yes, that is what he said in his initial message where he also said it was connected between the battery and an ESC.

But it would still be interesting to know if he is just using the bare ASC712 30A chip or some board which includes it with other components and if so which one.

Steve

Im using this one:
5Pcs 30A New Range Current Sensor Module Board For ACS712
https://banggood.app.link/mmhSEcj3tJ

This is how I have everything wired right now. I am also sending a pwm signal from the arduino to the esc through its signal and ground wires connected to ground and digital on the arduino. Those wires are not in the picture.

I tested my code with a lightbulb and some resistors and it read the amps correctly. I also ran the motor without the hall effect sensor on the battery lead and am sure that the electromagnets in the motor dont disturb the sensor.

I am now suspecting the nature of the motors current draw. I thought it could be considered constant at a set RPM but mabye not. I might also try the motor with a load to see if that changes anything.

Still getting readings all over the place. Appreciate the help :slight_smile:

I googled around a bit (mabye more) and found this:
This right here

I can not make sense of any of the code but the setup and the sensor is the same as mine so someone better than me could maybye try?

If he could get it to work with that setup i should be able to as well right? Only need to get the code right in that case.

You'll have to find out whether your current is even constant. I doubt it.

PWM signal is an on/off signal so your current does the same. It jumps between max and zero (plus likely other peaks due to stray capacitance and induction).

Brushless motors have a bunch of windings which are switched on and off as the motor turns (which is why PWM and brushless motors are generally not good friends). That will also put quite a bit of noise on the line, and make your current not exactly a constant thing.

A light bulb on the other hand IS a constant current draw, which makes it much easier to read.

You can have a look at the current pattern by using a shunt resistor and a scope connected to it. You're likely to see a very irregular pattern with the motor, against a very stable signal with the light bulb.

AlgotLin:
This is how I have everything wired right now. I am also sending a pwm signal from the arduino to the esc through its signal and ground wires connected to ground and digital on the arduino. Those wires are not in the picture.

That sounds as if you are driving the ESC with a standard PWM signal using analogWrite(). If so that may be one problem because that is not how you drive standard ESCs. They normally take a servo-type signal which is not the same thing at all. OTOH if that's one a OneShot125 flashed ESC that's still not standard PWM. So exactly what version of the LittleBee ESC do you have?

Also do you have any load (like a prop) on the motor. Because if it is unloaded the no-load current is a) quite low and b) not very sensitive to speed.

BTW by an amazing coincidence that picture of your wiring is absolutely identical to the picture in the page you linked to. How about a picture or diagram of YOUR actual setup instead of what you think you maybe should have done?

And I think it's probably time you posted the code you are using too because we can't really see how you're actually trying to do any of this.

Steve

slipstick:
BTW by an amazing coincidence that picture of your wiring is absolutely identical to the picture in the page you linked to. How about a picture or diagram of YOUR actual setup instead of what you think you maybe should have done?

I honestly have that exact setup lying here on my table. Its what I thought i should do AND what I did. So I figured that I could take the picture since its the same setup. And yea I know you shouldnt use others pictures but whatever, its from a tutorial.

There's no point in lying wgen solving your own problem. Doesn't get you anywhere.

-Algot

slipstick:
That sounds as if you are driving the ESC with a standard PWM signal using analogWrite(). If so that may be one problem because that is not how you drive standard ESCs. They normally take a servo-type signal which is not the same thing at all. OTOH if that's one a OneShot125 flashed ESC that's still not standard PWM. So exactly what version of the LittleBee ESC do you have?

And Im using the servo library

.writeMicrosecons();

And a value from 1000-2000 microseconds. Standard esc protocol afaik.

If you really want help, you should post what you really have. Photos of YOUR setup. A copy of YOUR code. Not from some tutorial, even if you think it's the same (it may very well be of course, but maybe it's not).

The motor: the closest to a spec sheet I found is this: RACERSTAR Official Website That's a pretty beefy one - especially for its tiny size, up to 950W coming from a 28 gram motor! Impresisve.

It has three wires, but no information on how those are to be used. You will have to provide this info, that'll be telling a lot.

Why are you using the Servo library for this motor? Is that how you're supposed to control them?

Hi,

Why are you using the Servo library for this motor? Is that how you're supposed to control them?

The ESC is designed to respond to RC receiver throttle output, which is a servo signal.

AlgotLin can you PLEASE post YOUR code, that is the code you are using in your controller.
Can you please post a picture of your project?

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom... :slight_smile:
PS, Find attached manual for "little bee" ESC

flza3000-tech.pdf (73.6 KB)