How to arm a flight controller from arduino

Hello I am building a quadcopter. Basically I have done this and today i did the first flight using a transmiter and a receiver in the quad that was giving / saying to the flight controller what to do. I am trying to do something like that using an arduino So there is the following setup.

My problem is that I can not ARM and DISARM a flight controller from Arduino ? I used to do this by moving the stick of my transmiter to the down left corner.

If anyone knows anything....please respond!! :slight_smile:

Thank you! :slight_smile:

What flight controller are you using ?

Is it based on an Arduino

You imply you have a flight controller and an arduino on the quad, which seems unlikely

It just sounds like you stick settings are not not calibrated

You would be better off posting to a forum about quads eg RCgroups

kkmulticopter.kr this one.

I know that i have to give 0 THR and MAX RUDD but dont know how.

const int buttonPin = 5;
Servo M1;
Servo M2;
Servo M3;
Servo M4;
int led = 13;
int buttonState = 0;

void setup() {
	Serial.println("Initializing motors...");
	Serial.begin(9600);
	
        M1.attach(7);
	M2.attach(12);
        M3.attach(8);
        M4.attach(11);
        
      
        pinMode(buttonPin, INPUT); 
       
	/*for(int power=60; power<64; power+=2){
		M1.write(power);
                
                M2.write(power);
               
		delay(5000);
	}*/
        pinMode(led, OUTPUT); 
	Serial.println("Sync completed...");
}

void loop() {
        digitalWrite(led, HIGH);
        buttonState = digitalRead(buttonPin);
        // check if the pushbutton is pressed.
        // if it is, the buttonState is HIGH:
        if (buttonState == HIGH) {     
           M3.write(68);
           M4.write(150);
         
       
        }	
            
}

If there is any ideas...please tell me.

xmarkx:
My problem is that I can not ARM and DISARM a flight controller from Arduino ? I used to do this by moving the stick of my transmiter to the down left corner.

If anyone knows anything....please respond!! :slight_smile:

Are you using the Servo library to control the AIL, ELE, THR, and RUDD inputs of the flight controller? You just have to figure out which two servo outputs to set. I guess THR to 0 and RUDD to 0:

    // Arm flight controller
   ThrottleServo.write(0);
   RudderServo.write(0);
   delay(2000); // Wait for the flight controller to recognize the ARM command
   RudderServo.write(90);  // Return rudder to center position.

Exactly but its not working.

I know that i have to give 0 THR and MAX RUDD

That doesn't sound like 0, 0

I have given 0-0 0-1500 1500-0 and more. None of them is working :S

xmarkx:
I have given 0-0 0-1500 1500-0 and more.

None of those sound to me to be "MAX" anything, unless your channels are inverted.

What is the MAX value? :confused: I tried to read from the receiver using my arduino but I only saw 0 and 1. Digital pin.

I know that i have to give 0 THR and MAX RUDD

What is the MAX value?

I can not say X.write(MAX);. I have to replace the word MAX with a value. And i dont know if this value is 1000 1500 2000 or more. That is what i am saying.

And i dont know if this value is 1000 1500 2000 or more. That is what i am saying.

I have given 0-0 0-1500 1500-0

It almost certainly ain't zero.

Assuming you're using writemicroseconds and assuming (again) that you're using 'standard' servos, fully down and fully left sounds like 1000,1000 to me. 1500 is a center position so that's unlikely to do you any good. Of course, as AWOL says, depending on your servo arrangement, either one of those 1000s might need to be 2000. Experiment!

johnwasser:

    // Arm flight controller

ThrottleServo.write(0);
  RudderServo.write(0);
  delay(2000); // Wait for the flight controller to recognize the ARM command
  RudderServo.write(90);  // Return rudder to center position.

If you want to use writeMicroseconds() that would be:

    // Arm flight controller
   ThrottleServo.writeMicroseconds(1000);  // MIN Throttle
   RudderServo.writeMicroseconds(1000);  // Full Left Rudder (use 2000 for Full Right Rudder)
   delay(2000); // Wait for the flight controller to recognize the ARM command
   RudderServo.writeMicroseconds(1500);  // Return rudder to center position.

Thank you i ll try that. Btw this is my quadcopter: VIDEO

THANK YOUUUUU!!!!! :smiley: Its is working. :slight_smile: Now i can do whatever i want !

I tried this,
and this is working like a charm :slight_smile:

johnwasser:
If you want to use writeMicroseconds() that would be:

    // Arm flight controller

ThrottleServo.writeMicroseconds(1000);  // MIN Throttle
  RudderServo.writeMicroseconds(1000);  // Full Left Rudder (use 2000 for Full Right Rudder)
  delay(2000); // Wait for the flight controller to recognize the ARM command
  RudderServo.writeMicroseconds(1500);  // Return rudder to center position.

Sir I have tried this but its not working...

johnwasser:
If you want to use writeMicroseconds() that would be:

    // Arm flight controller

ThrottleServo.writeMicroseconds(1000);  // MIN Throttle
  RudderServo.writeMicroseconds(1000);  // Full Left Rudder (use 2000 for Full Right Rudder)
  delay(2000); // Wait for the flight controller to recognize the ARM command
  RudderServo.writeMicroseconds(1500);  // Return rudder to center position.

I am having the same problem and I have used this code its not working...

How do you arm your vehicle? Please mention the procedure you are following, since not every FC is arm the same way.