Hello there! I am building my drone using Arduino Pro mini!
And i met annoying problem almost at finish line of my work!
The problem is, brushless motor controlled using ESC have some kind "lag".
I am controlling using servo.writemicrosecconds with range 1000-2000.
Motors are wired to next pins: 9, 6 , 5 ,3
When using my superheavy program motors ripples even if you wont send him new "servo.writemicroseconds". And when i upload simple motor test program it works beatifull, no ripple or lags. The question is, what could be the problem? Maybe those pins are affected in someking hidden functions? I am attaching video. At start if you listen carefully, youll hear rippling. And then at 0:45 motor test programm works cool.
The question is, what could be the problem?
Your code, most likely.
If the "simple motor test program" can successfully control the motors, and your sketch can't, it hardly seems like that there is a hardware issue. So, that only leaves software.
Can something affect it? Like Miso/moso, i2c? or maybe lack of arduino performance?
Delta_G:
Depends on how you wrote the code. I don't know how you expect someone to help you diagnose code that they can't see.How to use this forum - please read
.
The code is realy big, and hard to read.
Motor power are set in ArduinoFrimware.ino 175 line
ArduinoFrimware.zip (14 KB)
MrXLR8:
The code is realy big, and hard to read.
I think that means your work is cut out for you. Start by fixing the second part, as if even the author of code thinks it's hard to read then that generally means it's poorly written.