gnssDRWheelTickSetup (Function)

Top  Previous  Next

Architecture:

NX32, NX32L

Device support:

NX-200 DR.

Firmware version:

5.13 / 1.74.00


This configures the Wheel Tick support needed for Automotive Dead Reckoning.

 

Wheel ticks provide the GNSS module with information about how the vehicle moves to improve the positioning when there is bad or no GNSS coverage.

The wheel ticks can be provided either by using two digital inputs as tick and direction or from software by either providing a tick counter and direction or the speed.

The software wheel ticks should be provided as often as possible for the best result.

 

 

Input:

mode : SINT (Default 0)

The wheel tick mode to use.

0

No wheel tick

1

Hardware Wheel Tick using two digital inputs.

2

Software using ticks sent with gnssDRWheelTickPushTick

3

Software using speed sent with gnssDRWheelTickPushSpeed

 

hw_tick: INT

The number of the digital input to use as the wheel tick. Only used when mode is 1.

 

hw_tick_inv: BOOL

Invert the polarity of the tick digital input. Only used when mode is 1.

 

hw_dir: INT

The number of the digital input to use as the direction input. By default, active is forward. Only used when mode is 1.

 

hw_dir_inv: BOOL

Invert the polarity of the direction digital input. Only used when mode is 1.

 

scale: DINT

Specifies the distance represented by each wheel tick in µm.

If not set (or set to zero) it will be estimated during calibration.

 

quant: DINT

Wheel-tick quantization in µm. If mode is 3, then this is interpreted as the speed measurement error RMS in µm/s.

 

countmax: DINT

Wheel-tick counter maximum value (rollover - 1). Set to zero if relative wheeltick is used. This parameter is only used in mode 2.

 

latency: UINT

Wheel-tick data latency due to e.g. CAN bus in ms.

 

freq: USINT

Nominal wheel-tick data frequency in Hz.

 

 

 

Returns:

1

- Success

0

- Unsupported

-1

- Invalid input.

-2

- Generic error

-3

- GNSS power is OFF

-4

- Hardware input is not available.

 

Declaration:

FUNCTION gnssDRWheelTickSetup : INT;
VAR_INPUT
  mode           : SINT := 0;
  hw_tick        : INT;
  hw_dir         : INT;
  hw_tick_inv    : BOOL;
  hw_dir_inv     : BOOL;
  scale          : DINT;
  quant          : DINT;
  countmax       : DINT;
  latency        : UINT;
  freq           : USINT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
BEGIN
  ...
  // Configure to use HW wheel tick on DIN1 and DIN2
  gnssDRWheelTickSetup(mode:=1, hw_tick := 1, hw_dir := 2, scale := 6646);
  ...
  // Configure to use relative SW wheel tick
  gnssDRWheelTickSetup(mode:=2, countmax := 0, scale := 6646);
  ...
END;
 
END_PROGRAM;