Unwanted Behavior During Navigation

Hello,

I have an 800 class helicopter and I have brought the stability of the aircraft to a good level. The navigation performance is also at a good level. But I couldn’t find a solution to a problem.

While navigating between waypoints, my aircraft stops and turns at the new waypoint command. For example, let’s say we have waypoints named 1-2-3-4. Let’s move between them in order, starting from 1. When I say go to 2 while going from 2 to 3, it stops and turns 180 degrees. I am trying to prevent this and but I need ideas on how to do it.

Maybe I should make changes in the software part, but I am not sure what I can do. The L1 algorithm may work, but it would be a complicated enough solution for me.

The GitHub link of the previous work on this subject in the forum does not work, so I cannot examine those codes. But maybe we can solve it in a shorter way. Thank you in advance.

I wish you a good day.

@gareth_mark are you using any of the obstacle avoidance features of the code?

Please post a log showing this behavior.

Thanks!

Are you commanding the waypoints in guided mode or is it auto mode you are using?

Sorry for the late reply.

No, there is no add-on in the code that will affect the behavior. Only in Guided mode, when small position changes were made, when a destination was specified behind, the aircraft was turning the heading angle too much. To prevent this, I added the code that keeps the heading constant at a certain diameter depending on the parameter.

I am sending the log file as an attachment. Since the situation is a bit more complicated in real flight data, I shared the log of the SITL test that reflects the scenario I mentioned.

Thanks.

I am using auto mode. I am sending the log in the attachment.

Thanks.

I believe you are doing it the wrong way, since for guided you are using the wpnav libraries (bitmask 64 in your current parametrization).
This affects auto mode as well, and I see dangerous discontinuity in the behavior you have coded:



I think we need further info on exactly what libraries you have modified.
Also, for helis, is generally better to set WP_YAW_BEHAVIOR to 1.

Hello, I set the 64 in the GUID_OPTIONS parameter to zero. I repeated the test and observed the “discontinuity” situation you mentioned again.

As far as I observed, this situation is due to the fact that when I went from 2 to 3, as I mentioned above, I manually changed the waypoint destination to 2 and it threw a new navigation target. In other words, I do not observe any discontinuity. It throws new targets(poz, vel, accel etc.) at that very moment.

The code I added simply includes setting the yaw behavior to HOLD in the set_destination section in GUIDED mode if the resultant vector of the target is smaller than the diameter I specified.

Ok so you are commanding WP2 when it’s already marked as passed WP2 and heading for WP3. The behavior you are observing is correct. What behavior are you expecting to do instead?

This is actually the behavior I expect, because the algorithm works this way. But the behavior I want is different…

I don’t want it to stop and turn when it is asked to go to the previous WP again in the behavior I want. This means unnecessary power consumption and waste of endurance time. Instead of stopping and turning, it would be more correct to turn without resetting its speed like the L1 algorithm. But I’m not sure how I can do this.

Now I understand what you want in the behavior. I’ve been following along and actually looked at your data, but still didn’t understand what you thought was deficient until now. The copter waypoint navigation is designed to be very precise and will slow the aircraft down to a stop if necessary in order to make a turn within the waypoint radius and head out to the next waypoint. If the waypoint that you tell it to go to is close to the waypoint, it was originally headed for, you may not see the aircraft slow down much as it transitions to the new waypoint. However, if the course to the new waypoint is more than 90° from the current course, then it will most likely come to the near stop as it moves to the new waypoint. I didn’t design this waypoint controller, but have had some experience in trying to modify it. So I don’t think it would be easy to have it do what you would like it to do.

1 Like

There’s guided for doing this kind of stuff. I used a “moving” target wp approach in the past that let the heli slide along and turn without losing too much speed- allowing also this kind of maneuvering @gareth_mark wants to do. I looked as well at modifying the auto mode but I believe Guided is more suited for this, total freedom and flexibility without invasive code changes.