quadcopter F450, bumped start. Damaged one propeller.

Hello guys,
Hope y'all doing well. I am building a quadcopter F450 series. Since I am new to the programming and circuitry I am following YMFC-AL and his programs. It is quite easy to understand. But anyways I came across this serious problem with bumped start.

According to Brokking's procedure, my all tests, calibrations go well.
like receiver signals check out, gyro checks out. Furthermore while esc's calibration, they calibrate successfully. Also after calibration, with "ESC calibration" program inside arduino all motors run at equal speed when I gradually increase throttle. Until this everything works just fine.

But after uploading flight controller program, it gets worse right at the beginning.

  1. I connect the battery upon which everything calibrates, and it waits receiver signal to start.
  2. When I start it (Throttle low and yaw left then throttle center and yaw center) all motors start at the same speed except one motor at pin 6 (PORTD |= B11110000) keeps on increasing infinitely even if the throttle is at low and results into bumping of copter. I lost one propeller due to that.
    Here is the copter startup piece of code for reference:

//For starting the motors: throttle low and yaw left (step 1).
if(receiver_input_channel_3 < 1050 && receiver_input_channel_4 < 1050)start = 1;
//When yaw stick is back in the center position start the motors (step 2).
if(start == 1 && receiver_input_channel_3 < 1050 && receiver_input_channel_4 > 1450){
start = 2;
'
'
'
throttle = receiver_input_channel_3; //We need the throttle signal as a base signal.

if (start == 2){ //The motors are started.
if (throttle > 1400) throttle = 1400; //We need some room to keep full control at full throttle.
esc_1 = throttle - pid_output_pitch + pid_output_roll - pid_output_yaw; //Calculate the pulse for esc 1 (front-right - CCW)
esc_2 = throttle + pid_output_pitch + pid_output_roll + pid_output_yaw; //Calculate the pulse for esc 2 (rear-right - CW)
esc_3 = throttle - pid_output_pitch - pid_output_roll - pid_output_yaw; //Calculate the pulse for esc 3 (rear-left - CCW)
esc_4 = throttle - pid_output_pitch - pid_output_roll + pid_output_yaw; //Calculate the pulse for esc 4 (front-left - CW)

if (battery_voltage < 1240 && battery_voltage > 800){ //Is the battery connected?
esc_1 += esc_1 * ((1240 - battery_voltage)/(float)3500); //Compensate the esc-1 pulse for voltage drop.
esc_2 += esc_2 * ((1240 - battery_voltage)/(float)3500); //Compensate the esc-2 pulse for voltage drop.
esc_3 += esc_3 * ((1240 - battery_voltage)/(float)3500); //Compensate the esc-3 pulse for voltage drop.
esc_4 += esc_4 * ((1240 - battery_voltage)/(float)3500); //Compensate the esc-4 pulse for voltage drop.
}

if (esc_1 < 1100) esc_1 = 1100; //Keep the motors running.
if (esc_2 < 1100) esc_2 = 1100; //Keep the motors running.
if (esc_3 < 1100) esc_3 = 1100; //Keep the motors running.
if (esc_4 < 1100) esc_4 = 1100; //Keep the motors running.

if(esc_1 > 2000)esc_1 = 2000; //Limit the esc-1 pulse to 2000us.
if(esc_2 > 2000)esc_2 = 2000; //Limit the esc-2 pulse to 2000us.
if(esc_3 > 2000)esc_3 = 2000; //Limit the esc-3 pulse to 2000us.
if(esc_4 > 2000)esc_4 = 2000; //Limit the esc-4 pulse to 2000us.
}

else{
esc_1 = 1000; //If start is not 2 keep a 1000us pulse for ess-1.
esc_2 = 1000; //If start is not 2 keep a 1000us pulse for ess-2.
esc_3 = 1000; //If start is not 2 keep a 1000us pulse for ess-3.
esc_4 = 1000; //If start is not 2 keep a 1000us pulse for ess-4.
}

About my setup, I am using SimonK ESCs. unfortunately one of my simonK 30A escs got damaged so I had to buy another one but another brand with almost same specs. so 3 SimonK escs and one Wolfpack esc.

At first I thought it might due to different ESC thing coz it was happening on that esc (hence motor). So I exchanged that esc port (pin) with the other just to see if that esc works fine and it did. (i.e diff esc was at pin6 and I changed it to pin4). Surprisingly, SimonK esc (motor) on pin6 started behaving like the one before and the previous one exchanged to pin4 became normal like others. That's how I concluded it's with port (pin) problem not ESC.

I know this is very long-ass passage, and I apologize for that but i am trying to put here my scenario. I even got many cuts on hands and face due propellers (10x45).

Please suggest me what's going on here. Is it the program or escs or something else.

Thanks in advance.

all motors start at the same speed except one motor at pin 6 (PORTD |= B11110000) keeps on increasing infinitely even if the throttle is at low and results into bumping of copter. I lost one propeller due to that.

Are you sure that you have the sensors aligned properly with the orientation of the quad ?

If not then when the software attempts to keep the quad level it will increase the speed of the wrong prop, that tips the quad further out of level, the prop speed increases in an attempts to correct it, the quad tips further...

I am sure that you can see that this does not end well.

rushimw:
I know this is very long-ass passage, and I apologize for that but i am trying to put here my scenario. I even got many cuts on hands and face due propellers (10x45).

Oh lordy. Make sure you are wearing safety spectacles during future tests.
Until you are reasonably sure that it will fly, tether it to the ground so that it can only lift off a few centimetres.

   esc_1 = throttle - pid_output_pitch
   esc_2 = throttle + pid_output_pitch
   esc_3 = throttle - pid_output_pitch
   esc_4 = throttle - pid_output_pitch

That's part of your problem. To control pitch, two motors should be biased "+" and two motors "-". You have one "+" and three "-".

UKHeliBob:
Are you sure that you have the sensors aligned properly with the orientation of the quad ?

If not then when the software attempts to keep the quad level it will increase the speed of the wrong prop, that tips the quad further out of level, the prop speed increases in an attempts to correct it, the quad tips further...

I am sure that you can see that this does not end well.

yeah actually the MPU6050 is on the place. well it slightly offset due upper f450 frame has a hole. Also I made sure that with calibration. gives me desired ypr except +/-1 to +/-3 deviation in pitch and roll.

arduarn:
Oh lordy. Make sure you are wearing safety spectacles during future tests.
Until you are reasonably sure that it will fly, tether it to the ground so that it can only lift off a few centimetres.

yeah I was going to do that but had a confusion if motors will burn out. If the tethering is not too strong it is safe right? I am going with this option next.

Even better, test it with the props off. Put a piece if tape on the motor shafts so that you can see whether they are turning.