x4m03 confi procedure

Discussion in 'X4M03' started by LOUIE, Nov 29, 2019.

  1. LOUIE

    LOUIE New Member

    Hello.

    I got x4m03 module and trying to run with my program on PC.
    I can send and get commands and responses via UART, actually USB.
    I'm trying to get raw data from module but I couldn't get any.

    I sent commands like as below
    1. ping and got response
    2. pps with 20
    3. iterations with 20
    4. dac min with 10
    5. dac max with 100
    6. offset with 10
    7. frame start 0 end 20
    8. fps 10

    After then I expected to get raw data coming from module but couldn't get any data from module via UART/USB.
    So I wonder what is correct command flow to get raw data and config params.
    Can you help on this?

    ++++++++++
    [17:59:24] Sent PING
    [17:59:24] Rx : 8
    [17:59:24] Get XTS_DEF_PONGVAL_READY
    [17:59:30] Sent PPS
    [17:59:30] Rx : 4
    [17:59:30] Get ACK
    [17:59:33] Sent ITERATIONS
    [17:59:33] Rx : 4
    [17:59:33] Get ACK
    [17:59:38] Sent DAC_MIN
    [17:59:38] Rx : 4
    [17:59:38] Get ACK
    [17:59:40] Sent DAC_MAX
    [17:59:40] Rx : 4
    [17:59:40] Get ACK
    [17:59:41] Sent FRAME_AREA_OFFSET
    [17:59:41] Rx : 4
    [17:59:41] Get ACK
    [17:59:42] Sent FRAME_AREA
    [17:59:42] Rx : 4
    [17:59:42] Get ACK
    [17:59:43] Sent FPS
    [17:59:43] Rx : 4
    [17:59:43] Get ACK
    ++++++++++
     
  2. LOUIE

    LOUIE New Member

    Self answer : the reason what I couldn't get raw data was due to FPS setting value, IEEE 754 format value. After I correct this, I could get raw data.

    Regarding x4M03, I have more question.
    1. profile function seems to be for XM200/3000 and so on so in case of x4m03, profile function will not work. right?

    2, sensor mode command. whenever I sent sensor mode command with RUN/STOP?MANUAL, I got ERROR message. Is it due to I'm using x4m03 module? If not, why I got error? (I think command message seems to be ok)

    3. I have configured module with DAC_MIN = 900, DAC_MAX = 1150, PPS = 26, ITERATIONS = 16, FPS = 10.
    When I look at raw recorded file, I just saved when I get raw data from my PC tool, I could see its header info according to doc and what I see is like as below.
    "
    [15:17:31] Rx : 5891
    [15:17:31] Found RAW Sync...Pack Len 5882, 0xA0, 0x12, 0, 1393, 1467
    "
    1) I got 5891 payload data so when I change other params, its length will be change? so 5891 could be change to 6045 and so on? or its length will be same?

    2) according to raw data, actual payload length is 1476 so its payload will be 1467*4 bytes in float. 1467 is fixed value or could be change according to param change?

    3) I saw max length of single frame length is 1536. What's different with 1467 (above) and 1536? what's the relation between two of them? Or not relates with each other?

    4) Can I understand 1467 is num of bins? so it starts from 0 bin to 1466 bin?

    5) What's the maximum value of FPS?

    6) I'm using fps with 0 to stop module so using like as STOP command, this is right way to STOP module? Actually sensor mode command doesn't work with my tool


    I just started to review x4m03 and still confuse some details.
    Many thanks.
     
  3. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Louie,
    Here are answers for your questions:
    1. profile function seems to be for XM200/3000 and so on so in case of x4m03, profile function will not work. right?

    Yes, X4M200/X4M300 are sensors with specific application profiles. X4M03 is a development kit in which developers can add their own application algorithm.

    2, sensor mode command. whenever I sent sensor mode command with RUN/STOP?MANUAL, I got ERROR message. Is it due to I'm using x4m03 module? If not, why I got error? (I think command message seems to be ok)

    You need to follow a specific procedure to initialize the module. Which you can find from MCP document. We suggest developers use MC or MCPW as the basement instead of using serial port commands. Many commands are not documented but existing as MCP source code, which is part of XEP, MC, MCPW.

    3. I have configured module with DAC_MIN = 900, DAC_MAX = 1150, PPS = 26, ITERATIONS = 16, FPS = 10.
    When I look at raw recorded file, I just saved when I get raw data from my PC tool, I could see its header info according to doc and what I see is like as below.
    "
    [15:17:31] Rx : 5891
    [15:17:31] Found RAW Sync...Pack Len 5882, 0xA0, 0x12, 0, 1393, 1467
    "
    1) I got 5891 payload data so when I change other params, its length will be change? so 5891 could be change to 6045 and so on? or its length will be same?

    2) according to raw data, actual payload length is 1476 so its payload will be 1467*4 bytes in float. 1467 is fixed value or could be change according to param change?

    3) I saw max length of single frame length is 1536. What's different with 1467 (above) and 1536? what's the relation between two of them? Or not relates with each other?

    4) Can I understand 1467 is num of bins? so it starts from 0 bin to 1466 bin?

    MCP document section 6.1.1 describes the structure of the radar raw data message. The size of it depends on how mange range bins one message contains which is decided by the frame_area settings. In MC, it is the function: x4driver_set_frame_area.
    See this thread to under range bins for both RF and baseband data:
    https://www.xethru.com/community/threads/how-to-inteprate-the-x4m05-data.723/#post-3221


    5) What's the maximum value of FPS?

    See this discussion: https://www.xethru.com/community/th...-high-frame-rate-more-than-400.204/#post-1060
    Also, X4 user guide will help you understand FPS settings:
    https://www.xethru.com/community/resources/xethru-x4-radar-user-guide.149/


    6) I'm using fps with 0 to stop module so using like as STOP command, this is right way to STOP module? Actually sensor mode command doesn't work with my tool

    Yes, this is the correct way.
     
  4. LOUIE

    LOUIE New Member

    Hi Charlie.

    Thanks for your answer.
    I have some comments, can you help on these?

    1. OK, I understood

    2. I have refered mcpw_demo_x4m300() at task_xethru.c. Message seems to be correct but still I get error. Do you see what I'm missing?
    1) XTS_SM_STOP -> XTID_BAUDRATE_921600 -> XTID_SSIC_ORDERCODE -> XTID_SSIC_VERSION -> ... -> XTS_SM_RUN
    STOP is first command host send but when I send STOP, it keep returns error.

    [11:51:19] COM port finding...
    [11:51:19] Found COM17
    [11:51:21] Serial port COM17 opened
    [11:51:21] Rx : 16
    [11:51:21] UART Rx : 0x7D 0x30 0x10 0x00 0x00 0x00 0x5D 0x7E 0x7D 0x30 0x11 0x00 0x00 0x00 0x5C 0x7E
    [11:51:21] Get BOOTING response
    [11:51:21] UART Rx : 0x7D 0x30 0x10 0x00 0x00 0x00 0x5D 0x7E
    [11:51:21] Get READY response
    ==> Here I got BOOTING and READY response so module is ready

    [11:51:21] Start of UartRequestThread
    [11:51:25] UART Tx : 0x7D 0x20 0x13 0x4E 0x7E
    [11:51:25] Sent SENSOR_MODE STOP
    ==> Send MODE_STOP
    [11:51:25] Rx : 8
    [11:51:25] UART Rx : 0x7D 0x20 0x01 0x00 0x00 0x00 0x5C 0x7E
    [11:51:25] [UartReceiveHandler, 140] Get ERROR
    ==> Got error message

    3. OK, I understood

    Q1. XTID_SSIC_ORDERCODE is nor working with me so is it due to X4M03 module?
    [11:51:30] UART Tx : 0x7D 0x90 0x58 0x01 0xB4 0x7E
    [11:51:30] Sent ORDER_CODE
    ==> Sent ORDER_CODE
    [11:51:30] Rx : 8
    [11:51:30] UART Rx : 0x7D 0x20 0x01 0x00 0x00 0x00 0x5C 0x7E
    [11:51:30] [UartReceiveHandler, 140] Get ERROR

    Q2. set output control
    I get error whenever I send mcpw_set_output_control, I get error, is it due to MODE_STOP error?
    Reference code sends whiel its mode is in STOP. But I'm get error so...

    Q3. XethruExplorer
    I can see BASEBAND AMPLITUDE linear/logarithmic and BASEBAND PHASE graph.
    I expected to get these via XTS_ID_BASEBAND_AMPLITUDE_PHASE but got error.
    Do I need to calculate to display these from raw data or is there any option command to get these data?
     
  5. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi LOUIE,

    It seems you are using either older version or ateml_samg55 example now. If your setup is X4M300+Windows computer. I suggest you use latest MCPW generic example(MCPW\examples\generic). Latest MCPW:
    https://www.xethru.com/community/resources/module-communication-protocol-wrapper.97/

    See MCP document Page22, XTS_ID_BASEBAND_AMPLITUDE_PHASE message is supported by X4M200/300 sensor products. Just try with the generic example and enable this message output.
     
  6. LOUIE

    LOUIE New Member

    Hi Charlie.

    1. Can I set DAC_Min/Max/PPS/Iteration params without sensor_mode STOP?
    If so I can forget sensor_mode response error.
    Actually if I set these params, it return ACK, not error.


    2. Can I get "XTAN-11_XeThruModuleCommunicationProtocol_rev_c" extended version which includes all message formats if there is?
    If not, can you give response message format of below after I send GET?
    mcp reference code has info but confuse so I want to have clear info.
    - XTS_SPCXI_FPS
    - XTS_SPCXI_PRFDIV
    - XTS_SPCXI_FRAMEAREA
    - XTS_SPCXI_FRAMEAREAOFFSET


    3. "XTAN-11_XeThruModuleCommunicationProtocol_rev_c" page 23 mentioned baseband IQ data or RF data.
    So if I enabled downconversion, its payload is IQ and if disabled, its payload is RF data?
    Or IQ is only supported by x4m200/300?
     
  7. Charlie Shao

    Charlie Shao Moderator Staff Member

    1. Yes, it is not necessary for X4M03 which has no application level. X4M200/300 sensors have different modes. See this script as a reference, pay attention to the initialization process.

    2. Again, we encourage the developer to use MC or MCPW instead of getting hands dirty on parsing serial protocol directly. MCP document only contains critical commands to help the developer understand how it works. If you want to know more about MCP, please explore the source code of MCPW or XEP, MCP source code is part of them.
    To understand items like fps, prfdiv, you need to refer to X4 datasheet or X4 user guide.

    3. Yes, you are correct. X4 has an internal hardware converter to transfer RF data to IQ baseband data when downconversion is enabled. X4M03 and X4M200/300 support both kinds of raw data output.