Running examples con X4M03 and Windows

Discussion in 'X2 & X4 SoC' started by Sergi, May 7, 2018.

  1. Sergi

    Sergi New Member

    Hi,

    I am trying to run examples of ModuleConnector with Python 3.4 64bits on Windows 7, but I don´t know exactly how to run it.
    I have run python setup.py install, on the \ModuleConnector-win32_win64-1.4.3\python36-win64 path, and after it, I have setup up my environnement installing dependencies as matplotlib.

    Once all installed right, I try to execute the examples, but I don´t know how to indicate port number.

    D:\06.PROJECTES\VHFCSO\Software\ModuleConnector-win32_win64-1.4.3\python36-win64
    \pymoduleconnector\examples>python XEP_plot_record_playback.py COM15
    Traceback (most recent call last):
    File "XEP_plot_record_playback.py", line 11, in <module>
    import pymoduleconnector
    File "C:\Python34\lib\site-packages\pymoduleconnector-1.4.3-py3.4.egg\pymodule
    connector\__init__.py", line 2, in <module>
    from .moduleconnector import DataReader
    File "C:\Python34\lib\site-packages\pymoduleconnector-1.4.3-py3.4.egg\pymodule
    connector\moduleconnector.py", line 5, in <module>
    from .moduleconnectorwrapper import \
    File "C:\Python34\lib\site-packages\pymoduleconnector-1.4.3-py3.4.egg\pymodule
    connector\moduleconnectorwrapper\__init__.py", line 28, in <module>
    _moduleconnectorwrapper = swig_import_helper()
    File "C:\Python34\lib\site-packages\pymoduleconnector-1.4.3-py3.4.egg\pymodule
    connector\moduleconnectorwrapper\__init__.py", line 24, in swig_import_helper
    _mod = imp.load_module('_moduleconnectorwrapper', fp, pathname, description)

    File "C:\Python34\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
    ImportError: DLL load failed: No se puede encontrar el módulo especificado.

    How it is supposed to indicate the port number? as parameter or code must be modified to set up it?

    Thanks in advance.

    Kind regards,
    Sergi Palomar.
     
  2. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi, Sergi,
    Please using this command: python XEP_plot_record_playback.py -d COM15
    You can use python XEP_plot_record_playback.py --help to learn how to set other options.
     
  3. Sergi

    Sergi New Member

    Thank you, but the main issue is that there is an error on an import module:

    File "C:\Python34\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
    ImportError: DLL load failed: Can not find the specified module

    But it exists on C:\Python34\lib\

    Any idea?

    Thanks.
     
  4. Charlie Shao

    Charlie Shao Moderator Staff Member

    The python version you are using is python3.4, it might cause this problem. Please update to python3.6.
     
  5. Sergi

    Sergi New Member

    Thanks Charlie. I have updated to Python 3.6, and now from the examples path, I can run XEP_plot_record_playback.py, as you could see.
    upload_2018-5-8_13-42-11.png

    I don´t know the units of this data, x is time in us or ms?

    I want to get distance parameter to some objects, how I have to proceed? Any guide or tutorial to get deep inside.

    Thank you.
     
  6. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Sergi,
    x is not time. It is the radar data from the detection zone. You are able to get 1536 bins RF data or 188bins baseband data from the sensor module, which can cover a detection zone of 0-10m.
    There is a demo showing how to program X4M03 to get object distance. You can download from here: https://www.xethru.com/community/resources/xep-x4-distance-demo.89/
     
  7. Sergi

    Sergi New Member

    Thank you. Yesterday I was reading some post on the Community and I saw it.

    In baseband each range bin is 5.14cm long, so 188*5.14=9.66m.
    Is it possible to modified the long range for each range bin, in order to have more resolution?

    On the other hand on the 1536 bins of RF data, to get the real distance:
    Given Fs=23.328GHz, the frame length is:
    LightSpeed = 299792458
    (1536-1)*LightSpeed/23.328e9/2
    Out[ ]: 9.8632849586 ~9.86 meters
    1536 is the number of rf data sampling points

    I want to use only the X4M05 (Chip radar) and connect it to an Intel Edison (arduino). Which is the best way to translate the .dll to a *.cpp and *.h files. Do you have any example? I will check the xep-x4-distance-demo.89/

    Thanks.
     
  8. Charlie Shao

    Charlie Shao Moderator Staff Member

    Is it possible to modified the long range for each range bin, in order to have more resolution?
    No, the interval between two closed range bins is fixed. The precision is not dictated by it, you can e.g. interpolate the RF data or use the phase information in the baseband data. The precision is mostly given by SNR and can be sub-millimeter. Longer integration time gives better precision, so you can increase the iteration or pulses per step to get high precision.
    I want to use only the X4M05 (Chip radar) and connect it to an Intel Edison (arduino).
    Basically you need to transplant x4driver( in XEP) to Arduino. Unfortunately, there is the limited help we can provide. I suggest you to keep working on XEP platform at first, transplanting to Arduino may need more effort.
    Which is the best way to translate the .dll to a *.cpp and *.h files. Do you have any example?
    Building .cpp and .h file to a .dll library is irreversible process.

    Charlie
     
  9. Sergi

    Sergi New Member

    Thank you Charlie.

    Now I am trying to record radar raw data: python XEP_plot_record_playback.py -r -d COM15

    A new file is generated automatically: xethru_datafloat_20180510_122905.dat

    Inside there is raw data of the X4. How to interpret the data? Is something like this:

    0000 0000 0200 0000 0006 0000 9ff8 fa3d
    8bbd c83d 0000 fbbd 8d5d 963c 0100 fb3d
    4e2c 8abd ec64 dbbd 6447 f73d 151b 4c3d
    b123 fabd 8ddd db3c dac9 f73d c59e aabd
    135b 70bd ed04 bc3d 819d d4bb 76a2 b6bd
    155b 5e3d 02e0 013d 138b 9abd 6827 693c
    3cc1 883d c4ae 5dbd 4dec a4bc 159b 643d

    I have found in XTAN-05_XeThruFileFormats-v2.pdf:
    upload_2018-5-10_13-36-4.png

    Thanks,
    Sergi.
     
  10. Charlie Shao

    Charlie Shao Moderator Staff Member

    Hi Sergi,
    Inside the recording folder, there are several kinds of reading files. meta.dat provide information of the other real recording files. It is used by Dataplayer and Datareader class of ModuleConnector. The other data like *.csv and *.dat are real data from radar module. *.dat contains binary data, which is continued radar frame by frame, the frame format can be checked at XTAN-05_XeThruFileFormats-v2.pdf. CSV file can be opened by test reader or Excel. par file contains module configuration record.

    There are two kinds of way to interpret the data:
    1. use DataReader class from ModuleConnector, this thread has a discussion:
    https://www.xethru.com/community/th...ead-x4-baseband-data-in-matlab.284/#post-1789
    2. Interpreter *.data file directly. See the attached example for baseband IQ data.
     

    Attached Files:

    Last edited: May 22, 2018