Arduino PWM signal generation for ESC/motorpod control

Joined
Nov 15, 2016
Messages
191
Reaction score
112
Location
Fresno, CA
This is relatively mundane, but might assist somebody in their tinkering or motor balancing/testing.

I prefer the Hi-Tec Servo Tester but here's a quick and dirty way I was able to generate a PWM signal to spin up the motorpods with an arduino...

20170118_173017.jpg
Code:
//This is kind of buggy, but works in a pinch
//better to use potentiometer and code here
//https://dronesandrovs.wordpress.com/2012/11/24/how-to-control-a-brushless-motor-esc-with-arduino/


#include <Servo.h>
 
Servo esc;
void setup()
{
esc.attach(2);     //Attach to a PWM signal pin, for example pin 2 on Mega
}
 
void loop()
{
int throttle = 0;  //for solo motor pod, approximately 292 to 485
throttle = map(throttle, 0, 1023, 0, 179);
//if you're not using a potentiometer, there's no need to map this, just pick more appropriate throttle values
esc.write(throttle);
}

Code was butchered from How to control a brushless motor through a ESC with Arduino
 
Not hating on your idea, not everyone has a laptop with wifi, and last I checked, arduino's are much cheaper than laptops!
 
  • Like
Reactions: pious_greek
Very cool, never occurred to me to use an Arduino. The ability to use a pot to control the speed is great. Will definitely be using this to balance motor pods from now on.

Thanks!
 

New Posts

Members online

No members online now.

Forum statistics

Threads
13,096
Messages
147,752
Members
16,069
Latest member
Mr M