This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IWR1843BOOST: Problem with beamsteering using lua script

Part Number: IWR1843BOOST
Other Parts Discussed in Thread: IWR6843, IWR1843

Tool/software:

I wanted to try TX based beemsteering with the IWR1843BOOST EVM to boost the SNR of detected objects at higher ranges,

I was able to manually steer at specific angles thanks to the calculator by the TI team but when I tried the automated lua script to use frame based beamsteering, I am getting this error every time. I have used the following script

BSS_FW = "C:\\ti\\mmwave_studio_02_01_01_00\\rf_eval_firmware\\radarss\\xwr18xx_radarss.bin"
MSS_FW = "C:\\ti\\mmwave_studio_02_01_01_00\\rf_eval_firmware\\masterss\\xwr18xx_masterss.bin"


file_path = "C:\\ti\\data_capture"

adc_data_path1 = file_path.."\\IWR_adc_data_profile_bf.bin"
raw_data_path1 = file_path.."\\IWR_adc_data_profile_bf_Raw_0.bin"
pkt_log_path1  = file_path.."\\IWR_profile_bf_pktlogfile.txt"

--RX Gain Calculation
RF_GAIN_TARGET_30dB = 0
RF_GAIN_TARGET_34dB = 64
RF_GAIN_TARGET_26dB = 192
RX_GAIN_INPUT = 44


START_FREQ = 78
IDLE_TIME = 10
ADC_START_TIME = 8
RAMP_END_TIME = 49.2
TX_BACKOFF = 3
SLOPE_CONST = 60.833
TX_START_TIME = 0
NUM_ADC_SAMPLES = 512
SAMPLING_RATE = 12500
HPF1 = 3
HPF2 = 1
RX_GAIN = RF_GAIN_TARGET_30dB + RX_GAIN_INPUT


--reset and connect
ar1.FullReset()
ar1.SOPControl(2)
ar1.Connect(COM_PORT,921600,1000)

--download BSS FW
if (ar1.DownloadBSSFw(BSS_FW) == 0) then
    WriteToLog("BSS FW Download Success\n", "green")
else
    WriteToLog("BSS FW Download failure\n", "red")
end
RSTD.Sleep(500)

-- Download MSS FW
if (ar1.DownloadMSSFw(MSS_FW) == 0) then
    WriteToLog("MSS FW Download Success\n", "green")
else
    WriteToLog("MSS FW Download failure\n", "red")
end
RSTD.Sleep(500)

-- SPI Connect
if (ar1.PowerOn(1, 1000, 0, 0) == 0) then
    WriteToLog("Power On Success\n", "green")
else
   WriteToLog("Power On failure\n", "red")
end
RSTD.Sleep(500)

-- RF Power UP
if (ar1.RfEnable() == 0) then
    WriteToLog("RF Enable Success\n", "green")
else
    WriteToLog("RF Enable failure\n", "red")
end
RSTD.Sleep(500)

-- Channel Config
if (ar1.ChanNAdcConfig(1, 1, 1, 1, 1, 1, 1, 2, 1, 0) == 0) then
    WriteToLog("ChanNAdcConfig Success\n", "green")
else
    WriteToLog("ChanNAdcConfig failure\n", "red")
end
RSTD.Sleep(500)

-- LDO Bypass Enable
ar1.RfLdoBypassConfig(0x3)

-- ADC Config
if (ar1.LPModConfig(0, 0) == 0) then
	WriteToLog("Regualar mode Cfg Success\n", "green")
else
	WriteToLog("Regualar mode Cfg failure\n", "red")
end
RSTD.Sleep(500)

-- Enable Per Chirp Phase Shifter
if (ar1.SetMiscConfig(1) == 0) then
	WriteToLog("Per Chirp Phase Shifter Enable Success\n", "green")
else
	WriteToLog("Per Chirp Phase Shifter Enable failure\n", "red")
end
RSTD.Sleep(500)

-- RF Init
if (ar1.RfInit() == 0) then
    WriteToLog("RfInit Success\n", "green")
else
    WriteToLog("RfInit failure\n", "red")
end
RSTD.Sleep(1000)

-- Data Path Config
if (ar1.DataPathConfig(513, 1216644097, 0) == 0) then
    WriteToLog("DataPathConfig Success\n", "green")
else
    WriteToLog("DataPathConfig failure\n", "red")
end
if (ar1.LvdsClkConfig(1, 1) == 0) then
    WriteToLog("LvdsClkConfig Success\n", "green")
else
    WriteToLog("LvdsClkConfig failure\n", "red")
end
if (ar1.LVDSLaneConfig(0, 1, 1, 0, 0, 1, 0, 0) == 0) then
    WriteToLog("LVDSLaneConfig Success\n", "green")
else
    WriteToLog("LVDSLaneConfig failure\n", "red")
end
RSTD.Sleep(500)

-- Profile Config
if (ar1.ProfileConfig(0, START_FREQ, IDLE_TIME, ADC_START_TIME, RAMP_END_TIME, TX_BACKOFF, TX_BACKOFF, TX_BACKOFF, 0, 0, 0, SLOPE_CONST, TX_START_TIME, NUM_ADC_SAMPLES, SAMPLING_RATE, HPF1, HPF2, RX_GAIN) == 0) then
    WriteToLog("ProfileConfig Success\n", "green")
else
    WriteToLog("ProfileConfig failure\n", "red")
end



if (ar1.ChirpConfig(0, 0, 0, 0, 0, 0, 0, 1, 1, 1) == 0) then
    WriteToLog("ChirpConfig Success\n", "green")
else
    WriteToLog("ChirpConfig failure\n", "red")
end
if (ar1.FrameConfig(0, 0, 8, 128, 40, 0, 1) == 0) then
    WriteToLog("FrameConfig Success\n", "green")
else
    WriteToLog("FrameConfig failure\n", "red")
end
RSTD.Sleep(500)

-- Configure Chirp Based Phase Shifter
if (ar1.SetPerChirpPhaseShifterConfig(0, 0, 0, 123.750, 247.500) == 0) then
    WriteToLog("Chirp Based Phase Shifter Configuration Success\n", "green")
else
    WriteToLog("Chirp Based Phase Shifter Configuration failure\n", "red")
end
RSTD.Sleep(500)

-- Connect DCA1000
if (ar1.SelectCaptureDevice("DCA1000") == 0) then
    WriteToLog("SelectCaptureDevice Success\n", "green")
else
    WriteToLog("SelectCaptureDevice failure\n", "red")
end
if (ar1.CaptureCardConfig_EthInit("192.168.33.30", "192.168.33.180", "12:34:56:78:90:12", 4096, 4098) == 0) then
    WriteToLog("CaptureCardConfig_EthInit Success\n", "green")
else
    WriteToLog("CaptureCardConfig_EthInit failure\n", "red")
end
if (ar1.CaptureCardConfig_Mode(1, 2, 1, 2, 3, 30) == 0) then
    WriteToLog("CaptureCardConfig_Mode Success\n", "green")
else
    WriteToLog("CaptureCardConfig_Mode failure\n", "red")
end
if (ar1.CaptureCardConfig_PacketDelay(100) == 0) then
    WriteToLog("CaptureCardConfig_PacketDelay Success\n", "green")
else
    WriteToLog("CaptureCardConfig_PacketDelay failure\n", "red")
end
RSTD.Sleep(1000)

----------------------------- Capture 1 -----------------------------
--Start Record ADC data
ar1.CaptureCardConfig_StartRecord(adc_data_path1, 1)
RSTD.Sleep(1000)

--Trigger frame
ar1.StartFrame()
RSTD.Sleep(15000)

--Packet reorder utility processing the Raw_ADC_data
WriteToLog("Please wait for a few seconds for Packet reorder utility processing .....!!!! \n", "green")
ar1.PacketReorderZeroFill(raw_data_path1, adc_data_path1, pkt_log_path1)
RSTD.Sleep(10000)
WriteToLog("Packet reorder utility processing done.....!!!! \n", "green")

  • Hello,

    Your frame config is missing a 0. Which gives the error that the arguments are invalid for that method call since there are not enough of them. Should be like below.

    Use DataCaptureDemo_xWR.lua as a reference which can be found in C:\ti\mmwave_studio_02_01_01_00\mmWaveStudio\Scripts

    Best Regards,

    Pedrhom

  • Thanks a lot Pedrhom, I really appreciate the speedy response. If you don't mind me asking another question (Please bear with me as I am just an undergrad with not a lot of RF background)

    So I understood how the Frame based beam-steering works ( All the chirps in a frame are configured to steer at the beam at the same angle). Now I was wondering if I wanted to have beams at different angles in the same frame so that each chirp in the frame has a differently shifted TX phases to project the beam at different angles like say by increments of 5 degrees. 

    BSS_FW = "C:\\ti\\mmwave_studio_02_01_01_00\\rf_eval_firmware\\radarss\\xwr18xx_radarss.bin"
    MSS_FW = "C:\\ti\\mmwave_studio_02_01_01_00\\rf_eval_firmware\\masterss\\xwr18xx_masterss.bin"
    
    
    file_path = "C:\\ti\\data_capture"
    
    adc_data_path1 = file_path.."\\AOP_adc_data_profile_bf.bin"
    raw_data_path1 = file_path.."\\AOP_adc_data_profile_bf_Raw_0.bin"
    pkt_log_path1  = file_path.."\\AOP_profile_bf_pktlogfile.txt"
    
    
    
    --RX Gain Calculation
    RF_GAIN_TARGET_30dB = 0
    RF_GAIN_TARGET_34dB = 64
    RF_GAIN_TARGET_26dB = 192
    RX_GAIN_INPUT = 44
    
    
    START_FREQ = 78
    IDLE_TIME = 10
    ADC_START_TIME = 8
    RAMP_END_TIME = 49.2
    TX_BACKOFF = 3
    SLOPE_CONST = 60.833
    TX_START_TIME = 0
    NUM_ADC_SAMPLES = 512
    SAMPLING_RATE = 12500
    HPF1 = 3
    HPF2 = 1
    RX_GAIN = RF_GAIN_TARGET_30dB + RX_GAIN_INPUT
    
    --COM_PORT = 3
    COM_PORT = 3
    
    --reset and connect
    --ar1.FullReset()
    --ar1.SOPControl(2)
    ar1.Connect(COM_PORT,921600,1000)
    
    --download BSS FW
    if (ar1.DownloadBSSFw(BSS_FW) == 0) then
        WriteToLog("BSS FW Download Success\n", "green")
    else
        WriteToLog("BSS FW Download failure\n", "red")
    end
    RSTD.Sleep(500)
    
    -- Download MSS FW
    if (ar1.DownloadMSSFw(MSS_FW) == 0) then
        WriteToLog("MSS FW Download Success\n", "green")
    else
        WriteToLog("MSS FW Download failure\n", "red")
    end
    RSTD.Sleep(500)
    
    -- SPI Connect
    if (ar1.PowerOn(1, 1000, 0, 0) == 0) then
        WriteToLog("Power On Success\n", "green")
    else
       WriteToLog("Power On failure\n", "red")
    end
    RSTD.Sleep(500)
    
    -- RF Power UP
    if (ar1.RfEnable() == 0) then
        WriteToLog("RF Enable Success\n", "green")
    else
        WriteToLog("RF Enable failure\n", "red")
    end
    RSTD.Sleep(500)
    
    -- Channel Config
    if (ar1.ChanNAdcConfig(1, 1, 1, 1, 1, 1, 1, 2, 1, 0) == 0) then
        WriteToLog("ChanNAdcConfig Success\n", "green")
    else
        WriteToLog("ChanNAdcConfig failure\n", "red")
    end
    RSTD.Sleep(500)
    
    -- LDO Bypass Enable
    ar1.RfLdoBypassConfig(0x3)
    
    -- ADC Config
    if (ar1.LPModConfig(0, 0) == 0) then
    	WriteToLog("Regualar mode Cfg Success\n", "green")
    else
    	WriteToLog("Regualar mode Cfg failure\n", "red")
    end
    RSTD.Sleep(500)
    
    -- Enable Per Chirp Phase Shifter
    if (ar1.SetMiscConfig(1) == 0) then
    	WriteToLog("Per Chirp Phase Shifter Enable Success\n", "green")
    else
    	WriteToLog("Per Chirp Phase Shifter Enable failure\n", "red")
    end
    RSTD.Sleep(500)
    
    -- RF Init
    if (ar1.RfInit() == 0) then
        WriteToLog("RfInit Success\n", "green")
    else
        WriteToLog("RfInit failure\n", "red")
    end
    RSTD.Sleep(1000)
    
    -- Data Path Config
    if (ar1.DataPathConfig(513, 1216644097, 0) == 0) then
        WriteToLog("DataPathConfig Success\n", "green")
    else
        WriteToLog("DataPathConfig failure\n", "red")
    end
    if (ar1.LvdsClkConfig(1, 1) == 0) then
        WriteToLog("LvdsClkConfig Success\n", "green")
    else
        WriteToLog("LvdsClkConfig failure\n", "red")
    end
    if (ar1.LVDSLaneConfig(0, 1, 1, 0, 0, 1, 0, 0) == 0) then
        WriteToLog("LVDSLaneConfig Success\n", "green")
    else
        WriteToLog("LVDSLaneConfig failure\n", "red")
    end
    RSTD.Sleep(500)
    
    -- Profile Config
    if (ar1.ProfileConfig(0, START_FREQ, IDLE_TIME, ADC_START_TIME, RAMP_END_TIME, TX_BACKOFF, TX_BACKOFF, TX_BACKOFF, 0, 0, 0, SLOPE_CONST, TX_START_TIME, NUM_ADC_SAMPLES, SAMPLING_RATE, HPF1, HPF2, RX_GAIN) == 0) then
        WriteToLog("ProfileConfig Success\n", "green")
    else
        WriteToLog("ProfileConfig failure\n", "red")
    end
    
    
    for i =0,63 do
        if (ar1.ChirpConfig(i, i, 0, 0, 0, 0, 0, 1, 1, 1) == 0) then
            WriteToLog("ChirpConfig #%d Success\n", "green")
        else
            WriteToLog("ChirpConfig #%d failure\n", "red")
        end
    end
    
    
    if (ar1.FrameConfig(0, 63, 20, 4, 25, 0, 0, 1) == 0) then
        WriteToLog("FrameConfig Success\n", "green")
    else
        WriteToLog("FrameConfig failure\n", "red")
    end
    RSTD.Sleep(500)
    
    -- Configure Chirp Based Phase Shifter
    for i =0,16 do
        if (ar1.SetPerChirpPhaseShifterConfig(i, i, 0, 0, i) == 0) then
            WriteToLog("Chirp Based Phase Shifter Configuration #%d Success\n", "green")
        else
            WriteToLog("Chirp Based Phase Shifter Configuration #%d failure\n", "red")
        end
    end
    
    for i =17,63 do
        if (ar1.SetPerChirpPhaseShifterConfig(i, i, 0, (i-16), i) == 0) then
            WriteToLog("Chirp Based Phase Shifter Configuration #%d Success\n", "green")
        else
            WriteToLog("Chirp Based Phase Shifter Configuration #%d failure\n", "red")
        end
    end
    
    RSTD.Sleep(500)
    
    -- Connect DCA1000
    if (ar1.SelectCaptureDevice("DCA1000") == 0) then
        WriteToLog("SelectCaptureDevice Success\n", "green")
    else
        WriteToLog("SelectCaptureDevice failure\n", "red")
    end
    if (ar1.CaptureCardConfig_EthInit("192.168.33.30", "192.168.33.180", "12:34:56:78:90:12", 4096, 4098) == 0) then
        WriteToLog("CaptureCardConfig_EthInit Success\n", "green")
    else
        WriteToLog("CaptureCardConfig_EthInit failure\n", "red")
    end
    if (ar1.CaptureCardConfig_Mode(1, 2, 1, 2, 3, 30) == 0) then
        WriteToLog("CaptureCardConfig_Mode Success\n", "green")
    else
        WriteToLog("CaptureCardConfig_Mode failure\n", "red")
    end
    if (ar1.CaptureCardConfig_PacketDelay(100) == 0) then
        WriteToLog("CaptureCardConfig_PacketDelay Success\n", "green")
    else
        WriteToLog("CaptureCardConfig_PacketDelay failure\n", "red")
    end
    RSTD.Sleep(1000)
    
    ----------------------------- Capture 1 -----------------------------
    --Start Record ADC data
    ar1.CaptureCardConfig_StartRecord(adc_data_path1, 1)
    RSTD.Sleep(1000)
    
    --Trigger frame
    ar1.StartFrame()
    RSTD.Sleep(15000)

    For this use case, I found a script from TI which configures 64 chirps separately and then performs phase shifter by chirp and it seems to have this phase shifter pattern where for the chirps Chirp-0 to Chirp-16 : TX0: 0 TX1: 0 TX2: Increases from 0 to 90 in shifts of 5.625 while from Chirp-17 to Chirp-63  TX0: 0 TX1: Increases from 5.625 to (63-17)*5.625 TX2: increases from 17*5.625 to 63*5.625. 

    I would like to know why this phase shifter pattern was picked and how is the beamforming effectively happening because of this. I would like to beam steer in increments of 5 degrees between -60 to 60 degrees from my use case. So I would be grateful if you could tell me the logic for  modifying the  script for the same.

  • Hello,

    This is not on a raw data level (unfiltered, unprocessed, dumped ADC buffer real/complex data), but we have a demo called Long Range People Detection that provides a point cloud. All of our demos have beamforming, but only this demo has beamsteering as well. We have a PDF alongside it that talks about beam steering, and can help you in your studies.

    https://dev.ti.com/tirex/explore/node?a=1AslXXD__2.20.00.05&node=A__AE-Bpc-wQfi-OR.2V9TzCw__radar_toolbox__1AslXXD__2.20.00.05

    Best Regards,

    Pedrhom

  • Thanks. I am getting the IWR6843 board soon so I will try to modify the demo for my usecase. Although I have been experimenting and beamforming seems to be working fine but I have some doubts validating it. Have started a new thread for that.

  • Hello,

    Note that IWR6843 and IWR1843 are very similar, and usually the only change that needs to be made is the start/end frequency as 1843 is 77GHz and 6843 is 60GHz so it should be simple. Good luck, I have assigned assistance on your second thread and they will get back to you soon.

    Best Regards,

    Pedrhom