Go Down

Topic: Not able to run BLDC using Arduino (Read 340 times) previous topic - next topic

HelpThisMutant

May 21, 2019, 11:59 pm Last Edit: May 22, 2019, 01:07 pm by HelpThisMutant
Hey Guys.  :)

So, I am trying to make a quad using an arduino uno as flight controller. It will be powered by four 1400kv motors for which I am using 30 amp ESCs ( two SimonK 30A and two HW30).

So the problem is that while the two motors connected to SimonK ESC respond perfectly to the throttle, other two don't spin at all. Even if they sometimes spin, they stop after a while. I read the datasheet hw30 which says it requires a 8kHz PWM signal but I am still skeptical about it as it runs perfectly when directly hooked to an RC receiver. Please check the manual I have attached and let me know does that 8kHz mean what I interpreted.

Not sure how to solve this problem. Also, is using ESC from different manufacturers a bad idea?  :smiley-cry:

The code to test the working of motors is attached below. It's fairly straightforward:





#include<Servo.h>

Servo m1, m2, m3, m4;


void setup() {

 m1.attach(9);
 m2.attach(10);
 m3.attach(11);
 m4.attach(6);
 Serial.begin(9600);
}

void loop() {

 int ch=pulseIn(8,HIGH,25000);
 ch=map(ch,1080,1680,0,180);
 ch=constrain(ch,0,180);
 Serial.println(ch);
 m1.write(ch);
 m2.write(ch);
 m3.write(ch);
 m4.write(ch);
 delay(1);
}

vinceherman

I have to admit - If I were relying on 4 motors to balance an aircraft, I would want all 4 ESCs to respond exactly the same.

I think you are confused about the input signal.  From your manual:
Quote
Control Signal: 30A BLDC ESC requires standard 50-60Hz PWM signal from any remote control as throttle input. You can also generate similar input signal from the microcontroller for making your own customized flying platform. Throttle speed is proportional to the width of the pulse. Maximum throttle position is user programmable. In general throttle is set at zero for 1mS pulse width and full at the 2mS pulse width.
But you say the ESC behaves properly when hooked up to a standard RC receiver.  Perhaps the difference in behavior between the RC receiver and your adruino is not the signal, but instead part of how you are arming the ESC.

HelpThisMutant

Daang!! Looks like I uploaded the wrong manual. That was the manual for the SimonK ESC which works just fine. Here you go. The manual for HW 30A ESC is attached below. Please do give it a look.

slipstick

The 8KHz is the PWM between the ESC and the motor. Nothing to do with the ESC input signal from the Arduino. Have you programmed the ESC as the manual requires? It's not very clear what the factory defaults are and they may not be suitable for your setup.

Try adding an arming sequence of write(0) for each ESC followed by delay(1000) in setup(). That might allow the ESCs to start up properly.

But I suspect it may be a problem with the low voltage cutoff, particularly if you haven't done the programming right. What exactly are you powering these ESCs/motors with?

Steve

HelpThisMutant

Sorry for the late reply.
Regarding the question you asked, I'm powering the setup with with a 3s Li-Po battery. And I think the ESC should arm on their own as soon as I put the throttle to zero.

slipstick

I think the ESC should arm on their own as soon as I put the throttle to zero.
Perhaps it should...IF you've programmed the ESC correctly. So don't bother trying what I suggested.

Steve

vinceherman

And I think the ESC should arm on their own as soon as I put the throttle to zero.
Not all ESCs are programmed the same.  Some have an arming sequence.  Steve has suggested a test to see if it helps with your ESCs.  Have you tried that?

Go Up