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.

AWR2944EVM: Custom Automation lua

Part Number: AWR2944EVM


Tool/software:

I am trying to make a custom automation lua to take a single measurement and write the raw adc data to a .bin. where can I find more detailed information on what functions to use inside the lua. I have been following the mmwave_studio_user_guide.pdf.

  • Hi Mohamed,

    You can refer to the some of the reference Lua scripts provided with the mmwavestudio.

    you can also refer to the following thread to get some reference:

    https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/1287546/mmwave-studio-request-for-datacapturedemo_xwr-lua-script-compatible-with-mmwave-studio-03-01-01-00

    Regards,

    Shruti

  • Thank that was helpful. I do have an optimization issue however. My goal is to take 180 consecutive measurements so I changed the lua to not startup every time and I did it once manually. I also changed it to not disconnect at the end and to instead use stop recording. However this function takes about 30 seconds to complete. Is there a faster way to make the dca and radar take a measurement? Here is my updated automation lua for reference. 

    ----------------- Profile, Chirp & Frame Configuration -----------------

    -- Profile Config -- Profile - 0
    profile_indx0 = 0
    start_freq0 = 76.370591
    slope0 = 9.510963
    idle_time0 = 2.8
    adc_start_time0 = 2.23
    ramp_end_time0 = 24.76
    sampling_rate = 15000
    adc_samples = 256
    rx_gain = 30
    tx0_out_power_backoff_code = 0
    tx1_out_power_backoff_code = 0
    tx2_out_power_backoff_code = 0
    tx3_out_power_backoff_code = 0
    tx0_phase_shifter = 0
    tx1_phase_shifter = 0
    tx2_phase_shifter = 0
    tx3_phase_shifter = 0
    tx_start_time_usec = 0
    hpf_corner_freq1 = 0
    hpf_corner_freq2 = 0

    -- Chirp Config --
    function Configure_Chirps()
    ar1.ChirpConfig(0, 0, 0, 267, 0, 20, 0, 1, 0, 0, 0)
    ar1.ChirpConfig(1, 1, 0, 256, 0, 12, 0, 0, 1, 0, 0)
    ar1.ChirpConfig(2, 2, 0, 261, 0, 3.5, 0, 0, 0, 1, 0)
    ar1.ChirpConfig(3, 3, 0, 269, 0, 6, 0, 0, 0, 0, 1)
    WriteToLog("All Chirps Configured Successfully!", "green")
    end

    function Configure_Profiles()
    if (0 == ar1.ProfileConfig(profile_indx0, start_freq0, idle_time0, adc_start_time0, ramp_end_time0,
    tx0_out_power_backoff_code, tx1_out_power_backoff_code, tx2_out_power_backoff_code, tx3_out_power_backoff_code,
    tx0_phase_shifter, tx1_phase_shifter, tx2_phase_shifter, tx3_phase_shifter,
    slope0, tx_start_time_usec, adc_samples, sampling_rate,
    hpf_corner_freq1, hpf_corner_freq2, rx_gain, 0, 0, 0)) then
    WriteToLog("Profile 0 Configuration successful\n", "green")
    else
    WriteToLog("Profile 0 Configuration failed\n", "red")
    return -1
    end
    end

    -------------------- Device Configuration --------------------

    -- Channel & ADC Configuration
    tx0_en = 1
    tx1_en = 1
    tx2_en = 1
    tx3_en = 1
    rx0_en = 1
    rx1_en = 1
    rx2_en = 1
    rx3_en = 1
    bits_val = 2
    fmt_val = 0
    iq_swap = 0
    if (ar1.ChanNAdcConfig(tx0_en, tx1_en, tx2_en, tx3_en,
    rx0_en, rx1_en, rx2_en, rx3_en,
    bits_val, fmt_val, iq_swap) == 0) then
    WriteToLog("Channel & ADC Configuration successful\n", "green")
    else
    WriteToLog("Channel & ADC Configuration failed\n", "red")
    return -1
    end

    -- RF Init
    if (ar1.RfInit() == 0) then
    WriteToLog("RF Init Successful\n", "green")
    else
    WriteToLog("RF Init failed\n", "red")
    return -1
    end

    -------------------- Data Configuration --------------------

    -- Data path Configuration
    if (ar1.DataPathConfig(1, 1, 0) == 0) then
    WriteToLog("Data Path Configuration Successful\n", "green")
    else
    WriteToLog("Data Path Configuration failed\n", "red")
    return -1
    end

    -- Clock Configuration
    if (ar1.LvdsClkConfig(1, 1) == 0) then
    WriteToLog("Clock Configuration Successful\n", "green")
    else
    WriteToLog("Clock Configuration failed\n", "red")
    return -1
    end

    -- LVDS Configuration
    if (ar1.LVDSLaneConfig(0, 1, 1, 0, 0, 1, 0, 0) == 0) then
    WriteToLog("LVDS Configuration Successful\n", "green")
    else
    WriteToLog("LVDS Configuration failed\n", "red")
    return -1
    end

    -------------------- Sensor Configuration --------------------

    -- Profile Configuration
    Configure_Profiles()

    -- Chirp Configuration
    Configure_Chirps()

    -- Frame Configuration
    start_chirp_tx = 0
    end_chirp_tx = 3
    nframes = 1
    nchirp_loops = 64
    frame_periodicity = 100
    trigger_delay = 0
    trigger_select = 1
    if (ar1.FrameConfig(start_chirp_tx, end_chirp_tx, nframes, nchirp_loops,
    frame_periodicity, trigger_delay, trigger_select) == 0) then
    WriteToLog("Frame Configuration successful\n", "green")
    else
    WriteToLog("Frame Configuration failed\n", "red")
    return -1
    end

    -------------------- Data Capture --------------------

    -- Select DCA1000 Capture Device
    if(ar1.SelectCaptureDevice("DCA1000") ~= 0) then
    WriteToLog("******* Wrong Capture device *******", "red")
    return -1
    end

    -- Configure Capture Card
    ar1.CaptureCardConfig_EthInit("192.168.33.30", "192.168.33.180", "12:34:56:78:90:12", 4096, 4098)
    ar1.CaptureCardConfig_Mode(1, 2, 1, 2, 3, 30)
    ar1.CaptureCardConfig_PacketDelay(25)

    -- Start Capture
    adc_data_path = "C:\\ti\\mmwave_studio_03_01_03_01\\mmWaveStudio\\PostProc\\adc_capture.bin"
    ar1.CaptureCardConfig_StartRecord(adc_data_path, 1)
    RSTD.Sleep(1000)

    -- Start Frame
    ar1.StartFrame()
    RSTD.Sleep(7000)

    -- White check mark Stop Capture
    if (ar1.CaptureCardConfig_StopRecord() == 0) then
    WriteToLog("Capture stopped successfully\n", "green")
    else
    WriteToLog("StopRecord FAILED", "red")
    return -1
    end

    RSTD.Sleep(500)
    WriteToLog("White check mark Capture Complete", "green")