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:

Includes fix for Acro mode reset bug.
I went through all of the global variables and gave them lengthy descriptions. It's worth a read if you want to learn more how the internals work. I'll be doing some more organization like this as we move forward with an architectural redesign for 3.0 \
This version is mostly clean-up, but does include 1 interesting performance enhancement. It's disabled by default because It's fairly untested. The idea is that the wind compensation created by the Iterms for lat and lon in Loiter and Navigation are carried over into Stabilize. This unifies all of the modes so that when you switch modes, you don't get a small, but fast change in pitch or roll. This is only noticeable in high wind environment. 
To get this to work, I look for near zero velocity and start moving the pitch and roll into the wind control items. This takes a  transformation from copter frame to world frame, but the result is the copter will hold the position against the wind with the sticks in the center of the controller. If you fly around the wind compensation will bleed off slowly - about 30 seconds.
Again, this is off by default and needs significant testing, preferably in the HIL sim first.JNL has already started and flown this version for real.
The feature may be off by default for another version or two, but just letting you know it's there.
I think it will go a long way to making the mode changes feel seamless.

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.
Failsafe RTL now goes 10M up as it RTLs to avoid obstructions.
Added SIL test for failsafe. 

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

Views: 42944

Reply to This

Replies to This Discussion

Aerosim-RC running inside a window (instead of full screen)

I´ve got this nice modification from the developer to run Aerosim in a window.

You must create a file called FRAME (no extension) on following directory:

W7                   C:\ProgramData\AeroSIM_RC      (this directory is hidden by deffault)

XP, VISTA        C:\Documents and Settings\All Users\Program Data\AeroSIM_RC

Now you can combine both sim & MP for HIL testing and video-screen-recording. That´s it

Enjoy.

Angel

Good work Marco,

It seems that in your video you do a too fast yaw turn, could you please conduct the test for the heading set at 0°, 90° 180° and 270° from the wind direction, BUT with a pause of the turn rate at least for 15 sec... (not a continuous turn)... With the same weather conditions.

As I have done in my test video above.

May be you will notice a big difference in the LOITER position Hold and see how your PID are really tuned.

Regards, Jean-Louis

 

Thanks Jean-Louis! The coninuous turn is for test the realtime speed correction of AC with the wind.
In all
the multirotor system this is the best way to test the real quality of the loiter, because the software is very cool if you do not understand how you put the drone is also hard to think about the fix.

If the system
is too fast
and can handle all these factors it can be seen well only in this case, because it is during this maneuver that the software uses to make full and continuing all the automatic flight routine control based on the location.
If it were a
pc with Windows we have the task manager at 100%. :P
The rest I do not consider myself a normal tester, but a hard tester ... :-)
This is
what's really hard to do, the loiter is almost perfect (with both the sim).
Anyway I tried X-Plane but it has horrible graphics, and does not give you the feeling of having truly in the hands the quad, AeroSim is much better, "Phoenix RC" for me is the top (for heli), but is not supported... :-)
One thing, however, you should do is use the HIL mode "SENSORS", but unfortunately in this case you would have the GPS signal of the APM and read your fixed position (bad thing to do adequate testing), Jason should add a parameter in the case of "SENSORS" uses such as that of the GPS simulator, like this:

#define HIL_MODE     HIL_MODE_SENSOR
#define HIL_GPS        HIL_GPS_SIM  //  HIL_GPS_APM  for using the internal GPS connected to APM

All this just for using all the internal sensors with the sim gps.

Thanks Bro, work fine!
About the "video capture" there's a lot of software around, i use "Bepa Fraps", for me is the number one, because using a nice "low level" interception of the screen through the "direct draw".
Anyway you can try also "Camstasia" for capture the desktop area, in this thing is much better.

Here a video of a test flight in HIL mode on X-Plane v9.70 of the firmware ArduCopter v2.1.1 R6.  This is a test about the LOITER mode (1 turn) around a target during a full autonomous flight under a flight plan (AUTO mode).  The take off and the landing are also done automatically.

Regards, Jean-Louis

It's a shame that this forum can not be put "i like it" as on Facebook ... : P

Tres Bien.

Do you know if it's possible to do tradheli SIL with X-Plane?

Ok, first day of my yearly leave.

R5 code.

15Km/h wind, open field, Loiter is a no go, sorry.

In stabilize I had to tilt the into wind leg about 15-20 degrees down to maintain position.

Loiter did not even remotely indicate any ability to maintain position...

I have another two weeks of free time for testing though.....

Stabilize however was very solid flying around, not even one instance of "ohsh1t"

I hate to ask the obvious, but did you have GPS lock?  Sounds like your experience with r5 is quite outside the norm.  What are your Nav. PI settings?

Gustav, can you post your tlog here? (if you have telemetry installed)

Hi Robert, yes, gps lock, solid blue LED.

Standard/default settings.

Previously in much less wind, at my house, the impression was that it worked.

But the area there is limited, so couldn't let it alone too long.

Maybe the wind was stronger than I thought?

Grr, no, 1280 board, xBee is on the fixed wing.....

I'll try again tomorrow, if the wind allows :-(

Reply to Discussion

RSS

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service