Brushless motor with ESC does not work anymore

Hi all,
I want to use brushless motors (Turnigy 2213 1050kv 19A Outrunner 20turn) with ESC (Hobbyking SS Series 18-20A ESC) and an Arduino. I used the following code.#

#include <Servo.h>

Servo myRotorCW1;
Servo myRotorCW2;

//---------------------------------------------------------------------------------------------------------------------
void setup()
{
    arm(5000); 
    startRotor();
}

//---------------------------------------------------------------------------------------------------------------------
void loop()
{
	/// 
}  
//---------------------------------------------------------------------------------------------------------------------
void startRotor()			///Engines are started up, up to the starting speed.
{
int standbyPWM = 25;		/// PWM ab dem sich die Rotoren drehen
int startPWM = 60;			

	  for(int speed = standbyPWM0; speed <= startPWM; speed += 1) 
		  {
			rotorCW1Speed = speed; 
			setSpeed(rotorCW1Speed, ROTORCW1);			
			rotorCW2Speed = speed;
			setSpeed(rotorCW2Speed, ROTORCW2);						
			Serial.print("Speed CW 1 - ");Serial.print(rotorCW1Speed);
			Serial.print(" - CW 2 - ");Serial.println(rotorCW1Speed);
			delay(500);			
		  }
}
//---------------------------------------------------------------------------------------------------------------------
void arm(int modifyTime)		// arm the speed controller, modify as necessary for your ESC  
{ 
  setSpeed(0);
  delay(modifyTime); 			//delay 5 second,  some speed controllers may need longer
}
//---------------------------------------------------------------------------------------------------------------------
void setSpeed(int speed, rotor_t myRotor)
{
  // speed is from 0 to 100 where 0 is off and 100 is maximum speed
  // the following maps speed values of 0-100 to angles from 0-180,
  // some speed controllers may need different values, see the ESC instructions
  int angle = map(speed, 0, 100, 0, 180);
  
  switch(myRotor)
  {
	case ROTORCW1:
	myRotorCWFront.write(angle);  
	break; 

	case ROTORCW2:
	myRotorCWBack.write(angle); 
	break;	
  }
}
//---------------------------------------------------------------------------------------------------------------------

This code I found on the net, and somewhat modified.

To protect the lipo, I have taken a small 12V Leadaccu. It worked flawlessly. Until 2 days ago. Now it just beeps. Unfortunately, I find the net only notes for operation with an RC. Can someone please help me? I also replaced the ESC.

Regards
Willi

servo.attach - where is this in your code ?

Duane B

rcarduino.blogspot.com

I forgot to mention in the post.

Servo myRotorCW1;
LGW

And again

servo.attach - where is this in your code ?

Duane B

here
myRotor_CW1.attach(PIN_ROTOR_CW1);

I forgot to mention in the post too.

The beeps will have a meaning - find the ESC manufacturer's website to see if you can make sense of them. ESCs are very fussy and will fail-safe on over voltage, under voltage, over current, bad throttle setting at power up or erratic throttle changes. It might be simply be saying your battery voltage is wrong, or noticing too high a battery internal resistance (bad connection?).

Thanks for the advice. That is the magic word "writemicroseconds".
With "1" means that the right rotor:
With "2" means that the left rotor:

#include <Servo.h>

Servo motorCW1;
Servo motorCW2;

#define PIN_CW1	5
#define PIN_CW2	6

void esc()
{
  delay(5000);
  Serial.println("Sending lowest throttle CW1");
  motorCW1.writeMicroseconds(1000);
  delay(2000);
  Serial.println("Sending lowest throttle CW2");
  motorCW2.writeMicroseconds(1000);
  delay(2000);
  Serial.println("Low throttle sent");
}

void setup() {
  Serial.begin(9600);
  motorCW1.attach(PIN_CW1);
  motorCW2.attach(PIN_CW2);
  Serial.println("ESC calibration started"); 
  esc();
  Serial.println("ESC calibration completed");
}

void loop() {

  if (Serial.available() > 0)
  {
    int key = Serial.read();
    switch(key) 
	{
      case '1':
      motorCW1.writeMicroseconds(1050);	
//	  motorCW2.writeMicroseconds(1050);
	  Serial.println("1050");
      delay(2000);
      break;
      case '2':
//      motorCW1.writeMicroseconds(1100);
	  motorCW2.writeMicroseconds(1100);
	  Serial.println("1100");
      delay(2000);
      break;
	  case '6':
      motorCW1.writeMicroseconds(1000);
      motorCW1.writeMicroseconds(1000);
	  	  Serial.println("1000");
      delay(1000);
      break;

      default:
      motorCW1.writeMicroseconds(1000);
      motorCW2.writeMicroseconds(1000);
	  	  Serial.println("1000");
      break;
    }
  }
}

If I turn in "Case 1" CW2, the rotors spin very fast. Why is that?
Regards Kucky

Do you have any load on the motors? They (motors and ESC) are designed for an appropriate airscrew as load, the throttle setting will roughly be proportional to power delivered so wlil be plenty fierce without the nominal mechanical load (these motors can output > 100W of mechanical power, remember).

I have 2 propellers, which are also designed for the engines. The ECS´s are also configured.
Regards
Kucky