Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After intalling MTF-01 optic flow althold does not work. #10487

Closed
and-sh opened this issue Nov 29, 2024 · 21 comments
Closed

After intalling MTF-01 optic flow althold does not work. #10487

and-sh opened this issue Nov 29, 2024 · 21 comments

Comments

@and-sh
Copy link

and-sh commented Nov 29, 2024

Inav 8.0.0
Althold was tuned before installing optflow. Worked normal.
After installing optflow.
Under approx 2m - work normal.
Higher does not work.
Testing in field over flat surface (snow). Sunny day.
Surface mode = OFF
nav_max_terrain_follow_alt = 100
inav_max_surface_altitude = 100

Max altitude where rangefinder measure reliable data 120cm.
Screenshot From 2024-11-29 15-59-37

Max altitude where rangefinder measure something about 3m.
Screenshot From 2024-11-29 16-00-45

About 16m rangefinder report zero altitude
Screenshot From 2024-11-29 16-04-02
At the same time surface reliability = 1000.

Log
blackbox_log_2024-11-28_131957.TXT

@and-sh
Copy link
Author

and-sh commented Nov 29, 2024

I think the simplest way is do not report new altitude if distance strength or precision is low. Then agl engine decrease the surface reliability automatically. The same way it decrease surface reliability when altitude is higher than nav_max_terrain_follow_alt

@sensei-hacker
Copy link
Collaborator

sensei-hacker commented Nov 29, 2024

IMHO it shouldn't be using AGL at all if the pilot has AGL turned off (surface mode off). If I say I don't want it to dive into a ravine, I mean it.

If I choose to fly MSL altitude, it shouldn't kinda mix in a little AGL behind my back and dive into a ravine.

@and-sh
Copy link
Author

and-sh commented Nov 29, 2024

Rangefinder may be useful during landing because no matter how I isolate barometer there is high pressure close to the ground.
Screenshot From 2024-11-29 20-47-37

@and-sh
Copy link
Author

and-sh commented Nov 29, 2024

But I can land in surface mode instead. So surface mode can replace old behavior.

@MrD-RC MrD-RC transferred this issue from iNavFlight/inav-configurator Nov 29, 2024
@and-sh
Copy link
Author

and-sh commented Dec 3, 2024

Nobody need rangefinder here?

@and-sh
Copy link
Author

and-sh commented Dec 3, 2024

Is the way disable rangefinder from switch?

@sensei-hacker
Copy link
Collaborator

sensei-hacker commented Dec 3, 2024

Is the way disable rangefinder from switch?

Turning off surface should turn off (use of) the rangefinder, except for autoland. Unless I'm mistaken.

@and-sh
Copy link
Author

and-sh commented Dec 3, 2024

I think I got it. The rangefinder readings are not used directly to calculate the position. When the quality of the readings is high, they are used to calculate the correction for the inertial engine, when the quality is low, this correction is simply a constant.

What is the difference between the following parameters?
nav_max_terrain_follow_alt
inav_max_surface_altitude

@and-sh
Copy link
Author

and-sh commented Dec 3, 2024

If I set to zeroes
inav_w_z_surface_p
inav_w_z_surface_v
Will it effectively disable rangefinder for z position estimator?
Will surface mode work in this case?

@sensei-hacker
Copy link
Collaborator

If I set to zeroes
inav_w_z_surface_p
inav_w_z_surface_v
Will it effectively disable rangefinder for z position estimator?
Will surface mode work in this case?

Yes, that would disable the sensor that measures the distance to the surface. Which would make surface mode not work.

What is the difference between the following parameters? nav_max_terrain_follow_alt inav_max_surface_altitude

They are almost the same. max_terrain_follow_altitude is the maximum altitude it will go in surface mode. Your "throttle" (altitude) input is scaled based on this value.
inav_max_surface_altitude is the maximum reading at which your rangefinder should be trusted.

It often makes sense to set them to the same value.

@and-sh
Copy link
Author

and-sh commented Dec 4, 2024

It seems to me that the equal sign should be removed in this place.
Screenshot_20241204-090103_Firefox
Because
Screenshot_20241204-090411_Firefox

@and-sh
Copy link
Author

and-sh commented Dec 4, 2024

If somebody can fast recompile corrected source for matek 722 mini se, I can give it a try

@sensei-hacker
Copy link
Collaborator

sensei-hacker commented Dec 4, 2024

It seems so to me as well. At least, in the case of that particular type of sensor. I wonder if the same applies to others?

See also the similar line around

if (distance >= 0) {

Are you familiar with how to make a pull request?

@sensei-hacker
Copy link
Collaborator

That rangefinder is connected via MSP, right?
So it should already be handled here

return (sensorData > 0) ? sensorData : RANGEFINDER_OUT_OF_RANGE;

Above, you wrote "About 16m rangefinder report zero altitude", but your screenshot shows 1 rather than 0.

@and-sh
Copy link
Author

and-sh commented Dec 4, 2024

Above, you wrote "About 16m rangefinder report zero altitude", but your screenshot shows 1 rather than 0.

That means the problem is somewhere else.
Will try to check readings by rangefinder itself. Micoair have dedicated programm. May be this is problem of rangefinder itself.

@and-sh
Copy link
Author

and-sh commented Dec 4, 2024

I think I found the real problem. The rangefinder was installed incorrectly.

@sensei-hacker
Copy link
Collaborator

Glad you found the problem!
For the next person, what was incorrect about the installation? Was there something below the rangefinder it was getting a reading of? That is, something "blocking" part of the view so it was reading the distance the landing gear or whatever?

@and-sh
Copy link
Author

and-sh commented Dec 4, 2024

There was nothing directly below it. But it has a field of diffusive light of almost 180 degrees. Any object that hits it scatters light and becomes decisive at high altitudes, when the main signal becomes weak. The sensitivity of this simple devise is amasing.

It is necessary to have a switch to turn off the rangefinder, since any scattering from dust or fog can disrupt stabilization and lead to a sharp change in altitude

@and-sh
Copy link
Author

and-sh commented Dec 6, 2024

The rangefinder started working
Screenshot From 2024-12-06 21-22-04

@and-sh
Copy link
Author

and-sh commented Dec 6, 2024

And althold doesn't work.
Why the target position do not change when the RC input changes?

Screenshot From 2024-12-06 21-29-07

Screenshot From 2024-12-06 20-54-30

@and-sh
Copy link
Author

and-sh commented Dec 8, 2024

Ok. I remove the optical flow and return to the working combination of GPS + barometer + compass. If anyone in the future is interested in finishing the optical flow and rangefinder, contact me.

@and-sh and-sh closed this as not planned Won't fix, can't repro, duplicate, stale Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants