PX4 delayed startup?

Very often I get an EKF Internal Checks Error → not arming
I figured out that the magnetic canopy mount has to be closed immediately after the battery is connected for reducing the magnetic field to the value which mag cal was done. But closing the canopy adds vibration into the start procedure. Mostly this error occurs and does not arm. (all sensors got already calibrated several times …)
Waiting, warm up and then restart mostly doesn´t solve it.

Does there exist a parameter to delay the start procedure to have more time to close canopy and place the plane into a calm location for a proper initialisation of the FC cause I have to wait anyway till telemetry is connected? (previously I thought its the Chinese low sensor quality but after upgrading to Holybro it´s the same behavior)

To me this sounds like that the magnetic canopy is interfering with your mag. My opinion is that you should try to fix this interference, since the mag is usually combined with the GPS receiver, I would try to move the GPS (including mag) further away from the magnetic canopy.

If you have magnets on your airframe, then every mag sensor will pick up the field because it’s real and not a fluke that only shows up in “bad” sensors.

I know all this … and it works if I close the canopy fast enough without causing too much vibration … there are more FC and 2 GPS rec built into that airframe so there is not enough space to put all to places that are not magnetic at all … so is there a possibility to delay the startup a few seconds ? If the canopy is closed the field is reduced to a value to fly without problems only canopy open causes a field that disturbs to much. Further a fan was needed to cool the controllers which does add additional magnetic disturbance. But it reduces the temperature drift of the sensors.

I see. Well you can add a sleep 10 in the startup script, e.g. here:

1000 thanks, that works up to 12 seconds, above QGC displays a time out error cause mavlink seems to start earlier … flight tests will follow later (still enough time to place the plane with closed canopy into a vibration free space …)

1 Like

I don’t think MAVLink starts earlier but maybe you have another MAVLink component that you’re receiving?

tested with a spare PixRacer connected via USB and 12 sec works perfect without any errors.
Would it not be nice to add a start delay into the parameters to increase the delay eg in case of a cold start with very low temperatures.
And lower the delay for warm start or higher temperatures.
It would be much easier compared to calibrating a sensor temperature compensation.

since the 12 s startup delay I had no errors anymore, I could share the log (review.px4.io) but currently the log upload ends up with “HTTP Error 500” whereby viewing old logs still works

Thanks for the note. I was just told log upload should be fixed.

It seems that the arming procedure requires as well that the plane doesn´t move at all in this moment. here´s a log:
https://review.px4.io/plot_app?log=2998bcc2-07c2-4af6-821c-627187f0d79c

Hi Julian, Up to V1.11 I was able to use this delay of 3…5 sec at the end to successfully avoid e.g. high accelerometer bias and various other errors on different boards (some without sd slot).
Unfortunately, in V1.12 I can no longer find a good place where a delay of more than 2 seconds does not produce serious side effects.
I have also tried it board specific in boards/extras. Where would the best place for e.g. “sleep 5;ekf2 stop;sleep 1;ekf2 start” without generating other problems. This would also set alt rel to zero.
It would also help to delay the whole preflight check or do it one more time.

If you build the firmware yourself, you can just add it right here:

Much thanks, tried it, works perfect for copters but with vtol (magnetc canopy) it seems that it has to be inserted to rc vtol apps.

Yes of course, that makes sense.

How about implementing a “startup delay” parameter for all vehicles? Then a delay from 0 to 15 sec could be set if needed.

Feel free to make a PR.