My hexacopter constantly wants to yaw to the right (clockwise) at a fairly aggressive pace (One full 360 rotation in about 2-3 seconds. Only R/C input is a little throttle to get it airborne and it starts rotating on its own immediately)
Pixhawk Flight Controller running 3.2.1 firmware
Taranis X9D Plus radio with X8R receiver
Ublox NEO-M8N GPS/Compass
6x SunnySky 380kv motors with 30A ESC’s
6S lipo, 6000mah battery (Turnigy)
Tarot 680Pro carbon frame
Configured using MissionPlanner version 1.3.30
Things I’ve Tried So Far:
Re-calibrated the compass
Verified motors are level
Verified props are installed correctly and spinning the correct direction
Attempted to “trim it out” by moving yaw trim all the way to the left, didn’t put a dent in the spin
Attempted to move throttle/yaw stick to far left and apply throttle at takeoff, still wants to spin clockwise
Disarming the copter from my radio doesn’t appear to be working despite arming functioning just fine. When armed and throttle at minimum, it will disarm itself after about 10 seconds fortunately. I suspect that the lack of being able to disarm from the radio and the yaw problems are somehow related. Radio calibration shows correct min/max values for yaw however.
I finished this build a few months ago and had a Spektrum DX6i radio system originally. The hexa flew great with the Spektrum. Greedy for more channels and hearing lots of good things about the Taranis, I opened my wallet and swapped out the radio system. On my first flight with the Taranis a few months ago, I had a crash that ended up breaking one prop and part of the landing gear. Hexa seemed fine otherwise. Got a new prop installed and repositioned the receiver antennas (lost radio contact with it on the first crash when only 15ft away). Finally got around to working on it again and verified radio was good from 100yards away in range test mode. Configured failsafes, added redundant power to the pixhawk, and added a geofence. Despite all of this, I can’t seem to get this bird back in the air.
I did upgrade the firmware to 3.2.1 recently (was running 3.2 previously). I was also running MP 1.3.19 code vs 1.3.30 now. Not really sure if either are causing this or not. Not sure what else to check, hoping someone can help point me in the right direction.
Can you post the .bin file from any of your flights where the yaw problem was present? With a lot of the yaw issues i’ve seen on this forum the best way to diagnose the problem seems to be a graph of RCOUT. This graph will tell you if your CW and CCW motors are putting out the same amount of thrust. graphing RCIN CH4 also shows you what it thinks your yaw chan center point is.
Thanks for your quick reply, this issue is driving me nuts!
Here’s the BIN file from my first flight attempt yesterday. All subsequent attempts yielded the same behavior, so I’m just posting the first flight since I remember the details of that flight more vividly.
All of my trims were neutral and I applied throttle. Immediately upon taking off, I observed the clockwise YAW rotation. I tried to correct for this by moving my YAW left and right which you’ll see on the graph. As the copter drifted further away from me, I attempted to trim YAW to the left a few notches right before I brought it down in a controlled crash over tall grass. Nothing I could do would stop the clockwise spin, which was the case for the rest of the evening.
I did discover along the way that my compass was fairly off (at least 45 degrees I’d say). Thinking this might be causing the problem, I did perform a compass calibration. What’s interesting however is that it seemed to want to use the Pixhawk compass instead of my GPS/Compass. This is not desirable as my entire power distribution is within an inch under my pixhawk. Not sure if the compass being totally wrong can cause behavior like this in a manual flight or not, but wanted to point that out as something of concern.
I graphed the output from your hexa motors and it appears that upon the use of throttle motors 2, 4, and 5 immediately start to output ~50% power while motors 1, 3, and 6 are only using ~10-12%.
Motors 2, 4, and 5 "should" be your CCW motors and if they are it would explain your CW rotation while attempting to takeoff.
What I would recommend trying to do is to remove all props from your hexa to include your ESC wires plugged into the pixhawk ports 1, 3, and 6. Leave the ESC connections for motors 2, 4, and 5 plugged in. Once you are set plug in the pixhawk via usb for mission planner (telemtry link will also work) and power up the hexacopter. Once you are powered up go into the initial setup page optional hardware for mission planner and open up the motor test page. Using the motor test page get each one of the motors to spin that are still connected.
What you are trying to verify isn't that the motor is spinning in the correct direction as you have already tested that but instead attempting to make sure motors 1, 3, and 6 DO NOT spin at all. The reason why i ask this is because as you stated attempting to slow down or stop the spinning with your yaw input it had no effect via transmitter. This tells me that your esc's may be backwards (I.E. motors 1,3 and 6 plugged into ports 2, 4, and 5). It would only take 1 ESC plugged into the wrong spot to produce the problem you are seeing.
Are you flying + or X Hexa?
I don’t think the compass is part of this issue because it shouldn’t have the authority to cause yaw despite counter inputs unless your Yaw P rate term is non-existent.
Thank you for taking the time to review my flight log and help me figure this out. I’ll take the props off tonight and perform the motor test as you have suggested and post what I find out.
I’m pretty certain I’m configured for X Hexa, at least, that’s what my build requires. 2 motors in the front, 2 in the back, 1 on each side. Plus would be 1 in the front, 1 in the back, and 2 on each side correct?
What should my Yaw P rate term be set to? I’ll double-check that tonight as well.
Yes the Hexa motor layout is as you have described. Motor layout picture attached to this post. Note: The motor layout depicted on the motor test page may use letters instead of numbers. The concept for your test remains the same.
The Yaw Rate P / and Yaw Stab P terms are completely dependent on way too many variables for me to directly give you a number. Everything from Multi rotor weight, arm stiffness, motor power, prop size, ect all play into that variable. Once you get it up and flying i’ve found it best to adjust Yaw terms visually based on how your multirotor is flying. Until then it is best to start with the default settings and a fresh firmware install.
Yaw tuning example (How i’ve ususally done it, others may prefer other methods):
Starting with the Yaw D term at 0
For a slow yaw oscillation i’ve increased my Yaw Rate P (Decreasing the I term may have a similar effect)
For rapid oscillations decrease Yaw Rate P
Stab Yaw P effects the speed of the yaw input but may also induce potential overshooting.
Few people have found Yaw Rate D helps dampen overshooting but too much will result in rapid oscillations easily confused with too much P term.
The higher the D the higher the P term may go.
Here are the results of the motor test. I disconnected 1, 3, and 6 from the Pixhawk like you suggested:
Test Motor A Result = CCW Spin, Position 5
Test Motor B Result = Long beep followed by 2 short beeps from Pixhawk, no motor spin
Test Motor C Result = CCW Spin, Position 4
Test Motor D Result = Long beep followed by 2 short beeps from Pixhawk, no motor spin
Test Motor E Result = CCW Spin, Position 2
Test Motor F Result = Long beep followed by 2 short beeps from Pixhawk, no motor spin
So it looks like I have everything connected correctly, right? 2, 4, and 5 are all CCW motors and were the only motors to spin during the test.
It seems strange to me that if the CCW motors spin faster, that the hexa would yaw right… but I guess that’s the way it works.
I wonder why motors 2, 4, and 5 are spinning faster as you suggest?
It does appear that all of your wiring is correct based on the results of your testing.
Next I would try to rotate each motor one position left. If your multirotor starts to spin the opposite direction then we know its possible that a motor is to blame for the malfunction. If the spinning remains to the right in a CW manner then i'd next investigate your ESC's. It could be a bad throttle calibration.
As for the direction of rotation it comes down to that equal and opposite reaction thing.
Motor spinning CCW = force applied to what motor is attached to in a CW manner.
now to complicate the thought process the same result can be achieved by:
Slow down a CW motor = Less CCW thrust applied to frame while keeping your CCW motor the same you will still spin to the right.
Multi’s accomplish yaw by altering the speed of all CCW and CW motors. On a quad you will always see 2 speed up and 2 slow down. The trick to not gaining or losing altitude comes in the form of increasing / decreasing them all together while still turning. Some Flight computers handle this better than others.
I did some more research last night about how multirotors achieve yaw and it all makes sense to me now.
“For every action, there is an equal and opposite reaction.” (Thanks Newton!)
As for shifting the motors one position each, that’s going to take me a while. I think I’ll try the ESC calibration first and see if I get lucky. I’ve done at least 3 ESC calibrations since I’ve built this thing, but I haven’t done one since the last crash I had back in February.
I still to this day do not understand the importance of ESC calibration. One would think that the Pixhawk would always try to compensate itself. Say for example, I put throttle at 25% and 5 of my 6 motors add 25% power, but motor #1 (on the right) only adds 10% since it’s not calibrated. Why is it that the Pixhawk doesn’t send even more than the 25% it thinks it’s sending to maintain level? It has a gyro built-in and performs this exact function in loiter mode against the wind. Just baffles me.
The pixhawk and all Flight controllers to my knowledge do their best to maintain level despite ESC calibration. The problem that happens when the ESC’s are not calibrated is more easily seen when you take it to a more extreme example
4 motors + 4 ESC’s
3 of the 4 ESC’s range is properly calibrated to the range of 1000-2000 PWM signal. We will call this 0-100%
the 4th is off by 50% and only outputs 1000-1500. and we can call this 0-50%
The Flight computer will initially output equal signals to all. Depending on how far off the calibration is one motor may not even spin at power on, or in this case will only provide 50% max power. If you do manage to get it into the air and request 51% once motor 4 reaches its perceived maximum it will sag. Some flight computers will compensate for this by automatically limiting all motors to 50%. The multiwii comes to mind…
Others however will let you continue to request more and eventually cause a flip.
So in your example the flight computer will in fact send your deficient motor more power. to restore balance to the flight. the problem will return however when the pixhawk thinks its sending max to all, and one only provides less.
One way or the other the flight computer will lose the battle and a spectacular flip and or crash will occur promptly.
Another example of this is when a motor is damaged and or is slightly binding. the FC will output a stronger signal to that motor at all times trying to maintain flight. This can be graphed via the pixhawk when your RCOUT Channels have a split that continues throughout the flight.
Hopefully your ESC cal solves this issue and you’ll be back up and flying soon. Sadly the solution that requires the most effort is usually the one thats needed in my experience. best of luck either way!
Thank you for explaining that to me. Being somewhat new still to multirotors has left me with a lot of questions.
So I have some good news. I was getting ready to perform the ESC calibration last night, but decided to fire up missionplanner first and poke around. I plugged my 3 motors back in and decided to do a motor test and make sure they all spun up, which they did. After that, I ended up heading back over to the radio calibration page again and noticed something I didn’t pick up on before. The PWM value for the yaw midpoint was different than my rudder PWM. I don’t remember how much it was off by, maybe 10 or 20 points? My minimum PWM and maximum PWM values on each channel seemed to be correct though, so I sat there scratching my head for a bit - wondering why yaw was not at the exact mid point. The trims on my transmitter looked fine, as well as anything else I could find that would have any bearing on this.
I don’t know if you remember me saying I was also having trouble disarming or not, but after seeing what I saw on the radio calibration page, I decided to try something. Normally one has to move the throttle down and to the left all the way to arm and down and all the way to the right to disarm. What I did was move my stick down and about 80% of the way to the left. What I noticed was that was good enough and caused the copter to arm. Moving down and all the way to the right would not disarm however. I had to wait the 10 or so seconds for it to disarm itself.
This started making me highly suspicious of the radio system… more so than before when I thought I had observed this, but more or less brushed it off. I ended up doing yet another radio calibration. Amazingly, this time the mid point on yaw came up where it should. At a glance, it looked right before, but looking at the PWM’s, it was slightly off. This time it was dead-on. Hey, what do you know, I can arm and disarm now all of the sudden. Maybe my copter will fly straight too?
I took it out back and the clockwise rotation was gone. Very strange to me still since moving yaw all the way to the left and adding throttle before wouldn’t stop the CW spin. Not sure if I stumbled on a bug or what, but was just glad to see the problem behind me.
I did end up crashing on my deck in all the excitement, but I think it was pilot error. Will take it to a larger field this weekend to fly and see how things go.
Thanks again for all your help!
Glad to see your YAW problem is resolved! I’m hoping the new firmware beta version helps fix my own yaw issues. Happy flying!