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.

OPT8241 Voxel Viewer calibration how to do it

Other Parts Discussed in Thread: OPT8241

Hello,

I'm using the OPT8241 evaluation board and Voxel Viewer.

How can I do the calibration with a different set of frequency?

there are 7 steps to do it.

I understood that I can start with a parent profile camera lens only and then set the parameters to obtain the two desired frequencies.

The parameters that I choice are:

Parameters F1 value Parameters F2 value
mod_F1 [MHz] 30 mod_F2 [MHz] 60
MCD 30 MCD 30
mod_M1 15 mod_M2 15
mod_M_frac1 0 mod_M_frac2 0
mod_M1_eff 15 mod_M2_eff 15
mod_N1 2 mod_N2 2
mod_PS1 1 mod_PS2 0
quad frame cnt 6 sub frame cnt 2
sys clk freq 48 freq ratio 2048
FPS 30   pix cnt max 133333
ma 1 mb 2
ka 3 kb 1
VCO_1 [MHz] 360 VCO_2 [MHz] 360
delay_fb_coeff1 wo dealiasing 1280 delay_fb_coeff1 w dealiasing 2560
Unamb Range 7

Then I got the right frequencies by write these parameters in the conf file.

the steps that I don't now if I have correctly understood are the follow:

1) frequency calibration: which frequency I have to write here? I tryed with the 30 MHz (base frequency) and measure by an oscilloscope the real value

2) Crosstalk Calibration: I put a mirror in front of the camera at 40-50cm and calibrate it.

3) Nonlinearity Calibration: considering that I'm using a dual frequencies mode I set the IND_FREQ_DATA_EN register to 1 and IND_FREQ_DATA_SEL to 0 in order to have the first frequency. In my case I choose the unamb range to 7 meters, and I split the 16 points from 0 cm to the 15/16 of 7 meters. I measured for each frequency the releation phase distance.

4) Common Phase Calibration: I direct the camera in front of a flat wall at 50-60 cm and than put the exactly distance in the voxel viewer and start the common phase calibration

I can't do the thermal calibration because I don't have a thermal chamber.

But when I try to measure obstacle with this profile I get a wrong distance:

distance real (m) distance voxel viewer profile (m)
0,596 0,61
1,185 1,25
1,771 1,81
2,364 2,41
3 3,01
3,6 3,62
4,2 0,8
5 1,45

The way that perform the calibration is correct?

The parameter setting is right?
can someone help me?

Thanks

  • Gianluca,

    Could you please check with the attached .conf file (rename to .conf) TintinCDKCameraDealiased1.ini

    This sets up the same parameters as you but via a .conf file. The key point is that the VoxelSDK/VoxelViewer do not refresh the phaseToDistance conversion factors if the modulation frequency is changed while streaming. Setting them via a .conf file lets the streaming start with the correct conversion factor.

    Frequency calibration is just a scaling factor applied to the phaseToDistance computation to compensate for a bad crystal. You normally do not require this.

    You can ignore cross-talk, non-linearity and temperature calibration also for the moment.

    With dealiasing, to get reliable phase data, it is mandatory to do common phase calibration. You can run this manually without using the Calibration Wizard - just use IND_FREQ_DATA_EN = 1 and IND_FREQ_DATA_SEL = 0/1 to measure phase and program PHASE_CORR_1/2 accordingly. Then IND_FREQ_DATA_EN = 0 will give you proper dealiased phase, and the VoxelViewer should report the proper distance.

  • I just realized you are already using a conf file, and your measured data looks correct. Your last two values corresponding to 4.2 and 5.0 metres may be wrong due to low returned signal. What is the amplitude at these points?
  • I'm sorry but these measures are referred to another profile (F1 = 50 MHz and F2 = 60 MHz) that I created.
    I made the step of phase measuring by using your config file, dividing the measures as follows:

    d [m] phase 1 phase 2
    0,34 4095 4095
    0,629833333 3634 1942
    0,919666667 3871 2422
    1,2095 21 2904
    1,499333333 265 3380
    1,789166667 495 3855
    2,079 745 261
    2,368833333 993 765
    2,658666667 1218 1197
    2,9485 1478 1703
    3,238333333 1719 2178
    3,528166667 1921 2678
    3,818 2216 3163
    4,107833333 2455 3642
    4,397666667 2705 65
    4,6875 2973 575

    I put this in the voxel wizard and then restart the camera and voxel view, but the measure are wrong. The config file after this calibration is:

    [global]
    id = 143
    name = Dealiased1
    parent = 130

    [defining_params]
    unambiguous_range = 5
    mix_volt = 1500
    op_clk_freq = 0
    sub_frame_cnt_max = 2
    quad_cnt_max = 6
    frame_rate = 30.0000743866
    mod_freq1 = 30.0
    mod_freq2 = 60.0
    pix_cnt_max = 133333
    ma = 1
    mb = 2
    ka = 3
    kb = 1
    freq_ratio = 2048
    dealiased_ph_mask = 0
    intg_duty_cycle = 20
    illum_power_percentage = 100
    delay_fb_corr_mode = 0
    delay_fb_dc_corr_mode = 0
    delay_fb_coeff_1 =
    disable_temp_corr = 1
    intg_time = 31

    [calib]
    freq_corr_at = 48.0
    freq_corr = 1.0
    actual_distance = 0.65
    tillum_calib = 61
    phase_corr_2 = 1973
    phase_corr_1 = -1412
    tsensor_calib = 56
    phase_lin_coeff1 = 4095 4095 4095 3138 1975 2192 2450 2710 2968 3226 3482 3738 2809 880 446 718
    phase_lin_coeff0 = 4095 4095 3641 3647 54 315 568 836 1093 1354 1623 1856 2144 2415 2683 2970
    phase_lin_corr_period = 2


    These are the measure after do the caibration
    d real d voxel dealiased phase amplitude
    0,6 3,598 182 315
    1,2 3,42 175 95
    1,8 2,43 146 45
    2,4 3 157 24
    3 4,13 214 13
    3,6 3,55 183 10
    4,2 79 4090 6

    The distances of the 16 points choosen to do the calibration are correct?
    Why I get 79 meters if my unambiguous range is of 5 meters?
  • You do not need non-linearity calibration at this time.

    To eliminate this, could you please disable the phase_lin_coeff* and phase_lin_corr_period?

    Then only do the common phase offset calibration - if possible manually, - just use IND_FREQ_DATA_EN = 1 and IND_FREQ_DATA_SEL = 0/1 to measure phase and program PHASE_CORR_1/2 accordingly. Then IND_FREQ_DATA_EN = 0 will give you proper dealiased phase, and the VoxelViewer should report the proper distance.

    Could you check how this behaves?
  • I deleted this three line in the conf file:
    phase_lin_coeff1 = 4095 4095 4095 3138 1975 2192 2450 2710 2968 3226 3482 3738 2809 880 446 718
    phase_lin_coeff0 = 4095 4095 3641 3647 54 315 568 836 1093 1354 1623 1856 2144 2415 2683 2970
    phase_lin_corr_period = 2

    I do the phase offset calibration manually.
    Before start the phase offset calibration I deleted the previously vaues in the parameters phase_corr_2 = 1973 and phase_corr_1 = -1412
    I put an object at 0.65m and measure the two phases, the values are:

    actual_distance = 0.65
    phase_corr_2 = 1029
    phase_corr_1 = 774

    and the results are the follow:

    d real d voxel phase amplitude
    0,6 77,9 4024 108
    1,2 18,02 931 28
    1,8 37,47 1915 12
    2,4 57,19 2947 6,5

    But I do not understand why we must not make the non-linear calibration phase. The unambiguous range of LongRange profile is 8m, and this one is 5m, and we also changed the two frequencies.

    what is wrong in this procedure?
  • Non-linearity correction is not essential for now. We are eliminating non-linearity correction because you appear to have incorrect coefficients.

    The most important correction is the common phase offset.

    Can you explain how you obtained phase_corr_1 = 774 and phase_corr_2 = 1029? Are these the measured phase values, or the computed offset values?
    They should be (measuredPhase - expectedPhase).

    For your distance of 0.65m and frequencies of 30 MHz and 60 MHz.
    phase_corr_1 should be (measuredPhaseFreq1 - 534) and phase_corr_2 should be (measuredPhaseFreq2 - 1066).

    Can you confirm this is what you have done?
  • Thank you to help me.

    I'm sorry, I forgot to subtract the theoretical value.
    Before measure the two fases I deleted the previous phase corr, is it correct?

    without delte the previous phase correcct
    distance = 0,65 m
    phaseF1 = 2920 ----> phase_corr_1 = 2386
    phaseF2 = 4068 ----> phase_corr_2 = 3002

    If I set the two phase_corr before measure the offset I obtain:
    distance = 0,65 m
    phaseF1 = 1527 ----> phase_corr_1 = 993
    phaseF2 = 1973 ----> phase_corr_2 = 907

    with the secon values ( phase_corr_1 = 993 and phase_corr_2 = 907 ):

    d real d voxel (d_voxel - 3.45 m) (d_voxel - 3.45 m) - d real deal phase
    0,6 4,05 0,6 0 214
    1,2 4,68 1,23 0,03 245
    1,8 0,37 1,92 0,12 20
    2,4 0,97 2,52 0,12 50
    3 1,59 3,14 0,14 82
    3,6 2,2 3,75 0,15 114
    4,2 2,89 4,44 0,24 148
    4,62 3,28 4,83 0,21 169

    This point of the calibration procedure is correct?

    How can I delete this offset of 3.45m?
    The second thing is after correcting this initial offset (3.45m) I can correct the relative error ( (d_voxel - 3.45 m) - d real ) with the non linear calibration right?
  • Could you please zero out the phase_corr_1/2 registers before calibrating. Then calibrate again and check.
  • Is exactly what I made. This is the conf file before do the offset calibration:

    [global]
    id = 148
    name = 3060LAST
    parent = 130

    [defining_params]
    unambiguous_range = 5
    mix_volt = 1500
    op_clk_freq = 0
    sub_frame_cnt_max = 2
    quad_cnt_max = 6
    frame_rate = 30.0
    mod_freq1 = 30.0
    mod_freq2 = 60.0
    pix_cnt_max = 133333
    ma = 1
    mb = 2
    ka = 3
    kb = 1
    freq_ratio = 2048
    dealiased_ph_mask = 0
    intg_duty_cycle = 20
    illum_power_percentage = 100
    delay_fb_corr_mode = 0
    delay_fb_dc_corr_mode = 0
    delay_fb_coeff_1 =
    disable_temp_corr = 1

    [calib]
    freq_corr_at = 48.0
    freq_corr = 1.0
    tillum_calib = 61
    tsensor_calib = 56
    #phasecorrection = file:TintinCDKCameraDealiased18mPhaseOffset.bin

    I'm going to explain all the steps to do this.
    After open Voxel viewer I see the phase_corr_1 and phase_corr_2 to 0 and then set the disable_offset_corr to true and finally set IND_FREQ_DATA_EN = 1 and IND_FREQ_DATA_SEL = 0/1

    The two phases are:
    phaseF1 phaseF2
    202 3962

    But when I try to apply this two coefficient:

    phase_corr_1 = -332
    phase_corr_2 = 2896

    I got an error to the phase_corr_2:
    DepthCamera: Could not set value 2896 for parameter TintinCDKCamera(0::0451:9105::xxxxxxxx).phase_corr_2
    Can you help me? I guess that we are near the solution
  • phase_corr_1/2 are signed and range from -2048 to +2047. You can set phase_corr_2 to -(4096-2896) = -1200 instead.
  • wow, it's working many many thanks.

    These are the measures:

    d real d voxel
    0,65 0,66
    1,2 1,2
    1,8 1,81
    2,4 2,38
    3 2,98
    3,6 3,61
    4,2 4,25

    This is the solution, because I tried with a different set of F1 and F2 and all this profile are working. My problem was to do the calibration phase of the automatic offset through voxel viewer.

    Now if I want to compensate for differences along the range I perform the non-linear phase calibration right?
  • Good, now that you have it working with manual calibration, you should try the "Common Phase Offset" calibration in the Calibration Wizard. This should also work.

    Your issue was probably due to having incorrect non-linearity coefficients in the configuration file.

    It may be better to first characterize your system to see if you really need non-linearity correction.
  • Thank you. Today I will try to perform the Common Phase Offset calibration through the Calibration wizard and I will write the results.
  • After doing the manual phase offset calibration I tried with a voxel wizard, and I have to do this for 5 or 6 times to obtain acceptable phase compensation values, I don't know why, but finally I can considering this problem solved.
    When I try to see the depth map I get some problem when I have opaque object (see the allegate picture dl.dropboxusercontent.com/.../Problem.png ) in my scenario. The measurement by means of software is greater than 8 meters while the real measure is 3 meters. But if I get close to this object under 2 meters I get the right distance. Can I solve this problem? or maybe is a limit of this board?

    thank you
  • Dear Gianluca&Anand,

    how can i computed the phase_corr1/2 theoretical value? Can you give me example?

    I think i am almost near the solution.

    thanks&regards
  • Dear None_jeiyu

    First of all you have to disable the phase offset correction.

    The second step is to enable one frequency, set ind_freq_data_en to 1 and ind_freq_data_sel to 0 and manual measure the phase of the F1 at know distance.

    Third step enable F2 frequency, set ind_freq_data_sel to 1 and at the same distance of the first measure read the second phase.

    After that set ind_freq_data_en to 0 and manually edit the profile file and write the two phase in phase_corr1 and two and the actual_distance = to know distance

    Restart voxel view and see the results

  • Dear Gianluca,

    thanks for your reply.

    You explain to me help is very big, very detailed.

    But I have another question I hope you can help me, how to How to manually calculate Phase_corr1/2.

    Assume that the second step measured phase as Phase_measured_F1, the Third step measured phase as Phase_measured_F2,

    actual_distance‘s theoretical phase as Phase_theoretical , so

    Phase_corr1=Phase_measured_F1 -Phase_theoretical;
    Phase_corr2=Phase_measured_F2 -Phase_theoretical;

    I want to know whether my understanding is correct?Because I am in this way to calculate the Phase_corr1/2,my d_voxel is not right. Looking forward to get your guidance.

    Thanks&Regards
  • Your formula is correct.
    After measure the phase F1 and F2 you have to calculate the theoretical phase.
    Phase theoretical = actual_distance * 2^12 / Unambiguous_range
    pay attention, the phase_corr1 goes from -2048 to + 2047 if your phase_corr isn't in this range you have to use this equation: -(4096-(Phase_measured_F1 -Phase_theoretical))

    You can manually measure the Phase_measure_F1 and F2 by used the watch point in voxel view. For my opinion I suggest you to set the frame statistic mean to 100 frame or upper.
  • Dear Gianluca

    thanks for you information.

    I wonder why not Phase theoretical = actual_distance*ma*mb * 2^12 / (Unambiguous_range*2^(5-dealiased_ph_mask) ,because it is working on aliased stated?

    thanks&regards
  • I don't know.

    I started from the simple formula to calculate the phase theoretical and the phase offset calibration was good. Maybe you are right. You can calculate two phase theroetical and try with the first formula and the second and observe the results

  • Dear Gianluca,

    thanks for you reply.

    maybe you are right ,because in my formula the d real is not equal to d voxel .but you data looks like right.

    thanks&regards.

    None
  • Dear Gianluca,

    "For my opinion I suggest you to set the frame statistic mean to 100 frame or upper."

    1、Can you tell me how can i get statistic mean to 100 frame or upper data by voxel viewer?

    2、it should be right:Phase_corr1/2=Phase_theoretical - Phase_measured_F1/2 ; please check it?

    thanks&regards.

    None
  • Dear None,

    for the first question you just need to set in settings check the temporal statistics and set 100 measures or more.

    For the second is it correct for me. I do extactly this formula

  • Dear Gianluca,

    Phase_corr1/2=Phase_theoretical - Phase_measured_F1/2 not Phase_measured_F1/2 - Phase_theoretical , maybe it I didn't say clear.

    I will get the 200 frame data by myself not voxviewer.

    Thanks&Regards.

    None
  • Dear Gianluca,

    Today I did experiments, obtain a 200 frames of data by my self.

    this is conf file:
    [global]
    id = 130
    parent = 128
    name = Long Range

    [defining_params]
    unambiguous_range = 5
    mix_volt = 1500
    op_clk_freq = 0
    sub_frame_cnt_max = 2
    quad_cnt_max = 6
    frame_rate = 30.0
    mod_freq1 = 30.0
    mod_freq2 = 60.0
    pix_cnt_max = 133333
    ma = 1
    mb = 2
    ka = 3
    kb = 1
    freq_ratio = 2048
    dealiased_ph_mask = 0
    intg_duty_cycle = 20
    illum_power_percentage = 100
    delay_fb_corr_mode = 0
    delay_fb_dc_corr_mode = 0
    delay_fb_coeff_1 =
    disable_temp_corr = 1

    [calib]
    freq_corr_at = 48.0
    freq_corr = 1.0
    actual_distance = 1.812

    tillum_calib = 43
    disable_temp_corr = 0
    disable_offset_corr = 0
    phase_corr_1 = -40
    phase_corr_2 = -733
    tsensor_calib = 51

    the Phase1_measure=1524.67;
    the Phase2_measure=2217.671;

    the acutal distance=1.812, Phase_theoretical=1.812*2^12/5=1484.39. So I get

    the Phase_corr1=1484.39-1524.67=-40;
    the Phase_corr2=2217.671-1524.67=-733;

    After this I get the distance calibration value;

    d_real d_measure
    1.052 0.958
    1.384 1.286
    1.758 1.707
    2.19 2.13
    2.482 2.413
    2.982 2.909

    I want to know what went wrong? Can you help me ?

    Thanks&Regards

    None
  • after porforming crosstalk calibration incorretly, i find the data bad ,what can i do to recover the original set???