Community
Wiki Posts
Search

ESC/Motor Response

Thread Tools
 
Search this Thread
 
Old 02-10-2024 | 02:35 PM
  #1  
Thread Starter
Tech Rookie
 
Joined: Feb 2024
Posts: 7
Default ESC/Motor Response

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.
Mattwold42 is offline  
Old 02-10-2024 | 02:50 PM
  #2  
PDR's Avatar
PDR
Tech Elite
iTrader: (31)
 
Joined: Oct 2008
Posts: 2,207
From: Sydney, Australia
Default

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?
PDR is offline  
Old 02-10-2024 | 03:21 PM
  #3  
Thread Starter
Tech Rookie
 
Joined: Feb 2024
Posts: 7
Default

Originally Posted by PDR
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?
Thanks so much for the reply. Your observation about the neutral zone makes sense to me. As for the remainder of the PWM range, I unfortunately do not have an oscilloscope and the price to purchase one is a bit out of the range for this project. That being said, I’ve already replaced the ESC with the same model (thinking that my original one was damaged), but no luck; and I’ve confirmed I’m sending smooth signals from my potentiometer, so the output of the ESC really seems to be the last thing to check here. One thing I wanted to mention before was that my ESC has a feature where upon startup it beeps the number of cells that its senses from the battery. My battery is 4S and my ESC is only beeping 3 times. That seems odd. Perhaps I just choose a cheap ESC. I purchased the $22 40A “RC Electric Parts” brand off of Amazon.

Mattwold42 is offline  
Old 02-10-2024 | 03:47 PM
  #4  
PDR's Avatar
PDR
Tech Elite
iTrader: (31)
 
Joined: Oct 2008
Posts: 2,207
From: Sydney, Australia
Default

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 :-)
PDR is offline  
Old 02-10-2024 | 04:15 PM
  #5  
Thread Starter
Tech Rookie
 
Joined: Feb 2024
Posts: 7
Default

Originally Posted by PDR
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 :-)
Just checked the voltage, and my battery is running low, so it’s reading around 12v. I’ll go ahead charge it now, to make sure it’s actually getting up to 14.8v. I don’t have other hardware to switch out at this point, but I’m certainly at the point where I’ll go buy some alternate components to verify my current setup.

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!
Mattwold42 is offline  
Old 02-10-2024 | 04:25 PM
  #6  
PDR's Avatar
PDR
Tech Elite
iTrader: (31)
 
Joined: Oct 2008
Posts: 2,207
From: Sydney, Australia
Default

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.
PDR is offline  
Old 02-10-2024 | 04:58 PM
  #7  
Thread Starter
Tech Rookie
 
Joined: Feb 2024
Posts: 7
Default

Originally Posted by PDR
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 :-)
Originally Posted by PDR
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.
Got it, thanks. I’m a new user on here, so they won’t let me add a live link, but would something like this from Amazon work? h ttps://a.co/d/49vKQzC If that link doesn’t work, the description is “OGRC RC Digital Servo Tester/ESC Consistency Tester for RC”
Mattwold42 is offline  
Old 02-10-2024 | 10:27 PM
  #8  
PDR's Avatar
PDR
Tech Elite
iTrader: (31)
 
Joined: Oct 2008
Posts: 2,207
From: Sydney, Australia
Default

One of those will do the trick. Looks almost identical to one I have. Handy to have from time to time.
PDR is offline  
Old 02-11-2024 | 07:38 AM
  #9  
Alexv2024's Avatar
Tech Master
iTrader: (2)
 
Joined: Dec 2017
Posts: 1,356
From: Ohio
Default

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.
Alexv2024 is offline  
Old 02-23-2024 | 03:34 PM
  #10  
Thread Starter
Tech Rookie
 
Joined: Feb 2024
Posts: 7
Default

Originally Posted by PDR
One of those will do the trick. Looks almost identical to one I have. Handy to have from time to time.
Alright, so I got the ESC tester, and I hooked it up to the ESC, and it drives my ESC and motor beautifully in the PWM ranges I would expect. What this tells me, is that my motor, ESC, and battery setup are working well together. Additionally, I’ve verified that my code is commanding the appropriate PWM values to output from pin 9; however, the values must not be outputting appropriately, since I’m still getting a resolution of about 10%. So the issue lies with my arduino board? Is it possible that my arduino isn’t set up to handle the appropriate frequencies of the ESC? Per the ESC manual, it states that the ESC operates at 16Hz. Can Arduino handle this? Thanks in advance.
Mattwold42 is offline  
Old 02-23-2024 | 03:43 PM
  #11  
Roelof's Avatar
Tech Lord
 
Joined: Aug 2007
Posts: 14,051
From: Holland
Default

Do you have a scope to make the signal visible? Then you do not need to guess what is wrong.
Roelof is online now  
Old 02-23-2024 | 03:48 PM
  #12  
Thread Starter
Tech Rookie
 
Joined: Feb 2024
Posts: 7
Default

Originally Posted by Roelof
Do you have a scope to make the signal visible? Then you do not need to guess what is wrong.
I do not. I had mentioned previously that purchasing one was out of the budget for this project - but I agree that would really accelerate the troubleshooting process here.
Mattwold42 is offline  
Old 02-23-2024 | 07:00 PM
  #13  
PDR's Avatar
PDR
Tech Elite
iTrader: (31)
 
Joined: Oct 2008
Posts: 2,207
From: Sydney, Australia
Default

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.
PDR is offline  
Old 02-24-2024 | 01:51 AM
  #14  
Roelof's Avatar
Tech Lord
 
Joined: Aug 2007
Posts: 14,051
From: Holland
Default

Originally Posted by Mattwold42
I do not. I had mentioned previously that purchasing one was out of the budget for this project - but I agree that would really accelerate the troubleshooting process here.
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)
Roelof is online now  
Old 02-25-2024 | 01:53 AM
  #15  
PDR's Avatar
PDR
Tech Elite
iTrader: (31)
 
Joined: Oct 2008
Posts: 2,207
From: Sydney, Australia
Default

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:
  • 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.

PDR is offline  


Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service -

Copyright © 2026 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.