EM406: busted!

Ciao to everybody, just want you to know that today I finally made my EM406, ArduIMU and Ardupilot work together with a simple trick. From http://seniord.ece.iastate.edu/dec0803/manuals/EM-406%20Product_Guide1.pdf we see that the output baud rate of the infamous EM406 is 4800 bps. Adjusting the code for arduIMU, ardupilot to work at 4800 everything works very fast, ever without the "first time" GPS locking procedure. All right.
The only problem is that one might desire a higher than 4800 output rate. Argh, I am a very newbie to arduino and I am still searching for the solution.



UPDATE!

So, with the help of Hopslink, I finally got it all working.


This made my arduIMU connect with the so-hatred EM406 module without using the NMEA protocol.


If you make arduPilot communicate with arduIMU @ 38400 bps you're really done. That's it.

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Try this first. Set the baud rate for which the arduIMU onnects to the em406 module to 4800 bps, as the datasheet indicates.Always be sure that the red LED on the gps is blinking, meaning LOCK, or it is off, meaning BINARY mode. Again, be sure to wait a reasonably long amount of timme to get the fix. This worked for me!
  • Well I have came up empty handed on GPS lock :( So correct me if I am wrong, there should be no problem trying to obtain GPS lock on the IMU completely independent of the Ardupilot? So in another words I have removed the Ardupilot completely from the scenario. I have IMU powered by an external power source with no other connections other than the GPS. Should I not see a solid blue GPS light baring some error in the code?arduimu.zip
  • hey Jeff, here's the code. I got some little corrections from hopslink. And yes, I'm powering both boards from an external power supply, going to test with battery soon (i just burnt my arduIMU, damn!)ArduPilot_2_6.zip
    https://storage.ning.com/topology/rest/1.0/file/get/3692065352?profile=original
  • Guy's thanks for the responses... iangl if you would like to PM me your code I will have a look and see if I can find some thing wrong with mine. I am powering the Ardupilot from input channel three and the IMU from the VCC next to the programing pins( as showed in the pictures in the manual). So your are powering both boards separately with an external 5vdc power supply?

    hopslink, I will go through my configuration once more when I get home, I will report back tonight.
  • The code updates were added to the official download a month or so back. Grab the official download from here (top one).
    If you are still having issues post your configuration settings.

    All the best!
  • Jeff, i had some troubles with the power source of the boards. Try powering them from the programming input (the power pins located near the pins where you attach the programmer, on both boards). If you want I can pm you also my ArduPilot code so you can have a look at that. ciao
  • I have loaded the code that was givein in the first post but I am not able to get GPS communications on the IMU. I am pretty sure the code on my Ardupilot is correct for the 406. What am I missing?
  • Chris,

    There are some changes required, depending on what the development team view as the best way forward.

    The issue is the latest IMU 1.7 code never initialises the EM406 to binary mode (that I can see, and if it does it sets it to 57k where the IMU/AP combination is set for 38k). Code to do the setup is there but it doesn't seem to be called.

    The fix supplied changes the EM406 initialisation code to set it to 38k when used with the IMU, and calls that code during IMU setup. This seems the logical way forward since it is transparent to the user, requiring no extra user settings for various data rates in the IMU/AP code. That is based on the assumption that the 57k EM406 rate is a legacy setting from old AP versions and not an absolute requirement (but it seems to be working ok).

    Provided these changes do not break anything for Ublox users I would look to include them, or some better solution, in the IMU code. Obviously that is a choice for the development team.

    TimL's suggestion about changing the ArduPilot EM406 rate to match seems a good idea too as it saves users having to change telemetry settings for anything other than NMEA GPS types.
  • From my point of view the only confusion is that the ardupilot sets the 406 baud rate automatically and the imu does not. So I was confused by the fact that the 406 worked easily in one senerio and not another. I think others have also been confused by this.

    It is also tricky to keep switching the baud rate of the xbee when using em406 on the ardupilot or via the imu.

    So to my mind two things would make the confusion go away and also make life easier

    1) Auto set the 406 baud rate in the imu 406 code

    2) Alter the 406/serial code in the ardupilot to use the same speed as the imu (regardless of using thermopiles or imu)

    This means that switching between 406/imu and 406/ardupilot is just a matter of altering the published imu/ardupilot code settings + upload

    Thanks
  • 3D Robotics
    Guys, I'm trying to follow along, but a little unclear about whether there is a bug in the code we need to fix, or whether it was already fixed in 1.7 (none of us use the EM406 with ArduIMU, so we might have missed something). Hopslink, is this something we need to address?
This reply was deleted.