Quadcopter Not flying

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download

Quadcopter Not flying

Postby Nash » Fri Feb 01, 2019 2:05 pm

Hello Team,

I am trying to build an arduino quadcopter using arduino nano flashed with multiwii firmware with mpu6050 connected and standard flysky fs-i6s transmitter with FS-IA10B as reciever with ppm signal. I have connected the receiver 1st (PPM Pin) to the pin D2 of the arduino nano and also uncommented the following lines in multiwii config.h file.

#define QUADX
#define NANOWII
#define SERIAL_SUM_PPM ROLL,PITCH,THROTTLE,YAW,AUX1,AUX2,AUX3,AUX4,8,9,10,11

My copter is getting armed but it is not hovering and flying. I have calibrated the mpu in multiconfig gui by rotating the copter in all direction for 30sec and followed this link http://www.multiwii.com/wiki/index.php? ... alibration for esc calibration.

Kindly let me know the reason for which my copter is not flying. Also help me solve my problem. Also about the ESC calibration by multiwii code provided, do I need to do the calibration by uncommenting the fllowing line

//#define ESC_CALIB_CANNOT_FLY // uncomment to activate

What output does this line gives after uncommenting , how would we know that esc's are calibarted.

Thank You
Nash
 
Posts: 10
Joined: Fri Feb 01, 2019 1:49 pm

Re: Quadcopter Not flying

Postby RCvertt » Sat Feb 02, 2019 9:39 am

"I have calibrated the mpu in multiconfig gui by rotating the copter in all direction for 30sec"


Hi. Do not move the copter during calibration of mpu6050. Calibrate gyro with stick command and waite 20 seconds. Calibrate accel with GUI then wait another 20 seconds.

You only move the copter during magnetometer calibration. You do not have a magnetometer, so don't move the copter.

//#define ESC_CALIB_CANNOT_FLY // I have no idea what that is. I never touched it. I calibrate each ESC directly from the receiver one at a time. It's the easiest method. Calibrate your TX first, then calibrate the ESC one at a time, directly from the receiver.
RCvertt
 
Posts: 170
Joined: Fri Sep 14, 2012 11:45 am

Re: Quadcopter Not flying

Postby RCvertt » Sat Feb 02, 2019 9:49 am

NANOWII is not the same as an Arduino Nano.


Try...
#define QUADX
#define GY_521 // Chinese 6 DOF with MPU6050, LLC
#define SERIAL_SUM_PPM ROLL,PITCH,THROTTLE,YAW,AUX1,AUX2,AUX3,AUX4,8,9,10,11



The Arduino Nano is auto-detected. You don't have to define anything for it in the code. In (def.h) file, your Nano is automatically recongnized as a Pro Mini when you select the chip type in the IDE, which is close enough.
Code: Select all
// Proc auto detection
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
  #define PROMINI
RCvertt
 
Posts: 170
Joined: Fri Sep 14, 2012 11:45 am

Re: Quadcopter Not flying

Postby Nash » Sat Feb 02, 2019 11:59 am

Hi RCvertt,

I have tried as per the above suggestion and enabled #define GY_521 and also calibrated the each ESC separately by giving it to the receiver throttle pin. But still no luck drone is flying. Am using the flysky tx and rx with the mode set as PPM and also i have enabled the below line in the multiwii code, also checked in multiwii config gui am getting the variations from the tx if i vary roll,pitch,throttle and yaw changes are showing in multiwii config but my quad is not hovering. Kindly let me know what other parameters i have to check.

#define SERIAL_SUM_PPM ROLL,PITCH,THROTTLE,YAW,AUX1,AUX2,AUX3,AUX4,8,9,10,11


Thank You
Nash
 
Posts: 10
Joined: Fri Feb 01, 2019 1:49 pm

Re: Quadcopter Not flying

Postby RCvertt » Sun Feb 03, 2019 2:08 am

Hi Nash.

You say throttle moves in the GUI. Do the motors also show they are getting power in the GUI?

If motors show they are getting power in the GUI, arming copter should make all motors jump up to minimum power level, then I'm not sure what else to try. It should work.
RCvertt
 
Posts: 170
Joined: Fri Sep 14, 2012 11:45 am

Re: Quadcopter Not flying

Postby carlonb » Sun Feb 03, 2019 2:18 pm

RCvertt wrote://#define ESC_CALIB_CANNOT_FLY // I have no idea what that is. I never touched it. I calibrate each ESC directly from the receiver one at a time. It's the easiest method. Calibrate your TX first, then calibrate the ESC one at a time, directly from the receiver.


If you uncomment this line means that you can only do the esc calibration, it's not usable for flight.
If I remember well, you must switch the FC on with the motor stick of RC at max, then put the motor stick at min. That's all.
After this, comment again that line, recompile and reflash.
carlonb
 
Posts: 210
Joined: Sun Apr 03, 2011 6:29 pm

Re: Quadcopter Not flying

Postby Nash » Sat Feb 09, 2019 8:58 am

Hey, can any one help me with understanding the motor sequence ( showing motor position m1,m2,m3,m4) with Arduino pro-micro and Arduino nano pins for quad x configuration. Also i wanted to know that in output.cpp under Motor Pin order section there is defined motor pins for quad + so if we are using quad x do we need to add it by ourself??

/**************************************************************************************/
/*************** Motor Pin order ********************/
/**************************************************************************************/
// since we are uing the PWM generation in a direct way, the pin order is just to inizialie the right pins
// its not possible to change a PWM output pin just by changing the order
#if defined(PROMINI)
uint8_t PWM_PIN[8] = {9,10,11,3,6,5,A2,12}; //for a quad+: rear,right,left,front
#endif
#if defined(PROMICRO)
#if !defined(HWPWM6)
#if defined(TEENSY20)
uint8_t PWM_PIN[8] = {14,15,9,12,22,18,16,17}; //for a quad+: rear,right,left,front
#elif defined(A32U4_4_HW_PWM_SERVOS)
uint8_t PWM_PIN[8] = {6,9,10,11,5,13,SW_PWM_P3,SW_PWM_P4}; //
#else
uint8_t PWM_PIN[8] = {9,10,5,6,4,A2,SW_PWM_P3,SW_PWM_P4}; //for a quad+: rear,right,left,front
#endif
#else
#if defined(TEENSY20)
uint8_t PWM_PIN[8] = {14,15,9,12,4,10,16,17}; //for a quad+: rear,right,left,front
#elif defined(A32U4_4_HW_PWM_SERVOS)
uint8_t PWM_PIN[8] = {6,9,10,11,5,13,SW_PWM_P3,SW_PWM_P4}; //
#else
uint8_t PWM_PIN[8] = {9,10,5,6,11,13,SW_PWM_P3,SW_PWM_P4}; //for a quad+: rear,right,left,front
#endif
#endif
#endif
#if defined(MEGA)
uint8_t PWM_PIN[8] = {3,5,6,2,7,8,9,10}; //for a quad+: rear,right,left,front //+ for y6: 7:under right 8:under left
#endif

Am using Arduino Nano with below setup

Motors Arduino Nano Pins Position
M1 ( CCW ) D3 Front Right
M2 (CW ) D10 Rear Right
M3 ( CCW ) D9 Rear Left
M4 ( CW ) D11 Front Left

Is the above connection setup is correct, if not kindly send me the correct connection.

Thank You
Nash
 
Posts: 10
Joined: Fri Feb 01, 2019 1:49 pm

Re: Quadcopter Not flying

Postby RCvertt » Sun Feb 10, 2019 11:39 am

config.h is the only file you should modify. I suspect you have changed to much code and should start with a fresh code base.

There is a "Define QuadX" that you need to uncomment to get QuadX working.

There is a "Define QuadPlus" if you want to use + configuration.
RCvertt
 
Posts: 170
Joined: Fri Sep 14, 2012 11:45 am

Re: Quadcopter Not flying

Postby Nash » Mon Feb 11, 2019 6:07 am

Do I only need to un-comment some lines in config.h based on copter type, no other files to be change in multiwii right? Also can you please confirm me with the motor sequencing asked in previous post.

Am getting problem in yaw, once i ARM the quad rear right and front left motors speed is increasing by itself without me change in the throttle. Kindly help.

Thank You
Nash
 
Posts: 10
Joined: Fri Feb 01, 2019 1:49 pm

Re: Quadcopter Not flying

Postby PatrikE » Mon Feb 11, 2019 9:15 am

That's normal behaivour..
The PID controller is trying to correct small errors and the copter is sitting static.
Results in some motors is "spinning up" to compensate.
PatrikE
 
Posts: 1948
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Quadcopter Not flying

Postby Nash » Mon Feb 11, 2019 10:59 am

Is this configuration correct

Motors----->Arduino Nano---->Pins Position
M1 ( CCW )-------> D3------>Front Right
M2 (CW )-------> D10------->Rear Right
M3 ( CCW ) ------->D9------->Rear Left
M4 ( CW )------->D11------->Front Left


and

Motors-->Arduino Promicro-->Pins Position
M1 ( CCW )-------> 9------>Front Right
M2 (CW )-------> 10------->Rear Right
M3 ( CCW ) ------->5------->Rear Left
M4 ( CW )------->6------->Front Left
Nash
 
Posts: 10
Joined: Fri Feb 01, 2019 1:49 pm

Re: Quadcopter Not flying

Postby PatrikE » Mon Feb 11, 2019 1:54 pm

If you haven't enabled #define HWPWM6 or #define A32U4_4_HW_PWM_SERVOS
Code: Select all
uint8_t PWM_PIN[8] = {9,10,5,6,11,13,SW_PWM_P3,SW_PWM_P4};   //for a quad+: rear,right,left,front


The odrer shoulb be.
Motors-->Arduino Promicro-->Pins Position
M1 ( CCW )-------> D9------>Front Right
M2 (CW ) -------> D10------->Rear Right
M3 ( CCW ) ------->D5------->Rear Left
M4 ( CW ) ------->D6------->Front Left

A tip Use the code wrapper to link code.
It's almost impossible to follow #if #else #endif in normal text
Code: Select all
/**************************************************************************************/
/***************                  Motor Pin order                  ********************/
/**************************************************************************************/
// since we are uing the PWM generation in a direct way, the pin order is just to inizialie the right pins
// its not possible to change a PWM output pin just by changing the order
#if defined(PROMINI)
  uint8_t PWM_PIN[8] = {9,10,11,3,6,5,A2,12};   //for a quad+: rear,right,left,front
#endif
#if defined(PROMICRO)
  #if !defined(HWPWM6)
    #if defined(TEENSY20)
      uint8_t PWM_PIN[8] = {14,15,9,12,22,18,16,17};   //for a quad+: rear,right,left,front
    #elif defined(A32U4_4_HW_PWM_SERVOS)
      uint8_t PWM_PIN[8] = {6,9,10,11,5,13,SW_PWM_P3,SW_PWM_P4};   //
    #else
    uint8_t PWM_PIN[8] = {9,10,5,6,4,A2,SW_PWM_P3,SW_PWM_P4};   //for a quad+: rear,right,left,front
    #endif
  #else
    #if defined(TEENSY20)
      uint8_t PWM_PIN[8] = {14,15,9,12,4,10,16,17};   //for a quad+: rear,right,left,front
    #elif defined(A32U4_4_HW_PWM_SERVOS)
      uint8_t PWM_PIN[8] = {6,9,10,11,5,13,SW_PWM_P3,SW_PWM_P4};   //
    #else
      uint8_t PWM_PIN[8] = {9,10,5,6,11,13,SW_PWM_P3,SW_PWM_P4};   //for a quad+: rear,right,left,front
    #endif
  #endif
#endif
#if defined(MEGA)
  uint8_t PWM_PIN[8] = {3,5,6,2,7,8,9,10};      //for a quad+: rear,right,left,front   //+ for y6: 7:under right  8:under left
#endif
PatrikE
 
Posts: 1948
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden

Re: Quadcopter Not flying

Postby Nash » Tue Feb 12, 2019 1:22 pm

Hello, I have attached a video of multiwii config, in which I am getting gyro drift problem for the quad x configuration with promicro and mpu6050 connected. Kindly check and suggest.

[youtube]https://youtu.be/mRZb5flM8RQ[/youtube]

Thank You
Nash
 
Posts: 10
Joined: Fri Feb 01, 2019 1:49 pm

Re: Quadcopter Not flying

Postby RCvertt » Fri Feb 15, 2019 7:07 am

Hi. I checked your video.

It might be normal. The GUI may drift a lot in yaw since you don't have a magnetometer. The quad won't actually drift that much during flight though. Your roll and pitch look level with no drift which is what matters the most.

To be safe, you should calibrate the accel every time you upload code. Do that by calibrating the gyro first then do the accel. Calibrate the gyro every time before each flight with the TX stick combo. Wait 20 seconds before trying to fly to give time for the calibration to work. I still think you will see drift in yaw in the GUI though due to no mag. Just ignore it.
RCvertt
 
Posts: 170
Joined: Fri Sep 14, 2012 11:45 am

Re: Quadcopter Not flying

Postby Nash » Sat Feb 16, 2019 9:28 am

Hi,

Thank you for your inputs, but still my quad is not flying.. As per this image i have attached motors in the same sequence

https://static.rcgroups.net/forums/atta ... oMicro.jpg

Motors-->Arduino Promicro-->Pins Position
M1 ( CW )-------> D9------>Rear Right
M2 (CCW ) -------> D10------->Front Right
M3 ( CCW ) ------->D5------->Rear Left
M4 ( CW ) ------->D6------->Front Left

Is this correct??
Nash
 
Posts: 10
Joined: Fri Feb 01, 2019 1:49 pm

Re: Quadcopter Not flying

Postby RCvertt » Sun Feb 17, 2019 9:39 am

Sorry. I have only used Arduino ProMini or Arduino Nano that have 328p chip.

I have never used ProMicro which has the ATmega32U4 chip, so I can't help with that.
RCvertt
 
Posts: 170
Joined: Fri Sep 14, 2012 11:45 am

Re: Quadcopter Not flying

Postby Nash » Mon Feb 18, 2019 8:22 am

Can you send me the config.h and motor sequence for Arduino ProMini or Arduino Nano i will try with the same.
Nash
 
Posts: 10
Joined: Fri Feb 01, 2019 1:49 pm

Re: Quadcopter Not flying

Postby RCvertt » Mon Feb 18, 2019 8:49 pm

This was my most recent build done 6 months ago. I have no idea what the motor sequence is. It's just a standard quadPlus for multiwii.

Info in this thread...
https://www.rcgroups.com/forums/showthr ... t-a-goodie

2[1].jpg
Image of copter


MultiWii.zip
Multiwii single wire PPM
(166.6 KiB) Downloaded 2 times
RCvertt
 
Posts: 170
Joined: Fri Sep 14, 2012 11:45 am

Re: Quadcopter Not flying

Postby Nash » Sat Feb 23, 2019 12:17 pm

It would be really help full if any one can share the complete connection and code with motor sequence for quad x with promicro and mpu6050. Also the PID values for which quad has flown correctly.

Am getting wobbles in my quad over 50% throttle and is not flying correctly. Kindly help.

Thank You
Nash
 
Posts: 10
Joined: Fri Feb 01, 2019 1:49 pm

Re: Quadcopter Not flying

Postby RCvertt » Mon Mar 04, 2019 6:52 am

If it wobbles fast, turn P down.

If it wobbles slow, turn P up.
RCvertt
 
Posts: 170
Joined: Fri Sep 14, 2012 11:45 am

Re: Quadcopter Not flying

Postby PatrikE » Wed Mar 06, 2019 10:43 pm

How's your vibrations in the frame?
You can test to add some filtering on Gyro.
Start with
Code: Select all
    #define GYRO_LPF_42HZ

And later you can test this.
Code: Select all
    /************************    Moving Average Gyros    **********************************/
      #define MMGYRO 10                      // (*) Active Moving Average Function for Gyros
      #define MMGYROVECTORLENGTH 15          // Length of Moving Average Vector (maximum value for tunable MMGYRO
PatrikE
 
Posts: 1948
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden


Return to Software development

Who is online

Users browsing this forum: No registered users and 4 guests