I've been away on vacation for the last week and a half, but I was able to port Arducopter to Flash and do some simulations. This has helped me rewrite the navigation control laws, simple mode, and Loiter to all use a streamlined set of control loops. This not only has saved code space, but the end result is a quad that flies like it's on rails. 

 

Loiter and WP navigation are now the same code and use a rate based solution from the GPS. The heading and ground speed values are parsed into X(long) and Y(lat) components. This gives me a far more accurate estimation of position than just using the Mediatek's lat and long outputs. The controller takes the position error, desired speed, and minimum speed and outputs pitch and roll commands. I've noticed a marked improvement in Loiter hold. Basically it's glued to one spot. I'll need to do more testing in windy conditions, so stay tuned.

 

Altitude hold uses the same controller design and manages the speed of altitude change. Landing and altitude changes are much more controlled and I've not seen the quad loose altitude on RTL like it did in the past.

 

The  Throttle, Roll/Pitch, and Yaw control loops have all be separated to give you the option of redefining any of the modes. In the zip file below, Alt hold has been redefined (in APM_Config,h) to use SIMPLE mode for Roll/Pitch. Loiter has been redefined to use Manual throttle. 

 

The Flash based simulator uses nearly identical code to Arducopter. Here's the work in progress of the sim:

 

 

The code itself is available for download here and is considered alpha to me. WP's are being tested tomorrow. Only RTL, SIMPLE, ALT HOLD have been tested so far. Crosstrack correction is currently disabled. Everything should work, but be careful. Anything could happen. I've only crashed 4 times today ;)

Jason

 

Updated:

latest code

Views: 4563

Tags: Arducopter

Comment by malcolm churn on September 3, 2011 at 10:03am

Very quickly as martin (www.buildyourowndrone.co.uk) myself are still testing off to the field again in a few mins but here is a video of the code with my traditional heli. So far its like flying a different helicopter, the first Loiter test with tried it just stayed still. 2nd test is the video, it seemed to build up an error. Will post more as soon as i get home.


Moderator
Comment by John Church on September 3, 2011 at 10:27am

Nice, Malcolm! The elevator dips/oscillations that were evident in your last video are virtually gone. Very smooth!

Comment by Martin Szymanski on September 3, 2011 at 6:10pm

I tested the RTL and Loiter modes today on V 38 to get a comparison.

The RTL went up ~50 Ft and held with a altitude hold of 3 ft of variance. There was a NW 9 Mph breeze.

It turned in and out of the wind direction about 3 times then started a interesting head holding circle that was around a 100 Ft diameter going around 20 Mph. I let it fly around about 4 times watching in amazement and ready to grab it in stabilization mode at any time.  The Loiter mode worked well at lower altitudes. After switching from loiter to simple the copter took off upward and to the south at a great rate of speed. Putting it in stabilization mode gave back the sticks and it was brought in.  I am tempted to try the V 40. I just wish the grasses were a little higher like in spring time.

Comment by Heino R. Pull on September 3, 2011 at 10:12pm
I got caught on mode issues with v40 today and my radio set "simple" mode was mapped to Rtl or Auto ( not sure) and my stock quad wound up unexpectantly chasing me at 10 ft. No crash but a very fast heart rate. Alt hold sort of worked but was difficult to engage at sonar altitudes. I realize I needed to really examine the source particularly the configuration setup before flying. I went back to v38 and v36 and stuck at v36 since alt hold and loiter work so well on this version on my quad.
Comment by malcolm churn on September 4, 2011 at 1:41am

I only tested Loiter mode with the altitude on manual. No problems for me at all. i have another video, you can see how stable it was.

Comment by Jeff E on September 4, 2011 at 2:04am

I know this could just be Flash / browser issue (tested on IE Chrome FireFox) same result but the B on the flash simulation is going left and right, up and down seems to simulate quad with in windy condition. Maybe its a bug :D scary if this is present in the code, you will see a wild copter lol

Anyway, the difference in our frame setups seems to factor the stability of this version. Although I have the standard 28" arm ACM frame but doesnt exhibit good response. All my alt_hold can be triggered a lower altitude without climbimg 10ft and no sign of stopping since v33. Maybe the others are right that somehow altitude is controlled by throttle and had to dial it in so it will stop climbing but hopefully things can be sorted out. I myself would prefer the copter will stay within a few feet from where it was triggered not having to dial it in and have adverse effect when switching to modes like loiter.


Developer
Comment by jasonshort on September 5, 2011 at 3:27pm

Sorry, that copter is navigating between two hidden waypoints. Click the light grey area to toggle it between the WP. It was really just for me to play, but I thought i'd share.

Comment by Martin Szymanski on September 5, 2011 at 4:39pm

V 40 is was tested today. It flew good. The altitude hold acts different.

I will revert back to V 38 because the sonar alt hold worked better.

http://www.youtube.com/watch?v=LBD83ogwzuE

 

Comment by Paul on September 6, 2011 at 4:27am

following, looking forward to .40. to get a better stable loiter and RTL - ive never been able to have either of these modes work well at all which is no fun. does any one know why at low altitude, lets say 2m i switch over to alt hold and sometimes the quad shoots up and never stops? in saying so, over 6m if i would to hold position would that be a loiter or alt hold thing? im just a little confused why i cant get my quad to hold altitude solid and in loiter my quad has a mind of it own and not hold. in saying this, i have baro covered with earbuds, sonar far away as possible with custom usb shielded wire. 

great jobs guys nonetheless. 

Comment by mc_don on September 6, 2011 at 6:26am

how about camera gimbal setting?

g.rc_camera_pitch.set_angle(4500);
    g.rc_camera_pitch.radio_min     = 1000;
    g.rc_camera_pitch.radio_trim     = 1500;
    g.rc_camera_pitch.radio_max     = 2000;
    //g.rc_camera_pitch.set_reverse(1);

    g.rc_camera_roll.set_angle(4500);
    g.rc_camera_roll.radio_min         = 1000;
    g.rc_camera_roll.radio_trim     = 1500;
    g.rc_camera_roll.radio_max         = 2000;

can wee set from AMP on new ver?

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Social Networking

Contests

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.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service