UKHAS Wiki

UK High Altitude Society

User Tools

Site Tools


guides:ublox_psm

Ublox 6 Power Saving Modes

The Ublox 6 gps modules by default have excellent power consumption at around 50 - 60mA to get a lock and then around 40mA with a lock. They however have modes that allow them to reduce their consumption further and only a small loss to performance.

Eco Mode

Reduces average current usage to about 39mA.

Cyclic Mode

This mode is available on all models of the ublox6 family though the update period can, in theory, vary. When the GPS starts up it is by default in the Maximum Performance mode. Once you have switched from Max Perfom to Power Saving the default setting is cyclic with an update period of 1 second resulting in a draw on average (for the 3.3v module) of 14mA-15mA.

On the modules with the TCXO* this can according to the data sheet be extended to an update period of 10 seconds which reduces the current draw average to 10mA. However under testing by Anthony Stirk stable performance with anything other than the default cyclic of 1 second was not achievable.

Additionally :

  • You can only set the power saving mode once the GPS has got a lock otherwise the module has a habit of reseting itself and losing all your settings.
  • Setting power saving with the module that has a lock with only 4 satellites can lead to unstable performance. Its advise you only engage power saving mode when you have more than 5 satellites.
  • When setting the power saving on have a small delay (~1000ms) in code before proceeding with further settings.

* The NEO-6M module doesn't have a TCXO so cannot do 10 second cyclic (it can do 1 second though).

Example Code:

int firstlock = 0;
 
// Send a byte array of UBX protocol to the GPS
void sendUBX(uint8_t *MSG, uint8_t len) {
  for(int i=0; i<len; i++) {
    Serial.write(MSG[i]);
  }
  //Serial.println();
}
 
void setupGPSpower() {
  //Set GPS ot Power Save Mode
  uint8_t setPSM[] = { 0xB5, 0x62, 0x06, 0x11, 0x02, 0x00, 0x08, 0x01, 0x22, 0x92 }; // Setup for Power Save Mode (Default Cyclic 1s)
 
  sendUBX(setPSM, sizeof(setPSM)/sizeof(uint8_t));
}
 
void loop() {
  Serial.println("$PUBX,00*33"); //Poll GPS
  while (Serial.available())
  {
    int c = Serial.read();
    if (gps.encode(c))
    {
      //Get Data from GPS library
      //Get Time and split it
      gps.get_datetime(&date, &time, &age);
      hour = (time / 1000000);
      minute = ((time - (hour * 1000000)) / 10000);
      second = ((time - ((hour * 1000000) + (minute * 10000))));
      second = second / 100;
 
      //Get Position
      gps.get_position(&lat, &lon, &age);
 
      // +/- altitude in meters
      ialt = (gps.altitude() / 100); 
 
      if(firstlock == 0 && lat != 0){
          setupGPSpower();
          firstlock = 1;
      }
    }
  }
  //Transmit data here over radio
  }
 

Turn GPS on and off via software

Another option is to manually control the GPS, while this approach means that when the GPS is off it doesn't draw much it does mean that it'll need to reacquire a lock which will require more current. The ublox offers to options:

1) Switch the whole GPS to backup mode - minimal current draw <5mA, loses all settings, wakes on command via serial or after set time

 //Set GPS to backup mode (sets it to never wake up on its own)
 uint8_t GPSoff[] = {0xB5, 0x62, 0x02, 0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x4D, 0x3B};
 sendUBX(GPSoff, sizeof(GPSoff)/sizeof(uint8_t));
 
 delay(30000);
 
 //Restart GPS
 uint8_t GPSon[] = {0xB5, 0x62, 0x02, 0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4C, 0x37};
 sendUBX(GPSon, sizeof(GPSon)/sizeof(uint8_t));

2) Switch the RF GPS section off, draws about 5mA, retains its settings, wakes on serial command.

 uint8_t GPSoff[] = {0xB5, 0x62, 0x06, 0x04, 0x04, 0x00, 0x00, 0x00,0x08, 0x00, 0x16, 0x74};
 sendUBX(GPSoff, sizeof(GPSoff)/sizeof(uint8_t));
 
 delay(30000);
 
 uint8_t GPSon[] = {0xB5, 0x62, 0x06, 0x04, 0x04, 0x00, 0x00, 0x00,0x09, 0x00, 0x17, 0x76};
 sendUBX(GPSon, sizeof(GPSon)/sizeof(uint8_t));
Data obtained from Ublox uCenter :

CFG-NAV5

Dynamic Model '6' Aiborne < 1g Large Deviation
0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0xDC

Dynamic Model '3' Pedestrian Small Deviation
0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00, 0xFA, 0x00, 0x64, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x76         

This is possibly worth switching too on the way down or on the ground as it gives a much more accurate position and works below 9000 meters altitude and as long as the vertical velocity < 20m/s and horizontal velocity < 30/ms. 

CFG-RXM Commands 

Max Performance Mode (default)
0xB5, 0x62, 0x06, 0x11, 0x02, 0x00, 0x08, 0x00, 0x21, 0x91

Power Save Mode
0xB5, 0x62, 0x06, 0x11, 0x02, 0x00, 0x08, 0x01, 0x22, 0x92

Eco Mode Don't want this one but here for reference.
0xB5, 0x62, 0x06, 0x11, 0x02, 0x00, 0x08, 0x04, 0x25, 0x95 

CFG-PM2

Not sure what the implication of "do not enter 'inactive for search' state when no fix" is.

Update Period 1 second do not enter 'inactive for search' state when no fix unchecked (default setting)
0xB5, 0x62, 0x06, 0x3B, 0x2C, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x94, 0x02, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x4F, 0xC1, 0x03, 0x00, 0x87, 0x02, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x64, 0x40, 0x01, 0x00, 0x9B, 0x75 

Update Period 1 second do not enter 'inactive for search' state when no fix checked
0xB5, 0x62, 0x06, 0x3B, 0x2C, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x90, 0x03, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x4F, 0xC1, 0x03, 0x00, 0x86, 0x02, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x64, 0x40, 0x01, 0x00, 0x96, 0xEB

Update Period 10 seconds , do not enter 'inactive for search' state when no fix checked
0xB5, 0x62, 0x06, 0x3B, 0x2C, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x90, 0x03, 0x00, 0x10, 0x27, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x4F, 0xC1, 0x03, 0x00, 0x87, 0x02, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x64, 0x40, 0x01, 0x00, 0xE4, 0x8B

Update Period 10 seconds , do not enter 'inactive for search' state when no fix unchecked
0xB5, 0x62, 0x06, 0x3B, 0x2C, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x90, 0x02, 0x00, 0x10, 0x27, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x4F, 0xC1, 0x03, 0x00, 0x86, 0x02, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x64, 0x40, 0x01, 0x00, 0xE1, 0x51

CFG-RST 

Turn GPS RF section off 
0xB5, 0x62, 0x06, 0x04, 0x04, 0x00, 0x00, 0x00,0x08, 0x00, 0x16, 0x74

Turn GPS RF Section on
0xB5, 0x62, 0x06, 0x04, 0x04, 0x00, 0x00, 0x00,0x09, 0x00, 0x17, 0x76

GPS Cold Start (Forced Watchdog)
0xB5, 0x62, 0x06, 0x04, 0x04, 0x00, 0xFF, 0x87, 0x00, 0x00, 0x94, 0xF5
guides/ublox_psm.txt · Last modified: 2012/12/17 14:59 by upu

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki