3D Robotics

ArduPilot GPS lock bug fixed

Thanks to Rusty's detective work, I think we've fixed the GPS lock bug (the blue LED was turning off even when the module was showing valid data). New code is here. (Basically every instance of "if (fix_position == 0x01) ..." should have been "if (fix_position >= 0x01)..." It turns out that there are three valid fix values: 1,2 and 3. See the datasheet for more.)
E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Checked it, looks good, must have just been the timing.Thanks, Chris
  • Moderator
    Chris- I've uploaded the code and tested the gps lock for more than 5 minutes w/out a loss. I did not adjust any other parts of the code yet so the unit remains in the Return to Launch mode. I did notice that the rudder servo periodically moves. The question I have is how does the autopilot know when to return to launch coordinates? If you throw the plane up and toggle on the autopilot when you've reached alt that you want and say right over your head, that would give you the RTL coordinates. The part I don't understand is how do you tell it to RTB? The only way the logic works in my head is if the ardupilot gets the RTL coords during the power up. Then when you throw the plane up and get it to where you want it to return from, you flip the toggle and then it just comes back via the auto pilot.

    I hope that all makes sense! and thanks for all the hard work!
  • 3D Robotics
    John: I did have the wrong code there for an hour, but the code there should be right. Can you check again? You should see this line in the INIT tab: "while(((fix_position < 0x01)||(lat==0)));" and this line in the GPS navigation tab: if(fix_position >= 0x01) digitalWrite(12,HIGH);
  • I'm getting problem with the new code. Its happen when I toggle MUX channel. The STAT led like stuck, I mean it flash - stop - flash - stop and result like this
    ArduPilot!!!
    5313738
    103148248
    100
    Mot: 0 Yaw: 105 Alt: 0 Crs: 126 Dis: 1 Des: 298
    Mot: 130 Yaw: 105 Alt: 65534 Crs: 144 Dis: 2 Des: 320
    Mot: 130 Yaw: 105 Alt: 65534 Crs: 139 Dis: 3 Des: 311
    Mot: 130 Yaw: 105 Alt: 65534 Crs: 109 Dis: 4 Des: 303
    0
    -163
    1484
    79
    Mot: 45 Yaw: 94 Alt: 65534 Crs: 94 Dis: 4 Des: 291
    Mot: 0 Yaw: 94 Alt: 0 Crs: 121 Dis: 5 Des: 276
    0
    -163
    1474
    77
    Mot: 45 Yaw: 92 Alt: 10 Crs: 132 Dis: 5 Des: 271
    Mot: 45 Yaw: 62 Alt: 11833 Crs: 11314 Dis: 17080 Des: 87
    Mot: 0 Yaw: 62 Alt: 0 Crs: 18 Dis: 4 Des: 279
    0
    -163
    0
    -163
    Mot: 45 Yaw: -178 Alt: 9 Crs: 327 Dis: 4 Des: 272
    Mot: 0 Yaw: -178 Alt: 0 Crs: 261 Dis: 1 Des: 275
    Mot: 45 Yaw: -178 Alt: 8 Crs: 304 Dis: 0 Des: 270
    Mot: 45 Yaw: -178 Alt: 7 Crs: 22 Dis: 1 Des: 270
  • Thanks for the update guys, hopefully it resolves my LOCK LED issues, but,

    I think the link to new code is incorrect.The code downloaded from the link above is to an earlier release; its dated back to January 17th and therefore couldn't have been modified recently. Looking more closely reveals that all the lines that need fixing haven't yet been fixed and must be done manually.I'm sure with all the versions running around its an easy mistake. Plus its probably better that people modify the code themselves to get familiar with it.
  • Thanks Chris... :-)
This reply was deleted.