Testing between GPS to non-GPS(encoder mode)

Hello, I am having a challenge when trying to switch from GPS to non-GPS transitions. I have followed the process as outlined in the wiki GPS / Non-GPS Transitions — Rover documentation.

My setup is with skid steering using Rover 4.1.1. Manual mode and Auto Mode work perfectly and the encoders are counting properly. I was planning to use the encoders for GPS denied environments. I set RC6_OPTION= 90 on my 6 channel radio. In Mission Planner messages area, I can see the switch toggles between EKFPosSource LOW to EKFPosSource HIGH.

The EK3_SRC is setup as:
EK3_SRC1_POSXY = 3
EK3_SRC1_POSZ = 1
EK3_SRC1_VELXY = 3 GPS
EK3_SRC1_VELZ = 3
EK3_SRC1_YAW = 1

EK3_SRC2_POSXY = 3
EK3_SRC2_POSZ = 3
EK3_SRC2_VELXY = 7 Wheel Encoder
EK3_SRC2_VELZ = 3
EK3_SRC2_YAW = 1

EK3_SRC3_POSXY = 3
EK3_SRC3_POSZ = 3
EK3_SRC3_VELXY = 7 Wheel Encoder
EK3_SRC3_VELZ = 3
EK3_SRC3_YAW = 1

I do not hear the double beep, nor do I see the system changing to GPS to Encoder in the HUD.
Is there a threshold value for the GPS to change from GPS to Encoder?
Is there a better way to test the encoder mode?

Thanks!

1 Like

Hi @Citeone,

Great that you’re giving the EKF source switching a try. The beeps actually come from the lua script so maybe that isn’t running on the autopilot?

Feel free to include a log file if you’d like me to look at it in more detail…

Hello, Thank you for your guidance, I will try the lua script shortly. I am able use the manual switching mode using one of the RC channel switches. The encoder configuration appears to be working well. I am little confused on the various parameters of POSXY vs VELXY.
Where can I find a full description of the 5 SRCx parameters to fully understand how to use them. Setting VELXY to 7 for the encoder does work, but why is the this not called POSXY I am a little confused by the naming convention. My setup is a Skid steering rig with one GPS, compass and one encoder per side.
I have successfully tested the following two configurations:

I have tested Option A:

  • EK3_SRC1_POSXY = 0 (how is this parameter used?
  • EK3_SRC1_POSZ = 0 (why would I care about the z position on a rover?)
  • EK3_SRC1_VELXY = 7 (encoder used for XY map position?)
  • EK3_SRC1_VELZ = 0 (why would I care about the z position on a rover?)
  • EK3_SRC1_YAW = 1 (compass used for direction?)

Also tested Option B:

  • EK3_SRC1_POSXY = 3
  • EK3_SRC1_POSZ = 3
  • EK3_SRC1_VELXY = 7
  • EK3_SRC1_VELZ = 3
  • EK3_SRC1_YAW = 1

Which configuration would be the preferred method or is there a better setup?

Thanks.

@Citeone,

We have some information here and here.

Some answers:

  1. the EKF works in 3D so it needs an altitude estimate as well and it doesn’t help to not estimate the 3rd dimension. I would stick with the default of 1 (“Baro”).
  2. wheel encoders provide a speed estimate (not a position estimate) which is why EK3_SRCx_VELXY = 7 (wheel encoder). Speed (+ time) can be integrated to calculate an estimated position but this is different… with these parameters we are setting up what the source of various values are. Leaving EK3_SRCx_POSXY as zero means there’s no sensor that can provide an absolute position source which is OK. the EKF will do the integration to calculation the position.
  3. yes, it is best to stick with the compass for heading. wheel encoders could theoretically provide a change in head but they can’t provide an absolute heading.

OptionA uses only wheel encoders but OptionB will use both GPS and wheel encoders. It really depends upon the environment.

Thanks for giving this a try.