PX4Flow not working with Copter 4.0

I just updated my Quad from AC 3.6.10 Nuttx to Arducopter 4.0.
After the update I am getting now a Bad Optical Flow Health message and zero readings on opt_m_x, opt_m_y, opt_x, opt_y and opt_qua.
All parameters look ok, and the wiring of the PX4Flow is ok.
Optical Flow was working 100% fine with AC3.6 with 100% identical hardware setup prior to the upgrade.

Another strange observation is with my LidarLite Rangefinder connected through PWM. While I am getting reasonable readings for sonarrange and rangefinder1, the Parameter RNGFND1_OFFSET has zero effect on the readings. This was also working well with AC3.6.
Any ideas?

To add-
not sure if my issue is related to this issue Kakute F7 Mini and Kakute F7 AIO PX4Flow Not Working in Copter-4.0

I am running a Cube green.

@mtbsteve,

Can you post an onboard log file? It’s mostly guesswork without a log file…

@rmackay9 Hi Randy,
Here you go:
https://1drv.ms/u/s!AnKeW8KMoCcyhiMb9kF6WwfbQgGA?e=sqpNtV

I just retested with AC4.0.1 RC2 and with AC 3.6.12 NUTTX.
While the PX4Flow works fine with AC3.6, it fails to produce any output with AC 4.
I am on a Cube green.

@mtbsteve,

Thanks very much for that. I’ve reproduced the issue including it being a regression compared with Copter-3.6.12 so we will investigate and hopefully come up with a fix soon.

I’ve also added it to our Copter-4.0 issues list so it’s not forgotten.

Txs for the report!

OK, I think I’ve found the issue and created a PR to fix it. It needs to be peer reviewed but I expect it will be included in 4.0.2 which will likely start beta testing soon after 4.0.1 becomes the stable version.

1 Like

@rmackay9 Did you fix it? I’m facing the same problem of @mtbsteve in 4.0.7…

@S259420,

Yes, the fix was included in 4.0.2.

Another common issue is the flow sensor comes up too slowly so you need to set BRD_BOOT_DELAY to 600 to delay the autopilot’s startup (by 0.6sec) to give time for the flow sensor to boot up first.

Thankyou, your suggestion solved the problem

1 Like

Great, I’ve just added this advice to the bottom of the flow sensor’s wiki page so hopefully this will help the next user who hits this issue.