CXCAL Command — Continuous Calibration (AUTO mode)
New in v1.09.28. On earlier firmware SCXCAL replies with an error and changes nothing, and QCALAUTO does not exist (the device may answer it as if it were QCAL).
Calibration with SCALINT levels the device with a single stop, so it inherits the slope of that spot: in the field there are devices whose leveling is off by several degrees, which unbalances turns and shifts the impact thresholds of harsh maneuvers.
Since v1.09.28 the device observes its calibration all the time: at every stop it measures gravity and, with many stops in different places, it knows its real leveling. It can also measure the yaw while driving. What it does with that depends on the mode:
| Mode | What it does |
|---|---|
FIXED (0) | Calibration is not changed automatically, as up to v1.09.27. The observer still measures and reports in QCALAUTO how far off the device is |
AUTO (1) | The device applies what it measures: it corrects the leveling, keeps the yaw up to date and recalibrates itself if the mounting changes |
Which mode each device has:
- New factory device (no calibration in memory): ships in AUTO. It is installed in any position and calibrates itself, without
SCALINT. - Device updated from an earlier version: stays in FIXED, whether calibrated or not. The update does not change anyone’s mode.
Configuration: SCXCAL / QCXCAL
| Command | What it does | Response |
|---|---|---|
>SCXCAL1< | Switches to AUTO. Saves the current calibration as a backup (first time only) | RCXCAL1 |
>SCXCAL0< | Switches to FIXED with the calibration it has at that moment | RCXCAL0 |
>SCXCALR< | Goes back: restores the calibration from before switching to AUTO and stays in FIXED | RCXCAL0 |
>QCXCAL< | Queries the mode | RCXCAL0 / RCXCAL1 |
An invalid parameter, or SCXCALR with no saved backup, replies RCXCALERR.
>SCXCAL1<
>RCXCAL1<
>QCXCAL<
>RCXCAL1<The command is SCXCAL, not SCALAUTO. On a device with earlier firmware, any command starting with SCAL is interpreted as SCAL and may disable the calibration.
Interaction with the other calibration commands:
- A manual
>SCAL...<switches the device to FIXED: loading angles by hand is an explicit decision. - While a
SCALINTorSCALSTART*is running, AUTO does nothing; when the run finishes the device stays in AUTO. - AUTO never touches the offsets.
What AUTO corrects
Leveling (roll/pitch):
- On an unleveled factory device, the first stop already levels it; afterwards it refines.
- On a leveled device, it corrects when 7 places agree and the applied leveling is more than 1.5° away from the voted one. A well calibrated device is not touched.
- To avoid going back and forth: it does not correct if the bias measured while driving is below 10 mg (the leveling is already fine), and between two corrections it requires 8 renewed votes (new places or stopping again at the usual ones). If a correction would take it back to where it was before the previous one, it stops halfway and from then on corrects only above 2.5°.
- When it corrects the leveling, the yaw is adjusted so that “forward” is still forward.
Yaw:
- With no yaw established (factory or reinstalled device), the first complete measurement sets it directly, like
SCALINT. It takes as long asSCALINTphase 2 (car in the city ~10 minutes of driving; truck on the highway ~1 hour). - With a yaw established, it measures it all the time while driving and corrects it only if three consecutive measurements, at least ~1 hour of driving apart, agree with each other (±2°) and exceed 4°. Each time it has to correct in the opposite direction from the previous time, it halves the step.
Mounting change: if the device changes position (see “Device moved” below), it recalibrates itself. If the vertical changed more than 20° (reinstallation), it measures the yaw again from scratch.
Harsh maneuvers paused
In AUTO, while the device does not have leveling and yaw, the accelerometer HMs (types 2 to 7: turns, centripetal and impacts) do not fire: a false turn is worse than none. The GPS HMs (types 0 and 1) always work. The pause shows in QCALAUTO (field 14 = 1) and in the CAL02 signal = 4. In FIXED there is no pause. See HM Command, section “Device Orientation”.
How the observer votes
The observer runs on all devices, in AUTO and in FIXED:
- At each stop of 60 s or more with a fix (GPS speed below 3 km/h), it measures gravity for 15 s. If the device moves during that capture (loading, a door, someone getting in), it discards it and waits again.
- It stores the raw sensor gravity, uncalibrated: the vote stays valid even if the calibration changes later.
- One vote per place: within 300 m and with the same arrival heading (±60°), the new vote replaces the previous one. Parking the other way round at the same spot counts as another place.
- It keeps the last 16 places, also across reboots and updates.
- It converges (state
OK) with 5 or more places that agree with each other within 2°. - To count as a new stop, the vehicle must have driven 10 s in a row at 5 km/h or more, or moved 300 m away.
Device moved: if 3 places in a row give a vertical more than 10° away from the previous consensus and agree with each other within 3°, the device changed its mounting. It is flagged MOVED and keeps voting only with the new places. A ramp or a road shoulder at a single spot is not enough. The flag is cleared with SCAL, SCALINT, SCALSTART* or SCXCAL; in AUTO, on its own, when the recalibration converges.
Query: QCALAUTO
>QCALAUTO<
>RCALAUTO0,OK,6,11,2.4,-7.6,81,NA,NA,NA,0,0,SCALINT,0,9,6,2,0,0,0<| # | Field | What it is | In the example |
|---|---|---|---|
| 1 | mode | 0 = FIXED, 1 = AUTO | FIXED |
| 2 | state | NO_DATA (no votes), COLLECTING, OK (converged) or MOVED (device moved) | OK |
| 3 | places | voted places (0 to 16) | 6 |
| 4 | dispersion | how much the votes differ from each other, in tenths of a degree | 1.1° |
| 5-6 | suggested roll, pitch | the voted leveling, in degrees (ISO 8855, like QCAL) | +2.4° / −7.6° |
| 7 | deviation | how far the applied leveling is from the voted one, in tenths of a degree | 8.1°: it is off |
| 8-9 | bias X / Y while driving | what the accelerometer reads in the background while driving, in mg; NA if the yaw is not being measured (FIXED with no calibration in progress) | NA |
| 10 | yaw residual | what AUTO measures is still missing on the yaw, in tenths of a degree; NA in FIXED or before the first measurement | NA |
| 11 | moved | 1 = the device changed its mounting | 0 |
| 12 | corrections | corrections applied by AUTO (leveling or yaw) | 0 |
| 13 | origin | where the applied calibration came from: SCAL, SCALINT (also SCALSTART* and the verification after updating), AUTO, or - (earlier than v1.09.28) | SCALINT |
| 14 | HM paused | 1 = accelerometer HMs paused (AUTO not calibrated yet) | 0 |
| 15 | stops | 60 s stops seen since boot | 9 |
| 16 | votes | votes accepted since boot | 6 |
| 17 | discarded by movement | captures cut because the device moved, since boot | 2 |
| 18 | discarded by gravity | captures with a gravity out of band, since boot | 0 |
| 19 | leveling back-and-forth | 1 = the AUTO leveling went and came back: it stopped halfway and now corrects only above 2.5° | 0 |
| 20 | yaw back-and-forth | accumulated direction changes of the AUTO yaw (0 to 3); with 2 or 3, check the mounting | 0 |
What to look at:
- Device off level (in FIXED): state
OKand deviation of 15 or more (1.5°). To correct it, switch it to AUTO (>SCXCAL1<: it corrects itself at the next vote) or load the suggested leveling by hand with>SCAL1,<field 5>,<field 6><(the yaw is kept because theSCALdoes not include it). - In AUTO: field 12 = corrections made, field 10 = the yaw residual it is measuring, field 13 =
AUTOif the current calibration was set by AUTO. QCALSTATdoes not change with AUTO: the continuous measurement is not a calibration run andQCALSTATstill saysIDLE.
Example: a truck in FIXED with QCALAUTO in OK and deviation 31 (3.1°) → >SCXCAL1<. At the next vote it corrects itself: field 12 becomes 1 and the deviation drops to ~0. If something does not look right, >SCXCALR< goes back to the previous calibration.
CAL signal
The observer state is available as the CAL signal for event engine rules and for EVAL:
| Signal | EVAL | Value |
|---|---|---|
CAL00 | CAL(0) | 1 = converged (state OK) |
CAL01 | CAL(1) | 1 = device moved |
CAL02 | CAL(2) | state: 0 no data, 1 collecting, 2 OK, 3 moved, 4 = AUTO not calibrated with HMs paused |
CAL03 | CAL(3) | deviation in whole degrees (0 to 180) |
A rule only distinguishes 0 from non-zero. CAL00 and CAL01 work as is in a TRG=; CAL02 and CAL03 are almost always above 0, so TRG=CAL03+ stays always active. To compare values use EVAL, for example EVAL CAL(3) gt 5 (deviation above 5°).
Example: alert when a device changed its mounting:
>SRL90E;TRG=CAL01+;ACC={GCQ90L;TXT=DEVICE MOVED}<Compatibility
See Also
- Axis Calibration — SCALINT, QCALSTAT, SCAL and QCAL
- HM Command — Harsh maneuvers (pause in AUTO)
- AC Command — Accelerometer reading
- EVAL Command — Expressions with
CAL(n)