I created a quadcopter. When i test it, the motors are working great. I can increase/decrease the speed with no problems. But after some secounds (almost a minute) , two of the motors stop working. They stop at the exact same time. And sometimes, if I let them run, the other two also stop running. If I disconnect and re-connect the battery + arduino, everything starts working again and the cycle repeats. What could be the problem? BTW. The 2 motors are not always the same, but they stop working in pairs. Somethings motor 1 and 2 and sometimes motor 3 and 4. I cant think of any way these pairs are linked.
The problem was from my batter. I charged it and everything is ok now. New problem. Motors dont have the same speed. Anyone knows how to fix that? I saw somewhere that I have to calibrate the ESC's somehow.
OK, the code is simple enough. There does't seem to be anything obvious there that would stop two motors. Certainly not a random pair.
Since two stop simultaneously, it could be whatever power connection is common to both. Pull on the wires in each of those connectors - it may have broken the wire or it isn't screwed down properly.
Change your code to let you re-initialize the motors (the .write(40) line) so you can see if the motor goes offline permanently or if it was a transient glitch that went away.
Hi,
What is powering the Arduino?? This sounds like electromagnetic interference of some type. You have a lot of high power fast signals and they can easily get into the Arduino.
All the ESC grounds should meet at the battery negative terminal. Maybe add bypass capacitors across ESC power?
Somewhere in your main loop, flash an LED so you know where your code is running and if it crashes.
Guys. The problem was from the battery. It had only 7V. I charged it and everything is ok now.
But I have another problem. Motors dont have the same speed. Anyone knows how to fix that? I saw somewhere that I have to calibrate them somehow.
There's probably a lot of different ESCs that use the name "30A" unless you can tell us exactly where you bought them from, we would be guessing or giving you incorrect information.
How do you even know that the speed is different? Those propellors will all be making slightly different thrust, even at the same speed. You need active control to balance the quadcopter. I don't see any components in your list or in your photos which would allow the Arduino to measure the tilt of the copter, so you won't have any control over it once it lifts off the ground.