High-Precision Sensor Modbus Protocol
High-Precision Sensor Modbus Protocol
Register table
ADD ADD
R R SERI
REGISTER Bit1 Bit1 Bit1 Bit1 Bit1 Bit1 Bit Bit Bit Bit Bit Bit Bit Bit Bit
FUNCTION AL Bit0
NAME 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1
(Hex (Dec
) ) I/F
save/reboot/r
00 00 SAVE R/W SAVE[15:0]
eset
calibration
01 01 CALSW R/W CALSW[3:0]
mode
Serial port
04 04 BAUD R/W BAUD[3:0]
baud rate
Acceleration
05 05 AXOFFSET R/W AXOFFSET[15:0]
X offset
Acceleration
06 06 AYOFFSET R/W AYOFFSET[15:0]
Y offset
Acceleration
07 07 AZOFFSET R/W AZOFFSET[15:0]
Z offset
Angular
08 08 GXOFFSET velocity X R/W GXOFFSET[15:0]
zero bias
Angular
09 09 GYOFFSET velocity Y R/W GYOFFSET[15:0]
zero bias
Angular
0A 10 GZOFFSET velocity Z R/W GZOFFSET[15:0]
zero bias
Magnetic
0B 11 HXOFFSET Field X Zero R/W HXOFFSET[15:0]
Bias
Magnetic field
0C 12 HYOFFSET R/W HYOFFSET[15:0]
Y zero bias
Magnetic field
0D 13 HZOFFSET R/W HZOFFSET[15:0]
Z zero bias
Z-axis
WORKMOD
0E 14 operation R/W WORKMODE[15:0]
E【1】
mode
Z-axis peak-
GPTPTIME to-peak
11 17 R/W GPTPTIME[15:0]
【1】 acquisition
time
Z axis zero
GBAISTIME bias
13 19 R/W GBAISTIME[15:0]
【1】 acquisition
time
GSTATICTH Z axis static
14 20 R/W GSTATICTHRE[15:0]
RE【1】 threshold
Z axis
GSTATICTIM
15 21 stabilization R/W GSTATICTIME[15:0]
E【1】
time
Z-axis
PGSCALE
16 22 calibration R/W PGSCALE[15:0]
【1】
factor P
Z-axis
GSCALERA
18 24 calibration R/W GSCALERANGE[15:0]
NGE【1】
angle
device
1A 26 IICADDR R/W IICADDR[7:0]
address
Magnetic
Field X
1C 28 MAGRANGX R/W MAGRANGX[15:0]
Calibration
Range
Magnetic
Field Y
1D 29 MAGRANGY R/W MAGRANGY[15:0]
Calibration
Range
Magnetic
Field Z
1E 30 MAGRANGZ R/W MAGRANGZ[15:0]
Calibration
Range
BANDWIDTH[3:0
1F 31 BANDWIDTH bandwidth R/W
]
SLEE
22 34 SLEEP sleep R/W
P
Installation ORIE
23 35 ORIENT R/W
direction NT
Dynamic
25 37 FILTK R/W FILTK[15:0]
filtering
GPS baud
26 38 GPSBAUD R/W GPSBAUD[3:0]
rate
acceleration
2A 42 ACCFILT R/W ACCFILT[15:0]
filter
version
2E 46 VERSION R VERSION[15:0]
number
minutes/seco
32 50 MMSS R/W SECONDS[15:8] MINUTE[7:0]
nds
acceleration
34 52 AX R AX[15:0]
X
acceleration
35 53 AY R AY[15:0]
Y
36 54 AZ acceleration R AZ[15:0]
Z
Angular
37 55 GX R GX[15:0]
velocityX
Angular
38 56 GY R GY[15:0]
velocityY
Angular
39 57 GZ R GZ[15:0]
velocity Z
Magnetic
3A 58 HX R HX[15:0]
FieldX
Magnetic field
3B 59 HY R HY[15:0]
Y
Magnetic field
3C 60 HZ R HZ[15:0]
Z
X-axis angle
3D 61 LRoll R LRoll[15:0]
low
X-axis angle
3E 62 HRoll R HRoll[15:0]
high
Y-axis angle
3F 63 LPitch R LPitch[15:0]
low
Y-axis angle
40 64 HPitch R HPitch[15:0]
high
Z-axis angle
41 65 LYaw R LYaw[15:0]
low
Z-axis angle
42 66 HYaw R HYaw[15:0]
high
Module
43 67 TEMP R TEMP[15:0]
temperature
Gyro
GYROCALTI
63 99 calibration R/W GYROCALTIME[15:0]
ME
time
Gyroscope
6A 105 WERROR R/W WERROR[15:0]
change value
Z-axis still
6E 110 WZTIME time R/W WZTIME[15:0]
threshold
Z-axis static
6F 111 WZSTATIC R/W WZSTATIC[15:0]
threshold
485 data
74 116 MODDELAY response R/W MODDELAY[15:0]
delay
Device No.1-
7F 127 NUMBERID1 R ID2[15:8] ID1[7:0]
2
Device No9-
83 131 NUMBERID5 R ID10[15:8] ID9[7:0]
10
Device No11-
84 132 NUMBERID6 R ID12[15:8] ID11[7:0]
12
ROLL angle
95 149 LREFROLL R/W LREFROLL[15:0]
zero is low
ROLL angle
96 150 HREFROLL R/W HREFROLL[15:0]
zero bias
high
PITCH corner
97 151 LREFPITCH R/W LREFPITCH[15:0]
zero bias low
PITCH corner
98 152 HREFPITCH zero bias R/W HREFPITCH[15:0]
high
explanation:
Protocol format
Each register address, the number of read registers, and the read data are represented
by two bytes. The high and low bits of the register address are represented by ADDRH
and ADDRL, the high and low bits of the number of registers to be read are represented
by LENH and LENL, and the high and low bits of the read data are represented by
DATA1H and DATA1L.
The last two bits of the read command are standard CRC check bits. It can be calculated
using the CRC check digit calculation tool.
command send
Modbus function registers high 8 registers Read length Read length Check digit Check digit
address code bits lower 8 bits high 8 bits lower 8 bits high 8 bits lower 8 bits
0x03
ID ADDRH[15:8] ADDRL[7:0] LENH[15:8] LENL[7:0] CRCH[15:8] CRCL[7:0]
(read)
Data return
Data
Data Data Data Check
Modbus function read Data high 8 Data lower 8 high Check digit
lower high 8 lower 8 digit lower
address code length bits bits 8 high 8 bits
8 bits bits bits 8 bits
bits
0x03
ID LENL[7:0] DATA1H[15:8] DATA1L[7:0] …… …… DATAnH DATAnL CRCH[15:8] CRCL[7:0]
(read)
For each register address, the write data is represented by two bytes. The high and low
bits of the register address are represented by ADDRH and ADDRL, and the high and
low bits of the written data are represented by DATAH and DATAL.
command send
Modbus function register high 8 register Data high 8 Data lower 8 Check digit Check digit
address code bits lower8 bits bits bits high 8 bits lower 8 bits
0x06
ID ADDRH[15:8] ADDRL[7:0] DATAH[15:8] DATAL[7:0] CRCH[15:8] CRCL[7:0]
(write)
Data return
Modbus function register high 8 register Data high 8 Data lower 8 Check digit Check digit
address code bits lower8 bits bits bits high 8 bits lower 8 bits
0x06
ID ADDRH[15:8] ADDRL[7:0] DATAH[15:8] DATAL[7:0] CRCH[15:8] CRCL[7:0]
(write)
Register Description
All the following examples are commands when the Modbus address is 0x50 (default). If you
change the Modbus address, you need to change the address and CRC check bit in the
command accordingly.
SAVE(save/reboot/reset)
Default: 0x0000
Save: 0x0000
example:
send:50 06 00 00 00 FF C4 0B(reboot)
return:50 06 00 00 00 FF C4 0B
CALSW
Default: 0x0000
15:4
example:
return:50 06 00 01 00 04 D4 48
BAUD RATE
Default: 0x0002
15:4
0001(0x01): 4800bps
0010(0x02): 9600bps
0011(0x03): 19200bps
0100(0x04): 38400bps
0101(0x05): 57600bps
3:0 BAUD[3:0]
0110(0x06): 115200bps
0111(0x07): 230400bps
1000(0x08): 460800bps(Only
supportWT931/JY931/HWT606/HWT906)
example:
return:50 06 00 04 00 06 45 88
AXOFFSET~HZOFFSET(Zero bias setting)
Default: 0x0000
bias0.1g),0x03E8=1000,1000/10000=0.1(g)
return:50 06 00 05 03 E8 94 F4
WORKMODE(Z-axis operation mode)
Default: 0x0000
15:4
example:
return:50 06 00 0E 00 01 24 48
GYROPTP(Z-axis static peak-to-peak)
Default: 0x0000
Write 0x01 to the "WORKMODE" register to enter the "peak-to-peak mode", in this mode
the sensor automatically calculates the maximum and minimum values of the Z-axis
angular velocity within the time set by "GPTPTIME" and records them in "GYROPTP". In
"Zero Offset Mode", this data will be used to calculate and filter the zero offset.
eaxmple:
return:50 03 02 00 64 44 63
Defaults: 0x000A
Example:
Return: 50 06 00 11 00 0A 54 49
After entering the "Peak-to-Peak Mode", obtain the difference between the maximum value
and the minimum value of the Z-axis angular velocity within the "GPTPTIME" time, store it
in "GYROPTP", and use this data for zero bias in the "Zero Bias Mode". calculation filter.
GYROBAIS(Z-axis zero bias value)
Default: 0x0000
The Z-axis horizontal gyroscope has a certain zero bias value when placed at rest, and the
angular velocity at rest can be eliminated by this zero bias value. The zero offset value can
be automatically calculated by automatically obtaining the zero bias. Enter the "Zero bias
Mode" to automatically calculate the zero bias value according to the peak-to-peak value of
"GYROPTP" and the "GBAISTIME" bias acquisition time.
example:
return:50 03 02 00 64 B1 0F
Default: 0x000A
Example:
Send: 50 06 00 13 00 0A 2F5 89 (set the Z-axis zero bias acquisition time to 10S)
Return: 50 06 00 13 00 0A 2F5 89
The time required to obtain the Z-axis zero biast, and the zero bias value is obtained
according to this time when the zero bias is obtained.
GSTATICTHRE(Z-axis static threshold)
Default: 0x0032
Default value 50
The Z-axis horizontal gyroscope has slight data jitter when it is placed at rest. This
parameter can filter out these slight jitters. When the angular velocity is less than the
"GSTATICTHRE" setting value and continues for the time set by "GSTATICTIME", it is
regarded as stationary, and the Z-axis angular velocity is zero. This parameter can be
appropriately increased when it is used in scenes with jitter and the Z-axis is accumulated
due to jitter, and this parameter can be appropriately decreased in scenes with very slow
and uniform rotation.
example:
100/10000=0.1(°))
return:50 06 00 14 00 64 C5 A4
GSTATICTIME(Z-axis stabilization time)
Default: 0x0064
Z-axis static judgment time threshold. It is considered stationary when the angular velocity
is less than the value set by "GSTATICTHRE" for the time set by "GSTATICTIME". If the
stabilization time is required to be higher, this parameter can be adjusted appropriately.
Lowering this parameter can speed up settling time but may also increase error.
example:
50/10000=0.05(°))
return:50 06 00 15 00 32 14 5A
PGSCALE(Z-axis calibration factor P)
Default: 0x2710
range:0~20000
15:0 PGSCALE[15:0]
This parameter is written in the factory using a high-
precision turntable, please do not modify it
example:
return:50 03 02 27 74 24 48
Default: 0x02D0
example:
0x0168=360)
return:50 06 00 18 01 68 04 32
The angle of rotation required in the Z-axis "scale factor mode", generally set to an integer
multiple of 360°.
IICADDR(Device address)
Default: 0x0050
15:8
0x01~0x7F
example:
return:50 06 00 1A 00 02 24 4D
LEDOFF(turn off LED light)
Default: 0x0000
15:1
example:
return :50 06 00 1B 00 01 35 8C
MAGRANGX~MAGRANGZ(Magnetic Field Calibration
Range)
Default: 0x01F4
example:
return:50 06 00 1C 01 F4 45 9A
BANDWIDTH(bandwidth)
Default: 0x0004
15:4
set bandwidth
0000(0x00): 256Hz
0001(0x01): 188Hz
0010(0x02): 98Hz
3:0 BANDWIDTH[3:0]
0011(0x03): 42Hz
0100(0x04): 20Hz
0101(0x05): 10Hz
0110(0x06): 5Hz
Example:
Return: 50 06 00 1F 00 01 74 4D
GYRORANGE(Gyroscope range)
Default: 0x0003
15:4
Example:
Return: 50 06 00 20 00 03 C5 80
ACCRANGE(Accelerometer range)
Default: 0x0000
15:4
0000(0x00): ±2g
example:
return:50 06 00 21 00 03 94 40
SLEEP(sleep)
Default: 0x0000
15:1
set sleep
example:
return:50 06 00 22 00 01 E5 81
ORIENT(Installation direction)
Default: 0x0000
15:1
example:
return:50 06 00 23 00 01 B4 41
AXIS6(algorithm)
Default: 0x0000
15:1
set algorithm
Example:
Return: 50 06 00 24 00 01 05 80
FILTK(K value filter)
Default: 0x001E
15:0 FILTK[15:0] The smaller the FILTK[15:0], the stronger the seismic
performance and the weaker the real-time performance.
example:
return:50 06 00 25 00 1E 15 88
ACCFILT(acceleration filter)
Default: 0x01F4
Example:
Return: 50 06 00 2A 01 F4 A5 94
VERSION(version number)
Default: none
Example:
VERSION[15:0]=(short)(((short)VH<<8)|VL)
YYMM~MS(on-chip time)
Default: 0x0000
Example:
Return: 50 06 00 30 03 16 05 7A
Return: 50 06 00 31 09 0C D3 D1
Return: 50 06 00 32 3A 1E B7 2C
Send: 50 06 00 33 01 F4 74 53 (set milliseconds 500)
Return: 50 06 00 33 01 F4 74 53
AX~AZ(acceleration)
Default: 0x0000
Example:
AX[15:0]=((short)AXH <<8)|AXL;
AY[15:0]=((short)AYH <<8)|AYL;
AZ[15:0]=((short)AZH <<8)|AZL;
GX~GZ(Angular velocity)
Default: 0x0000
Example:
GX[15:0]=((short)GXH <<8)|GXL;
GY[15:0]=((short)GYH <<8)|GYL;
GZ[15:0]=((short)GZH <<8)|GZL;
HX~HZ(magnetic field)
Default: 0x0000
example:
HX[15:0]=((short)HXH <<8)|HXL;
HY[15:0]=((short)HYH <<8)|HYL;
HZ[15:0]=((short)HZH <<8)|HZL;
Roll~Yaw(angle)
Default: 0x0000
example:
return:50 03 0C LRollH LRollL HRollH HRollL LPitchH LPitchL HPitchH HPitchL LYawH
LYawL HYawH HYawL CRCH CRCL
pitch angle(y-axis)
Pitch=((HPitchH<<24)|(HPitchL<<16)|(LPitchH<<8)|LPitchL)/1000°
yaw angle(z-asix)
Yaw=((HYawH<<24)|(HYawL<<16)|( LYawH<<8)|LYawL)/1000°
TEMP(temperature)
Default: 0x0000
example:
TEMP[15:0]=((short)TEMPH <<8)|TEMPL ;
q0~q3(Quaternion)
Default: 0x0000
example:
return:50 03 08 q0H q0L q1H q1L q2H q2L q3H q3L CRCH CRCL
q0[15:0]=((short)q0H <<8)|q0L ;
q1[15:0]=((short)q1H <<8)|q1L ;
q2[15:0]=((short)q2H <<8)|q2L ;
q3[15:0]=((short)q3H <<8)|q3L ;
Default: 0x0000
15:0 GYROCALITHR[15:0]
Gyro Still Threshold
value=GYROCALITHR[15:0]/1000(°/s)
example:
return:50 06 00 61 00 32 54 40
When the angular velocity change is less than 0.05°/s and lasts for the time of
"GYROCALTIME", the sensor recognizes it as stationary and automatically resets the
angular velocity less than 0.05°/s to zero
The setting rule of the static threshold of the gyroscope can be determined by reading the
value of the "WERROR" register. The general setting rule is:
GYROCALITHR=WERROR*1.2, unit: °/s.
Default: 0x03E8
example:
return:50 06 00 63 01 F4 74 42
When the angular velocity change is less than "GYROCALITHR" and lasts for 500ms, the
sensor recognizes that it is stationary and automatically resets the angular velocity less
than 0.05°/s to zero
Default: 0x0000
Example:
Send: 50 06 00 69 B5 88 22 A1 (unlocked)
Return: 50 06 00 69 B5 88 22 A1
Default: 0x0000
Gyroscope change
value=WERROR[15:0]/1000*180/3.1415926(°/s)
15:0 WERROR[15:0]
When the sensor is stationary, the "GYROCALITHR" register
can be set by changing this register
WZTIME(Angular velocity continuous rest time)
Default: 0x01F4
Example:
Return: 50 06 00 6E 01 F4 E5 81
When the angular velocity is less than "WZSTATIC" and lasts for 500ms, the angular
velocity output is 0, and the Z-axis heading angle is not integrated
Default: 0x012C
Example:
Return: 50 06 00 6F 01 F4 E5 81
When the angular velocity is greater than 0.5°/s, the Z-axis heading angle starts to
integrate the acceleration
When the angular velocity is less than 0.5°/s, and the duration set by the register
"WZTIME", the angular velocity output is 0, and the Z-axis heading angle is not integrated
Default: 0x0BB8
15:0 MODDELAY[15:0] Set 485 data response delay, default 3000, unit: us
Example:
Return: 50 06 00 74 03 E8 C4 EF
When the sensor receives the Modbus read command, the sensor delays 1000us and
returns data
Default: none
15:0 NUMBERID1[15:0]
15:0 NUMBERID2[15:0]
15:0 NUMBERID3[15:0]
15:0 NUMBERID4[15:0]
15:0 NUMBERID5[15:0]
15:0 NUMBERID6[15:0]
Device number:WT4200000001
XREFROLL~YREFPITCH(Angle zero reference value)
Default: 0x00000
Example: The current roll angle is 2°, set the roll angle zero, subtract 2°, then
REFROLL[31:0]=2*1000=2000=0x07D0
LREFROLL[15:0]=0x07D0, HREFROLL[15:0]=0;
Return: 50 06 00 95 07 D0 97 CB
Return: 50 06 00 96 00 00 64 67