Cannot switch to loiter mode with optical flow

Yes it should you need an external distance measurement and a sonar can be used.

Thank you @ppoirier.

I will test with Copter 3.5 and update the progress.

Hi Madhu,

I was able to resolve my issues by reloading the firmware. I had tried this unsuccessfully before, but I found some other advice that said to load the firmware for a different type of airframe (e.g., ArduPlane), then reload the ArduCopter firmware. This resolved my issue of not being able to switch to loiter mode.

Last time I checked, there was a strong recommendation not to use the onboard sonar because it is unreliable over a large number of surface types. I recommend doing some testing on surfaces you will be flying over before actually flying.

-David

Hi David , ppoirier,

I tried the both the ways as you suggested. But still I am not able to enter into loiter mode.

Its is beeping twice and showing flight mode is not changed. I observed one thing with copter 3.5.1, after putting FLOW ENABLE to 1 and restarting the pixhawk again the FLOW ENABLE is going back to 0.

Help me with this.

If you have good readings from optical flow (numbers change values an polarity according to movements) and that you have readings from sonar and EKF is ser correctly it should get into loiter

Otherwise click on the reset the parameters button and reconfigure

I am having similar issues with PX4flow and LidarLite v3 and pixhawk 2.1, on 3.5 copter release.

They are giving meaningful values, and I disabled the arming check for GPS and Range finder already.

I can’t arm or switch to LOITER mode. Althold works, no GPS module.

Any ideas would be helpful!
00-01-01_01-14-30.bin (936 KB)

@proficnc Phillip, what is the Bus Address of the external I2C ?

Copter 3.5 has one bug with booting the px4flow on start up.

Check one thing, are you getting optical flow readings when you power up the pixhawk with battery ?

In my case I was getting readings only when I power the pixhawk with usb, it was not showing values with battery.

Help me with this.

I tried calibrating my px4flow sensor as per the documentation. My optical flow data is very very noisy. I have kept chess checker board to focus and tune the FLOW_FX and FLOW_FY. I am gettingg very noisy values.

https://www.dropbox.com/s/qa72bj5u4vlcuvu/optical_flow.png?dl=0

Help me how can I sort this out ?

I didn’t in fact have readings when flying with battery. You are right. I will see how I can use copter 3.6. Does copter 3.6 dev exist?

Are you using pixhawk 2.1 as well? I don’t know maybe 1m/s error is still fine for flying?

Otherwise I will check if loaded the required version of firmware and calibrate again. I will see what kind of measure I am getting for comparison

Which firmware version are you using?

Is this data recorded during flight, or just while you’re holding it in your hand? If it’s during flight, you might want to make sure that your props are very well balanced. If you have your Pixhawk connected to MissionPlanner or QGroundControl while you try to arm in loiter mode, it should give you a reason why it is unable to arm. Have you checked this? What was the reason?

If you connect your pixhawk to the MissionPlanner or QGroundControl software while you try to arm the system, it will give you a reason why it cannot arm. Have you tried this? What was the reason given for not being able to arm?

Hi thanks for reply.

Arming in LOITER works when powered with USB, LOG file displays OF information.

Currently I don’t have telemetry so I have to read the log to see why the arming doesn’t work with battery.

When powered with battery, arming/ mode switch fails, and the log doesn’t have optical flow data. I enabled logging while not armed and FLOW parameters are alright. Is the reason for arming/mode switch failure logged somewhere in the log file?

Are you using pixhawk2 the cube together with arducopter 3.5?

Yes same problem I faced.

There is a small thing you can do, power the px4flow from on board computer if you have it will work.

or connect the usb first and then connect the battery and remove the usb, then it will work. The problem is with booting. The same problem is there with PX4 flight stack, there is hack for that. I checked the same for arducopter I didn’t find any use full patches.

@superlazy

Hi,

I got that data when calibrating with hand. I tried following the same as per the documentation, the outcome was that.

I observed one thing, When I flashed the PX4 FLow with stable firmware from QGC 2.0 the flow data was really good. But with the suggest firmware from ardupilot doc is showing to much of noise in its flow data. If I use stable firmware I am getting 0 (zero) reading for FLOW_X and FLOW_Y in the logs, so I had to switch to ardupilot suggested firmware. Its is very noisy, and the drone not at all staying in the same place.

Suggest me some thing on this.

Interesting. Let me test it.

The quick hack works, thanks!

Update: Mine has flow value between ±0.2 when hover by hand. I will test loiter now.

I achieved position hold with this setup. With some pattern downneath it was able to hold position at 1 meter
real well. I am using Lidarlite v3, and the focal length is set at max, around 2 meters.

@JD-ETH

What is the minimim focus range I have to fix if want to fly it with in 1 m height ?

Please tell me the procedure you followed to do the calibration ?

Which fiware version you are using ?

You can tune the focal length by using QGC and turn the camera. But some newer version seems to be fixed and not tunable. I checked the video quality in QGC to be pretty nice at my desired height (around 1.5), then I tuned the YAW_ORIENTATION so that the axis align. And it works fine.

I use copter 3.5.2 rc1 i think, the current beta

Best of luck!

Really useful information!

Would be nice if the wiki was updated to match the current progress…please.