ESC/Motor Response
#1
Thread Starter
Tech Rookie
Joined: Feb 2024
Posts: 7
I am running a 1400KV 12N14P brushless motor with a 40A ESC and 4S Lipo battery. I have my ESC connected to my arduino and a potentiometer connected as well. I have my arduino sending potentiometer and ESC values back to my serial monitor. I've mapped the 0-1023 range from my potentiometer to output a range of 1000-2000ms pulsewidth to the ESC. When I rotate the potentiometer I can see on my serial monitor that there is a smooth linear relationship to the values sent to the ESC. The issue I'm having is that my motor is only responding to my ESC values in increments of 100. For example, the motor won't respond until I send 1100 and then it jumps up again at 1200, and so on. The motor responds to 1100-1199 signals all the same. And this is true for all increments of 100 up to 2000. Is this an issue with my ESC itself, or perhaps the compatibility between the ESC and motor? Thanks in advance.
#2
Two things.
Firstly, most ESCs have a "neutral zone" that's designed to eliminate jitter around zero throttle, which might explain the "nothing happens until 1100" observation.
The second is that it's most likely the way the ESC is mapping the inputs to outputs.
In both cases, it's coarser than what I'd expect. It's pretty common to have a neutral zone of around 5% - yours looks to be 10%.
Unless there's something unexpected going on in how the arduino code is mapping the intended PWM value to actual signal, it's going to be entirely down to how the ESC works. Do you have a 'scope or similar to inspect the actual PWM signal from the Arduino?
Firstly, most ESCs have a "neutral zone" that's designed to eliminate jitter around zero throttle, which might explain the "nothing happens until 1100" observation.
The second is that it's most likely the way the ESC is mapping the inputs to outputs.
In both cases, it's coarser than what I'd expect. It's pretty common to have a neutral zone of around 5% - yours looks to be 10%.
Unless there's something unexpected going on in how the arduino code is mapping the intended PWM value to actual signal, it's going to be entirely down to how the ESC works. Do you have a 'scope or similar to inspect the actual PWM signal from the Arduino?
#3
Thread Starter
Tech Rookie
Joined: Feb 2024
Posts: 7
Two things.
Firstly, most ESCs have a "neutral zone" that's designed to eliminate jitter around zero throttle, which might explain the "nothing happens until 1100" observation.
The second is that it's most likely the way the ESC is mapping the inputs to outputs.
In both cases, it's coarser than what I'd expect. It's pretty common to have a neutral zone of around 5% - yours looks to be 10%.
Unless there's something unexpected going on in how the arduino code is mapping the intended PWM value to actual signal, it's going to be entirely down to how the ESC works. Do you have a 'scope or similar to inspect the actual PWM signal from the Arduino?
Firstly, most ESCs have a "neutral zone" that's designed to eliminate jitter around zero throttle, which might explain the "nothing happens until 1100" observation.
The second is that it's most likely the way the ESC is mapping the inputs to outputs.
In both cases, it's coarser than what I'd expect. It's pretty common to have a neutral zone of around 5% - yours looks to be 10%.
Unless there's something unexpected going on in how the arduino code is mapping the intended PWM value to actual signal, it's going to be entirely down to how the ESC works. Do you have a 'scope or similar to inspect the actual PWM signal from the Arduino?
#4
Entirely likely that a lower cost ESC could cut corners in a number of areas. Do you have a different setup to try? A different 2S ESC? A servo?
Have you double-checked the voltage coming from the battery?
You're probably doing an "analogRead()" to get the value from the potentiometer and then a "Serial.print()" to check it. There's still room for the value to be incorrectly processed to output the PWM. I'm not suggesting this is the cause, but can't rule it out completely.
Feel free to post the Arduino code :-)
Have you double-checked the voltage coming from the battery?
You're probably doing an "analogRead()" to get the value from the potentiometer and then a "Serial.print()" to check it. There's still room for the value to be incorrectly processed to output the PWM. I'm not suggesting this is the cause, but can't rule it out completely.
Feel free to post the Arduino code :-)
#5
Thread Starter
Tech Rookie
Joined: Feb 2024
Posts: 7
Entirely likely that a lower cost ESC could cut corners in a number of areas. Do you have a different setup to try? A different 2S ESC? A servo?
Have you double-checked the voltage coming from the battery?
You're probably doing an "analogRead()" to get the value from the potentiometer and then a "Serial.print()" to check it. There's still room for the value to be incorrectly processed to output the PWM. I'm not suggesting this is the cause, but can't rule it out completely.
Feel free to post the Arduino code :-)
Have you double-checked the voltage coming from the battery?
You're probably doing an "analogRead()" to get the value from the potentiometer and then a "Serial.print()" to check it. There's still room for the value to be incorrectly processed to output the PWM. I'm not suggesting this is the cause, but can't rule it out completely.
Feel free to post the Arduino code :-)
Here’s my Arduino code:
#include <Servo.h>
// Define the ESC control pin
const int escControlPin = 9; // Connect the signal wire of ESC to pin 9
// Define the potentiometer pin
const int potPin = A0; // Connect the middle pin of the potentiometer to analog pin A0
// Create a servo object to control the ESC
Servo esc;
void setup() {
// Initialize Serial communication for debugging
Serial.begin(115200);
// Attach the ESC to the ESC control pin
esc.attach(escControlPin);
}
void loop() {
// Read the value from the potentiometer
int potValue = analogRead(potPin);
// Map the potentiometer value (0-1023) to the ESC pulse range (1000-2000)
int escValue = map(potValue, 0, 1023, 1000, 2000);
// Output the ESC value to the ESC control pin
esc.writeMicroseconds(escValue);
// Print the potentiometer and ESC values for debugging
Serial.print("Potentiometer Value: ");
Serial.print(potValue);
Serial.print(" | ESC Value: ");
Serial.println(escValue);
// Delay for stability
delay(10);
}
Thanks again for your help!
#6
The code looks ok. Sometimes you can get weird things with data types (ints being out of range etc), but it looks reasonable. Chance are the ESC is pretty basic in the way it processes the signal - for a lot of budget scenarios, people aren't going to notice 10% bands.
Note that you can also test with any servo (unloaded, it shouldn't out too much strain on the Arduino voltage regulator). Equally, you can use a cheap servo tester on your ESC.
Note that you can also test with any servo (unloaded, it shouldn't out too much strain on the Arduino voltage regulator). Equally, you can use a cheap servo tester on your ESC.
#7
Thread Starter
Tech Rookie
Joined: Feb 2024
Posts: 7
Entirely likely that a lower cost ESC could cut corners in a number of areas. Do you have a different setup to try? A different 2S ESC? A servo?
Have you double-checked the voltage coming from the battery?
You're probably doing an "analogRead()" to get the value from the potentiometer and then a "Serial.print()" to check it. There's still room for the value to be incorrectly processed to output the PWM. I'm not suggesting this is the cause, but can't rule it out completely.
Feel free to post the Arduino code :-)
Have you double-checked the voltage coming from the battery?
You're probably doing an "analogRead()" to get the value from the potentiometer and then a "Serial.print()" to check it. There's still room for the value to be incorrectly processed to output the PWM. I'm not suggesting this is the cause, but can't rule it out completely.
Feel free to post the Arduino code :-)
The code looks ok. Sometimes you can get weird things with data types (ints being out of range etc), but it looks reasonable. Chance are the ESC is pretty basic in the way it processes the signal - for a lot of budget scenarios, people aren't going to notice 10% bands.
Note that you can also test with any servo (unloaded, it shouldn't out too much strain on the Arduino voltage regulator). Equally, you can use a cheap servo tester on your ESC.
Note that you can also test with any servo (unloaded, it shouldn't out too much strain on the Arduino voltage regulator). Equally, you can use a cheap servo tester on your ESC.
#9
Im only really familiar with 1/10 scale racing stuff, but as PDR pointed out it makes sense for a low end basic speed controller.
For 1/10 and 1/8th racing stuff we have sensor wires and position sensors inside the motor, so it makes regulating the motor much more precise. It does require a compatible motor and esc. That way you can engage the motor at very low rpm and have good control. Early brushless motors were known for cogging, or poor low speed rpm control. Without sensors, the esc measures EMF back feed for good ones, or just has set programming for when to switch phases with no dynamic adjustment. Again I dont have much knowlege about how exactly they adjust phases and motor timing, but its much more coarse than sensor setups. Im not sure if sensored versions exist for your size but just informing you of where to look for better controls. Smaller stuff exists but again, I'm not sure exactly where to get it. Maybe a brand like Castle Creations offers smaller sensored motors and escs.
So factor all that in with you buying an inexpensive esc for a small motor. So its likely to be fairly basic control to remain cheap and accessible. I would have suggested getting a servo tested like PDR did, and you can see how the signal is generated so you're on the right track for sure, but dont be surprised if not much changes.
For 1/10 and 1/8th racing stuff we have sensor wires and position sensors inside the motor, so it makes regulating the motor much more precise. It does require a compatible motor and esc. That way you can engage the motor at very low rpm and have good control. Early brushless motors were known for cogging, or poor low speed rpm control. Without sensors, the esc measures EMF back feed for good ones, or just has set programming for when to switch phases with no dynamic adjustment. Again I dont have much knowlege about how exactly they adjust phases and motor timing, but its much more coarse than sensor setups. Im not sure if sensored versions exist for your size but just informing you of where to look for better controls. Smaller stuff exists but again, I'm not sure exactly where to get it. Maybe a brand like Castle Creations offers smaller sensored motors and escs.
So factor all that in with you buying an inexpensive esc for a small motor. So its likely to be fairly basic control to remain cheap and accessible. I would have suggested getting a servo tested like PDR did, and you can see how the signal is generated so you're on the right track for sure, but dont be surprised if not much changes.
#10
Thread Starter
Tech Rookie
Joined: Feb 2024
Posts: 7
#12
Thread Starter
Tech Rookie
Joined: Feb 2024
Posts: 7
#13
For clarity, which Arduino board are you using? And, do you have any other Arduino boards handy? I've got a clone Uno that refuses to work for specific scenarios, but is fine for others. Took me ages to figure that out.
As another experiment with the gear you have, try using pins 14-19 (A0 - A5) instead of pin 9.
As another experiment with the gear you have, try using pins 14-19 (A0 - A5) instead of pin 9.
#14
The most simple thing is the DSO 138 for just 40 dollar, But if you are into electronics a scope is a must. Very affordable and awesome for its price is the Owon HDS242 (they have more models in this serie)
#15
I tried your code with my clone Uno with the output on pin 9 and it seems to behave as the code expects. The PWM output matches the intended value pretty much down to the microsecond. I have a little PWM tester that shows me pulse width and framerate. My Arduino is outputting @ 49Hz, which should be virtually identical to the default setting of the servo tester (the one you have should default to 50Hz and capable of 125Hz and 250Hz by pressing the button).
Some other thoughts:
Some other thoughts:
- How are you powering your Arduino board? Note that they typically run at 5V - be careful about it clashing with the output from the ESC BEC (maybe make sure the positive wire is disconnected).
- I'm using Arduino 1.8.19 (the 2.X releases don't work well with some of the add-on cores I use). It looks to be using the included Servo library in the release (ie: ...\Arduino\libraries\Servo\src\avr\Servo.cpp). Entirely possible a different version of library could behave differently.




