Thank you for the detailed information. I will try to replicate the circle mode dips in another area (or surface) when the weather permits. I will also look at your tutorial link and see if it deviates from the APM Wiki where I set up my PX4 Flow board and firmware.
I noticed that you have two sonars installed on your copter (one on PX4Flow and one Maxbotix). You canāt have two sonars powered at the same time because they will interfere with each other. The way they work is to send a pulse and then listen for that pulse to bounce back and measure the latency. If you have two sonars sending pulses, they will hear each otherās pulses and return incorrect readings.
It is true that there are two sonars but only the one external to the PX4Flow board is activated. The sonar that comes with the PX4Flow board is not accurate enough for good distance measurements.
The installation I used is in the APM Wiki here. The Wiki also contains a list of appropriate external sonar devices with a wide range of pricing.
I do not know why you need to arm in Loiter mode. I typically arm in Stabilize mode and move the quad out onto the field for testing before changing to other modes. Currently, Stabilize mode is the only mode I can count on for accurate flight when Optical Flow is enabled. Note that you still need to pick up the quad before arming to calibrate the range finder.
I just happened to re-test my Tarot 650 quad yesterday in a wild field of long grass and bushes. I did video the two flights but decided not to render them on Vimeo since the performance was so poor. Several times, even though I was at a proper height, the quad was almost destroyed. I am still using the same firmware and parameters as mentioned above in my previous post and video.
When switching from Stabilize mode to Alt Hold mode, the copter would always dip significantly in height forcing me to raise the throttle setting to gain height. When switching to Loiter mode, the copter would usually stay in proper position. In this tall grass field, Circle mode did not work well. Switching back to Loiter mode from Circle mode made the copter move off rapidly in a wrong direction. I was forced to switch back to Stabilize mode and fly manually home.
It seems that BARO works much better for altitude hold and my M8N GPS works best for position hold than using the Optical Flow feature. It may be that my choice of an inexpensive rangefinder (Maxbotic I2C EZ4 $40.) does not perform well. Using a more expensive Lightware SF11/C 120m unit for $249 or Lightware SF10/B laser rangefinder for $400 may provide better results but they are not in my hobby budget.
I will likely abandon my Optical Flow testing for now and simply switch back to BARO and GPS with a parameter change. Perhaps the better sensors will come down in price for DIY users and I can revisit Optical Flow on a new copter firmware release. I am also waiting for prices to drop on RTK since $700 is beyond my hobby budget.
I tried the First Flight (Copter Only) as mentioned in the guide - I started flying the copter indoor in STABILIZE mode with EKF_GPS_TYPE = 0 at a height of 1 meter (approx). After a few minutes of flying, I switched to ALT_HOLD mode and my copter suddenly took an extreme hike in altitude and hit the ceiling and crashed, damaging the legs. Though it was not enabled to let ELF use Optical Flow, I am not able to figure out what went wrong.
Test 2:
I went to open space, set the EKF_GPS_TYPE parameter to 3 to make the EKF ignore GPS and use the flow sensor. Started flying in STABILIZE mode, took to copter to a height of 2 meters (approx), then switched to LOITER mode - Just in a nick of time, the poor copter dropped down damaging the legs, props and one motor. It didnāt get disarmed, I guess it just couldnāt respond to the throttle or something I donāt know.
I am expecting to find the reason for these behavior before I do any further experiment with my copter.
My todayās goal was to test Position Hold using Optical flow and Lidar Lite V3 in LOITER & ALT_HOLD mode. But my ultimate goal is to make this thing work in GUIDED & GUIDED_NO_GPS mode. I want my copter to hold position even if GPS is not available for which I thought I could use Optical flow. So after this, i need to figure out - How to make this work in GUIDED mode.
Iāve had a CUAV PX4 flow 2.1 sitting in the projects drawer for ages, waiting for a companion lidar to be purchased and for me to grow a pair.
Iāve just realised the sonar mounted is the maxbotix EZ4 1242 - so this should be a plug and play PX4 flow for anyone wanting to get started without buying an additional sonar or needing an i2c splitter as itās done onboard. Correct me if Iām wrong. Iāll try it out. Nice work CUAV
Aside, is there any mileage to mounting the PX4flow to the bottom of a gimbal so it always faces straight down or is it ardupilot coded to account for pitch and roll? My Git fu isnāt strong enough to check.
hello @GregCovey
according to your tutorial that you have discarded above and that http://ardupilot.org/copter/docs/common-px4flow-overview.html#common-px4flow-overview
the drivers of PX4flow and separate Maxbotix sonar are already taken by arducopter ??
just change some parameters in Mission Planner
to make a servo and landing with the PX4flow and sonar, is it true or it is necessary to modify the code that I clone since the source git clone https://github.com/ArduPilot/ardupilot.git ?
The PX4FLOW (Optical Flow) Sensor is a specialized high resolution downward pointing camera module and a 3-axis gyro that uses the ground texture and visible features to determine aircraft ground velocity. Although the sensor may be supplied with a built-in Maxbotix LZ-EZ4 sonar to measure height, this has not been reliable enough over a range of surfaces in testing, so its readings are not used
just out of curiosity, why the maxbotix of Px4flow is not used?
in what situation are these data false?
thanks for any answer
hi @GregCovey
take-off and landing using the PX4flow and a separate range finder are already supported by Ardupilot ?
how are used optical flow data as optical flow velocity controler ?
regards
Iām struggling trough a similar problem with my PX4 and PX4Flow sensor on mission planner V3.5.5. Iām attempting to use the sonar as my rangefinder as well. Have you made any progress you could share? Here are my current parameters if that is helpful to you.