Hey guys,
I have an Arduino Uno and want to send the appropriate throttle signal to the esc via a potentiometer.
My problem is that the analog input takes the potentiometer value in 10 bit resolution and i cannot convert it to a 8 bit pwm signal for the esc.
Do you have any suggestions on how to solve this?
Use the Servo library. An ESC takes the same type of signal as a servo. It is NOT standard PWM.
Steve
Thanks for the hint, I will try that ![]()
Ok, this is what I got now:
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int potpin = A5; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
void setup() {
myservo.attach(5); // attaches the servo on pin 9 to the servo object
Serial.begin(9600);
}
void loop() {
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
Serial.println(val); //lets me read the reult from serial monitor
delay(15); // waits for the servo to get there
}
However the motor wont spin in the other direction, do you know how to achieve that?
Do you have a link to your ESC and motor?
Some ESCs require to be armed before the motor will turn. The arming sequence should be covered in the documentation. It is often something like 1. zero throttle and wait for a beep. 2. full throttle and wait for a beep 3. zero throttle.
Not all ESCs support forward and backward. Aircraft ESCs especially favor forward only.
How do you have things wired up? A wiring diagram helps. Pictures help.
What are you powering the ESC with?
I' using this esc: https://hobbyking.com/de_de/turnigy-plush-30amp-speed-controller.html?___store=de_de
Also a simple 12 V power supply.
I could not find any info whether this esc supports forward and backward operation ![]()
I'm gonna draw a simple schematic in a moment.
That's a standard aircraft ESC. It only runs forward, it does not have a reverse mode. For that you would need a car/boat ESC. Perhaps something like this car ESC or this boat ESC
Steve
Eldor19:
I' using this esc: https://hobbyking.com/de_de/turnigy-plush-30amp-speed-controller.html?___store=de_de
Also a simple 12 V power supply.
I could not find any info whether this esc supports forward and backward operation
I'm gonna draw a simple schematic in a moment.
That's a pretty popular ESC. There should be lots of information , videos and tutorials about flashing the turnigy plush with "Blheli" firmware. You use your arduino to do it. When you have that firmware on there you can select bi-direction mode.
Ok thanks to both of you ![]()
i'm gonna try flashing that thing tomorrow, and well if something goes wrong, I'm gonna buy a new one anyway ![]()
Ok I need your help once again.
I'm now trying to flash the arduino and the esc using the Blheli32 firmware. However i keep failing to connect the Esc... It says 'Please check Data and power signals connections to the esc'.
I guess that's the problem.
Does anyone know on wich pins I need to connect the ESC (Turnigy Plush 30 A) to my Arduino Uno?
I could not find any helpful information concering that.