APM 3.3rc10 -(OF) Px4flow+Lidar: Loiter-Prearm:need 3dfix

Hi,
i am using the px4flow + lidar light combination at my pixhawk with apm 3.3rc10. I did the setup like mentioned in the wiki (copter.ardupilot.com/wiki/common … -overview/) and all seems to work ok in the prearm-logs.
After i have set the EKF_GPS_TYPE to 3 (optical flow) i cannot arm anymore in loiter, giving me the Message
"Prearm: need 3d fix". (i have a gps+compass attached too, which is working fine if i change the EKF_GPS_TYPE back to 0)

Does anyone have the same issue?
Could it be since the last rc10 commit:
“2) b) always check GPS before arming in Loiter (previously could be disabled if ARMING_CHECK=0)”
?

I would be very grateful if someone can help me.
Regards
Kraxnor

Hallo,
i have attached 2 log files and my current apm-config to my issue
(i used dropbox links, because the log files seem to be too big for the forum upload):

Here are some graphs, showing the opt-flow and lidar light is working

  • 1 orig

  • 2 apm firmware

Regards
Kraxnor

Disable GeoFence and enjoy!

Hey and thx for your reply,
i think i already disabled geo-fence by setting the param FENCE_ENABLE to 0, here the part i copied out of my config file (attached to my first post: dropbox.com/s/802gdp1iv4k11 … param?dl=0)

FENCE_ENABLE,0
FENCE_ACTION,1
FENCE_ALT_MAX,100
FENCE_MARGIN,2
FENCE_RADIUS,300
FENCE_TYPE,3

is it perhaps required to set FENCE_ACTION and FENCE_TYPE to 0 too?

Regards
kraxnor

Hi,

Recently, I ran into the same issue.

Looking through the recent changes in the code, it looks like your comment was spot on.

[quote] Could it be since the last rc10 commit:
“2) b) always check GPS before arming in Loiter (previously could be disabled if ARMING_CHECK=0)”
?
[/quote]

The order of pre-arm checking logic was modified in a way that prevented you from arming in Loiter unless you had GPS 3D fix.

Here are the changes I made which enabled me to arm in loiter mode without GPS, as long as EKF_GPS_TYPE is set to ‘3’ and PX4Flow unit is sending data.

https://github.com/senzai/ardupilot/commit/159696a7ae7108c73e4453320a88648e81fb8bfc

I haven’t done much testing on this and I’m still having issues with the build-in sonar on PX4FLOW not updating EKF5.meaRng as the wiki suggest should be the case. Also, at least since the rc10 release, it appears the latest 3.3 release branch wasn’t tested with OpticalFlow. So please be cautious if you want to try my mods.

Hi, and thank you for your code changes,
i will test them on the coming weekend at an open field and will tell you how it worked.

You mentioned “I’m still having issues with the
build-in sonar on PX4FLOW not updating EKF5.meaRng”

I only got this working, by adding an additional range sensor (f.e lidar lite) to the controller.

The wiki says:

regards
kraxnor

Thanks for the pointers.

Since I was getting some data through OPTICAL_FLOW.ground_distance in telemetry logs, I assumed the wiki was just outdated…

I’m flying pretty small 250 quads indoors (major reason for not using GPS and relying on OF instead), so LZ-EZ4 should be good enough for me (I have SF02/F LiDAR as well, but it’s too bulky and heavy). I’ll see if I can use the readings from the sonar on PX4Flow in EKF. If it goes well, maybe I can expose this setting via MAVLink parameter so people have the option of turning it on or off from their GCS.

I just found out on GitHub that there are other people having the same issue:
github.com/diydrones/ardupilot/issues/2832

I posted my patch there as well, hoping people who know what they are doing can take a look and maybe suggest a better way to go about fixing this.

Hi,

One of the APM Dev Gods came down and solved it, like, within an hour of me posting on GitHub. How amazing is that?

It looks like we’ll be able to use OpticalFlow in all modes with the Copter 3.3.2-rc2 release which should be released this week.
github.com/diydrones/ardupilot/ … -157620722

I’m assuming this means we DON’T have to arm in loiter mode anymore, and thus there’s no need for my mods.

So I suggest you wait for the RC2 release and try that build instead of my hack.

Cheers,

[quote=“Goro Senzai”]Hi,

One of the APM Dev Gods came down and solved it, like, within an hour of me posting on GitHub. How amazing is that?

It looks like we’ll be able to use OpticalFlow in all modes with the Copter 3.3.2-rc2 release which should be released this week.
github.com/diydrones/ardupilot/ … -157620722

I’m assuming this means we DON’T have to arm in loiter mode anymore, and thus there’s no need for my mods.

So I suggest you wait for the RC2 release and try that build instead of my hack.

Hello, I mounted my HKPilot32 and configured it with the Mission Planner(1.3.32.7 the last version). The actual version of the HKPilot32 is 3.2.1. I use “E300” controllers. All configuration is OK. Connecting the Battery, the controllers son signal is OK. Some minutes later obtained GPS fix with 7 or 8 satellites even indoor. ARMIN is correctly signalled by song and Mission Planner. Unfortunately there is impossible to start motors. Please help me with answers: a) Must I change to the last software version? Eventually an other proved to working. b) Are there some particular conditions to start the motors when using OPTO “E300” ESC’s? Which ones?

Yours, Georges

Cheers,[/quote]

Hi All,
I solved the problem with starting the motors. It was do to the lack of +5 V feed for the OPTO E300 ESC.

UNFORTUNATELY now the motors 2 and 3 are super amplified. Consequently the Quad tends to turn on the right.

Please help with your conseils.

Yours,
Georges

Hi,

Have you done ESC calibration?

youtube.com/watch?v=gYoknRObfOg

[quote=“Goro Senzai”]Hi,

Have you done ESC calibration?

youtube.com/watch?v=gYoknRObfOg[/quote]

I have OPTO E300 ESC controllers. As I know for this type of controllers there is not necessary to perform the calibration. The command differences for the motors are viewed also in Mission Planner 1.3.32.7 used. It comes from the software. I suppose the existence of a wrong parameter value.

Yours, Georges

You might want to try calibrating accelerometer first and then do the compass calibration and see if it makes any difference.

So I think this “need 3dfix” issue is resolved in Copter-3.3.2-rc2 so i’ll close this issue.
I think @kraxnor’s issue can be raised as a separate/new issue.

Hi and thank you all for your replies/work to this issue.

I had the chance to test my setup yesterday with the new 3.3.2-rc2 release, and everything is working fine now. The copter loiters very stable, even on bad lighting conditions and bad ground surface textures/contrast.
My measured spikes of the lidar light rangefinder seems to be gone, if i boot the pixhawk via usb first (which is also required for the OF to be working)

Regards Kraxnor

Hi kraxnor

It’s very glad that your drone can hover stably indoor.

I also tried v3.3.2 rc2 to fly my drone with a px4flow and an external sonar module.

But drone can’t armed in loiter mode, I tried to arm in stabilize mode and turn to loiter mode to take off my drone, but the drone couldn’t hover and lost control. Everything seems to be fine as calibration process, so now I don’t know what to do next. Can you help me to figure out what happened or give me some comment. Thanks!!