Channel sounding and more antenna paths

Hi,

I have a question about Channel Sounding:
I want to run the CS procedure with 4antenna paths. Both the reflector and the initiator have 2 antennas. I started with the examples for ras_initiator and reflector from NCS 3_1. I changed these lines in prj.conf:

CONFIG_BT_RAS_MAX_ANTENNA_PATHS=4  
CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=4  
CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=2  

In the overlay, I set the correct pins for the antenna switch:

ant-gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>,
            <&gpio0 2 GPIO_ACTIVE_HIGH>;

In the initiator, I also changed:

.tone_antenna_config_selection = BT_LE_CS_TONE_ANTENNA_CONFIGURATION_A2_B2,
.preferred_peer_antenna = BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_1 | BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_2,

Yes, I get measured distance results - but each second result is invalid: get  LOG -> Dropped subevent results. Waiting for ranging data from peer.
If I move the reflector more than 1 meter away, this message appears even more often, and at 2 meters I cannot get any measured distance.

To check if the problem is HW or SW, I tried CS with only one antenna path - I manually tested all combinations of antennas and RF paths, and all worked about the same. In a room, I have no problem getting data at 5-6 meters with a 250 ms period. So, single RF paths look OK.
It seems the problem is in the software.

My main question:
Is your example tested with 4 antenna paths? Are the results as reliable as with 1 or 4 paths? The result period is the same for 1 - 4 antenna paths?
Or is it necessary to change anything else to use 4 paths?

Thank you very much for any advice. I really don't know where to look for the problem anymore.

I can share the CS settings - but as I said: It is from your example of ncs 3_1. 

Maybe I should also mention that I only added another semaphore in the ranging_data_cb callback - when I get new data, I release the semaphore, and the main loop prints the new distances immediately when they are available.
So, I do not wait for a delay like in the original example.

Thank you very very much.

  • Hello,

    Thank you. I tried your recomendation, but I can not say I see any improvements, I would really like to know where is main problem, also I use internal RC (32kHz) instead of the external one.
    There is my settings for 4 AP:

    struct bt_le_cs_create_config_params config_params = {
    		.id = CS_CONFIG_ID,
    		.main_mode_type = BT_CONN_LE_CS_MAIN_MODE_2,
    		.sub_mode_type = BT_CONN_LE_CS_SUB_MODE_UNUSED,
    		.min_main_mode_steps = 2,
    		.max_main_mode_steps = 5,
    		.main_mode_repetition = 0,
    		.mode_0_steps = NUM_MODE_0_STEPS,
    		.role = BT_CONN_LE_CS_ROLE_INITIATOR,
    		.rtt_type = BT_CONN_LE_CS_RTT_TYPE_AA_ONLY,
    		.cs_sync_phy = BT_CONN_LE_CS_SYNC_1M_PHY,
    		.channel_map_repetition = 3,
    		.channel_selection_type = BT_CONN_LE_CS_CHSEL_TYPE_3B,
    		.ch3c_shape = BT_CONN_LE_CS_CH3C_SHAPE_HAT,
    		.ch3c_jump = 2,
    	};

    const struct bt_le_cs_set_procedure_parameters_param procedure_params = {
    		.config_id = CS_CONFIG_ID,
    		.max_procedure_len = 2000,
    		.min_procedure_interval = realtime_rd ? 5 : 10,
    		.max_procedure_interval = realtime_rd ? 5 : 10,
    		.max_procedure_count = 0,
    		.min_subevent_len = 60000,
    		.max_subevent_len = 60000,
    		.tone_antenna_config_selection = BT_LE_CS_TONE_ANTENNA_CONFIGURATION_A2_B2,
    		.phy = BT_LE_CS_PROCEDURE_PHY_1M,
    		.tx_power_delta = 0x80,
    		.preferred_peer_antenna = BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_1 | BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_2,
    		.snr_control_initiator = BT_LE_CS_SNR_CONTROL_NOT_USED,
    		.snr_control_reflector = BT_LE_CS_SNR_CONTROL_NOT_USED,
    	};
    

    and Kconfig:
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    CONFIG_DK_LIBRARY=y
    
    CONFIG_BT=y
    CONFIG_BT_SMP=y
    CONFIG_BT_CENTRAL=y
    CONFIG_BT_MAX_CONN=1
    CONFIG_BT_BONDABLE=n
    CONFIG_BT_CTLR_CONN_RSSI=y
    
    CONFIG_BT_GATT_CLIENT=y
    CONFIG_BT_GATT_DYNAMIC_DB=y
    
    CONFIG_BT_CHANNEL_SOUNDING=y
    CONFIG_BT_RAS=y
    CONFIG_BT_RAS_RREQ=y
    
    CONFIG_BT_SCAN=y
    CONFIG_BT_SCAN_FILTER_ENABLE=y
    CONFIG_BT_SCAN_UUID_CNT=1
    
    # The Ranging Profile recommends a MTU of at least 247 octets.
    CONFIG_BT_L2CAP_TX_MTU=498
    CONFIG_BT_BUF_ACL_TX_SIZE=502
    CONFIG_BT_BUF_ACL_RX_SIZE=502
    CONFIG_BT_ATT_PREPARE_COUNT=3
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
    
    # This reduces RAM usage. Additional RAM is needed to support optional
    # features such as mode 3 or multiantenna. Change or remove these if
    # using those features
    CONFIG_BT_RAS_MODE_3_SUPPORTED=n
    CONFIG_BT_RAS_MAX_ANTENNA_PATHS=4
    CONFIG_BT_CTLR_SDC_CS_MAX_ANTENNA_PATHS=4
    CONFIG_BT_CTLR_SDC_CS_NUM_ANTENNAS=2
    CONFIG_BT_CTLR_SDC_CS_STEP_MODE3=n
    CONFIG_BT_CTLR_SDC_CS_ROLE_INITIATOR_ONLY=y
    CONFIG_BT_RAS_RRSP=y
    #CONFIG_BT_RAS_RRSP_AUTO_ALLOC_INSTANCE=y
    CONFIG_BT_RAS_RRSP_RD_BUFFERS_PER_CONN=10
    
    # Disabling the CS Test command reduces flash usage
    CONFIG_BT_CTLR_CHANNEL_SOUNDING_TEST=n
    
    # This allows CS and ACL to use different PHYs
    CONFIG_BT_TRANSMIT_POWER_CONTROL=y
    
    # This improves the performance of floating-point operations
    CONFIG_FPU=y
    CONFIG_FPU_SHARING=y
    
    CONFIG_CBPRINTF_FP_SUPPORT=y
    
    CONFIG_BT_CS_DE=y
    CONFIG_BT_CS_DE_512_NFFT=y
    
    CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
    
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    # Enable calibration for internal RC oscillator to improve accuracy
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
    # Maximum number of skipped calibrations in a row (energy saving)
    CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP=2


    I have RF switch with switching time under 100 nsec: AS179-92LF.

    Thank you very much for any advice, Also what about reflector? Anything to check there?

    Thanky youvery much. Jan.

  • Hello,

    Just wanted to let you know that I have not forgotten your ticket. I forwarded your questions to our R&D, but I didn't hear back from them. I will ping them, and hopefully get back to you soon!

    Best regards,

    Edvin

  • Hello,

    One of the R&D engineers working on channel sounding said that he recently tested this, and seemingly got it working:

    https://github.com/nrfconnect/sdk-nrf/commit/f809ae1d0f033eb0603a46330c9ae0b761d0e598

    He said that he was testing on main, rather than on NCS v3.1.0 or 3.1.1. I would have tested on v3.1.1, as that is closest to main, but you can also try main if that doesn't work.

    The main changes, apart from actually enabling multiple antenna are:

    - Increased connection interval

    - Increast subevent len to fit all the steps of one procedure in a single subevent (measurements for each channel take more time when they have to be done on multiple antennas).

    Best regards,

    Edvin

  • Update: 

    It may be that the issue you are seeing is related to an issue that is patched in this pull request.

    It will likely be merged soon, but you can try to build with NCS v3.1.1, and either cherry pick this pull request, or copy the changes in the commit over to your SDK, and see if that helps:

    https://github.com/nrfconnect/sdk-nrf/pull/24778

    All users who are attempting to use multiple antenna paths should include this PR.

    Best regards,

    Edvin

  • Hi,


    Please, can I manually switch to the main branch in the ncs repository? The mentioned commit is already merged in the main. However, when I do that, I can't compile it with the 3.1.1 toolchain - am I doing something wrong?

    I switched to commit 560d4f7b09e2b58630a4e8c867f5be068173072e 

    Then I created new project from sample - RAS initiator.. but build can not be done without errors.. Missed I anything?

    The build fails with multiple Kconfig symbol definition errors in the Nordic SDK's Bluetooth controller configuration:

    1. BT_CTLR_EXTENDED_FEAT_SET (Kconfig:538) - Symbol defined without specifying data type
    2. BT_CTLR_SDC_EXTENDED_FEAT_MAX_REMOTE_PAGE 
    3. ....



Related