# Change Yaw in Flight or at a Waypoint

How does one change Yaw while flying or when one gets to a waypoint.  I want to be able to point my hexcopter at the center of a circle while I fly around it.  I tried using "Yaw Ang" in the Waypoint within Flight Planner, but nothing happened.  My hex just changes it's yaw to the direction of flight to the next waypoint.  I then tried using Loiter_Time and setting the "Yaw Per" and that also did nothing.  Any ideas how this can be done?

Thanks,
Richard

Views: 511

### Replies to This Discussion

Seems like I keep solving my own problems.  LOL.  Anyway thought I would share my solution just in case someone else might have the same problem.

What I ended up using was CONDITION_YAW and entered degrees under the Deg column.

So my flight plan looks like this.

1. DO_CHANGE_SPEED - speed m/s = 1  (I want to slow done my flight, I'm in no hurry)
2. CONDITION_YAW - deg = 180  (I want to face south)
3. WAYPOINT - Delay = 10  (Move to first way point and wait 10 seconds)
4. CONITION_YAW - deg = 270  (I want to face west)
5. WAYPOINT - Delay = 10  (Move to second way point and wait 10 seconds)
6. CONDITION_YAW - deg = 0  (I want to face north)
7. WAYPOINT - Delay = 10  (Move to first way point and wait 10 seconds)
8. CONITION_YAW - deg = 90  (I want to face east)
9. WAYPOINT - Delay = 10  (Move to second way point and wait 10 seconds)
10. RETURN_TO_LAUNCH  (This does not work right, the copter tries to land at it's current way point, I believe Code 2.8 fixes this)  I normal take back manual control at this point.

Hope this help,
Richard

Thanks! This can be quite useful.

Just wanted to clarify, do you know if the yaw will remain when the quad will flies to the next waypoint? (So the quad flies sideways or backwards) Or does it just turn at the waypoint itself?

Also, to what reference is the rotation? Compass or heading?

Thanks for sharing this!
Ervine

Just got to fly again today.

The quad holds the yaw as it flies to next waypoint.

Rotation is done with the column labeled "Dir 1=CW".  If the value is 0 the quad will rotate counter clock wise to get the compass heading.  If the value is 1 then the quad rotates clock wise.  So 0 degrees is North, 90 degrees is East, 180 degrees is South and 270 degrees is West.

It's actually pretty cool to see.

Regards,
Richard

Hi Richard, thanks for solution, I was searching a similar.

Could you please tell me when you set a waypoint, do you set Yaw Ang to zero or to the same value as condition_yaw?

I don't use the Yaw Ang within the waypoint settings.  All I change is the condition_yaw.  It works really well.

Hi Richard,

I am using your setup for CONDITION_YAW combined with WP delay and works great.

But I have a question:

I do want my Quad to reach a specific altitude (e,.g. 70m) and then to start the yaw (rotation), see on the attachment my 360 degrees. The issue for me is that the copter starts the rotation before reaching the altitude (70m), so when it really reach the desired altitude, it already yaw to next 3-4 WP. For that reason I did force the copter to do 360 deg and in adition another 90 deg, to assure all the circle is at the same altitude.

How should I delay the YAW until the altitude is reached (and then start to yaw)?

Thanks, Chris

Attachments:

Hi Chris,

You really don't need to have all those Condition_Yaw statements.  Start with a Condition_Yaw to 0 degrees, then delay a bit longer at the waypoint so Quad can get to the correct altitude, then have another Condition_Yaw statement to 359 degrees.  I've not tested this, but it should work.

Good Luck,
Richard

Hi Richard,

I've been taking panorama pictures by putting my quad in loiter and manually rotating it in yaw and setting off camera at each step. Yesterday I was trying to automate this based on your description above using CONDITION_YAW, but it didn't seem to have any effect.

I don't suppose you could take a quick look at the attached mission file and tell me what I'm doing wrong? I have a series of DO_DIGICAM_CONTROL triggers (which each need to be followed by a WAYPOINT to work), each wrapped with a CONDITION_YAW either side to pause on a given heading for 2 seconds before and after taking the picture. It seemed to just skip through all the CONDITION_YAW statements at the first location and head straight for the second location.

This is using 2.9.1, perhaps that command is broken in the latest release? Have you used it again since upgrading?

Cheers.

Attachments:

First you need to move your home location closer to your way points.  You never want to fly over homes or out of sight.
Second you need to start with a simple flight with 1 or 2 waypoints and 1 or 2 yaw commands.  I don't understand the need for 2 yaw commands together, why not just one yaw to the angle you need?  Test your simple flight to make sure the copter flies the way you want and turns the way you want.  When you have a good feel, then add Digcam command and make sure that works as you want.  Once all works like you want then try adding more steps.

I made the same mistake on my first auto flight, tried to fly around a circle, but the circle was to small and my waypoint radius were to large.  The copter streaked across the field like a bat out of hell, until it hit the tree.  It turned out my copter kept shooting past each waypoint, never really finding it's place until it end up in the street, next to the field I was flying in.  First of many hard lessons learned.  It's expensive hobby, but loads of fun.  LOL.Have fun and fly safe. Richard

Hi Richard,

I have started with automated scripting missions of my quad just a few days ago, so there is alot of new and "secret" for me, yet. I started to use Condition_YAW command, but I dont uderstand its exact usage. So:

1) What does it mean "condition" in the name of this command? Is there any condition, which has to be fulfilled before this YAW command is processed?

2) What is exact usage of parameters of this command? There are parameters deg, sec, dir, r/a. What is meaning of these parameters and how they should be used?

I don't know what the condition means.
I use the yaw command to turn the copter via compass heading in degrees only. I also have used the Dir 1=CW, which means clockwise and a 0 = CCW or counter clockwise.

Richard, I have probably stupid question, but in what exact syntax do you use Condition YAW command? Im trying various parameters, but it still does nothing.

After row with waypoint command (in a mission script) I insert row with Condition YAW command and I hope it will be processed before move to next waypoint. But nothing happens and my quad continues without any yaw rotation to the next waypoint. Probably Im doing someting wrongway.

1

2

3

4

5

6

7

8

9

10

## Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

51 members

671 members

1280 members

8 members

182 members