Problem ek2 in flight

Hi, I recently made a drone with a Durandal flight controller. Everything is fine in general, but after a while I get a message about ek2 that it has crashed and some parameter needs to be changed to “0” before writing, of course I searched and read somewhere that “ek” receives different data from the barometer and gps - and for height it is bugged, yes, but I didn’t see a solution to the problem anywhere. please if anyone can help me I would be very grateful for that! I’m also attaching some short gogs from the flights so you can look at them if it becomes clear, thanks.
2022-12-06 12-51-41.bin (407.8 KB)

That log is useless, there’s no effective flight and the error you talk about is not there.
Also there’s some odd things like the battery voltage goes up while current goes up - backwards to normal :frowning:

Set these for the next flights
EK2_ENABLE,0
INS_ACCEL_FILTER,10
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

And update to latest stable firmware too

Upload a new log to a filesharing service like Dropbox or similar, and provide the link to it here

I am sending 3 logs that I have downloaded from the quadcopter, if it is not in flight I will download more, thanks for the review!!!

You need to disable EK2 as Shawn suggested and make the other parameter changes. Before advancing you will have to address the very high vibration levels with clipping events. They are very bad when it’s on an isolated IMU.
Work on it, plot this same graph and Aim for the peaks to be < 15-20 with no clipping:

You battery is sagging precipitously also.

just want to say i solved the problem, it was really coming from the big vibrations on the controller, i put it on rubber pads and everything went great! thanks to those who responded and helped!

Make sure you do the settings I suggested
If you can provide another log after that we can check a few things.

Copied here:
Update to latest stable firmware
EK2_ENABLE,0
INS_ACCEL_FILTER,10
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

Yes, I made the changes you recommended, I am also attaching a log file of the last flight to see if there is anything else to change :slight_smile: thanks!

OK set these next
INS_HNTCH_ENABLE,1 ← set this then refresh params to see the rest
INS_HNTCH_BW,30
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_FREQ,60
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.18

The FFT looks like the frequency to target is around 120Hz, but the motor outputs are so noisy that the FFT graph is just being swamped with a spread of frequencies.
image

Anything you can do to further reduce vibrations will be effort well spent.

I think the correct target frequency is 60Hz to 70Hz so we’ll try my settings for now and subsequent flights will tell more. I base this on your (estimated) prop size and the fact that usually the tallest peak is the first harmonic, not the actual base frequency.

Apart from motor outputs being quite “noisy” , the attitude control looks reasonable.
If you can do a bit with vibrations and run another test flight just in AltHold with hovering and gentle movements, you would be able to move on to Autotune and get this very well performing.

All the noisy motor outputs and 2nd-rate attitude control just consumes more battery power than required. Improved tuning can help flight time and reliability.

What ESCs and motors and props do you have?

The motors are some “fictional” (cheap) e-max, I think they were, the speeds are nice, since I had to change them, they are Tekko32 F4 45A. I will try to remove the propellers and try to balance them, as I also deal with airplanes and helicopters and I know that they balance the propellers, hopefully this will reduce the vibrations even more! I will do it at the first convenient moment and give results here, since I am from Bulgaria and the weather here at the moment is about 0 degrees :slight_smile: thanks for the tips, I will try to do this as soon as possible and write :slight_smile: have a nice day

With that weather you might have some spare time :slight_smile:

I’m going to ask if you can do some rewiring regarding those ESCs.
This will use them as BLHELI Bi-Directional DSHOT.
You had selected to use DSHOT previously but it wasnt working because the motors were connected to the ordinary PWM outputs. This is much more reliable than ordinary old PWM, and you can get RPM data from the ESCs too. All without extra wiring.

First load the bi-directional DSHOT firmware, it’s the same as what you have now and will keep all existing parameters, just with a bit extra capability.

  • Connect the flight controller to MissionPlanner and go to Setup / Install Firmware
  • Click on the quadcopter icon and so on…
  • When you get to “More than one choice exists” you choose the Platform and Firmware with Durandal and bdshot in the name (my example here is using an old Pixhawk1)

After that’s all done and you’ve rebooted, change this wiring:

  • Plug the ESCs into AUX 1, 2, 3 and 4 (instead of the Main 1,2,3,4)

then set these parameters:
BRD_SAFETY_MASK,12543
BRD_SAFETYENABLE,0
BRD_SAFETYOPTION,0
INS_HNTCH_MODE,3
INS_HNTCH_REF,1
MOT_SPIN_MIN,0.12
MOT_PWM_TYPE,6
SERVO_BLH_AUTO,1
Apart from setting you up for DSHOT, these also disable the Safety Switch - just so you are aware!
This is much easier for testing, and I think actually safer since you dont have to be amongst the props to press the safety switch at all.

In MissionPlanner Setup / Mandatory… / Servo Output
Use the Function drop-down list to change the Motor1/2/3/4 from being on Servo 1/2/3/4 to being on Servo 9/10/11/12 position
From this


To this

Then reboot the flight controller

Now you should be able to download and unzip BLHELI32 Suite from

With the flight controller connected and a battery connected to power the ESCs (props off is a good idea!)
you can run the BLHeliSuite32.exe and it should connect to all the ESCs through the flight controller pass-through option

  • Select Interface, Betaflight
  • Select a Comm port and Connect
  • Read Setup
    In the BLHELI settings adjust these:
  • Temperature Protection = 100
  • Low RPM Power Protect = OFF
  • Low Voltage Protection = OFF (it might be off by default)
  • Sine Modulation = ON (I use this, but you dont have to, it’s optional)
  • Write Setup

No need to change timing or any other BLHELI settings.

There’s plenty of info here, but you can safely ignore most of the settings listed there, I’ve already specified the ones you need.
https://ardupilot.org/copter/docs/common-blheli32-passthru.html

DSHOT should be working now and the Harmonic Notch Filter will take it’s input from the RPM reported by the ESCs.

Do another test flight in AltHold and Loiter when possible.
We should see the RPM data in the log under the ESC catagory.

you are a great hacker, a unique person, I am amazed by your knowledge!!! i will TRY to do all this and write, thanks a lot for all this info!!!