Quad Climbs Uncommanded in the Wind

I’ve been doing some test flying on a quad after mounting some new motors/ESCs on it. After tuning it, it flies great when it’s calm (Althold, loiter, and guided), but when it’s windy it buffets a lot and doesn’t fly smooth and it starts climbing uncontrollably. When this happens I have to fight it until it eventually quits climbing for no apparent reason. When I get it back it seems to somewhat fix the issue until it flies again. This has happened 2 times in the wind, but I flew twice in the calm and it was flawless in all 3 modes. After I autotuned it and had it flying well on a calm wind flight, I disabled the MOT_HOVER_LEARN but this made no difference.

Does anyone have ideas on why it would behave like this? If any more info would help I do have the log file.

The usual. Post a link to a .bin file flight log where this is occurring.

Make sure the baro is wind protected.

Thank you for the input so far. Those sound like viable solutions I’ll try. Here is the log file:

https://drive.google.com/file/d/12cYngScPWjyCEYHT_bgE74N5HxKvWdQM/view?usp=sharing

The main problem is vibrations, particularly Z axis of course

Motor 3 is going to minimum at times which means there’s going to be problems descending even without vibrations

Attitude control can do with some work

General motor output imbalance - this indicates a physical yaw bias in this case. So check for motor mount and frame twist.

MOT_SPIN_MIN,0.2 is high-ish, only just lower than MOT_THST_HOVER,0.2683
This wont be helping the ascent problem.
I would lower MOT_SPIN_MIN to around 0.15 (you’ve got MOT_SPIN_ARM,0.04 so we should be assuming motors can spin reliably at very low RPM). Use the MissionPlanner motor test to check these values.
Re-enable the Learn and save setting would be my recommendation, at least for testing and tuning. Later if it seems to interfere with payload-swaps or something you can manually set hover thrust if you need to. Even set it to learn but dont save - later after more tuning.

MOT_THST_EXPO,0 ?? What props, motors and ESCs do you have?

Caveat -> custom firmware: ArduCopter V4.0.2.10 by Skyfish
EDIT: highly recommended to use latest stable release and do the bootloader update with Cube Orange. If you are in control of the custom version, make sure it is based off latest stable.

1st fix the vibrations and yaw bias, disable the internal compass
2nd check some initial params via sreadsheet, set everything it recommends (or ask here)
3rd hover tests and set up Harmonic Notch filter, Autotune
4th get back out there!

Come back here with a new log file after each step if you need to, or ask for help. Happy to oblige.
It’s easier than expected to set up the harmonic notch filter and is extremely worth while, shout out when you are ready.