This is a work in progress. I've tried to address some fine tuning and performance issues.
Denny R. had made a comment about the inertia of bigger props causing issues. I've added a low pass filter to smooth the positive acceleration of the props to see if we can get at this issue. It may require tuning up Rate_P for a few folks, but I saw little issue in multiple flights.
Crosstrack had a small math error that decreased the resolution of it. I've fixed that and upped the default gains to get better tracking.
Made WP hit radius 1 by default. even 3m is too much for quads. (If you pass a WP you will move on to the next)
The Loiter method is tuned a little better by default, and now uses GPS offsets when flying less than 1.5m/s. Code experimentation will continue on this front. Thanks to Emile and afernan for their help!
A fix in the Z Accel startup was added to get an averaged result.
Added the ability to enter Loiter with Optflow enabled. - still a work in progress, not for everyday use just yet.
This alpha is on GIT now and is for user's who want to test code. As always, you need to use the "relaxpatch" version of Arduino you can find in the downloads section.
Update: We've found and patched some small type bugs in the latest and updated some GPS drivers in the Library. Be sure to pull the latest code and check http://apm.tridgell.net/ for the status of each build run against the SIL sim server.
I pushed a version on to GIT that addresses a number of issues.
- the low speed GPS XY calculations were incorrect and have been fixed
- Nav_Rate I term has been removed in loiter control - it's too easy to get two iterms working out of phase
- A second derivative has been added to Roll and Pitch. I found it removed wobbles nicely - Can be adjusted in the planner as STAB_D with a default of .25 (just enough)
- Smoothing has been applied to the motor commands in a way that really quiets down the alt hold pulsing without much effect on latency
- Yaw now has a dynamic constraint and I've upped the yaw gain.
- The motors output now have an LP filter on them so that the accelerate just a tad slower than the deceleration. This is a test to see if it helps big Octo's and Hexa's
- The Rate_I term is now zero'd for first five seconds after takeoff to keep balance.
- Loiter gains are lightened up a bit
- Nav_Rate_P is lower to remove back and forth sped related hunting in loiter
- Compass is enabled by default
- New I2C Library now included which should solve I2C related lockouts
- optflow is still a work in progress.
This update is based on flights today in a very windy environment.
It occurred to me that we're handling the WP nav I terms incorrectly and I reworked the WP navigation to share the same I terms from the Loiter. Even though they use different error input, etc, they turn out to both deal with wind in the same way. I have not Flown WPs with this new code, but heavily tested it in the sim and It's really rocking in hard wind. Transitions from Loiter flight and Nav flight are very smooth. Please let me know if you have luck.
This is a quick patch based on a bad crash Marco had. My theory was an I term that built up during wind that needed to be reset, but wasn't. It's a corner case but It bit Marco pretty bad. Please re-pull if you have R4 running to go to R5. And please, please be careful. This is alpha code not for general testing, but for development. Don't fly it on anything you would feel bad about crashing.
Update R7:Added an auto-land timer for RTL. If you don't change modes for 20s after the copter arrives at home, it will begin to auto-land. If you have failsafe and no GPS, you will immediately begin auto-landing.
Minor tweaks and cleanup
Made climb rate controller for landing universal for all altitude changes
Updated Loiter controller - Works great in the sim, thanks Afernan.
My question is the use in the code. There must be ways this great component can stabilize the cyclic of the drone to avoid corrections with the stick.
Arnt: Yes, that's what we do (it's impossible to fly a multicopter autonomously without using the accelerometers). We've got years of IMU experience--remember that there are thousands of planes out there flying APM already--and a dev team full of sensor experts.
If your copter is not flying stably enough, that's a tuning question. On a well-tuned copter, it should be rock solid.
How close are we to a new zip? I am really anxious to play with r5, but I am always afraid the git might be in flux.
Thanks again Jason for the incredibly hard work. Here's hoping your New Year with a new baby is wonderful!
John, I've snapshotted the latest Git as a zip here. Remember that this is development code, only for testing under safe conditions with the usual warning about fly-at-your-own risk and away from others. Be safe!
I am on it.
Thanks Chris! Danger is my middle name! :)
Happy New Year and thanks for doing a great job herding this bunch of cats. This year will be magical.
I compiled and uploaded to my 1280 board ?????
I thought the new, unmodified code will only fit on a 2560 board......
Or did you clever guys build auto modification into the code ?
Going to scrape together some guts, and fly now!
OK !, flew it in my living room first, then outside in quite windy and turbulent conditions, stabilize mode only.
I'm impressed, it gets pushed up and down and sideways by the turbulence, but stays level, and the yaw is rock solid.
Like a trad heli with a good heading hold gyro.
I have had my first flight with DJI wk in the night, I must say I'm impressed. it was rock solid right out of the box. Setup program to DJI revealed that the aileron stick (Dx8) was far outside the center, perhaps it is this that has made apm unstable(drifting). This was a hardware failure inside the transmitter that I fixed. The last version I have flown by arducopter is 0.56 afernan. I will now install the latest code (R5?), is it necessary with some modifications of the code with the Arduino, or can I install straight from the MP?
Thank you for your hard work with apm, I now you have spent hour with this!
Happy new year Chris and all other :)
R5 must be loaded with Arduino until we've finished the testing period, at which point it will be released to the general public via the MP.
Some things have come up in testing that really warrant some rigorous testing. I think R5 is OK, but I would be extra careful and I would not fly Acro on it yet. It may be a week or two of testing and reviewing code before we can release the next version.
Here are some results from r5.
Loiter was a non-event. There are several loiters in the attached.
The auto segments didn't appear to go to plan. It seems to hit the waypoints OK, but the jump commands didn't take. I tried the old way (jump cmd after the nav command following the loop) and new way (jump command after the end of the loop).
You will see it wander off at random when it was meant to be loitering at the end of the 100x100.
The carrying on at the end of the 100x100 file after the auto segment ends is me flying around for fun. I let it get too far away, thought I selected RTL when it got away, but didn't :(.
I can only add 3 files at a time, so there are two replies.