Product is specified: (i) in PNI’s Price List in effect at time of order acceptance; or (ii) on PNI’s web site (www.pnicorp.com) at time of order acceptance, be free from defects in material and workmanship and...
Introduction Thank you for purchasing PNI’s TRAX2 Attitude & Heading Reference System (AHRS) & Digital Compass module. The TRAX2 employs a proprietary Kalman filtering algorithm that intelligently fuses PNI's patented Reference Magnetic Sensors with a 3-axis gyroscope and 3- axis accelerometer. The result is an orientation device that provides accurate heading information under a wide variety of conditions, including its ability to overcome errors normally caused by erratic motion and/or changes in the local magnetic field.
≤65° of pitch, and after a Full-Range calibration has been performed. 3. Assumes heading status is “1”. See Section 0 or Section 7.5.3 for a discussion on heading status. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 3...
2.3V min. and is guarenteed by design to be 1.87V min (2) Vin on UART Rx is rated at 4V MAX. Higher than 3.6V can cause excessive loading on source. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
Parameter Value RS232 and TTL-compliant Communication Interface serial UART Communication Protocol PNI Binary Communication Rate 2400 to 921,600 baud ≈30 samples/sec Maximum Data Output Rate Footnote: 1. The TRAX2 can operate up to 921,600 baud, but native RS232 is limited to 115,200 baud.
Table 3-6: Mechanical Characteristics Parameter Value Dimensions (l x w x h) 3.5 x 4.3 x 0.84 cm Weight 7 gm Connector 6-pin Molex, part number 51021-0600 PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 6...
After making the electrical connections, it is a good idea to perform some simple tests to ensure the TRAX2 is working as expected. See Section 6 for how to operate the TRAX2 with TRAX Studio or Section 7 for how to operate the TRAX2 using PNI’s binary protocol. PNI Sensor...
Ensure any stand-offs or screws used to mount the TRAX2 are non-magnetic. Refer to Section 3.2 for dimensions, hole locations, and the reference frame orientation. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
The orientation should be programmed in the TRAX2 using the Configuration Tab in TRAX Studio or using the kSetConfig command and the kMountingRef setting in the PNI Protocol, as described in Section 7.4.2. The default orientation is “STD 0°”. PNI Sensor...
User Calibration The magnetic sensor in the TRAX2 is calibrated at PNI’s factory in a magnetically controlled environment. However, sources of magnetic distortion positioned near the TRAX2 in the user’s system will distort Earth’s magnetic field and should be compensated for in the host system with a user calibration.
Page 17
Other Considerations Unlike a digital magnetic compass, such as PNI’s TCM module, the TRAX2 has an AHRS mode that incorporates a gyroscope and as such it can compensate for transient changes in the local magnetic field. However, the TRAX2 will work best if it is kept away from dynamic magnetic fields.
“Minimum Recommended” value, or greater. Calibration may be performed using TRAX Studio or using the PNI binary protocol, and up to 8 sets of magnetic calibration coefficients may be saved. The recommended calibration patterns described in the following sub-sections provide a good distribution of sample points.
Endianness, north reference, etc. Section 6.5 outlines how to perform a calibration using TRAX2 Studio, while Section 7.6.2 provides a step-by-step example of how to perform a calibration using the PNI protocol. Full-Range Calibration 5.1.1 A Full-Range Calibration is appropriate when the system with the TRAX2 installed can be pitched ±30°...
• It is not necessary for the unit to be pointing North to start; however, it may provide better results, especially in high latitudes. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
It provides both hard-iron and soft-iron distortion correction. The recommended 12-point calibration pattern given below is a series of 3 circles of evenly spaced points, with as much tilt variation as expected during use. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
The TRAX2 uses a MEMS accelerometer to measure attitude. This data is output as pitch and roll data. The accelerometer data is critical for establishing an accurate heading reading when the TRAX2 is tilted, as discussed in the PNI white paper “Tilt-Induced Heading Error Compass”,...
Page 24
PNI for recalibration. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 20...
TRAX and TRAX2. Among other features, the program can log and save the outputs from the TRAX2 to a file for off-line evaluation. Anything that can be done using TRAX Studio also can be done using PNI’s binary protocol, as discussed in Section 7.
TRAX Studio tabs, then either <Apply> or <Save> must be selected for the change to take effect. Save Clicking the <Save> button will save any changes made in TRAX Studio to the TRAX2’s onboard non-volatile and volatile memory. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 22...
For any changes to take effect, the <Save> button must be selected. Clicking on the <Default> button will load the factory default values, although these must be saved to take effect. Clicking the <Retrieve> button will show the current settings of the device. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
Note that selecting a larger number of taps can significantly slow the time for the initial sample reading and, if “Flush Filters” is selected, the rate at which data is output. The default setting is 32. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
Studio requests new data as soon as the previous request is fulfilled. Note that the inverse of the Polling Delay is greater than the sample rate, since the Polling Delay does not include the actual measurement acquisition time. The default is 0. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
<45°. (i.e. full range calibration is not possible.) Accelerometer – The user should select this when accelerometer calibration will be performed. Accelerometer calibration is recommended every 6 to 12 months to PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
Page 31
(8) sets of accelerometer calibration coefficients. This feature is useful if the compass will be placed in multiple locations that have different local magnetic field properties. The default is index number 0 and initially this is populated at PNI with factory-generated coefficients for the device itself. The other sets initially are unpopulated.
Regardless of whether “Automatic Sampling” is selected, two criteria must be met for a calibration sample to be taken. First, the TRAX2 must be held steady enough to meet PNI-defined stability criteria. Second, the TRAX2’s orientation must have changed enough to meet PNI-defined orientation change criteria.
Full-Range Calibration and Hard-Iron-Only Calibration, this should be ≥45°. For 2D Calibration, this ideally would be ~2°. For Limited-Tilt Calibration the value should be as large as possible given the user’s constraints. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
Clicking the Mag Factory Reset and/or Accel Factory Reset will reset the calibration coefficients currently indexed to those established at PNI. For example, if “Mag Coefficient Set 1” is selected as the current set, “Mag Factory Reset” will reset it to factory coefficients.
Page 35
The “Output Format” and “North Reference” fields mimic the settings on the Configuration Tab. To change these, return to the Configuration Tab, make the change, then <Apply> or <Save> the change. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 31...
Page 36
Three options are available, Standard, Tight and autoMerge. Standard (Loose) is the default. Please see section 7.4.2 for details. If Gyro Stabilized Compass Configuration is enabled, Settings related to Truth Method is ignored. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 32...
AHRS mode in which heading is determined by the addition of gyroscope propagated heading. Log Data Tab TRAX Studio can capture measurement data and then export it to a text file. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 34...
The “User” data and plot (red) provides data after applying the user calibration coefficients. In AHRS Mode the data and plots are identical, while in Compass Mode there is an offset which represents PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
The System Log tab shows all communication between TRAX Studio and TRAX2. Closing TRAX Studio will erase the system log. Select the <Export> button, at the bottom right of the screen, to save the system log to a text file. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
Operation with PNI Binary Protocol The TRAX2 utilizes a binary communication protocol, where the communication parameters should be configured as follows: Table 7-1: Port Configuration Parameter Value Number of Data Bits Start Bits Stop Bits Parity none 7.1 Datagram Structure...
Note that for this converter, little Endian values must be manually converted to big Endian. Please refer to the Standard for more information. PNI also recommends referencing the user’s compiler instructions to understand how the compiler implements floating-point.
0=positive and 1=negative. Big Endian Signed 8-Bit Integer (SInt8) UInt8-based parameters are unsigned 8-bit numbers. Bit 7 represents the sign of the value, where 0=positive and 1=negative. byte PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 39...
UInt16-based parameters are unsigned 16-bit numbers. Unsigned 8-Bit Integer (UInt8) UInt8-based parameters are unsigned 8-bit numbers. Boolean 7.2.5 Boolean is a 1-byte parameter that MUST have the value 0=FALSE or 1=TRUE. byte PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 40...
Queries for the sensor acquisition parameters 0x1A kSetAcqParamsDone Response to kSetAcqParams 0x1B kGetAcqParamsResp Response to kGetAcqParams 0x1C kPowerDownDone Response to kPowerDown Resets magnetometer calibration coefficients to 0x1D kFactoryMagCoeff original factory-established values PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 41...
This frame queries the device's type and firmware revision number. The frame has no payload. kGetModInfoResp (frame ID 2 , 0X02) The response to kGetModInfo is given below. The payload contains the device type identifier followed by the firmware revision number. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 42...
ID followed by a format-specific value. These configurations can only be set one at time. To save these in non-volatile memory, the kSave command must be issued. Payload Config ID Value UInt8 ID Specific PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 43...
Calibration Mode Allowable Minimum Range Recommended Full-Range 10 to 18 Limited-Tilt 10 to 18 2D Calibration 10 to 18 Hard-Iron-Only 4 to 18 Accelerometer-Only 12 to 18 Mag-and-Accel 12 to 18 PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 45...
Page 50
This frame is the response to kSetConfig frame. The frame has no payload. kGetConfig (frame ID 7 , 0X07) This frame queries the TRAX2 for the current internal configuration value. The payload contains the configuration ID requested. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 46...
Page 51
The “Distortion Mode” is Off by default. The payload is defined below. Payload DistortionMode Payload Value: “0”: Off DistortionMode “1”: On UInt8 PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 47...
Page 52
The time constant is square proportional to the time it takes the system to settle, the settle time is proportional to the TC value of the power of 2. ∝ () PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
It is recommended to set this to the same value as kMergeRate. kGetMergeRate (frame ID 129 , 0X81) This frame queries the setting of the Mag Truth Method. It has no payload. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 49...
This frame re-aligns the TRAX2 9-axis heading to the 6-axis (mag and accel) heading and establishes the criteria for the reference magnetic field. The frame should be sent when the user is confident the local magnetic field is not distorted. It has no payload. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
32 new samples must be taken before a reading will be output. The length of the delay before outputting data is directly correlated to the number of FIR taps. PNIReserved: These 4 bytes serve no function. PNI recommends populating the bytes with 0. SampleDelay: The SampleDelay is relevant when the Continuous Acquisition Mode is selected.
0x18 Float32 degrees kRoll 0x19 Float32 degrees kHeadingStatus 0x4F UInt8 value kQuaternion 0x4D 4x Float32 quaternion ˚ Celsius kTemperature 0x07 Float32 0x08 True or False kDistortion Boolean (Default) PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 52...
Page 57
& kAccelZ (Component IDs 21 , 22 , 23 These values represent the accelerometer sensor data for the x, y, and z axis, respectively. The values are normalized to g (Earth’s gravitational force). PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 53...
If heading and heading status are set to be output per the Example: kSetDataComponents command, the payload would look like: Payload 359.9 Heading ID Count Heading ID Heading Heading (Float32) Status ID Status (UInt8) PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 54...
Send the following two commands, Trax2 will stop outputting data after next power cycle. kStopContinuousMode (frame ID 22 This frame commands the TRAX2 to stop data output when in Continuous Acquisition Mode. The frame has no payload. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 55...
10° of tilt, but accuracy will not be as good. Hard-Iron-Only Calibration Recalibrates the hard-iron offset for a prior calibration. If the local field hard-iron distortion has changed, this calibration can bring the TRAX2 back into specification. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 56...
Page 61
TRAX2 is ready to take samples. Payload 1 to 18 indicates each point sampled successfully. Payload SampleCount# UInt32 kStopCal (frame ID 11 This command aborts the calibration process. The prior calibration results are retained. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 57...
The calibration score is automatically sent upon taking the final calibration point. The payload is defined below, and the various payload components are discussed after this. Payload MagCalScore Bytes 5-8 AccelCalScore DistributionError TiltError TiltRange Float32 Float32 Float32 Float32 Float32 Float32 PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 58...
TRAX2 is close to a source of local magnetic distortion that is not fixed with respect to the device. Bytes 5-8: Reserved for PNI use. AccelCalScore: Represents the over-riding indicator of the quality of the accelerometer calibration.
In this case the TRAX2 operates very similarly to PNI’s TCM electronic compass. There are a couple of reasons it may be desirable to place the TRAX2 in Compass Mode. As previously mentioned, it is necessary to place the TRAX2 in Compass Mode to perform a calibration.
FIR taps to use, which can be 0 (no filtering), 4, 8, 16, or 32. This is followed by the tap values (0 to 32 total Values can be in the payload), with each Value being a Float64, and suggested values given in Table 7-7. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
This frame confirms the TRAX2 received a command to power up. (The TRAX2 will power up when it receives any signal on the native UART Rx line.) The frame has no payload. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
The ability to store and access multiple calibration coefficients sets the TRAX2 apart from our Prime or legacy TCM. This section will detail the command list and provide two examples for utilizing this functionality. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
(frame ID) (config ID) (UInt32) 0x07 0x13 0x00 0x06 0x07 0x00 0x0A 0x08 0x13 kAccelCoeffCopySet 0x13 0x09 0x65 0x00 0x00 0x00 0x?? value which is CRC1 CRC2 currently used in TRAX2 PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 65...
Page 70
Send kSave command to save the kCoeffCopySet to flash so that it will be still available after power cycle. The kSave command is as following. 0x00 0x05 0x09 0x6E 0xDC PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 66...
00 17 05 04 05 43 b3 df 5e 18 be 88 ed bd 19 3d b5 15 53 4f 03 91 6. Repeat steps 4 and 5 whenever data is desired. PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021...
Page 77
& 0xFF; // store the frame ID mOutData[index++] = frameType; // copy the data to be sent while (len--) mOutData[index++] = *data++; // compute and add the crc = CRC(mOutData, index); PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 73...
Page 78
// Ticks is a timer function. 1 tick = 10msec. // wait up to 1/2s for the complete frame (mExpectedLen) to be // received mTime = Ticks() + 50; mStep++; PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 74...
Page 79
// expecting within 1/2sec of receiving the length bytes. Clear // everything in the input buffer since the data is unreliable mSerialPort->InClear(); mStep = 1; // Look for the next length bytes break; default: break; PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 75...
Page 81
// read the type and go to the first byte of the data // Only handling the 4 elements we are looking for case CommProtocol::kHeading: // Move(source, destination, size (bytes)). Move copies the PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 77...
Page 82
Message("Heading: %f, Pitch: %f, Roll: %f, Temperature: %f\r\n", heading, pitch, roll, temperature); mStep--; // send next data request break; default: // Message is a function that displays a formatted string PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 78...
Page 83
// Ticks is a timer function. 1 tick = 10msec. (Ticks() > mResponseTime) Message("No response from the module. Check connection and try again\r\n"); mStep = 0; break; default: PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 79...
Page 84
PNI Sensor DOC#1032877 TRAX2 User Manual Aug 2021 Page 80...
Need help?
Do you have a question about the TRAX2 AHRS and is the answer not in the manual?
Questions and answers