Hello, I have a rare problem on a project that uses A2212 motors and 30 A ESC, I have done some test separately and after so many test I have identified the problem and I am able to reproduce it. The following is the description of how I can reproduce it, is by doing some steps physically and by using a specific code.
Physically:
(PDE: the motors and Arduino Nano use different power supply, I use lipo for motors and USB for Arduino Nano.)
Connect the motors
Connect Arduino (all goes well, I hear some beeps, maybe not all but it seems that all works and I am able to control the motors)
Disconnect Arduino
Connect Arduino
And now the motors spin at max speed even though I have not specified that I want them to do it.
This is the Software that makes the problem present with the previous steps:
(This is in setup)
MotorESC.attach(9, 1000, 2000);
while (millis() < 3000);
If I don't specify "writeMicroseconds(1000);" after the .attach method, the motors will spin at max speed all the time that the while is blocking (in this case 3000), after that the code will move to loop where I have writeMicroseconds(1000) and then they stop.
(I have as well tried delay(3000) looking for any difference but no difference)
In brief, by following these steps the motors won't stop until they receive "MotorESC.writeMicroseconds(1000)".
Now, my question is if is this normal?, the problem I have got in the main project is similar to this but I didn't follow any steps, I was controlling the motors and then randomly started to spin very fast and I could not make it stop, I had to unplug the power supply
I can put the writeMicroseconds(1000); right after the .attach, but I am wondering if this will make the motors to not be good armed at set up and I am as well concerned if then I can get this anomalous behavior when I am already controlling the motors.
Any help or information, experience... is very appreciated
