Control a brushless motor with an ESC using an Arduino
FunduinoPublished on
Einen starken Modellbau-Motor über einen Fahrtregler steuern
You need this
10 kOhm rotary potentiometer - carbon film, 6 mm shaft, up to 30 V
0,90 € *Item no. F23106608About the product — 10 kOhm rotary potentiometer - carbon film, 6 mm shaft, up to 30 V
SimonK ESC 12 A - Speed controller for brushless motors with BEC
8,41 € *Item no. F23108640About the product — SimonK ESC 12 A - Speed controller for brushless motors with BEC
EDF impeller turbine - brushless motor, Ø 27-70 mm, 3900-11000 kV — 35mm, ADF35-100 PLUS 11000KV
29,69 € *Item no. F23108733About the product — EDF impeller turbine - brushless motor, Ø 27-70 mm, 3900-11000 kV — 35mm, ADF35-100 PLUS 11000KV
Funduino UNO R3 Microcontroller - ATmega328P, 16 MHz, for Arduino
11,12 € *Item no. F23107480About the product — Funduino UNO R3 Microcontroller - ATmega328P, 16 MHz, for Arduino
830-point Breadboard - solderless breadboard for Arduino
2,90 € *Item no. FUN-1010553About the product — 830-point Breadboard - solderless breadboard for Arduino
Breadboard Cables Male-to-Male - 40 Pieces, 20 cm
1,74 € *Item no. FUN-1010558About the product — Breadboard Cables Male-to-Male - 40 Pieces, 20 cm
All 6 parts together 54,76 € *
* All prices include statutory VAT, plus shipping costs.
Why a Brushless Motor Needs an ESC
Wiring
Control the ESC
Control speed using a potentiometer
// Add the servo library. It is used because an ESC is controlled in the same
// way as a servo from an electrical perspective.
#include <Servo.h>
// The ESC (Electronic Speed Controller) is defined as an
// object named "ESC".
Servo ESC;
int Potentiometer; // Potentiometer output value
int Speed; // Control value for the ESC
void setup()
{
// The three values are the pin, minimum and maximum pulse width in microseconds.
// 1000 and 2000 are standard values that work with most speed controllers.
// If this doesn't work, look up your ESC's values in its datasheet.
ESC.attach(8, 1000, 2000);
}
void loop()
{
// Reads the value of the potentiometer on analog pin A0. It ranges from 0 to 1023.
Potentiometer = analogRead(A0);
// The map command converts the measured value to a value between 0 and 180
// that the ESC can process.
Speed = map(Potentiometer, 0, 1023, 0, 180);
// The value is sent to the ESC, which controls the motor accordingly.
ESC.write(Speed);
}Rate the instructions