Replies: 2 comments 4 replies
-
I appreciate your work on this and ill try it out! Are there any programming lines we don't absolutely need for this to work? I have 5 or 6 that I don't want to fly without. |
Beta Was this translation helpful? Give feedback.
-
The files have been updated to answer some peoples questions. It now explains which logic conditions you should alter, so you can run bench testing. Make sure you change the conditions back after testing. Or speed mode won't work in flight. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd often heard people on the forums talking about the benefits of INAV fixedwing having auto speed control, like the old Eagletree Vector had.
I thought the idea might have some merit. But I really wasn't sure how well it would work in practice. So I wrote the logic in the programming framework to give it a try.. The key to get it working, was to use IPF PID controller 3. Because it has the fastest looptime.
As can be seen from the video link. It works far better than I anticipated, in all flight modes. With practically no issues at all. With its climb/dive performance working as good as
pitch2thr
does.The following information explains its functionality. With the zip file including all the information required to set it up in your own models.
General flight efficiency is greater. However there are times when normal throttle control can be more efficient. It all depends on the flight conditions.
3Dspeed target works best for general cruising around. Being that it gets you to your location in a more timely manor than Airspeed, if you have a strong headwind.
3Dspeed also has a minimum airspeed override. Which will work to prevent a stall in a tail wind condition, if the airplane is commanded to climb or turn.
Airspeed target works better for the highest power management.
However it is better to use a real Pitot sensor in this case, because virtual airspeed requires a course correction at least every 500mtrs to maintain its accuracy, as the wind shifts during the course of the flight.
Speed mode can be used with all flight modes - MANUAL, ACRO, ANGLE, HORIZON, ANGLEHOLD, CRUISE, COURSEHOLD, LOITER, WP and RTH.
When using with MANUAL, ACRO or HORIZON modes. It will automatically increase or decrease the throttle when you command the airplane to climb/descend or Loop.
The same will apply to a climb or descent in ANGLE, ANGLEHOLD or COURSEHOLD modes.
When used with navigation modes. Pitch2throttle is replaced with a speed based climb/descent target. Which changes the throttle accordingly.
It can be more efficient IF the rate of climb and speed targets aren't set unrealistically high.
The maximum speed target setting should not be set higher than 110km/h. Calculation will not work correctly.
The maximum throttle that can be used to drive the speed target can be taken up to 100%. But it will reduce efficiency when tuned tightly, if it applies more throttle for time, than is required.
The minimum throttle that can be used to drive the speed target, can be reduced to 0%. But is NOT recommended, due to no propulsive thrust being available. This could lead to an ESC startup de-sync if higher auto throttle is quickly called for.
The minimum SAFE air speed value should be set 1/3 greater than the airplane Actual Stall speed.
e.g. the airplane stalls at 35km/h. Set the SAFE minimum airspeed to approximately 50km/h.
It require 2 spare RC channel for operation. One Pot or Slider to adjust the speed target. And the other on a 3 position switch to enable 3D and Air based speed targeting.
I haven't tested this. But if Miles/h is required in place of km/h. LC 20 and LC 37 should have the value of 28 replaced with 45. And LC 36 should have 110km/h replaced with 68Mi/h.
PID-FF tuning
P-term - sets how fast the throttle will increase or decrease to 'reach' the speed target. If set too higher, the throttle can oscillate.
I-term - tries to 'hold' and prevent drift once the actual speed is close to the speed target. Increasing it will hold the target speed tighter, up to a point.
D-term - will try to damping the throttle when near the target speed. * Only use in SMALL amounts.
FF-term - will attempt to drive the throttle harder to reach the target, based on instantaneous speed change. But pushing it past 480 - 500, will cause target drift without well filtered data from the speed source.
Functions
If the throttle stick is moved greater than a set rate, above or below the its position from when speed mode was activated. It will cancel and exit speed mode for safety.
Be sure to cycle the speed mode switch to re-enable it again.
Speed mode has to reach approximately 35km/h GNSS ground speed, before the virtual pitot airspeed is trusted.
Speed mode will be disabled if a GNSS fix is lost. Which still allows fixedwing dead reckoning to work as normal. It's also disabled when fixedwing
Auto Landing
orAuto Launch
are active.. Not because it can't add great benefit to these functions, as I have found. But because it requires too many extra programming lines.It does not exit speed mode when a Failsafe occurs in the present programming. Which hasn't proven to be an issue. As long as its RC control switch stays active in an RX FS condition.
If anyone has any questions, comments or doubts. Ask away.
IPF speed mode setup.zip
Beta Was this translation helpful? Give feedback.
All reactions