QuickCal
Proposal of a mechanism for quick calibration routine for SCuM.
- 1 Calibration Box (CalBox)
- 1.1 Naming
- 1.2 General Info
- 1.3 Stages
- 1.3.1 Initialization
- 1.3.2 Synchronization
- 1.3.3 Time slotted communication
- 1.4 Stages
- 1.4.1 Initialization
- 1.4.2 Synchronization
- 1.4.3 Time slotted communication
- 1.4.4 Scan Acceleration Trick
- 1.4.5 Calibrating Duration
- 2 Frame format
- 3 Demo Video
- 4 Result
This mechanism consists of two parts:
A CalBox with 16 OpenMotes
a SCuM chip that needs to calibrate, within range of the CalBox
The goal is to determine SCuM’s frequency setting for each channel, both for RX and TX. We want that to quickly as soon as possible.
The result of this algorithm is two freq_setting tables:
frequency_setting_rx[16] which contains the frequency settings of 16 channels for RX
frequency_setting_tx[16] which contains the frequency settings of 16 channels for TX
Calibration Box (CalBox)
Naming
CalBox is consist of 16 OpenMotes. Each OpenMote is labeled as MM1, MM2, …, MM16 where:
MM1 is the master node, acting as time master
MM2-MM16 are the slave nodes, acting as time slaves
General Info
The software running on OpenMote is simple time-slotted protocol, no stack running on top.
Slotframe contains 16 slots and each slot is split into multiple sub-slots for transmitting one frame and receiving an Acknowledgement.
The communication rules on each slot are:
Before being synchronized, each OpenMote only listens on channel 11 and wait for CalBeacon sent by MM1.
After being synchronized, each OpenMote only sends multiple CalBeacon frames on specific slot at specific channel. E.g.
MM1 can only send beacons on slot 0 on channel 11. During all other slots except slot 0, MM1 listens on channel 11,
MM2 can only send beacons on slot 1 on channel 12. During all other slots except slot 0, MM2 listens on channel 12,
MM3 can only send beacons on slot 2 on channel 13. During all other slots except slot 0, MM3 listens on channel 13,
… …
After synchronized, when an OpenMote received a frame from SCuM, it sends back an Acknowledgement (CalAck) on the same channel it was listening before.
The Acknowledgement contains the frequency_offset of the incoming frame.
Stages
Initialization
All OpenMotes listen on channel 11 all the time and wait for CalBeacon frame to synchronize, except MM1 since it is the timer master.
MM1 follows the rule above to send CalBeacon frame on slot 0.
Synchronization
When an OpenMote received a CalBeacon, according to the SeqNum inside the frame, it is able to calculate where the slot boundary is, hence complete the synchronization stage.
Time slotted communication
The general behaviors of OpenMote after synchronized is explained in #General Info
The following figure shows how the QuickCal box works:
SCuM
Stages
Initialization
SCuM is placed in the communication range of CalBox
Configure SCuM to Radio Rx state at frequency setting coarse.mid.fine 22.00.00, waiting for a CalBeacon for 1 sub-slot duration
If nothing received, repeat the process after increment the setting to 22.00.01
Loop through whole settings until setting is set to 23.31.31.
If no CalBeacon is received during the period. Set frequency setting to 22.00.00 and repeat the whole process again
Synchronization
When the SCuM received a CalBeacon, according to the SeqNum inside the frame, it is able to calculate where the slot boundary is, hence complete the synchronization stage.
After synchronized, SCuM knows when there are frames sent on which channel at what time.
Wait a Slotframe duration
Time slotted communication
“1 coarse“ settings indicate 32*32=1024 frequency setting in sequence. For example, frequency setting 24.0.12 - “1 coarse“ setting = 23.0.12
Frequency setting for Rx
At beginning of slot 0, SCuM starts to configure frequency settings from
23.0.0
to24.31.31
to listen on each of the frequency settingRecord the frequency setting if a valid CalBeacon frame is received.
Among the frequency settings recorded, select one as the frequency setting
rx_ch11
At beginning of slot 1, SCuM starts to configure frequency settings from
rx_ch11
to (rx_ch11
+“2 coarse“ settings) to listen on each of the frequency settingRepeat the process above, within slot 1, SCuM knows the frequency setting
rx_ch12
Repeat this processes until the last slot in one slotframe, SCuM gets the frequency settings table: frequency_setting_rx[16].
When frequency_setting_rx[16] is archieved:
Frequency setting for Tx
At slot 1,
if frequency_setting_rx11 is NOT calibrated, SCuM sends one CalProbe frame per frequency setting to MM1, ranging from
23.0.0
to23.31.31
.if frequency_settingrx_11 is calibrated, SCuM sends one CalProbe frame per frequency setting to MM16, ranging from
rx_ch25
torx_ch25
+ “1 coarse“ settings.
Record the frequency setting when an CalAck is received from MM1. The frequency settings with the smallest freq_offset difference to +2 is selected as
tx_ch11
At slot 2, SCuM sends one CalProbe frame per frequency setting to MM2, ranging from
rx_ch11
torx_ch11
+ “1 coarse“.Record the frequency setting when an CalAck is received from MM2. The frequency settings with the smallest freq_offset difference to +2 is selected as
tx_ch12
At slot 3, SCuM sends one CalProbe frame per frequency setting to MM3, ranging from
rx_ch12
torx_ch12
+ “1 coarse“.Record the frequency setting when an CalAck is received from MM3. The frequency settings with the smallest freq_offset difference to +2 is selected as
tx_ch13
… …
At slot 15, SCuM sends one CalProbe frame per frequency setting to MM15, ranging from
rx_ch24
torx_ch24
+ “1 coarse“Record the frequency setting when an CalAck is received from MM15. The frequency settings with the smallest freq_offset difference to +2 is selected as
tx_ch25
Now SCuM gets the frequency settings table: frequency_setting_tx[16].
Scan Acceleration Trick
According to the frequency sweep result, when doing the frequency sweep to find the right settings, the scan step can be set to 3 to acceleration the scan process.
E.g. to scan from 22.0.0 to 23.31.31, the settings below to be checked only:
22.0.0, 22.0.3, 22.0.6 …
Calibrating Duration
The duration to obtain the two frequency settings tables is 2-slotframe duration.
Hence the slot duration determine how fast the calibration can be completed.
To calculate the duration:
The frames is 10 bytes (320 us@250 Kb/s), the minimal sending interval is 214us (theoretically 192us), then 1ms sending frame interval is enough.
“2 coarse ” contains 2048 settings, if using 3 as the step for scaning, then there are totally 682 settings. Hence the slot duration is set to 682ms.
Hence, the calibrating duration is 2*16*682= 21.824 seconds.
Frame format
The SeqNum is reset to 0 at beginning of each slot, it increments at each sub-slot when a frame is sent out.
Demo Video
Result
Round 1
| channel 11 | channel 12 | channel 13 | channel 14 | channel 15 | channel 16 | channel 17 | channel 18 | channel 19 | channel 20 | channel 21 | channel 22 | channel 23 | channel 24 | channel 25 | channel 26 |
TX
| 23.30.4 | 24.18.7 | 25.4.23 | 25.11.13 | 25.17.14 | 25.23.18 | 26.9.30 | 26.15.30 | 26.22.24 | 27.10.16 | 27.15.25 | 27.21.23 | 27.26.31 | 28.14.22 | 28.20.20 | 29.9.5 |
RX | 23.27.16 | 24.14.22 | 24.20.24 | 25.8.21 | 25.16.6 | 25.22.6 | 25.25.30 | 26.13.26 | 26.21.10 | 26.25.26 | 27.13.20 | 27.20.12 | 27.24.27 | 28.11.28 | 28.18.19 | 28.24.15 |
Round 2
| channel 11 | channel 12 | channel 13 | channel 14 | channel 15 | channel 16 | channel 17 | channel 18 | channel 19 | channel 20 | channel 21 | channel 22 | channel 23 | channel 24 | channel 25 | channel 26 |
TX
| 23.29.13 | 24.15.30 | 25.6.2 | 25.12.3 | 25.16.26 | 26.3.30 | 26.9.30 | 26.18.3 | 27.3.29 | 27.10.16 | 27.15.22 | 28.2.27 | 28.10.7 | 28.15.12 | 28.20.20 | 28.25.28 |
RX | 24.9.14 | 24.14.22 | 24.21.17 | 25.7.28 | 25.14.22 | 25.21.15 | 25.26.23 | 26.14.19 | 26.20.19 | 26.25.25 | 27.14.13 | 27.20.12 | 27.25.18 | 28.13.13 | 28.18.19 | 28.25.8 |
Round 3
| channel 11 | channel 12 | channel 13 | channel 14 | channel 15 | channel 16 | channel 17 | channel 18 | channel 19 | channel 20 | channel 21 | channel 22 | channel 23 | channel 24 | channel 25 | channel 26 |
TX
| 23.30.4 | 24.18.7 | 25.5.14 | 25.12.4 | 25.16.27 | 25.24.6 | 25.28.27 | 26.17.16 | 27.4.18 | 27.11.8 | 27.15.25 | 28.3.20 | 28.9.15 | 28.15.12 | 29.1.28 | 29.8.15 |
RX | 23.26.25 | 24.15.14 | 24.21.15 | 24.27.13 | 25.15.14 | 25.21.15 | 25.26.23 | 26.15.11 | 26.20.20 | 26.26.17 | 27.14.14 | 27.18.28 | 27.25.18 | 28.12.21 | 28.18.19 | 28.25.9 |
Round 4
| channel 11 | channel 12 | channel 13 | channel 14 | channel 15 | channel 16 | channel 17 | channel 18 | channel 19 | channel 20 | channel 21 | channel 22 | channel 23 | channel 24 | channel 25 | channel 26 |
TX | 23.28.25 | 24.17.15 | 25.6.4 | 25.10.22 | 25.16.27 | 25.23.15 | 26.12.3 | 26.17.13 | 27.5.8 | 27.9.25 | 27.15.23 | 28.5.0 | 28.10.4 | 28.16.3 | 28.22.2 | 29.7.24 |
RX | 24.8.21 | 24.15.15 | 24.21.18 | 24.26.24 | 25.14.22 | 25.20.22 | 25.27.14 | 26.14.19 | 26.19.28 | 26.26.19 | 27.15.5 | 27.20.11 | 27.24.27 | 28.13.13 | 28.18.20 | 28.24.17 |
Round 5
| channel 11 | channel 12 | channel 13 | channel 14 | channel 15 | channel 16 | channel 17 | channel 18 | channel 19 | channel 20 | channel 21 | channel 22 | channel 23 | channel 24 | channel 25 | channel 26 |
TX | 23.29.16 | 24.18.4 | 25.6.4 | 25.11.13 | 25.17.16 | 25.23.18 | 26.11.14 | 26.16.25 | 27.4.17 | 27.10.18 | 27.16.13 | 27.22.13 | 27.26.27 | 28.15.12 | 28.20.20 | 29.7.23 |
RX | 23.26.24 | 24.15.14 | 24.22.8 | 24.28.9 | 25.15.14 | 25.20.23 | 25.28.6 | 26.14.18 | 26.20.19 | 26.27.9 | 27.12.28 | 27.18.28 | 27.25.18 | 28.12.21 | 28.17.27 | 28.25.7 |
Round 6
| channel 11 | channel 12 | channel 13 | channel 14 | channel 15 | channel 16 | channel 17 | channel 18 | channel 19 | channel 20 | channel 21 | channel 22 | channel 23 | channel 24 | channel 25 | channel 26 |
TX | 23.29.13 | 24.17.16 | 25.3.31 | 25.9.31 | 25.18.8 | 26.3.30 | 26.12.2 | 26.18.3 | 27.4.17 | 27.9.25 | 27.15.25 | 27.23.1 | 28.10.5 | 28.16.4 | 28.22.0 | 28.27.6 |
RX | 24.8.21 | 24.14.22 | 24.21.17 | 25.9.14 | 25.15.14 | 25.21.16 | 25.27.13 | 26.13.26 | 26.19.27 | 26.26.17 | 27.13.21 | 27.19.20 | 27.25.18 | 28.11.28 | 28.19.10 | 28.24.16 |
Round 7
| channel 11 | channel 12 | channel 13 | channel 14 | channel 15 | channel 16 | channel 17 | channel 18 | channel 19 | channel 20 | channel 21 | channel 22 | channel 23 | channel 24 | channel 25 | channel 26 |
TX | 23.30.4 | 24.17.14 | 24.23.18 | 24.29.17 | 25.19.2 | 25.23.15 | 25.29.15 | 26.18.5 | 27.3.25 | 27.10.17 | 27.15.25 | 27.20.31 | 27.27.21 | 28.15.12 | 29.1.28 | 29.7.25 |
RX | 23.27.17 | 24.15.13 | 24.20.25 | 25.10.6 | 25.15.15 | 25.21.15 | 25.26.24 | 26.14.20 | 26.19.28 | 26.26.17 | 27.13.21 | 27.21.4 | 27.25.19 | 28.13.12 | 28.18.19 | 28.23.26 |
Round 8
| channel 11 | channel 12 | channel 13 | channel 14 | channel 15 | channel 16 | channel 17 | channel 18 | channel 19 | channel 20 | channel 21 | channel 22 | channel 23 | channel 24 | channel 25 | channel 26 |
TX | 23.28.25 | 24.18.4 | 25.4.21 | 25.12.3 | 25.18.8 | 25.22.27 | 26.9.30 | 26.17.12 | 27.3.29 | 27.9.27 | 27.15.25 | 27.21.24 | 28.8.25 | 28.16.4 | 29.3.9 | 29.8.14 |
RX | 24.7.28 | 24.14.22 | 24.21.16 | 24.26.26 | 25.16.6 | 25.21.15 | 25.27.15 | 26.15.10 | 26.20.19 | 26.26.17 | 27.13.20 | 27.21.3 | 27.26.9 | 28.12.21 | 28.26.17 | 28.30.30 |
Round 9
| channel 11 | channel 12 | channel 13 | channel 14 | channel 15 | channel 16 | channel 17 | channel 18 | channel 19 | channel 20 | channel 21 | channel 22 | channel 23 | channel 24 | channel 25 | channel 26 |
TX | 23.28.26 | 24.17.16 | 24.23.16 | 24.31.0 | 25.16.25 | 25.23.16 | 25.30.7 | 26.17.15 | 27.4.19 | 27.10.15 | 27.17.4 | 27.21.22 | 28.10.5 | 28.15.12 | 28.21.13 | 28.26.19 |
RX | 23.28.10 | 24.15.14 | 24.20.26 | 25.8.22 | 25.15.15 | 25.21.15 | 25.27.15 | 26.15.10 | 26.20.20 | 26.26.19 | 27.14.13 | 27.19.21 | 27.25.19 | 28.12.22 | 28.18.20 | 28.24.17 |
Round 10
| channel 11 | channel 12 | channel 13 | channel 14 | channel 15 | channel 16 | channel 17 | channel 18 | channel 19 | channel 20 | channel 21 | channel 22 | channel 23 | channel 24 | channel 25 | channel 26 |
TX | 23.28.23 | 24.16.25 | 25.3.31 | 25.11.16 | 25.19.0 | 25.22.27 | 25.28.24 | 26.15.31 | 27.5.9 | 27.9.27 | 27.17.4 | 27.23.2 | 28.9.15 | 28.13.31 | 28.22.2 | 29.7.22 |
RX | 24.7.28 | 24.15.15 | 24.21.17 | 24.26.26 | 25.13.29 | 25.20.23 | 25.28.7 | 26.14.17 | 26.20.19 | 26.26.18 | 27.12.28 | 27.20.12 | 27.25.18 | 28.11.28 | 28.18.21 | 28.24.17 |