Developer

Arducopter 2.0.40 preview

3689422502?profile=originalI'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

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Chris: Hehe... You guys are like Father Christmas and his North Pole staff.

    I make a wish and what do I see when I open my favorite site?  The little elf's hard at work to make my wish come true!! :D

  • @chris nice info..  thank's

  • That is fantastic news

     

  • 3D Robotics

    mc_don: The DIY Drones camera team is hard at work on a really sophisticated set of camera and gimbal commands via MAVLink that will make setup and tracking easy. You'll be able to do all setup via the Mission Planner. Look for that in a few weeks

  • 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?

  • 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. 

  • 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.

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

     

  • Developer

    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.

  • 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
    3692264467?profile=original
    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.

  • 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.

This reply was deleted.