Marico

  • **
  • 52
YAW control to facing next waypoint not POI
« on: July 25, 2021, 08:48:28 pm »
Hello,
I try figure out how System > VtolPathFollowerSettings > YawControl set to "POI" works.  Let say I have a 3  waypoints  (a triangle). In the middle is Home location. During approaching (next) waypoint copter always is (front) facing Home.  So I guess Home location is POI in this context, but in the details - what is the difference between POI and Home location? Documentation about "HomeLocation as POI Location" says something about PoiLocation and PositionState but is not clear for me...

Is it possible configure it to facing approaching (next) waypoint or just facing front current fly direction instead of POI?


Re: YAW control to facing next waypoint not POI
« Reply #1 on: July 26, 2021, 05:09:18 am »
I have never used POI, but maybe someone else can give some advice.

Some related things that I do know:
- Clicking on the map and setting the Home Location to where you want POI is not a bad idea like it says in the wiki.  Flight plans now have an option to be relative to Home Location or not (and I presume this works).  So either set Home at the interesting place you want to watch and then click up a flight plan, or first convert an already working flight plan to absolute coordinates, and then move Home Location to where you want to the interesting place and the flight plan will not move.  In both cases, you are doing the simple thing of using POI Location = 0,0,0 and you don't need to change it.
- HomeLocation has nothing to do with RTB (or really anything that the user needs to worry about) unless you use TakeoffLocation->Mode->Preset and then it is relative to Home so 0,0,0 = Home and it will RTB to this entered location rather than arming location or first gps lock location.  By default RTB goes to TakeOffLocation=ArmingLocation.
- I may be wrong, but I recall TakeOffLocation is always where GPS got a good lock and it does not correctly follow the settings to be arming location or first arming location...
- There seems to be a flight mode called POI, but I would probably try VtolPFSettings -> YawControl = POI
- VtolPFSettings.YawControl has PathDirection which sounds like it points to next waypoint
- VtolPFSettings.YawControl has MovementDirection which sometimes goes a little crazy when hovering in one place and it moves a tiny amount and so it quickly turns in that direction, only to find that it has moved a tiny amount in another direction and quickly turns to point in that direction.  If your quad doesn't like yaw, then it is doing a lot of something it doesn't like.  Turn down the yaw max rate in Stabilization -> Advanced -> Responsiveness -> Maxratelimit -> Yaw
- VtolPFSettings.YawControl has Manual which I use sometimes to point the camera at this or that while it is flying a waypoint mission.
- HomeLocation is just some point near by where you fly that doesn't have to relate to anything.
- POI Location (I am pretty certain) is relative to Home Location, so POI Location = 0,0,0 is exactly Home Location.  100,0,0 is 100 meters north of HomeLocation.
- POI Location (I presume) is where it should always point the nose when flying GPS and with YawControl=POI, but I have never used POI.

Marico

  • **
  • 52
Re: YAW control to facing next waypoint not POI
« Reply #2 on: July 27, 2021, 05:29:12 pm »
Correct me if I'm wrong: I see the waypoints are stored in FC only as relative "measurements" values and they are related to home location (if "relative to home" is set)  but what happen when "relative to home" in waypoint config is NOT set? They are relative to what - take off place? Does UAV always start flight plan with flying to HL first then first WP? What happen when I take off far away from (saved) HL but with uploaded same waypoints with unchecked "relative to home"?
Next my question is about arrows on flight plan map. What is the meaning red arrows/pointers with dashed (or not dashed) lines?

Re: YAW control to facing next waypoint not POI
« Reply #3 on: July 28, 2021, 02:16:57 am »
As I recall, if you look at a waypoint flight plan in the waypoint editor, you will see that each waypoint is listed both relative to home, and as GPS coordinates.  I haven't been in that code, but it seems clear that it would just use those GPS coordinates when not "relative to home".  I haven't used this feature, but I assume that it works.

It always starts by flying to first waypoint, wherever that is, period.  No HomeLocation or TakeoffLocation or POI.  When done with last waypoint, the default is to start the mission again by going to first waypoint.  The default is that it does this loop till the battery runs out.  You can change it to land after the last waypoint, etc.

Crazy homework assignment:  :)  If you put a waypoint on the opposite side of the earth, would it try to fly through the earth to get there?  Does Relative to Home or not make a difference?   ???

As I recall, one color of lines and arrows on the waypoint plan are for the plan, while others are "error destination".  Error destination is where it goes if it has an error going to the normal waypoint.  Like if it can't make the desired speed because of wind or can't maintain altitude because of empty fuel (guesses).  I did have this trip me up on one airplane before I got the airspeed behaving.  It kept turning around and going back to waypoint 1 (error destination).  It is good to select mindful error destinations including landing (or disable error destinations) for anything that is not just a trivial test.  You can disable error destinations (which is just a waypoint number) by putting a negative number in the error destination for each waypoint.

There is maybe even another set of lines and arrows because there is also "jump destination".

Marico

  • **
  • 52
Re: YAW control to facing next waypoint not POI
« Reply #4 on: July 29, 2021, 09:21:50 am »
As I recall, if you look at a waypoint flight plan in the waypoint editor, you will see that each waypoint is listed both relative to home, and as GPS coordinates.  I haven't been in that code, but it seems clear that it would just use those GPS coordinates when not "relative to home".  I haven't used this feature, but I assume that it works.

I thought  so but when I disabled "relative to HL"  on each waypoin then uploaded new WP data to UAV and checked waipoint data saved in the UAV (data object->waypoint->waypoint0->position etc.) -  waypoint data was still stored as realtive vaules (meters) not GPS coordinates (I expected GPS coordinates instead)...


It always starts by flying to first waypoint, wherever that is, period.  No HomeLocation or TakeoffLocation or POI.  When done with last waypoint, the default is to start the mission again by going to first waypoint.  The default is that it does this loop till the battery runs out.  You can change it to land after the last waypoint, etc.

But wiki says https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/84672520/Autonomous+POI+setup:
Quote
Set your HomePosition near where you are flying. Be sure to set height correctly (Its important because in PathPlanner flightmode copter will first fly to HomeLocation and then to the waypoints and heights for waypoints will be used from HomeLocation)

My tests shows the same: when I switch to pathplanner flight mode during fly copter move to HL first then to the first WP...

Re: YAW control to facing next waypoint not POI
« Reply #5 on: July 29, 2021, 03:09:00 pm »
As I recall, if you look at a waypoint flight plan in the waypoint editor, you will see that each waypoint is listed both relative to home, and as GPS coordinates.  I haven't been in that code, but it seems clear that it would just use those GPS coordinates when not "relative to home".  I haven't used this feature, but I assume that it works.
I thought  so but when I disabled "relative to HL"  on each waypoin then uploaded new WP data to UAV and checked waipoint data saved in the UAV (data object->waypoint->waypoint0->position etc.) -  waypoint data was still stored as realtive vaules (meters) not GPS coordinates (I expected GPS coordinates instead)...
I can imagine reasons for that.  Mainly that the flight code only needs to understand one kind of waypoint.  I don't see any "relative to home" flags anywhere in the flight objects, so it looks like the GCS handles it, including translation to the new home location to make it act like it is not relative to home.  It turns out that the flightplan/waypoints stored on the disk have both GPS coordinates Lat Long Alt, and home relative in meters North East Down.

I bet if you move home after loading the plan, that the plan moves, even if it is not relative to home.  Reload the non-home-relative plan after moving home to put it back where it should be.

I would test with a small flight plan (not home relative) with home in the middle, then move home (see whether reuploading the flightplan is needed after moving home) and see if it circles the new home or the old one.

It always starts by flying to first waypoint, wherever that is, period.  No HomeLocation or TakeoffLocation or POI.  When done with last waypoint, the default is to start the mission again by going to first waypoint.  The default is that it does this loop till the battery runs out.  You can change it to land after the last waypoint, etc.

But wiki says https://librepilot.atlassian.net/wiki/spaces/LPDOC/pages/84672520/Autonomous+POI+setup:
Quote
Set your HomePosition near where you are flying. Be sure to set height correctly (Its important because in PathPlanner flightmode copter will first fly to HomeLocation and then to the waypoints and heights for waypoints will be used from HomeLocation)

My tests shows the same: when I switch to pathplanner flight mode during fly copter move to HL first then to the first WP...
I'm surprised by that.  My home location is always close to where I take off and engage pathplanner mode, but I would have guessed I would have noticed it going to home location rather than 1st waypoint.  I've done this many times.  Even last weekend.  It's probably because there is some distance tolerance and doesn't have to hit waypoints exactly.  It thinks it is already there and just heads off to the first waypoint.  This is something I will definitely test the next time I fly.

A quick look, I don't see the FC code specifically going to 0,0,0 at planner startup, but it is possible that the GCS just loads 0,0,0 into the first wayplint and thus uses 3 waypoints when the user only made 2.  If that is the way it works, it sounds like a bug that got documented the way it is.  Why would you want to force it to go home rather than letting the user add a waypoint at home if he really wants one?

"heights for waypoints will be used from HomeLocation" maybe that is POI mode where the flight plan is localized right at the POI.  Maybe it means it is relative to home.
« Last Edit: July 29, 2021, 03:13:14 pm by TheOtherCliff »

Marico

  • **
  • 52
Re: YAW control to facing next waypoint not POI
« Reply #6 on: July 30, 2021, 11:10:44 pm »

As I recall, one color of lines and arrows on the waypoint plan are for the plan, while others are "error destination".  Error destination is where it goes if it has an error going to the normal waypoint.  Like if it can't make the desired speed because of wind or can't maintain altitude because of empty fuel (guesses).  I did have this trip me up on one airplane before I got the airspeed behaving.  It kept turning around and going back to waypoint 1 (error destination).  It is good to select mindful error destinations including landing (or disable error destinations) for anything that is not just a trivial test.  You can disable error destinations (which is just a waypoint number) by putting a negative number in the error destination for each waypoint.

I did some tests with 4 WPs (square shape) and VtolPFSettings.YawControl set to PathDirection . Now quad flies with nose pointed to next WP, good. But also I noticed some strange behavior. Sometimes just before reaching the next WP quad makes 180 degrees turn and try reach WP flying "backwards". After reaching WP it flies back to the previous WP (with nose pointed to) not the next one. I guess it took "error" path. There was a calm day, no wind, GPS had steady fix. Could it be related to failsafe mode? I noticed that path plan could be terminated with failsafe mode when RC radio link is lost (my input configuration has active failsafe mode).
Is it possible to ignore failsafe mode in path plan (to reach WPs located beyond RC coverage)  BUT with possibility switch to RTB manually (with flight mode switch) when quad re-enter back RC radio range?
« Last Edit: July 31, 2021, 12:02:04 am by Marico »

Re: YAW control to facing next waypoint not POI
« Reply #7 on: July 31, 2021, 09:15:36 am »
Sometimes just before reaching the next WP quad makes 180 degrees turn and try reach WP flying "backwards".
That is strange.  Maybe it reached the waypoint but is going fast and overshoots while slowing down?  Also assuming that square is not tiny where it thinks it has already arrived at waypoint 3 when it arrives at waypoint 2.

After reaching WP it flies back to the previous WP (with nose pointed to) not the next one. I guess it took "error" path.
That's what it sounds like to me if it flies all the way back to previous waypoint.  Also assuming that square is not tiny where it thinks it has already arrived at waypoint 3 when it arrives at waypoint 2.

Could it be related to failsafe mode? I noticed that path plan could be terminated with failsafe mode when RC radio link is lost (my input configuration has active failsafe mode).
Is it possible to ignore failsafe mode in path plan (to reach WPs located beyond RC coverage)  BUT with possibility switch to RTB manually (with flight mode switch) when quad re-enter back RC radio range?
There is no capability to have failsafe do one thing in one flight mode and a different thing in a different mode.  You can put RTB on the switch and use it like any mode when it comes back into range.

Failsafe should be carefully considered.  There is failsafe build into RC radios.  If used, the FC will never know that it has gone out of range.  If RC radio is configured to "stop sending servo pulses" when out of range, the FC will see this as failsafe and do whatever you have configured for failsafe in the FC.

Some RC radios go into permanent "hold last known stick positions" when they go out of range.  Other radios can be configured that way.  There is always a short delay (say 1-3 seconds) for radio to know it is out of range.  You can configure the FC failsafe to a normal flight mode that can fly with speed or drift with the wind.  These are all a death sentence waiting for you to fly out of range or for transmitter battery to go dead.

Flying from a moving vehicle (especially one that you don't have a way to stop) is bad with regard to RTB since you have already moved away from "base".

Be aware that LibrePilot does return flying at the highest one of: "current altitude" or "TakeoffLocation altitude".  If you fly up the side of a mountain and do RTB with Hold option it may be so high that you don't know it is there and it finally drops when battery is dead.  Worse yet is to just fly straight up till out of range.  It will never come back into range and will drop when battery is dead.

I fly with RC transmitter antenna purposefully in non-optimal location so that if it goes out of range I can hold transmitter above my head and get it back.

Some reasonable multicopter failsafes:
- RTB with either Land or Hold (hover) option.  Librepilot requires good GPS signal before arming (don't use "always armed"), so RTB will be to a good known location unless you change settings (example: TakeOffLocation to Preset then change HomeLocation and forget to change TakeOffLocation).  Default is to always return to arming location.  I am probably thinking of an older version or airplane always armed, but I would make sure it really is "arming location" and not "first good GPS fix location" if it matters to you.
- Land.  Better than loosing an aircraft, but it could land in a tree or lake or into a person or still be a long way away.
- Default is stop motors and drop from the sky.  Better than a fly away.
- Attitude mode with motors a little less than hover power on a full fresh battery in heaviest configuration (e.g. with camera and heavy battery).  About the same as Land, but doesn't turn motor off, and drifts with the wind.  Motors running will probably get caught in grass and stop with power on, maybe burning a motor or ESC or forest.

One thing I do with failsafe on my quads is to add some small amount of yaw when in failsafe.  That way I can tell visually that it has entered failsafe mode.

Marico

  • **
  • 52
Re: YAW control to facing next waypoint not POI
« Reply #8 on: July 31, 2021, 12:15:39 pm »
That's what it sounds like to me if it flies all the way back to previous waypoint.  Also assuming that square is not tiny where it thinks it has already arrived at waypoint 3 when it arrives at waypoint 2.
I uploaded a short video to show it, check this out:

 

PathPlanner has 4 WPs in a rectangle shape (50mx30mx50mx30m).

00:02 Switching to PathPlanner, quad yaws to the WP1 and goes there.
00:19 WP1 reached, yaws to WP2 
00:34 in a 3/4 way to WP2 quad makes a 180° turn and try reach it flying backwards
00:47 WP2 was slowly reached and quad start fly back to WP1
01:16 WP1 reached and quad starts plan from the beginning. From this point quad makes full rectangle w/o problems
01:29 WP2
01:40 WP3
01:56 WP4. Starts over with WP1
02:06 WP1
02:21 WP2
02:30 WP3, switching off PathPlanner, the end.

At 00:34 was the strange turn and back flight.  I run 2 tests (video is from 2nd test) and quad did this twice in the same place between WP1 and WP2 (video above is from 2nd test). Is it possible to debug/check in log why quad takes a "error path"? I have a a telemetry data log from this flight...


Failsafe should be carefully considered.  There is failsafe build into RC radios.  If used, the FC will never know that it has gone out of range.  If RC radio is configured to "stop sending servo pulses" when out of range, the FC will see this as failsafe and do whatever you have configured for failsafe in the FC.

My failsafe (FS) config works as expected. My RC receiver stops sending pulses when goes out the range, so I use FC FS mode. When I switch off the RC transmitter or just fly out the range quad switch to FS mode and gentle fly back to RTB and prepare to land. I tested it many times and was no problems with it yet.

 
« Last Edit: July 31, 2021, 12:32:56 pm by Marico »

Re: YAW control to facing next waypoint not POI
« Reply #9 on: August 03, 2021, 02:14:53 pm »
Sorry.  I had my nose in other things for a few days and no one else came along.

Are you still running 16.09?  Next has some new GPS flight modes that I haven't tried and don't know if there are things to avoid.  I trust INS13, if only from having no experience with new Next modes.

With OpLink telemetry, you can log the flight and play it back whenever you want to.  Same GCS response as the first time.  You can watch one thing (say a scope setup) and then replay and watch something else (say some UAVOs in the System page or different scopes).  It would be useful to know if it flew by that waypoint and that is why it turned around.  The waypoint lines and GPS path both there on the map should tell the story.

I assume that you have left the waypoint settings stock.  There are different modes it can fly in (such as circle, endpoint, vector ... from memory).  My guess is that it got to the waypoint, but then had an error trying to get to the next waypoint and took the error path.

When flying in Attitude mode with Manual throttle does it respond quickly and correctly?

I see that the yaw response is very quick.  I wonder if the roll/pitch/altitude is also quick.  When flying in VelocityRoam mode, does it respond quickly to roll, pitch, and altitude?

I recall a bug, I think is is in 16.09 and probably fixed in next.  RTB was OK or it was very slow, depending on what mode it was before RTB.  I mention that because it looked like after it did the turn, it slowed down slowly and flew very slowly back.

I notice that you get some roll/pitch when you yaw quickly and it doesn't level out very quickly.  This would usually be PIDs need to be tighter.  Is it balanced fairly well or is there a heavy camera or weak motor on it?

May I suggest AutoTune if you haven't already done it on this aircraft?

Are you running a DJI or uBLox GPS?  There are some uBLox settings that can make the GPS respond to changes slowly, so you should run stock GPS settings.  Don't run NMEA on the GPS.  Need DJI or uBlox.

You could post the waypoint flight plan and your settings.  I can't say when I will be able to spend time on it, but the flight plan is fairly simple to look at to see if there are any strange settings.

I would fly it in Attitude/Manual and report if it flies well and responds quickly.  You should be able to move the stick a lot and it bank a lot and quickly, and center the stick and it come back to level quickly, almost instantly.  Does it have plenty of power to climb when it needs to?

There is a possible invisible yaw oscillation (very small and very fast) that causes the throttle to respond as if the stick were closer to center than it is.  High throttle isn't as high as it should be and low isn't as low.  Motors get hotter than you would expect.   If manually tuned, reduce the D terms (yaw is the important one).  If AutoTuned (no need for retune flight) set the System -> Settings -> SystemIdentSettings -> DerivativeFactor to 0.5 or 0.25 (to save: click once on DerivativeFactor to highlight it.  Then click the red up arrow (Save) at top of screen).  Then re-export your PIDs with SmoothQuick (make sure you rebooted the FC after putting AutoTune on your Flight Mode Switch, you are disarmed, quickly toggle into AutoTune mode and out of it, 3 times, quickly, 6 clicks, I recall you have 2 seconds).  You can be watching PID bank 3 (default destination of AutoTune PIDs) in Configuration -> Stabilization -> Bank3 -> Advanced, and you will see the new PIDs appear immediately after the 6x FMS toggle, especially the reduced yaw D term.  If you set the DerviativeFactor to zero, then the D terms will be zero.  That is OK and a good way to verify that the PIDs did get changed.

Enough for one posting.  :)

Marico

  • **
  • 52
Re: YAW control to facing next waypoint not POI
« Reply #10 on: August 04, 2021, 12:32:35 am »
Sorry.  I had my nose in other things for a few days and no one else came along.

Are you still running 16.09?  Next has some new GPS flight modes that I haven't tried and don't know if there are things to avoid.  I trust INS13, if only from having no experience with new Next modes.

I'm using 16.09+r782~g8c101ad




When flying in Attitude mode with Manual throttle does it respond quickly and correctly?

I see that the yaw response is very quick.  I wonder if the roll/pitch/altitude is also quick.  When flying in VelocityRoam mode, does it respond quickly to roll, pitch, and altitude?


I just configured fast yaw response,  I like it. Pitch and roll are much slower.
I didn't checked VelocityRoam, could You say more about VelocityRoam mode? Description in the wiki is not clear for me...

I recall a bug, I think is is in 16.09 and probably fixed in next.  RTB was OK or it was very slow, depending on what mode it was before RTB.  I mention that because it looked like after it did the turn, it slowed down slowly and flew very slowly back.

Hmm I remember one case when RTB was slow than expected. RTB has "speed" settings, I figured out that above some values (6 m/s) increasing it did not reflect in speed change...why?

I notice that you get some roll/pitch when you yaw quickly and it doesn't level out very quickly.  This would usually be PIDs need to be tighter.  Is it balanced fairly well or is there a heavy camera or weak motor on it?

May I suggest AutoTune if you haven't already done it on this aircraft?


I've already done it, we discussed about it in the thread about my problems with banking take off. After AutoTune quad is (in my opinion) now quite stable durning flying.
AutoTune was done with smaller (lighter) battery (1500mAh) and pathplanner on the video was done with 2200mAh, a bit bigger.  Does it matter?

Are you running a DJI or uBLox GPS?  There are some uBLox settings that can make the GPS respond to changes slowly, so you should run stock GPS settings.  Don't run NMEA on the GPS.  Need DJI or uBlox.

uBlox

You could post the waypoint flight plan and your settings.  I can't say when I will be able to spend time on it, but the flight plan is fairly simple to look at to see if there are any strange settings.

I would fly it in Attitude/Manual and report if it flies well and responds quickly.  You should be able to move the stick a lot and it bank a lot and quickly, and center the stick and it come back to level quickly, almost instantly.  Does it have plenty of power to climb when it needs to?

There is no problem with climbing (even with 4200mAh 3S battery which is pretty big for such 250 quad) or fast banking (120km/h with banking fly). Hard to say about coming  back to level, I guess is OK but I have no experience to judge it, this is my first build. I'll try upload a video. The only difference I see watching other people's videos with "free style" flying is that my quad (rather my flying)  has a little "deadband" style   (don't know how describe it correctly and I don't mean GPS assist fly mode  - it's perfect stable in the air), for me is hard to achieve precise flight especially between obstacles like trees etc - I need a space for safe flight  (or just my flying skills are not yet high).

There is a possible invisible yaw oscillation (very small and very fast) that causes the throttle to respond as if the stick were closer to center than it is.  High throttle isn't as high as it should be and low isn't as low.  Motors get hotter than you would expect.   If manually tuned, reduce the D terms (yaw is the important one).  If AutoTuned (no need for retune flight) set the System -> Settings -> SystemIdentSettings -> DerivativeFactor to 0.5 or 0.25 (to save: click once on DerivativeFactor to highlight it.  Then click the red up arrow (Save) at top of screen).  Then re-export your PIDs with SmoothQuick (make sure you rebooted the FC after putting AutoTune on your Flight Mode Switch, you are disarmed, quickly toggle into AutoTune mode and out of it, 3 times, quickly, 6 clicks, I recall you have 2 seconds).  You can be watching PID bank 3 (default destination of AutoTune PIDs) in Configuration -> Stabilization -> Bank3 -> Advanced, and you will see the new PIDs appear immediately after the 6x FMS toggle, especially the reduced yaw D term.  If you set the DerviativeFactor to zero, then the D terms will be zero.  That is OK and a good way to verify that the PIDs did get changed.

Uh...
« Last Edit: August 04, 2021, 12:37:55 am by Marico »

Re: YAW control to facing next waypoint not POI
« Reply #11 on: August 04, 2021, 11:05:27 am »
I'm using 16.09+r782~g8c101ad
That is one of the "Next" versions it is 16.09 ... + 782 sets of changes.

I just configured fast yaw response,  I like it. Pitch and roll are much slower.
I didn't checked VelocityRoam, could You say more about VelocityRoam mode? Description in the wiki is not clear for me...
VelocityRoam: Just imagine Attitude mode that becomes Position Hold when you center the sticks.  It is better than that though.  The roll/pitch stick controls horizontal velocity.  Throttle stick controls vertical velocity with a large center deadband so you don't have to be real careful to maintain the same altitude.  If you have max horizontal speed set to say 5m/s then that is what you get at full stick.  At half stick you get 2.5m/s.  This is true whether you are flying into the wind or with the wind.  Full throttle straight up is only whatever you have max vertical speed set to, and low throttle is that same speed, but coming down (NOT falling as you would with normal throttle).  Be careful because zero throttle stops the motors (a safety feature that can be disabled, but I leave the motor kill there.

Try VelocityRoam.  If it isn't the easiest flying imaginable, then there is a problem.  I am guessing that the problem is that your Attitude mode response needs to be "instant" but it isn't.

There is a thing with autonomous flight modes.  The quad needs to be set up so that Attitude mode works almost instantly.  The code assumes this.  If it doesn't have it, it gives a bank command and if it doesn't see a response soon, it asks for more and more bank and then it is too much.  It gets confused.

When flying Rate mode you need a slower aircraft response for a given stick position, because your eye and brain is in the control loop.  You hold this much stick for this long to get it to move 45 degrees, even if that is measured in 10ths of a second, you develop a feel for it that you can't develop if it moves too quickly with a small movement.  If it is moving instantly, you can't reliably/repeatedly stop at 45 degrees.

When flying Attitude mode, although you could configure slower response, you don't have to because X amount of stick always produces Y amount of bank, and as I said before, the code assumes the Attitude mode response is quick unto instant.  When you are flying Attitude mode, if you want it smooth, move the sticks slowly.  Get to where you think "stick angle equals bank angle with no delay"

Think of a steering wheel on a car.  You don't want it to delay so that you only get a turn a second after you ask for it, and you are used to it having instant response so you move the steering wheel smoothly.

In GPS flight modes like VelocityRoam, the code is flying in Attitude mode and you are asking the code to change speed from 0 to 5 m/s.  The code initially banks a lot to accelerate quickly, but soon reduces the bank to almost zero when it gets up to speed.  You don't even need to know that.  This is like pressing the resume button on a car cruise control.  It uses more throttle till it gets up to speed, but then it reduces it to just enough to maintain speed.

VelocityRoam: For instance, if you are flying forward slowly downwind with a small amount of forward pitch stick with a fair amount of wind at your back, it is probably actually banking backwards to hold it from drifting downwind quickly, but you don't have to know this.  You just know that X amount of stick always produces Y amount of speed, regardless of which way the wind is blowing.

How did you limit the roll/pitch response?  Using the Stabilization page response sliders?  That is the correct way, but again, I think at least part of the problem is slow response in Attitude mode.  I shudder to recall that some folks have detuned the PIDs in an effort to reduce the response.

Hmm I remember one case when RTB was slow than expected. RTB has "speed" settings, I figured out that above some values (6 m/s) increasing it did not reflect in speed change...why?
It may be that the max speed set in VtolPathFollowerSettings won't let you go any faster?  It may be an issue in the flight code.  Again, I recall that a guy got two different RTB speeds depending on which flight mode he was in before RTB, and that was probably a bug.  I kind of assume that the issue had been fixed in next.  I am guessing a lot here.

I've already done it, we discussed about it in the thread about my problems with banking take off. After AutoTune quad is (in my opinion) now quite stable durning flying.
I didn't know if this was a different aircraft.  When someone uses AutoTune I expect that it will make the Attitude mode response nice and crisp, but that isn't what I think I saw in the video.

AutoTune was done with smaller (lighter) battery (1500mAh) and pathplanner on the video was done with 2200mAh, a bit bigger.  Does it matter?
You should tune (auto or manual) with the heaviest, slowest configuration, but if you don't, it isn't usually a big problem.  Maybe some roll/pitch small oscillations.  Using the heavy tune in a light configuration just makes it fly like it is heavy, a little less responsive.  Using a light tune in a heavy configuration causes small roll/pitch oscillations / ringing.  This is one reason we have multiple PID banks.  You can have one bank tuned for heavy and another for light if you want it perfect.  I don't bother with it.

There is no problem with climbing (even with 4200mAh 3S battery which is pretty big for such 250 quad) or fast banking (120km/h with banking fly). Hard to say about coming  back to level, I guess is OK but I have no experience to judge it, this is my first build. I'll try upload a video. The only difference I see watching other people's videos with "free style" flying is that my quad (rather my flying)  has a little "deadband" style   (don't know how describe it correctly and I don't mean GPS assist fly mode  - it's perfect stable in the air), for me is hard to achieve precise flight especially between obstacles like trees etc - I need a space for safe flight  (or just my flying skills are not yet high).
A crisp, tight, response in Attitude mode is a joy to fly and it makes you feel more in control, connected to the aircraft, and easier to fly.

For me and I suspect most people, hovering very slowly (especially with FPV) through a gate is harder than going a bit faster.  You line it up from a ways out and by the time you get there, it's perfect and you just go straight through.  It is like balancing when walking is easier than balancing when standing.

There is a possible invisible yaw oscillation (very small and very fast) that causes the throttle to respond as if the stick were closer to center than it is.  High throttle isn't as high as it should be and low isn't as low.  Motors get hotter than you would expect.   If manually tuned, reduce the D terms (yaw is the important one).  If AutoTuned (no need for retune flight) set the System -> Settings -> SystemIdentSettings -> DerivativeFactor to 0.5 or 0.25 (to save: click once on DerivativeFactor to highlight it.  Then click the red up arrow (Save) at top of screen).  Then re-export your PIDs with SmoothQuick (make sure you rebooted the FC after putting AutoTune on your Flight Mode Switch, you are disarmed, quickly toggle into AutoTune mode and out of it, 3 times, quickly, 6 clicks, I recall you have 2 seconds).  You can be watching PID bank 3 (default destination of AutoTune PIDs) in Configuration -> Stabilization -> Bank3 -> Advanced, and you will see the new PIDs appear immediately after the 6x FMS toggle, especially the reduced yaw D term.  If you set the DerviativeFactor to zero, then the D terms will be zero.  That is OK and a good way to verify that the PIDs did get changed.

Uh...
Yea, don't worry about this.  It is way down the list of possible causes.

I know I keep mentioning that Attitude mode response needs to be instant.  If you intend to use Rate mode at all, be aware that there are settings that allow Rate mode to have a slower response and still allow Attitude mode to have instant (well much quicker anyway) response.

Re: YAW control to facing next waypoint not POI
« Reply #12 on: August 04, 2021, 11:32:58 pm »
Truly, once it is well set up, VelocityRoam is the easiest mode to fly a multicopter in.  Center the sticks and it stops (goes into PositionHold) where it is to let you figure out what to do next; even in the wind.

Get it up to your desired height with the throttle stick, then put the throttle stick in the middle and leave it there (there is a large deadband so it doesn't have to be perfectly in the center).  Leaving the throttle stick within the center deadband is altitude hold.  Now drive it like a car.  Hold the pitch stick forward constantly at some comfortable speed.  That is the car accelerator pedal (more like cruise control speed).  You are now flying forward, constantly.  Use yaw as the car steering wheel, to point it in whatever direction you want.  It's very much like driving an RC car around when you do this, and just as easy since it doesn't drift with the wind.

Non-RC people can fly this mode the first time:  "Hold this stick forward to make it go.  Use this stick to steer left and right.  It's important to keep the steering stick's "up and down" in the middle since that controls altitude.  That is the hardest part."

The stuff below may sound confusing till you have done it once.  Concentrate on the stuff above to get the concept.  :)

Flying in a circle is just adding a small constant amount of yaw to the constant forward pitch.  Hold it that way and it is flying a circle with speed adjusted on the pitch stick and diameter for that speed adjusted on the yaw stick.  Because this is a GPS flight mode, the wind doesn't matter (nearly as much).

Driving it like a car even works while flying backwards or sideways or any angle.  Assuming you are flying with roll and pitch on the same stick, you can hold that stick constantly in any direction and it flies in that direction at that speed.  Use yaw to steer as before.  Just think about the flight direction now being the nose as you steer it around.  Think of it as a noseless flying blob with only flight speed and left / right steering to think about.

You even get a simple "POI" from this.  E.g. hold some amount of constant right roll to fly sideways to the right at a comfortable speed.  Now add a constant, but very small yaw to the left to that.  You are now flying a circle with the nose always pointed into the middle.  Once you are familiar with this, you can learn to vary the amount of yaw slightly to move the center of the circle to where you want it.  Relax the yaw for a short time and it flies straight sideways for a short time.  In addition to right roll with left yaw, you can also do left roll with right yaw to circle in the other direction.

Very small wind caveat that hardly bears mentioning:  It should go into PositionHold when you release the sticks, but for most people it drifts very very slowly.  This is because of a bug that VelocityRoam doesn't have the (small normal) stick deadband that it should.  Still not fixed in next since it hasn't got the required number of upvotes (I just added a vote.  I really need to look through the pull requests for PRs I can add a vote to).  Code is OK.  Extra devs on hiatus.  Work around is to set VelocityRoam as a GpsAssist mode in the flight mode setup.
https://librepilot.atlassian.net/browse/LP-620
« Last Edit: August 04, 2021, 11:48:52 pm by TheOtherCliff »

Marico

  • **
  • 52
Re: YAW control to facing next waypoint not POI
« Reply #13 on: August 04, 2021, 11:54:57 pm »
VelocityRoam: Just imagine Attitude mode that becomes Position Hold when you center the sticks.  It is better than that though.  The roll/pitch stick controls horizontal velocity.  Throttle stick controls vertical velocity with a large center deadband so you don't have to be real careful to maintain the same altitude.  If you have max horizontal speed set to say 5m/s then that is what you get at full stick.  At half stick you get 2.5m/s.  This is true whether you are flying into the wind or with the wind.  Full throttle straight up is only whatever you have max vertical speed set to, and low throttle is that same speed, but coming down (NOT falling as you would with normal throttle).  Be careful because zero throttle stops the motors (a safety feature that can be disabled, but I leave the motor kill there.

Try VelocityRoam.  If it isn't the easiest flying imaginable, then there is a problem.  I am guessing that the problem is that your Attitude mode response needs to be "instant" but it isn't.

This is a video from my VelocityRoam test:


I just banked left-righ and forward-backward.  During flight quad seems stable, I didn't noticed any problems but VR for me flying in this mode is a bit slow and "swings" (breaking?)  when I put sticks to neutral positions.



In GPS flight modes like VelocityRoam, the code is flying in Attitude mode and you are asking the code to change speed from 0 to 5 m/s.  The code initially banks a lot to accelerate quickly, but soon reduces the bank to almost zero when it gets up to speed.  You don't even need to know that.  This is like pressing the resume button on a car cruise control.  It uses more throttle till it gets up to speed, but then it reduces it to just enough to maintain speed.

I noticed that  but I think speed is reduced, too... How get rid of these "swings" in VelocityRoam when the sticks go to neutral position?

How did you limit the roll/pitch response?  Using the Stabilization page response sliders?  That is the correct way, but again, I think at least part of the problem is slow response in Attitude mode.  I shudder to recall that some folks have detuned the PIDs in an effort to reduce the response.

Yes, using the stabilization page response sliders but IMHO respond in Attitude mode is quite fast. I can record a video to show how it fly in Attitude, what should I do during flight? Banking and move sticks to neutral? Leveling speed after flip in Rattitude? 

Hmm I remember one case when RTB was slow than expected. RTB has "speed" settings, I figured out that above some values (6 m/s) increasing it did not reflect in speed change...why?
It may be that the max speed set in VtolPathFollowerSettings won't let you go any faster?  It may be an issue in the flight code.  Again, I recall that a guy got two different RTB speeds depending on which flight mode he was in before RTB, and that was probably a bug.  I kind of assume that the issue had been fixed in next.  I am guessing a lot here.

AFAIK  VtolPathFollowerSettings->HorizontalVelMax is for speed only in pathplanner mode. RTB speed is in FlyModeSettings->ReturnToBaseVelocity. I changed this one but above 20 m/s I don't see any significant change in speed in RTB mode.

A crisp, tight, response in Attitude mode is a joy to fly and it makes you feel more in control, connected to the aircraft, and easier to fly.

For me Attitude mode has annoying trend to drift away after leveling (when the sticks go to neutral) and quad wont's "stops"  as I expect - just slow drift away, how get rid of this? In GPS mode like GPSAssist or VelocityRoam when the sticks go to neutral quad "swings" (breaking?) , of course after it it perfectly stays in the position but those "swings" are  annoying, too...

Marico

  • **
  • 52
Re: YAW control to facing next waypoint not POI
« Reply #14 on: August 05, 2021, 12:02:51 am »
Truly, once it is well set up, VelocityRoam is the easiest mode to fly a multicopter in.  Center the sticks and it stops (goes into PositionHold) where it is to let you figure out what to do next; even in the wind.

I noticed it, a bit late...I didn't know that until I tried after your hints... Wiki say nothing about this mode that's why I totally ignored it (it mentions only something about Attitude mode as  easiest mode to learn how to fly).

Very small wind caveat that hardly bears mentioning:  It should go into PositionHold when you release the sticks, but for most people it drifts very very slowly.  This is because of a bug that VelocityRoam doesn't have the (small normal) stick deadband that it should.  Still not fixed in next since it hasn't got the required number of upvotes (I just added a vote.  I really need to look through the pull requests for PRs I can add a vote to).  Code is OK.  Extra devs on hiatus.  Work around is to set VelocityRoam as a GpsAssist mode in the flight mode setup.
https://librepilot.atlassian.net/browse/LP-620

BTW, what is the difference with flight mode set to VelocityRoam and Assited Control set to None vs VelocityRoam with Assited Control set to GPSAssist? I tested both configurations and didn't noticed any significant changes...
« Last Edit: August 05, 2021, 12:41:53 am by Marico »