There is quite a bit of development going on right now, but I thought I'd share what I'm working on. I'm using Flash to implement a simulator and test Arducopter code. What's on my site at jasonshort.com is on the current Trunk.
What isn't there is a whole lot of other work including Tridge's DCM core updates and Andreas' APM_limits code which is a geo-fencing library.
You'll notice the sim has been updated to work in 3D now, so you can fly full missions, Yaw and Loiter in 3D. An orange line now indicates nav_yaw which is the yaw hold angle. A black circle indicates the GPS positions and the red box is the next waypoint location.
A new crosstrack algorithm:
Based on our flights in high winds at the Copter Rodeo, I set out to improve our crosstrack error correction. We had previously been using Arduplanes' track correction which turns the plane into the error to correct it. Of course copters can fly sideways and don't need to give up forward momentum to track correctly. The new algorithm solves this and acts very similar to the loiter control. Crosstrack gain will be lowered to a default of .2 because of new approach.
GPS lead filter:
Another idea from the rodeo, the lead filter takes into account the velocity and acceleration of the copter and the latency of the GPS to guess where the copter really is, not just where it was 1 second ago. This helps Loiter somewhat, but where it really shines is the Waypoint and RTL navigation. When you hit the WP it acts immediately, and not 1 second later which helps reduce overshoot.
Phillip Jones suggested prioritizing the altitude over navigation when fighting wind to prevent the quad from loosing altitude during a hard pitch. This keeps the quad from hitting the ground during WP flight. Anything greater than a 1m error begins to level out nav_pitch to gain altitude. Still a WIP and not on the trunk yet.
RTL_altitude is now implemented. This will cause the copter to rise to the desired altitude in Loiter before heading home. The parameter rtl_approach_alt will change how the copter will land after RTL or a mission that doesn't end in a land command. Basically setting this param to 0 will cause a land, setting this to any other number will cause the copter to go to that altitude after RTLing. The param auto_land_timeout is used to trigger this altitude change. The RTL Approach altitude parameter is great for bringing the copter down without worrying about touching the ground.
Alternate Yaw control:
A new control method for Yaw goes back to the hybrid rate/stabilzie approach, but uses a timer to lock in the hold angle. This allows the rate controller to brake the Yaw and then set the new hold angle without much overshoot and dreaded snapback.
Better Yaw gains:
Testing the SIM with an out of alignment motor allowed me to test various I term settings. An iterm of .02 for BOTH Rate and Stabilize Yaw works best.
Discovered Yaw Bias issue:
While running missions in the sim I realized the copter would run off track while Yawing to the target. Turns out we change and update Yaw continuously, but the copter's nav_roll and nav_pitch is only updated 4x with GPS reads. This causes the copter to be pitching at at angle to the target instead of towards the target when Yawing. The nav_roll and nav_pitch are now updated at 50 hz instead of 4 which get's rid of most of the issues.
Self centering throttle:
This is very experimental, and probably won't be enabled by default. The throttle cruise value is calculated at all times, and the lower limit of throttle is raised to place that cruise value right at mid stick.
Takes the desired velocity and outputs a pitch and roll that should match the drag of the copter. This lets the I-terms deal with just the wind and not the wind + drag combined. It also helps the track accuracy by about 30%.
"Angle boost" a more accurate algorithm in 2.6, but we found it didn't account for the inefficiency of the thrust pattern. A small correction has been added to account for this.
Throttle min and max
Implemented the params for throttle min and max so you can change them from the MP.
What's new with the SIM:
Added new top view
Added 3D physics
Added the ability to run the SIM at up to 10x speed for running variations
Added a Score for integrating crosstrack error to use for gradient descent (machine learning)
Added a new joystick controller class that acts like a real radio, or allows user to adjust 1 axis only.
Added 2D wind
Added Yaw Gains
Added iteration # limit to stop the sim after N number of 100hz main loops.
What's next in the SIM:
If you are testing the trunk, please check the SIM and see if you can reproduce bugs. If not, please note that in bug reports.
Code is here:
Flash FLA project file available by request.
Video from WIP last week.