My quadcopter rotates uncontrollably

This forum is dedicated to all issues and questions related to your individual setups and configurations
Post Reply
giacomos97
Posts: 3
Joined: Sun Mar 13, 2016 3:53 pm

My quadcopter rotates uncontrollably

Post by giacomos97 »

Hello everyone,
I'm trying to build a QuadX copter with a 3D printed frame, arduino pro mini and GY521 sensor.
Unfortunately, as I arm the motor, my copter rotates on itself in both idle and horizon mode.
For the first case (motors in idle mode) I though that the problem could be due to a slightly irregular structure. But, when I check on the interface, I see that the Head value constantly increases even though the copter is completely still.
This is what I tried so far:
-calibrating via Configurator
-calibrating esc via arduino sketch
-isolating the sensor with something metallic
but nothing changed. I also checked that the copter responds properly to the inputs (roll, pitch, yaw) by holding it in hand.
I'm not sure how to calibrate PIDs properly, but I think at this point it would be useless as the readings from the sensor are wrong.

Can anyone suggest me something I could try to fix this issue? :|

Thanks in advance!

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: My quadcopter rotates uncontrollably

Post by Kbev5709 »

giacomos97 wrote:Hello everyone,
I'm trying to build a QuadX copter with a 3D printed frame, arduino pro mini and GY521 sensor.
Unfortunately, as I arm the motor, my copter rotates on itself in both idle and horizon mode.
For the first case (motors in idle mode) I though that the problem could be due to a slightly irregular structure.
First, I, and probably no one else here, knows what you mean by "idle mode". I know of no flight mode in multiwii called Idle. Now, if you mean "acro", OK. If you mean "level", OK. ??????Idle???????? Never heard of it. As far as the sensor goes, it is a standard MPU6050 Gyro/ACC combo. Exactly what do you mean by it "rotates on itself"? If you mean the motors rotate when armed and at idle speed, that is normal. There is a statement in config.h to stop rotation at idle speed. It will rotate when armed no matter what flight mode you are in until you #define_MOTOR_STOP in config.h.
giacomos97 wrote:But, when I check on the interface, I see that the Head value constantly increases even though the copter is completely still.
After re-reading exactly what you said I have concluded that "rotates on itself" most likely means "rotates BY itself" referring to the Heading behavior and the way it increases by 1 degree at a time. Am I correct on this assumption? The GY521 ACC and gyro does not completely control the Head(ing) value reported on the GUI. You say yourself in the next paragraph that the ACC and gyro values are responding as they should. THE DEVICE NEEDED TO USE THE HEADING READOUT PROPERLY IS NOT INCLUDED IN YOUR BUILD AND WOULD BE A MAGNETOMETER. So, until you use a mag you will not have accurate Head(ing) readings. As long as your ACC and Gyro readings are not changing when the quad is sitting still, you are ok so far.
giacomos97 wrote:This is what I tried so far:
-calibrating via Configurator
-calibrating esc via arduino sketch
-isolating the sensor with something metallic
but nothing changed. I also checked that the copter responds properly to the inputs (roll, pitch, yaw) by holding it in hand.
Can anyone suggest me something I could try to fix this issue? :|
!
Yes, buy an HMC5883 magnetometer http://www.gearbest.com/sensors/pp_2572 ... Ai2R8P8HAQ and hook it up and then define it in your config.h sketch. You might also need to set the "enforce your individual sensor orientation" for the mag in the config.h so it reads properly. Don't forget when you use a mag it has a forward direction usually marked with an arrow and the mag needs to have the arrow pointing towards the front on your quad when finally mounted in it. Make sure that your mag is NO WHERE NEAR any sources of stray RF and power wire interference and by all means keep it away from anything metallic. Then, calibrate the new mag. Too bad you are running that Pro Mini. If it was a ATMega2560 http://www.dx.com/p/mega2560-r3-atmega2 ... ujI9tIrK1s you would have memory to put on a baro and run GPS too.
giacomos97 wrote: I'm not sure how to calibrate PIDs properly, but I think at this point it would be useless as the readings from the sensor are wrong.
You can still set the pitch, roll and yaw PIDs even using just the Gyro/ACC and since your problem is the lack of a compass, there is no fault with the readings from your Gyro/ACC. If you use the factory defaults that is a good place to start. Here is the default settings Image
Also, reset your RC Rate and RC Expo to 35 each to start out. 65 and 90 are extreme settings more suited to professional pilots than beginners.

By the way, I took my spare mega board that also uses an MPU5060, but has a bad baro, and disabled the mag as well to see if my Heading readings did the same thing as yours and yes, they do. When I re-enable the mag the Heading readout stabilizes.

giacomos97
Posts: 3
Joined: Sun Mar 13, 2016 3:53 pm

Re: My quadcopter rotates uncontrollably

Post by giacomos97 »

Thank you for your reply!
Sorry if I wasn't clear in the description, you perfectly got what my issue is.
I changed the settings in config.h and the parameters in the Configurator as you suggested me.
Still remains the issue with the rotation when not at idle speed. If I check on the Configurator I see that Arduino sends different input to the ESCs, even if the copter is perfectly still and horizontal. For example, if I put the throttle stick at a "half position", at the very beginning the four motors get a 1500 "input", but for a couple of them (CW rotation ones or CCW ones) the "input" rapidly increases to 1700 (resulting in an uncontrollable yaw).
My doubt now is, can I fly the copter even without having an accurate Heading reading? In other words, does MultiWii care about that value while flying?
In conclusion, what do you suggest me to try to fix the (physical) rotation? Could it be just a matter of PIDs?
Thank you again for interest!

Kbev5709
Posts: 451
Joined: Mon Aug 17, 2015 5:56 pm

Re: My quadcopter rotates uncontrollably

Post by Kbev5709 »

giacomos97 wrote:Thank you for your reply!
Sorry if I wasn't clear in the description, you perfectly got what my issue is.
I changed the settings in config.h and the parameters in the Configurator as you suggested me.
Changing config.h for a mag that is not there is probably not a good idea. I hope you left that alone until you install a mag.
giacomos97 wrote:Still remains the issue with the rotation when not at idle speed. If I check on the Configurator I see that Arduino sends different input to the ESCs, even if the copter is perfectly still and horizontal. For example, if I put the throttle stick at a "half position", at the very beginning the four motors get a 1500 "input", but for a couple of them (CW rotation ones or CCW ones) the "input" rapidly increases to 1700 (resulting in an uncontrollable yaw).
Have you actually flown the quad and had the yaw issue? Or, are you just describing the behavior of the motors in the GUI? If the answer is yes, I have the trouble when actually trying to fly, do you have your transmitter sticks centered? Are you sure your yaw stick is centered at 1500?? Your transmitter's sticks need to be set up by you so the GUI reads 1000 at low, 1500 in the middle, and 2000 in the high end of your throttle, yaw, pitch and roll stick throw. If you haven't done this it would explain the yaw issue. Every transmitter has a sub menu for adjusting sub trims and end points. If you haven't done that then you need to do it.

On the other hand, if the yaw behavior you describe only happens when running in the GUI, and you did the stick centering, it is completely normal for motor speeds to speed up, slow down and even stop when there is no motion input to any of the sensors and without actually flying it some you will never know if the issue is real or only in the GUI.
giacomos97 wrote:My doubt now is, can I fly the copter even without having an accurate Heading reading? In other words, does MultiWii care about that value while flying?
No, it doesn't need a mag. As a matter of fact, when you fly in Acro mode, the only sensor being used is the gyro. The mag is only required for Headfree mode, GPS Position Hold, GPS Return To Home, and Waypoint missions. You can not do anything GPS until you have a mag and the GPS system automatically utilizes the mag when needed.
giacomos97 wrote:In conclusion, what do you suggest me to try to fix the (physical) rotation? Could it be just a matter of PIDs?
Thank you again for interest!
Other than your sticks (especially yaw) not being centered properly, the only thing I can think it would be is the #define YAW_DIRECTION 1 in the config.h. If it is set wrong the quad will spin out of control in flight. It can be 1 or -1. Mine works set to 1.

/******************************** PID Controller *********************************/
/* choose one of the alternate PID control algorithms
* 1 = evolved oldschool algorithm (similar to v2.2)
* 2 = new experimental algorithm from Alex Khoroshko - unsupported - viewtopic.php?f=8&t=3671&start=10#p37387
* */
#define PID_CONTROLLER 1

/* NEW: not used anymore for servo coptertypes <== NEEDS FIXING - MOVE TO WIKI */
#define YAW_DIRECTION 1
//#define YAW_DIRECTION -1 // if you want to reverse the yaw correction direction

Or it could be something even more basic like the wrong motor wire to the wrong ESC pin on the FC or even a prop rotating the wrong way or put on upside down. Maybe two props of the same rotation on one side of the quad? Something really basic like that could be the culprit.

giacomos97
Posts: 3
Joined: Sun Mar 13, 2016 3:53 pm

Re: My quadcopter rotates uncontrollably

Post by giacomos97 »

I can think it would be is the #define YAW_DIRECTION 1 in the config.h.

Hi! Sorry for the late answer. I managed to fix the issue with the rotation changing the yaw correction value (I don't know why but it was set to -1 instead of 1, probably my mistake while programming). :idea:
Thank you very much for your help, your tips were essential.

Post Reply