Hi all,
Here's the obligatory YouTube video, it's REALLY cool! There are two runs that have the same phenomenon (I put both runs in this video which is only 1 minute 20 seconds long).
http://www.youtube.com/watch?v=TMM_wWSaJGc&feature=youtu.be
Cool, eh?
I try not to report a "feature" I can't reproduce, but this "feature" is reproducible. I wasn't able to prevent a crash in the first run from Monday night (it was a surprise), but after thinking about the problem, today (Tuesday morning) I was prepared to STOP the motors midflight, then restart them, in order to recover, this worked nicely.
It's the Conditional_Yaw that starts the twirling.
Here's the documentation for Conditional_Yaw, which seems incomplete and/or wrong, not sure.
*********************************************
CONDITION_YAW
| Option | Alt | Lat | Lon |
| Direction (1 = clockwise, 0 = counter) | Relative: amount (degrees), Absolute: ending angle(degrees) | Speed (meters/s) | Relative angle change = 1, Absolute = 0 |
*********************************************
What I've found using version 2.5.5 is that the first parameter (labeled "Degs" in mission planner) seems to be degrees per second. The second parameter (Labeled "Sec" in mission planner) seems to be the time in seconds for the conditional_yaw. This is seems to be my experience with 2.5.5.
In this run, my parameters were 36 deg's per second, and 10 seconds, so should do one revolution in 10 seconds.
The problem starts at about 72% in the attached TLog file and record 11350 in the attached Log file. It happened 2 times this morning, first time I put it in stabilize and it recovered without help. This is because I put it in stabilize before it really got up to full "twirl speed".
After I went to stabilize and it recovered (first incident this morning), I went back to Auto, it started the run again, went to waypoint 3, then repeated the twirl on its way to WP5, but this time I let it twirl until it started spinning like a top. After I went to stabilize, it kept spinning, like the prior evening, and I believe it would have crashed if I had not had a recovery plan in place.
In order to recover, I was ready to STOP the motors, let it slow down twirling, then restarted the motors. This worked, and prevented the crash this morning (adrenalin rush here!).
What may be different from my use of Condtional_Yaw in version 2.5.5 is I'm pretty sure that Relative/Absolute was set to Relative, and in this "mission", I believe I had it set to Absolute. This could have given it a huge Yaw Position Error to begin with, and it got into a crazy Yaw Aliasing Control loop problem.
Let me know what you all think.
Attached is an APM Log Visualizer Graph Screen shot. It shows an AngleBoost spike (I have no idea what this means).
You can also see when the red line goes to zero is when I went into stabilize, You can see it continue to spin, then you see the ThrottleIn (Cyan Color) go to zero, that's when I stopped the motors. Then you see the Yaw recover nicely when I restart the motors.
Dan Gray, Portland, Oregon
P.S. here's a video taken when using a conditional Yaw in version 2.5.5. It starts at about index 1:22
http://www.youtube.com/watch?v=dZTQf6WMLAc
P.S.S. All of my GPS paths look more jagged in version 2.7, does anybody know why? I've seen this reported before too.
Tags:

Permalink Reply by Dan Gray on July 31, 2012 at 11:09am Here's the screenshot and the TLog and Log files.

Interesting, thanks. If pulling the throttle low fixed the issue then it is a Yaw Rate I problem.
We went to the Yaw_Rate_I parameter in 2.7, but it's a tricky one. It seems to have built up during that mode and once you go to Stab, it's still there, built up. in 2.7.1 we've reduced the i_max value to cope with buildup. It was too high for what it needed to do. It won't fix this bug, but it will prevent the spinning while in Stab and promote a fast recovery.
I'll look into it.
Jason

Permalink Reply by Dan Gray on July 31, 2012 at 3:17pm Thanks Jason,
Yes, I've seen integral make things go wrong many times in my line of work!
If I can help you get more data, please let me know. This afternoon, I'm going to try again but use relative instead of absolute Conditional_Yaw. I'll let you know what I find out.
Dan

Permalink Reply by Dan Gray on August 2, 2012 at 9:06pm Jason and all interested.
I downloaded the code, and figured out how to compile it, so started working on the Condition_Yaw.
And, I do believe I figured out the trouble!
Now I can use the Condition_Yaw commands, so I can do nice panoramas!
I tested both directions and both relative and absolute, and other than in absolute, it does the
condition_yaw 2 times if it hasn't reached the next waypoint, it appears to work properly.
I've been having trouble with this since I started, and now I'm happy I can use the command.
There were two issues (possibly 3) in the two functions:
do_yaw() and verify_yaw()
In do_yaw(),
1.
I had to set up the variable command_yaw_end if it was doing relative moves.
Not setting it up made it jump at the end of the conditional_yaw.
if (command_yaw_relative == 1){.........
command_yaw_delta = command_cond_queue.alt * 100;
//I added the following lines
if(command_yaw_dir == 1) command_yaw_end = command_yaw_start + command_yaw_delta;
else command_yaw_end = command_yaw_start - command_yaw_delta;
command_yaw_end = wrap_360(command_yaw_end);
//command_yaw_end was not being set in 2.7.1. This made the copter jump at the end. (dpg)
}
2.
I made Casts to (floats) so the variable command_yaw_time was more accurate, and not zero under certain conditions.
command_yaw_time = (int) (((float)command_yaw_delta / (float)command_yaw_speed) * 1000.0); //casting to floats for precision (dpg)
I'm not sure that the casts are absolutely necessary, probably others may know better than me.
Now this is the BIGGY one that made my copter go twirly in yaw:
In verify_yaw(), the variable "command_yaw_dir" is a byte, and was set to -1 in do_yaw() if ccw.
There was a multiply by the -1, but it actually multiplied by 255 instead, making the yaw go NUTSO!
Here's what I did:
// else we need to be at a certain place
// power is a ratio of the time : .5 = half done
float power = (float)(millis() - command_yaw_start_time) / (float)command_yaw_time;
if(command_yaw_dir != 1) power = 0.0 - power; //dpg ***********NEW LINE
//notice the commented out part of the following line: * command_yaw_dir That's where
//the multiply by 255 instead of -1 happened.
nav_yaw = command_yaw_start + ((float)command_yaw_delta * power /* * command_yaw_dir*/ ); //dpg
nav_yaw = wrap_360(nav_yaw);
auto_yaw = nav_yaw;
//Serial.printf("ny %ld\n",nav_yaw);
return false;
Hope this helps! Maybe it (or something similar) will be in 2.7.2 before long!
Dan Gray
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.51 members
185 members
130 members
315 members
51 members
© 2013 Created by Chris Anderson.
Powered by
