*Hopefully simple fix?* Brushless motor and ESCs are not properly working with the simplest code

Hi everyone.

For a project I am starting, I am trying to test the functionality of 1 set of brushless motor + ESC.

However, whenever I try to run the simplest of code for it (pasted below), I can never get the actual motors to turn. There have been no error codes during compiling or uploading, it just won't go.

I have the motor soldered to the pads on the ESC, with a 3S LIPO also connected to it, and the white and black wires on the ESC connected to PWM pins and ground respectively.

I've looked for help all across the web but no real information is out there with my current setup.

Could this be a firmware issue? Is there additional software I need to run my brand of motor or ESC? Is there a discrepancy with using certain COM channels? Any help is appreciated

The code:

#include <Servo.h>

Servo ESC; 


void setup(){
ESC.attach(13,1000,2000);
}

void loop(){
  
 
  ESC.write(1999);
}

Please show a circuit diagram.

Does the ESC beep? Is it drone type and maybe have an arming procedure (down and right on the transmitter stick iirc, for some like DJI)

List your parts, please.

Oh, and this will be a problem. You're writing a servo angle of 1999 degrees with this line. If you are sure about the min max of the ESC

ESC.attach(13,1000,2000);

of 1000 and 2000, you'll want to write your control like this:

ESC.writeMicroseconds(1999);

Also, if those min max values are approximately correct, then you should find that between 1400-1500 will be neutral, < neutral - 1000 is one direction, >neutral to 2000 is the other direction.

How do you intend on getting the writeMicroseconds values to the Arduino beyond one simple command over time?

I'll try out the new code tomorrow. As for how I intend on sending inputs to the motors in the future, I will be using an HC-06 bluetooth module to pair to an xbox one controller since the Rev3 doesn't have bluetooth by default. This is for a quadcopter build if that means anything to you. I derived this concept from projects I found online (links below)

1
2

Some of these builds also feature a USB Host Shield and windows wireless adapter, which I figure to use only if the HC-06 by itself won't work.

Also, I am not sure that 1000 and 2000 are the min max of the esc. I copied that part from a different tutorial. Are those numbers just the kV rating on the motor?

Thanks for your help

Yep, it beeps when I connect the battery to it. And per my reply to your other comment, I wont be using a radio transmitter or receiver, but only bluetooth. It'll only give me 30ft of range, but that's enough for my purposes.

The only parts I am using for this stage in the process are 1 escs, 1 motor, the battery, and the arduino uno r3.

ESCs

HGLRC

4 motors

RS2205

3 LI-PO battery

Tattu 3S

Negative. kV ratings are the RPM a motor will spin at full throttle when unloaded given an input voltage. It's on the exam, if you live in Canada for any drone over 249g.

Fly these as part of my job, yep, gotcha. We fly the DJI Matrice 300 RTK and my personal drones are a custom DJI F550 hexacopter running Arducopter (until I turned it into an airboat for some GI Joe figures) and a DJI Mavic Air.

No, to be clear, that has nothing to do with the kV rating of the motor. Servo signals are typically around 1000-2000 uS (microseconds) pulses that folks a lot smarter than me on this forum can probably explain in detail.

Nevertheless, for you, the important part is to read the datasheet for your ESCs. It should tell you the pulse range. I have seen servos with a range as wide as 640-2400 uS.

You can read the pulses for your ESCs through the RX/TX with the pulseIn() function.

As for integrating an Xbox controller, I don't know. I have used Nintendo controllers with Arduino but not Xbox (unless you count the Kinect camera but not for a drone).
I always use the radio controls that come with hobby grade stuff such as DJI or Spektrum and read in to an Arduino, do my own mixing and send the new signal out to the ESCs for my purposes.

Interesting, did we have this conversation in another thread? In any case, I would prefer to type the few extra keys so I know what I am saying to the ESC is what I actually want.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.