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.
Update r3:
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.
Update R4:
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.
Update R5:
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.
Jason
Update R6:
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.Update R8:
Minor tweaks and cleanup
Update R9:
Made climb rate controller for landing universal for all altitude changes
Update R10:
Updated Loiter controller - Works great in the sim, thanks Afernan.
Thanks,
Jason
Replies
I have tested the R5 version, with my Y6 and after yawing to the right millisecond after release the stick the Y6 pitch up for sort time and come back to leveled,
While yawing to the left it do the same effect but pitch down.
Does any body had it to?
2.1.1 r5 - possible error in code
I wanted to check the evolution of "lat_error" and "long_error" during LOITER in "Navigation.pde, line91 & 94.
I´ve added this printf to check it in real time in line 95:
Serial.printf("Long error %d, \t lat_error %d \n",long_error,lat_error);
What I´ve found is that "lat_error" is allways 0 or -1, while "long error" looks to behave normally (see my screen log attached)
Do I miss something?
Angel
lat-lon error.jpg
Hello everyone! One very important thing: do not use absolutely the ACRO mode with this release and with others over 2.0.50 (including), as has already written Jason is there's a remote possibility that it may take over a problem in flight, my heavy octo sacrificed himself for others to test this thing, with a loss of over 1000$ but making it in the future you save a lot, ensuring a more secure future for your.
The incident is luckily documented, logged with telemetry and filmed, that's part of my cooperation with DIY Dev Team, although I would prefer not to happen (LOL).
I waited to alert the community because we wanted to make sure the problem was not an isolated case but now Tridge, with a thorough and surgical analysis he understood what happened, and all we are infinitely grateful.
No other mode of flight is afflicted by this problem, if you do not use ACRO for now you can fly much safely.
This anomaly can not be present if you fly with all the simulator, but just in the reality and for a number of specified steps, although it is quite unlikely but not impossible.
All future releases will be fixed from this bug/issue, Jason clearly write it in the news.
Cheers, Marco
Jason, could you offer some advice on PID tuning for R5. I switched from stable to loiter and my quad immediately gained about 15 to 20 feet of altitude and then immediately lost 20 to 25 feet of altitude. The whole process of PID tuning has basically been a guessing game for me. Could you please offer some advice on how PIDs for Loiter, Throttle Rate, and Altitude Hold should be changed based on observed behavior? I would be extremely grateful.
Thanks,
Mark
Test of the firmware ArduCopter v2.1.1 R5b in HIL mode on X-Plane v9.70
Regards, Jean-Louis
hi jason,
for which we have the APM1 1280, you can make a list compiled version to load from arduino?
to download from here?: http://code.google.com/p/arducopter/downloads/list
Is there a lot of people like me who do not know what we have to eliminate to enter into the 1280
Just a thought here,,,,,,
With the code getting somewhat big (read, sophisticated/mature), isn't it time to split MultiRotor, Trad Heli and Fixed Wing into their own sub-groups?
With slimmer code, it might be easier to spot shortcomings, for all disciplines.
I'm sure Michael Oborne could easily adapt Mission Planner (my favorite! ), to load/pull/get just that part you require ?
After running r5 on my stock quad today, it seems there is quite some life left in the older boards.....
I just tested R5 with medium wind on a apm2 quadcopter. For me r5 is a big no. I have a lot of surging on the engines in stable mode. Copter yaws left and right all by itself. And even rolls sometimes to the left and right. It showed much unpredictable behaviour. I also posted my log. I am not sure but something seems wrong. With 2.1 I get with the same pids I used today I get a lot better result. For me 2.0.49 with apm1 was the best results I ever had with arducopter.
2012-01-02 03-35 5.log
@ Jason & Chris: I've only just bought my APM half a year ago, it's the 2560 APM1. Like so many other people I'm getting a little worried that APM1 support is going to be discontinued once the APM2 is properly launched.
Can you please tell us what dev. team's plans are?
Will future software also be developed / work for "old" APM1's?