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.

Parents
  • Hello,

    I am sorry for the late reply. I have looked at your questions, but I have not tested with multiple antennas before (as we don't have it on our DKs). I have forwarded your question to our SoftDevice Controller team, but have not heard back yet. I will ping them now. I will get back to you as soon as I know more.

    Best regards,

    Edvin

Reply
  • Hello,

    I am sorry for the late reply. I have looked at your questions, but I have not tested with multiple antennas before (as we don't have it on our DKs). I have forwarded your question to our SoftDevice Controller team, but have not heard back yet. I will ping them now. I will get back to you as soon as I know more.

    Best regards,

    Edvin

Children
  • Great, I hope they will also see the graphs I added a bit later - that could be more intuitive.

  • Hi Edvin,

    How does it look? Would it help if I made a new private ticket on this topic?

    Thank you.

  • Hello,

    From our R&D:

    Can you share the rest of your parameters? Adding multiple antenna patsh to the channel sounding means the controller produces more data, which in turn means the devices need to exchange more data over GATT to produce distance estimates. If there isn't enough time to transfer the data before more data is produced, the new data will overwrite the old.

    Here are two things to try;

    1: Inscrease the procedure interval

    2: Increasing CONFIG_BT_RAS_RRSP_RD_BUFFERS_PER_CONN

    Also, what antenna switch are you using? Can you verify whether it satisfies the switching time requirement of 6µs?

    https://docs.nordicsemi.com/bundle/ncs-latest/page/nrfxlib/softdevice_controller/doc/channel_sounding.html#adding_a_custom_antenna_switch_ic 

    Best regards,

    Edvin

  • 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.

Related