- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
Im using Distance2GoL (Software-Controlled FMCW radar)
I am trying to obtain the distance parameter when running the example C-Code. However the only printed output doesnt seem to be sufficient to calcualte the distance. And i cant find the distance elsewhere in the code aswell.
The printed data aswell as the corresponding part in the in code is attached. The code is commlib24_D2GL_basics.c line 555.
"Sample-Data" seems to be a float between 0 and 1 but im not quite sure what that represent. When im trying to use the formular for the distance R in the documentation im missing the variable "fb (beat frequency corresponding to the target).
Is it even possible to extract the raw distance data when using the c-code? I am planing to use the distance as a live parameter for a sound project.
Thanks alot!
luca
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Luca,
1) The example C-Code of Distance2GoL is having functions of raw data and result of detected target called separately in the main code. The Raw data function fmcw_get_raw_data_cnf_callback prints frame number, chirp number, receiver number, ADC number, number of samples, sample data respectively.
Whereas fmcw_adv_result_cnf_callback function has range or distance, strength, velocity, target status, direction of movement which can be visible later, if you can run the code for more than 2-3 counts.
2)
The function in the above snippet has the range parameter which gives distance of the target.
3) Sample_Data is the data from ADC in the normalized form which will be a float value between 0 and 1.
4) The beat frequency can be obtained using a Fast Fourier Transform(FFT) on Intermediate Frequency (IF)signal to find the distance R, but it is not required for you to do this because Distance2GoL displays the distance as mentioned above.
You can also skip printing the raw data by making .show_raw_data = false and .show_raw_data_header = false
5) If you want to print the range/distance as a live parameter, you can remove count and run the while loop continuously.
Thanks and Regards,
Pugitha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Luca,
1) The example C-Code of Distance2GoL is having functions of raw data and result of detected target called separately in the main code. The Raw data function fmcw_get_raw_data_cnf_callback prints frame number, chirp number, receiver number, ADC number, number of samples, sample data respectively.
Whereas fmcw_adv_result_cnf_callback function has range or distance, strength, velocity, target status, direction of movement which can be visible later, if you can run the code for more than 2-3 counts.
2)
The function in the above snippet has the range parameter which gives distance of the target.
3) Sample_Data is the data from ADC in the normalized form which will be a float value between 0 and 1.
4) The beat frequency can be obtained using a Fast Fourier Transform(FFT) on Intermediate Frequency (IF)signal to find the distance R, but it is not required for you to do this because Distance2GoL displays the distance as mentioned above.
You can also skip printing the raw data by making .show_raw_data = false and .show_raw_data_header = false
5) If you want to print the range/distance as a live parameter, you can remove count and run the while loop continuously.
Thanks and Regards,
Pugitha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey Pugitha,
thanks a lot for your answer. I managed to print the distance in a loop to the console, independent from the count variable by setting the loop to while(true). So far it's working but now the loop breaks after 100 iterations, which I set as an argument (repeat_count) in the function call in line 785 and 792. Is it possible to run the loop infinitly?
best regards
luca
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi LucaH,
Sorry for the delayed response.
If you want to print target status infinitely, place the function
After using the loop, the repeat_count variable carries no weightage to the code. The code will run infinitely irrespective of the repeat_count value.
Thanks and regards,
Pugitha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Pugitha,
thank you very much for your response! I managed to integrate your solution. The next issue is that i am trying to set custom parameters, ideally from a .json or similar, so that compilation after changes of parameters is obsolete. For now I hardcoded the custom parameters in the file "EndpointRadarD2GL.c":
Also i am wondering what exactly max_distance_m_lower_boundary means. As i understand those would be technical limitations and stop the code when the max_distance_m was outside the boundary. But when i set the max_distance_m_lower_boundary to 5 and the max_distance_m to 4 it wouldnt show an error and proceed as usual.
On a side note: I was also trying to write the parameters to the board via the GUI. But the Make Persistent option didnt seem to stick. Any idea whats going on there?
One more thing. I understand that the radar has 180 degree reception angle and that cant be altered? For my application a more narrow angle would be better suited.
Thanks alot for your help so far!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi LucaH,
1. Host does not have the access to change all parameters in the example file because some parameters are written to the XMC board. These parameters can only be changed in config.h file present in the DAVE Project. After configuring parameters build the DAVE Project and flash the new hex file created to the board.
2. In max_distance_m_lower_boundary, lower_boundary or upper_boundary are actually referred as the range bin boundaries. The maximum range is divided into certain number of range bins. For example, if the maximum range is 5m and number of range bins are 64. So, each range bin=5/64=0.078125m = 7.81cm. If there is a target at 1m, the radar might check between the range bins 11 to 13.
3. Please ensure after changing parameters, first apply it and then use make persistent option.
4. Distance2GoL comes with 80 degree/29 degree field of view(FOV). Can you please brief me about the reception angle which your speaking about?
Thanks and regards,
Narra Pugitha.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @LucaH
Hope your query is resolved.
We are closing this thread due to inactivity. Please create a new thread for further queries.
Thanks and regards,
Pugitha.