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.

OPT3101: using dealias mode

Part Number: OPT3101

as far as I can see it, the SDK for the OPT3101 with version 0.9.1 does not contain calibration or usage of the dealias mode.

I have seen the documentation ("OPT3101 – De-aliasing to extend the Distance Range") for using the de-aliasing. However, I was disappointed to read on the forum, that 12MHz is not a good choice.

https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/891035/faq-opt3101-dealias-operation

Also I am not quite sure on:

  • how to program alpha & beta
  • how to use dealias with HDR mode
  • how to setup monoshot mode to enable the LED as little as possible

So I wondered, if anyone has put together some code where I can see the procedure on how to go to do about it.

  • Hi Horst,

    We do not have dealias support in the SDK or example code for this online.

    For a and b: the same equation in the dealias doc provided in the e2e post you linked to can be used for 8.57MHz delias mode. 

    "Crosstalk registers of the main modulation frequency of 10MHz are scaled to obtain the crosstalk values for 12MHz modulation frequency. From the measured crosstalk data of de-alias frequency 12MHz (I2, Q2) and crosstalk of default frequency 10MHz (I1, Q1) compute the crosstalk scaling coefficients α, β using the equation below." (see equation in doc)

    I'm not sure about your other questions. HDR/monoshot mode is independent of dealias and there are hdr0 and 1 registers for dealias frequency.

    Best,

    Alex

  • Hi Alex,

    thank you for your comments.

    I am still not sure, if my understanding is correct. 

    Assuming that xtalk is similar for both frequencies, the registers "alpha1_dealias_scale" and "beta1_dealias_scale" would be programmed to "1" in most cases?

    Do you have an example for calibration values? - this might help me to see if my code works as expected, and returns the correct values.

    • iphase_xtalk_reg_hdr1_tx0
    • qphase_xtalk_reg_hdr1_tx0
    • alpha1_dealias_scale
    • beta1_dealias_scale
    • phase_offset_hdr1_tx0
    • phase2_offset_hdr1_tx0

    In regard to my related question regarding HDR mode:

    Both De-Alias and HDR mode use the sequencer. What is the reccomended way to program the sequencer when using de-alias and HDR modes?

    With regard to monoshot mode:

    I understand that in the monoshot mode MONOSHOT_NUMFRAME frames are captured.

    In the SDK the sequencer is started at the end of a capture:

    	this->reg.tg_seq_int_start  = 9850; // Sequence Start
    	this->reg.tg_seq_int_end        = 9858; // Sequence End
    

    So I need to MONOSHOT_NUMFRAME  to the number of sequencer steps + 1 in order to get a correct measurement at the end of a monoshot?

    Will the sequencer start at position 0 for each monoshot trigger?

    Thanks,

    Horst

  • Hi Horst,

    Xtalk is not expected to stay the same between different frequencies so I would expect likely the a and b will be non unity.

    I don't have an example to provide currently for dealias.

    HDR (switching hdr0 to 1) does not use sequencer commands to work - you just need to enable the appropriate register. Are you referring to super HDR mode? This will use the sequencer.

    Best,

    Alex

  • Hello Alex,

    I am having difficulties measuring the XTalk with 8.57 MHz.

    How do you switch to that frequency in order to measure correct crosstalk values.
    When I do switch to 8.57MHz, my crosstalks (internal and illumination) are close to zero.

    When using 12MHz, the calculated illumination crosstalk alpha1 and beta1 are quite different for H and L HDR modes.
    What values do I use?

    It would be ideal if you could give an example with, for HDR mode:

    • crosstalks at 10MHz
    • how to switch to dealias frequency
    • crosstalks at dealias frequency
    • how to calculate and program alpha0, beta0, alpha1 and beta1

    That would be very helpful.

    Thank you,

    Horst

  • Hi Horst,

    I’m checking to see what we can do to help

    best,

    Alex

  • Hi Alex,

    I wondered if you got a chance to check up on how to measure crosstalk at 8,57MHz and how to best set the parameters.

    Thanks,

    Horst

  • Hi Horst,

    What do you mean by crosstalk is close to zero when you switch to 8.57MHz? What is xtalk at 10MHz and what is it at 8.57MHz?

    For 12MHz, we don't recommend using the 12MHz mode since we see xtalk increasing quite a bit using this. However, if you share your values I can take a closer look.

    Best,

    Alex

  • Hi Alex,

    by crosstalk close to zero, I mean the I and Q values are below 10.

    I took measurements twice, one time at 10MHz (standard setting), and the next time, I only switched to 8.57MHz:

    These are the outputs for 10MHz:

    INFO::Internal Cross talk Measurement Completed
          I,      Q,S, ScaledI, ScaledQ,tMain,tIlum,tMain(C),  tIlum(C),Magnitd
    -007911,+005298,0,-0007911,+0005298, 0000, 0000,     +00, -128.0000, 31.1
    
    INFO::Cover Photodiode with optical shied for illumination Cross talk measurement
    Press any Key to continue:
    INFO:Performing Illum Crosstalk for TX0 HDR 0
          I,      Q,S, ScaledI, ScaledQ,tMain,tIlum,tMain(C),  tIlum(C),Magnitd
    -001422,+000684,0,-0001422,+0000684, 2264, 0000,     +27, -128.0000,  5.2

    And this is what I get for 8.57MHz, the only difference is the switch to 8.57MHz:

    INFO::Internal Cross talk Measurement Completed
          I,      Q,S, ScaledI, ScaledQ,tMain,tIlum,tMain(C),  tIlum(C),Magnitd
    +000000,+000000,0,+0000000,+0000000, 0000, 0000,     +00, -128.0000,  0.0
    
    INFO::Cover Photodiode with optical shied for illumination Cross talk measurement
    Press any Key to continue:
    INFO:Performing Illum Crosstalk for TX0 HDR 0
          I,      Q,S, ScaledI, ScaledQ,tMain,tIlum,tMain(C),  tIlum(C),Magnitd
    +000000,+000000,0,+0000000,+0000000, 2248, 0000,     +25, -128.0000,  0.0

    when I do the same switch but to 12MHz, I can measure crosstalk.

    Do you see a similar behavoiur? - Do you have some sample code on how to switch to 8.57MHz, or how to use dealias mode?

    Thanks,
    Horst

  • Hi Horst,

    Something seems incorrect here. Yes with 8.57 you should be getting some output. I don't have a sample code for SDK with 8.57MHz unfortunately.

    Best,

    Alex

  • OK, thank you for confirming that the values are not correct.

    How can we find out what is happening?

    This is a serious problem for us.

    We want to measure low reflectance objects with up to 15m distance, so we would need the dealias mode in order to get useful results.

    What do you recommend we do?

  • Hi Horst,

    I am looking into this and I will let you know what I find as soon as I can.

    Thank you,

    Brent Elliott

  • Hi Elliott,

    thanks for looking into it. Were you able to reproduce this behaviour? - Do you need more information from me?

    Thanks,

    Horst

  • Hi Horst,

    I have not been able to reproduce this behavior yet, I apologize. I will get back to you as soon as I can this week with an update on what I have found.

    Thank you,

    Brent Elliott

  • Hello,

    Did you manage to have a look into this? Were you able to reproduce the behaviour?

    Thanks,

    Horst

  • Hi Horst,

    We will make sure to get a response to you today by end of day CST time zone on this.

    Best,

    Alex

  • Hi Horst,

    I am not able to replicate this issue on my end and get the device performing as expected with 8.57MHz mode. It is possible there is some register config that is missing.

    Are you able to check that you have the following settings used for dealias? The below code will allow you to get the settings for 6/5 or 6/7 mode by setting the values of the deAliasFreq variable. Below the syntax will be different from the SDK. The below is using python and dev.register_name is used to indicate writing values to each register. Let me know if easier for me to generate the values for you rather than having as code.

    # De-alias settings

    deAliasFreq=1 # 0 for 6/5 and 1 for 6/7

    dev.override_clkgen_reg=0

    dev.dealias_en=1 # Switch to enable or not. if 0 always 10MHz when override=0

    # Digital Settings

    dev.en_multi_freq_phase=1 # Irrespective of modulation frequency it will give out f1 and f2 information when 1

    dev.en_dealias_meas=0 # Freq of modulation is determined by NCR config register.

    dev.ncr_config=1-deAliasFreq

    dev.sub_vd_clk_cnt=np.uint16(9999*(5+(deAliasFreq<<1))/6.0)

    dev.tg_illumen_start=np.uint16(0*(5+(deAliasFreq<<1))/6.0)

    dev.tg_illumen_end=np.uint16(8500*(5+(deAliasFreq<<1))/6.0)

    dev.tg_capture_start=np.uint16(9300*(5+(deAliasFreq<<1))/6.0)

    dev.tg_capture_end=np.uint16(9800*(5+(deAliasFreq<<1))/6.0)

    dev.tg_calc_start=np.uint16(8500*(5+(deAliasFreq<<1))/6.0)

    dev.tg_calc_end=np.uint16(9999*(5+(deAliasFreq<<1))/6.0)

    dev.capture_clk_cnt=np.uint16(8600*(5+(deAliasFreq<<1))/6.0)

    dev.tg_en=1

  • I'll extract the xtalk calibration code as well and share this tomorrow. Hopefully this will be helpful for giving an example of the xtalk process along with alpha and beta scaling factors.

    Best,

    Alex

  • Thank you,

    this works.

    I was following the register setting from "OPT3101 – De-aliasing to extend the Distance Range" chapter 4 "Calibration"

    In this chapter the registers for the timing generator are not modified. - Maybe this caused the issue?

    @Alex: I managed to get good results with my calculation of scaling factors. So I assume, that I managed to calculate them correctly.

    So there is no need to send the code extract.

    The main confusion came from gettting 0 I/Q Values in dealisasing mode.

    Horst

  • Hi Horst,

    Great to hear you were able to get the issue fixed. Yes, sounds like this was the issue. Since the 8.57MHz has longer period the timing needs to be extended. I'll make sure to update the FAQ where I attached that dealias document to note that these register updates. Thanks for pointing out it is missing there.

    Best,

    Alex