Brushless Motor doesn't spin constantly

Hello,
I need to rotate a small mirror with a constant speed.
Therefore I use a BLDC EMAX 2213-935KV, an ESC Brushless 40A 2-4S LIPO BEC: 5V/3A and a LIPO Youme Power 5200mAh 50C 11,1V Battery.
I can controll the speed through a potentiometer with the arduino, but the speed doesn't stay always the same while leaving the poti as it is.
Even after changing the code to send a specific speed to the ESC, regardless of the poti, I can hear the motor spinning sometimes a little faster and sometimes a little slower.
It doesn't change a lot, but its not constant.

Details of the project:
I want to project multiple laserbeams with only one (blinking) laserdiode. So the speed has to be almost exactly the same, otherwise the beams are wandering back and forth.
The laserdiode casts the beam onto the spinning mirror. Everytime the beam is redirected into a photodiode, this sends a signal to the arduino and the blinking pattern starts.

I'm not sure if it is because of the battery or (more probably) the ESC or BLDC.
Thought, I ask before throing out more money to buy stuff that doesn't actually work :wink:

Thank you,
Ritti

Some things to consider:
Your voltage source to the ESC is fluctuating.
Or your servo signal to the ESC is fluctuating (jitter).

I had lots of jitter when I used a non crystal oscillator based processor (attiny) to generate the servo signal.

Then the way how you generate the servo signal is also a factor. It can only be as good as your timekeeping in your code, or in the code of a library that you may be using.

What in this secret build do You want forum to check?

Thank you for your replies.
Here some details, because I actually dont know what to check:
The servo signal is generated from an Arduino UNO.
The code was more complex, so I recreated it from scratch from this guide:

to eliminate problems with timings and changed the code to:

#include <Servo.h>

Servo ESC;     // create servo object to control the ESC

int potValue;  // value from the analog pin

void setup() {
  // Attach the ESC on pin 9
  ESC.attach(9,1000,2000); // (pin, min pulse width, max pulse width in microseconds) 
}

void loop() {
  ESC.write(20);    // Send the signal to the ESC
}

Assuming its not the battery causing this inconsistant rotation speed (its new and balance-charged),
is it more likely a faulty motor, or esc? or maybe the signal from the arduino?
Or am I missing something and the way I'm trying to acchieve a constant speed is totally wrong?
The speed changes of the motor are same as I would turn the poti for a few degrees, and after a few seconds turn it back a little bit and so on.

I made a small test sketch, where I generate a servo signal by purely setting up Timer1. So all is done by hardware without any further code needed. That should give the most stable signal possible.

void setup(){
  TCCR1A = 1 << COM1A1 | 1 << COM1A0 | 1 << WGM11 | 1 << WGM10;
  TCCR1B = 1 << CS12;
  DDRB = 1 << DDB1;
  OCR1A = 988; // 1129 us
}

void loop() {
}

When loading that in my Arduino Nano it puts out a 30Hz servo pulse of 1129 microseconds. When measuring the pulse with a pulse analyzer I see no different stability compared to your sketch. Your sketch generates a 50Hz pulse of 1121 microseconds.

Both have a jitter of one microsecond max.

So I suspect your ESC (or especially its software) is the most likely problem factor. They don't need to be very precise to be able to fly a model airplane or a drone.

Thank you for your detailed answer :slight_smile:
I just did some research for a better esc and it seems that I need a sensored esc + motor.
Unsensored have problems with low speed. In fact I changed the construction and added a gear train from small to big, so I can spin the motor faster without letting the mirror rotate too fast and the result is waaay better.

I think a gear is indeed the way to go. To make it better at low speeds you can also use a 2 cell lipo (or LiFe) instead of a 3 cell one. The lowest voltage your ESC will accept would be best.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.