Uncommanded yaw variation/drifting

I have a Q450 frame which generally flies ok after an autotune, and can hold position, RTL, etc. I have done a compass calibration, and redone it several times. MissionPlanner shows the correct headng in Flight data when on the bench.

However, in flight it sometimes yaws without command, as can be seen from the attached log plot of Yaw, DesYaw and RCin4 (rudder). Also, sometimes giving sharp yaw commands can cause a slow (a few Hz) roll/pitch oscillation, which goes away when the rudder stick returns to centre.

On the graph, at around 3600 the copter yaws significantly (it wraps around 0 to 360), and then settles at around 3800, all with no rudder input at all. It was in stabilise mode throughout.

I have compass learning turned off (0), and have tried with AHRS_GPS_GAIN at 1.0 and also 0.0.

Any suggestions or tips would be much appreciated!
[attachment=0]YawIssues.jpg[/attachment]

hi, a log file would be easier to try and diagnose than your picture.

Stu

Thanks - here it is. Between 3600 and 3800 is a good example of the problem.

:frowning: too big for an attachment? I get a weird error message about Guru meditation…

So here is a dropbox link: dropbox.com/s/h9qftd2umj84s … 9.bin?dl=0

[quote=“RabbitStu”]hi, a log file would be easier to try and diagnose than your picture.

Stu[/quote]

[quote=“PeeBee”]Thanks - here it is. Between 3600 and 3800 is a good example of the problem.

:frowning: too big for an attachment? I get a weird error message about Guru meditation…

So here is a dropbox link: dropbox.com/s/h9qftd2umj84s … 9.bin?dl=0

[quote=“RabbitStu”]hi, a log file would be easier to try and diagnose than your picture.

Stu[/quote][/quote]

not sure this is the issue but the auto analysys has a compass warning Log File C:/Users/Stuart/AppData/Local/Temp/tmp82CC.tmp.log
Size (kb) 1198.0654296875
No of lines 17460
Duration 2 days, 12:44:27
Vehicletype ArduCopter
Firmware Version V3.2
Firmware Hash c8e0f3e1
Hardware Type
Free Mem 0
Skipped Lines 0

Test: Autotune = UNKNOWN - No ATUN log data
Test: Balance/Twist = GOOD -
Test: Brownout = GOOD -
Test: Compass = WARN - Moderate change in mag_field (29.82%)

Test: Dupe Log Data = GOOD -
Test: Empty = GOOD -
Test: Event/Failsafe = FAIL - ERR found: GPS
Test: GPS = FAIL - Min satellites: 0, Max HDop: 99.99
Test: IMU Mismatch = NA -
Test: Parameters = GOOD -
Test: PM = GOOD -
Test: Pitch/Roll = GOOD -
Test: Thrust = GOOD -
Test: VCC = GOOD -

your yaw doesn’t look particularly locked in either. desyaw will chase yaw around if yaw can’t be maintained. try tuning your yaw up, my rate yaw p is 0.6, yours 0.2, my rate yaw i is 0.06 yours 0.02 and my imax is higher at 1000 compared to your 800…not saying to use my values, but maybe tweak them up a bit one at a time slowly to see if yaw authority improves. I was thinking of detuning mine as its quite aggressive, but yours looks like its struggling to me.

Thanks for the reply.
29% - that seems a lot! Could that be motor interference?

It makes sense, if I understand correctly, that desYaw chases Yaw if it cannot control the yaw. I wonder why the software does that - why isn’t the desired heading the desired heading, no matter what happens? That’s what I was expecting.

I tuned it all down in an attempt to minimise the wobble and yaw problems. I thought the yaw gains were too high, resulting in too much change in the motors, hence the wobbling. Its a huge pity that auto tune doesn’t do yaw as well.

I will try easing them up again…

You mention imax at 1000 - that means 100% of throttle for yaw control right? It was that - I thought that’s a lot, and could result in two motors switching off completely? I thought that could cause a wobble if the COG is a bit off?

[quote=“RabbitStu”][quote=“PeeBee”]
not sure this is the issue but the auto analysys has a compass warning Log File

your yaw doesn’t look particularly locked in either. desyaw will chase yaw around if yaw can’t be maintained. try tuning your yaw up, my rate yaw p is 0.6, yours 0.2, my rate yaw i is 0.06 yours 0.02 and my imax is higher at 1000 compared to your 800…not saying to use my values, but maybe tweak them up a bit one at a time slowly to see if yaw authority improves. I was thinking of detuning mine as its quite aggressive, but yours looks like its struggling to me.[/quote][/quote]

I also noticed that even though you have a quad set, that all 8 channels are hot.

Also the motor outs show that 1 and 2 are spinning faster than 3 and 4 which is a yaw in the counter clockwise direction which is what your seeing. Just don’t know why APM is doing that. Since they are rather high you must have a heavy craft.

Yaw seem to get worse as you fly. Check that no high powered wires are running next to the compass.

Mike

[quote=“PeeBee”]Thanks for the reply.
29% - that seems a lot! Could that be motor interference?
[/quote]
Check your wiring for loops and proximity to your compass. Have you done a compassmot?

Its done on purpose in the code, I think so the control system doesn’t just spring back if it can’t cope and fighting itself. When tuned its not an issue, only something very extreme would knock it out of kilter, and should never happen if all motors are running correctly on a quad. On something with redundancy it will even fight a dead motor in most cases.

Yeah try upping them a bit. If gain was too high and oscillating, yaw would be more centered on des yaw but oscilating either side, yours just seems to wander not keeping des yaw, and falling either side as conditions dictate.

imax is basically a limiter value that stops the i term of the PID ramping up and up and up if it can’t get to desyaw. The I part basically tries to bring the error between des yaw and yaw to zero. Imagine it this way if some one is pushing on you trying to make you lean over your PID in your head will fight back. Imagine you only used the P part to try and stop them pushing you over, you would push back, but you wouldn’t push back hard enough to get back to the same position you were before they pushed you. The I part sees the error and increases until the error is zero, you are back to where you want to be (ignoring oscillations over shoots etc :slight_smile:). the iMax limits how much this can ramp up, so if too low you won’t be able to get back to where yo want to be if being pushed.

I would try upping the other terms a bit first, but if its starts oscilating you may have to wind back, but maybe increase imax.

An example of this is you have a twisted arm meaning the propeller on it adds a rotation force (torque) trying to yaw the copter, the with a low i limit the copter may keep spinning as it can’t add enough to fight back.

which relating to that iseries has a good spot on that motors speeds. 1 and 2 spinning at different speeds to 2 and 4 could be caused by 1 or more arms twisted which is trying to yaw the copter, the apm is fighting this by using the differential motor speeds. It doesn’t take a lot of mis alignment to see this effect. Check all motors are square, it will impact efficiency of there is any twist, and make the yaw controllers life a bit easier too :slight_smile:. If it was a weak motor I think the outputs would look generally unbalanced rather than each pair looking as similar as they do.

Stu

Thanks, just flew it and the problem seems gone! :smiley:

What gave me the clue was you saying two motors were spinning faster. I had some protecting legs on the frame, and they were not quite vertical, so as they were caught in the down draught they put a yaw force on the quad. I think this is what was turning it as certain motors powered up.

The yaw rates are still at the low level. Its not heavy - about 1.3kg.

Is it a problem that all 8 channels are ‘hot’? I am not sure I know what this means…

[quote=“iseries”]I also noticed that even though you have a quad set, that all 8 channels are hot.

Also the motor outs show that 1 and 2 are spinning faster than 3 and 4 which is a yaw in the counter clockwise direction which is what your seeing. Just don’t know why APM is doing that. Since they are rather high you must have a heavy craft.

Yaw seem to get worse as you fly. Check that no high powered wires are running next to the compass.

Mike[/quote]

glad you found it, happy flying