Skip to main content

FMCW

Based on initial & ongoing work by Henrik Forstén/@Ttl.

Documentation: Read The Docs

  1. Generalities
  2. Description of the flow
  3. Technical considerations

Generalities

Version convention

Releases have a version number in the following format: X.YYY.ZZZ

  • X is the hardware version.
  • YYY is the release version
  • ZZZ is the minor update version

History

The FMCW package is a library designed to interact at a high level with the fmcw radar from Henrik Forstén/@Ttl. If you are not familiar with it, start with taking a look at Henrik's blog post on the third version of the radar: FMCW 3

For additional information on this type of radar, you can also take a look at the previous blog posts written by Henrik. These older radars are not be compatible with this library but can help shine some light on radar theory and the history of the project:

Additionnaly, Henrik's fmcw project was covered in a few articles. For instance:

Where to get an fmcw3?

Short answer: you have to make it yourself.

Longer answer: only a few boards seem to have been made so far, all based on the files that Henrik uploaded on his GitHub repository. If you plan on building one, make sure you have:

  1. proper hardware to place the components & reflow them
  2. 200+ hours ahead of you (VERY dependant on your existing knowledge)
  3. ~$500

Of course, these are rules of thumbs and should not be taken at face value.

FMCW3

I have an fmcw3, what should I do next?

Congratulations! There are two main options:

  1. You write your own script based on the library. This is expected to be hard as the documentation is lagging behind the code I write.
  2. You reuse the latest release I have for the main script. This is the recommended option.

In what follows, I will describe how I use the library with 190830_rt_fmcw3.py, uploaded with release 3.1.ZZZ.

Description of the flow

Four main tasks are being executed by the script:

  1. Read the data from the FPGA
  2. Process the data
  3. Save the data to file
  4. Display the data in real time

Architecture

A picture is better than a thousand words so here is a schematic: Architecture

Read the data from the FPGA

This step is less easy than it sounds for a simple the reason: the FPGA is a real time chip while everything else (the usb port, the OS on my laptop, python...) is not. As a result, the FPGA outputs data are fixed intervals and if anything down the chain is not ready to receive it, the 4 kb buffers on the FTDI chip will quickly overflow and be overwritten. I have not found a silver bullet for that problem so far and only managed to mitigate it.

See here for more information: Stack Overflow

Process the data

The data coming from the FPGA is parsed to separate it in sweeps. Valid sweeps are then processed in order to display 3 types charts in real time. Invalid sweeps (most of the time incomplete sweeps due to dropped bytes on the USB bus) are zeroed and displayed as such.

Save the data to file

Threads are used to write the data to file. A total of three threads are spawned from the main process:

  1. One for writing the settings to file. Note that it is immediately closed after writing to file.
  2. One to write the raw, byte data to a text file.
  3. One to write the processed data to a csv file.

Display the data in real time

The main script offers the option to display data in real time. But there is no such thing as perfect real time: there is always a lag. Depending on how many sweeps you read at once from the USB port before processing, and how long these sweeps are, the lag can be increased or reduced. With the default settings, the lag is a few hundred ms.

The refresh rate is also severly limited on most laptop given the amount of work needed to refresh a plot that can have tens of thousands of pixels on it. Despite minimizing the amount of elements to refresh when updating a plot and keeping each plot in a separate subprocess, 10 Hz appears to be the maximum refresh rate on my CPU (i7-8565U).

Below, a few examples of the displayed plots: IF signal Angle plot Range time plot

Technical considerations

Batch processing

Here is quick description of how a batch of data is processed. Batch processing Feel like this is cryptic? It is. In a nutshell, the point is to mitigate the non-real time nature of the script as much as possible. It is not perfect and some data will be lost, but these days less than 5% is lost. If you ever want to learn more just reach out to me.

Release files for fmcw 3.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fmcw 3.2.5
File Size Uploaded
fmcw-3.2.5.tar.gz 32.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fmcw 3.2.5
File Interpreter ABI Platform
fmcw-3.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 80.4 kB

Release files / fmcw-3.2.5.tar.gz

Download URL fmcw-3.2.5.tar.gz
Size 32.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d3340eefc5062211b7879488a53426b3f020317515729ce9e61de462dcd86230
BLAKE2b-256 checksum
How to use checksums
c9812945cd909e7d35267c251017c27238c81dc12deda81a0422b114585c2d83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15+

Release files / fmcw-3.2.5-py3-none-any.whl

Download URL fmcw-3.2.5-py3-none-any.whl
Size 47.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b5f2be91671765c88948eb49850162507d3cd3d5f2f133f76884b437f626083
BLAKE2b-256 checksum
How to use checksums
1e5a5c74e6b0da2cf9d1d1ec421bb92031e2c0360c546acc1355a1695e036cc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15+

Release history Release notifications | RSS feed

This release

3.2.5 This release

2 release files

3.2.4

2 release files

3.2.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.1.29

2 release files

3.1.28

2 release files

3.1.27

2 release files

3.1.26

2 release files

3.1.25

2 release files

3.1.24

2 release files

3.1.23

2 release files

3.1.22

2 release files

3.1.21

2 release files

3.1.20

2 release files

3.1.19

2 release files

3.1.18

2 release files

3.1.17

2 release files

3.1.16

2 release files

3.1.15

2 release files

3.1.14

2 release files

3.1.13

2 release files

3.1.11

2 release files

3.1.10

2 release files

3.1.9

2 release files

3.1.8

2 release files

3.1.6

2 release files

3.1.5

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

0.3.33

2 release files

0.3.32

2 release files

0.3.31

2 release files

0.3.30

2 release files

0.3.29

2 release files

0.3.28

2 release files

0.3.27

2 release files

0.3.26

2 release files

0.3.25

2 release files

0.3.23

2 release files

0.3.22

2 release files

0.3.21

2 release files

0.3.20

2 release files

0.3.19

2 release files

0.3.18

2 release files

0.3.17

2 release files

0.3.16

2 release files

0.3.15

2 release files

0.3.14

2 release files

0.3.13

2 release files

0.3.12

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page