-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Feature request : Add estimated Wind Speed and Direction as logic condition flight parameters #10372
Comments
In general I am always keen to see additional values usable for programming but I am curious, what you want to do with these values specifically. |
I had an idea of using the estimated wind speed and direction, if applicable to the approach heading; to drive timer based throttle or elevator override conditions. To either push the nose down a little at select distances from the landing location. And add or subtract a small amount of throttle, based on the headwind and current altitude at a given position on the approach. Being permitted by setting Don't shoot me for a theory. It would require some testing to see if the idea has merit; and it may not work. |
I see where you are coming from but there are some issues. We thought about changing settings like cruise throttle values with programming but after some debate it was considered too dangerous to change essential flight parameters by the programming framework. Also you might have a false conception about airplane physics thats very common. Another issue is, you never ever push the nose down to land. Flying a plane is constantly converting potential energy (altitude) with kinetic energy (Speed). If you push the nose down you will speed up and make the problem of a float worse. What you actually wanna do is, to pull the nose up to slow down and then sink to the ground faster. This brings me to an idea... Have you ever tried to start the glide phase with a higher angle of attack, pushing the nose up 2-3° more to slow down further? *We actually have some concepts about a different throttle control for INAV but we might not have the time to bring that in INAV 8.0. This would include a separate throttle value for the approach and makes the P2T modifier obsolete. |
Thankyou for the information. I do understand the physics of aerodynamics, relative to air density. The issue I see presently, is the glide approach angle is a product of the
You may have got the wrong idea of what I have in mind. Anyway. I won't rave on. I'll just wait and see if anything comes of this request and play around with the programing logic in the meantime. Thanks |
I found this comment really interesting @b14ckyy :
If people are messing around with essential flight parameters in the programming framework, don't you think they understand the risks? I would love to see a TON of variables added to the programming framework including the PID controller values - which I assume would be considered essential flight parameters. More essential flight parameters are what we need to work with in IPF, and its way more limited than it should be at present. IPF is the sandbox. Sure you may crash, but that's expected if you are messing with certain parameters, and its always a risk. Otherwise never take off. |
The main problem is, that we exhausted the capacity if the MSP protocol with all the settings and values loaded on that page. Additionally we do not want to add any settings parameters. We have temporary overrides for some like loiter radius but they are not saved. For things like cruise throttle and other Settings parameters we would need to add temporary variables for each raising the ram and the code complexity significantly. Because you don't want to accidently save the changed value as the config value, right? |
One potential workaround may be to utilize the adjustments tab in conjunction with IPF. This could get tricky, but if the flight parameters could at least be referenced in IPF, I wonder if we could trigger adjustment-tab changes with the IPF code without adding a bunch of additional MSP payload. I don't understand the limitations well enough to know if this is a solution to the issue. |
It wasn't trickery. The method for getting the LCs was just changed to allow for getting each LC individually, rather than as a single call. I've just done the same for the custom OSD elements. There shouldn't be a problem adding more operands to the LCs. Only the ID is sent over MSP. So it wouldn't add any overhead. The programming framework is an advanced feature. There are already parts of it that could easily down an aircraft if used incorrectly. For example RC channel overrides, axis reversal, throttle overrides, plus others. I think adding to the programming framework. Each thing should be assessed on how useful it could be. Cruise throttle could be useful for closed loop speed control (PID + airspeed sensor). Wind speed and direction I'm not sure on though. As a temporary work-around until a feature gets a slight improvement doesn't seem like a good reason. It should be a permanent reason. I definitely don't think access to the stabilisation PIDs should be in there either. They should be managed by internal means. Which could include things like switching from TPA to APA (Airspeed PID Attenuation, potentially using virtual airspeed even). |
I think Inflight Adjustments and the Programming Framework should remain separate. Inflight Adjustments are mostly for tuning these days. So what they do shouldn't need to be accessed all the time. |
Hey as long as APA is a planned feature, I'm satisfied. My current APA implementation of switching the PID profiles in IPF based on airspeed is far from perfect. But that exhibits the problem. We can't anticipate all everything that people want to solve in the programming tab, so shouldn't we make as much available as possible? That's kinda the nature and point of IPF. Likewise, the more that can be made available in the adjustments tab, the better. (The issue there is just with OSD visibility of all the parameters.) |
Not really. The purpose of the programming framework is to allow people to add fairly basic functionality. Anything complex or potentially dangerous should be a part of the main firmware, and well developed. The programming framework could be used as a test bed for some features. As @b14ckyy demonstrated with autoland. But it's not intended to solve complex problems. |
@MrD-RC Thankyou for chiming in. @trailx You raised a good point in your first post. We aren't all newbies. Many of us have considerable RC, FPV and INAV experience. I occasionally drop by this repository to see what changes are in the works. |
I don't see anyone saying it can't or shouldn't be added. B14ckyy brought up the MSP thing, but MrD addressed that - it's not a problem. Things just get discussed, because being mindful and discussing changes is how we improve the quality of INAV. If I get time (not super likely), I may add estimated wind to IPF soon, make a pull request. Or rts18, you can look at one of the other PRs that added something to IPF and try your hand at adding this value. |
What examples can you think of for adding wind direction and speed to the programming framework? |
You raised this one a few posts back. Having a operand for wind speed and not just airspeed; removes the need to calculate wind speed based on addition or subtraction of the ground speed. Which could potentially take up an extra half dozen lines in the programming tab. An example a few of us had pondered, was a limited throttle range management. Which could be applied to waypoint mode. Please note; I am fully aware of the extra logic, timers etc required to make this work as described. |
But you don't need to calculate wind speed if using airspeed. The aircraft doesn't care. Your answer is still based on a hack for the autoland. Forgetting that totally. Why would you want wind direction or speed in the programming framework? |
No.
That is correct. However it does provide a reference point for the magnitude of the airspeed. This allows for the application of the flight logic under these specific conditions of the examples given. |
This shouldn't be necessary if the navigation is tuned correctly. INAV should compensate for this, regardless of wind. Again, you shouldn't need programming framework routines to try to fix fundamental navigation issues if they exists. If this is a problem, it should be fixed in the firmware.
I don't understand why anyone would want to do this? When you set up cruise throttle, it should be set for the most efficient airspeed with a reasonable buffer over stall airspeed. So why would you want to slow down on approach to a waypoint? WP mode uses auto throttle; which has a minimum of cruise throttle (unless you are descending where P2T could reduce it) or minimum ground speed, whichever is higher. So you couldn't reduce below that anyway. You could use throttle override to increase the throttle above cruise throttle. But surely that would be for a leg, not just a turn? Wind shouldn't matter, as cruise throttle should be set at a reasonable amount above stall airspeed anyway. I know a waypoint can have a speed. I believe this only works with multirotors currently. So perhaps implementing waypoint speed for fixed wing would be useful. I believe there are even flags still available. So there could be a choice between throttle percentage or airspeed (if available). But even then, cruise throttle should be the minimum throttle setting. |
I think his point is, to compensate for wind speed and direction to maintain a more or less constant groundspeed when flying in headwind during a WP mission. if INAV ever gets a airspeed based throttle control be actually possible to have certain speeds for waypoints predefined (with a minimum airspeed set) to have consistent over ground flight speeds during waypoint missions. This would be helpful for search or mapping operations. having some kind of control over cruise throttle with programmed triggers, would still be an interesting feature for such scenario. although I would rather control the cruise throttle value based on ground speed and that would not need wind speed and direction. |
@MrD-RC With respect I understand navigation isn't an area you often make changes; that would be @breadoven 's forte. However take my word for it. INAV does not compensate to the level of precision you may think it does. @b14ckyy I see you understand the concept and eloquently described it. Thankyou! I was starting to pull my hair out over the interrogation. |
@MrD-RC @b14ckyy I see there is benefit to reducing the throttle on the downwind leg of a mission, for a short distance leading up to a WP turn, to reduce the extra likelihood of the plane being pushed past the WP by the tailwind. |
As discussed on Discord, the airspeed would recover after 3-10 seconds or so if throttle wasn't changed. One could say tailwind is pushing the plane forward, causing it to speed up. But that takes a few seconds. So the throttle increase is needed during and for a few seconds after the turn. To avoid stall right after turning downwind, BEFORE the wind "pushes" the plane to a higher speed. Immediately after you turn downwind your airspeed may be close to zero - it will certainly be lower than it was crosswind. You can therefore look at it as being similar to when you first launch. You need launch throttle for a little while to build up speed, then you can reduce to cruise throttle. This is mostly important when the wind speed is a significant percentage of the airspeed, as it is on most of my planes. If you're zipping around at 70+ knots the windspeed is probably a small percentage of that, and you probably have plenty of margin before stall. My builds tend to fly closer to 25-30 knots, so 12 knots of wind is the difference between cruise and stall. |
Consider a Zohd Drift flying cross wind at 40 km/h. That's just 20% below the maximum safe speed of the plane. (The manufacturer warns against exceeding 50 km/h due to flutter). Suppose the wind at altitude is 25 km/h. "When you set up cruise throttle, it should be set for the most efficient airspeed with a reasonable buffer over stall airspeed" Setting cruise throttle 25 km/h higher would put you at 55 km/h, which is 5 over Vne and you would expect flutter may lead to loss of the airframe. You may fly planes with 50 km/h difference between Vs1 and Vne. Not all of us do. The Drift, for example, has Vs1 around 25, Vc about 38, and Vne of 50. So 15 -20 km/h of wind change due to a turn will result in either a stall or an overspeed if you don't manage the throttle and elevator. Therefore flying at a constant throttle with the intent to fly crosswind at ( stall + wind speed + margin ) would almost certainly result in stall on downwind turns and overspeed on upwind turns, with flutter as the immediate result and loss of the airframe possible |
@sensei-hacker I agree... The other area of navigation this is encountered is in Loiter circuits when its windy. This often leads to the plane holding altitude on the headwind side of the loiter and losing it on the tailwind side. |
That scenario was never suggested. That may be useful. It may also burn more battery than required. Causing an aircraft to not make it home. |
it doesn’t need to be an area I make changes in to know that something should be addressed by the firmware, rather than bodging things in the programming framework. The whole point is the programming framework should not be used to bandaid issues in the firmware. Those issues should be raised and fixed in the correct place.
The example Marc raised is not what you have been asking for at all. |
I agree with points raised by @Jetrell and @sensei-hacker. But, I don’t believe the solution to the issues they raised should be dealt with in the programming framework. They should be dealt with in the firmware. |
OK lets summarize before we beat our heads because of some semantics: Wind Speed and Wind Direction has actually some use (Just while typing I think of a tail-wind warning when flying long range on the way out, with your new custom OSD Elements). end result: If Wind Speed and Heading would be input values for the Logic Conditions, everyone would be happy :D |
@MrD-RC I understand your point. But I wonder if such an alteration to the navigation throttle control is a realistic option in the near future?
Also correct. However Marc grasped the idea behind my requests for these additions to the programming framework. And as stated; there are many use cases for these two operands. With all being related to some type of navigation control. Which may have been why you assumed I was referencing the same example twice.
Once again, no argument from me. However I don't presume for you to take on the roll to fix and add new navigation throttle framework. That's not my personal style to request something that demanding. To finish; @b14ckyy last post would cover all bases; both relating to all the aforementioned issues and more that could be dreamed up by other users. Not withstanding the additions of proper fixes in later releases; after tests with the programming framework have proven them to be viable options. |
I agree it would be good for the firmware to be aware of and address these issues. The development path for that could be similar to the path used for the auto land feature, or could be different. I won't have time this week to develop it in the firmware. Is this something Darren has time to work on, or should we let people experiment with it via IPF first? |
But that's the point. Those things should be raised as issues. You're not demanding something of me. You're reporting that something isn't as it should be and requesting a fix. Which any developer can take on. Same as here you're requesting an addition to the programming framework. Which any developer can add. I'd just much rather see problems be raised as issues than people trying to fix them themselves using the framework. |
I agree that the ultimate implementation of widespread solutions should be addressed by the firmware. That said, there are niche problems that may only need to be solved by one person, thus would never get prioritized. Most INAV users are not devs or programmers, and while the programming framework is somewhat complex it does provide a route for non-devs to find and test our own solutions without risking anyone else's planes. Testing updates to the firmware requires not only programming knowledge, but also building a hex file, which is beyond most of us. So there's a huge barrier and the programming framework is our workaround. My point is simply that we can't anticipate all possible uses of the framework. Solving these niche problems is exactly why IPF exists. Therefore any additional parameters we can access through IPF could potentially be helpful to someone in the future. I'd personally love to see the current IPF I/O parameter list doubled. If you want specifics, I've seen people on rcgroups mention that efficiency-related parameters (current mah/mile, and average mah/mile, etc) would have been helpful for a program. I've wished PIDs, filtered gyro signals, or filter settings were accessible for in-flight programmatic adjustments. Maybe someone could then develop their own auto-PID program, or a gains adjustment for the main PIDs like BF has. Filter settings available in IPF could be used to make an A/B test on a switch to safely try and fly different filter settings between a 'known good' and more paired down filter setting. This would effectively minimize risk to the plane. |
Desired Behavior
After talking with @b14ckyy about the matter of fixedwing auto landing and wind speed effecting the landing position. I was thinking it would be helpful to have the
estimated wind direction
andestimated wind speed
added as flight parameters to the programming tab.Who does this impact? Who is this for?
I believe this would help people to perhaps find a work-around to the aforementioned issue using the programming tab. Until a proper fix can be implemented at a later date.
Thanks for your consideration.
The text was updated successfully, but these errors were encountered: