Every time a robotic vacuum cleaner leaves the charging dock in the kitchen and set out to explore the apartment, out of curiosity, I open the mobile app and watch the live broadcast and copy my interior map of the entire apartment. Whereas yesterday there was a kitchen chair at coordinates 1426: 4589 that he had to carefully encompass around that he could no longer see because he was lying on the table, so he temporarily modified his spatial model.
The vacuum cleaner can do all this thanks to two main technologies. In a small canopy, the roof rotates very quickly Lidar And its data is instantly processed by a powerful processor in a complex algorithm strong hit.
In the continuation of our series today on electronics programming, we’ll be building such a LiDAR – its simplest 180-degree version and slowest.
For the project we will need:
- Arduino Uno or other prototype board with I²C and UART
- Automotive devices
- TF-Luna, VL53Lx, or other laser range limiter
This will be the result:
In the following paragraphs, we’ll discuss what LiDAR is, why it uses a laser, and how servo motors work, and we’ll complete the entire project with ours.
Light and range detection
But in order, what exactly is lidar? It has been talked about and written for years, particularly in relation to autonomous cars, although its history and industrial use have a much longer history. But as one of the many English acronyms suggests, it is a device for optical detection and measurement – usually a laser -. Actually, it is Dust-free rangefinder.
The LiDAR vacuum cleaner measured distances to obstacles and SLAM used this data to create a map and locate the vacuum cleaner without the need for a Global Positioning System (GPS).
When we built a simple one last fall Garage door status detector, We measured the distance with a common prototyping ultrasound rangefinder HC-SR04 For a few crowns.
Well if we attach the same range finder to a motorcycle, which we will slowly rotate at specific angles, then we will use it to measure the distance to all the obstacles around us. And it is exactly that 2D lidar, Which measures 360 distances for each complete stage after a full rotation of the shaft, and we get an idea of the obstructions in the immediate vicinity of the rangefinder.
Rotary laser rangefinder in a robot vacuum cleaner canopy
Now imagine that we are placing, for example, three on the motor shaft of the HC-SR04 rangefinder, one pointing to the front plane, the other pointing 10 degrees below the level, and finally the third point 10 degrees above the level. After one complete turn, we would now have the obstacle data in a much wider vertical range, and would actually have a very simple 3D lidar basis with a low image resolution.
Ultrasound LiDAR is not a good solution
But the LiDAR ultrasound machine will be seriously ill. The sound is too slow! In air at normal room temperature, its waves propagate rapidly at about 346 meters per second. To be able to detect an obstacle from a fixed position, the sound wave must not only reach it, but it must also bounce and return to the detector at the same time.
Common prototypes of ultrasound rangefinders US-100 and HC-SR04
This means that an obstacle at a distance of 1 meter will be detected first with the help of an ideal ultrasound detector without additional load. 5.78 ms (1000/346 x 2). Now bear in mind that we have only measured the first angle so far, so the motor is asked to rotate 1 ° and then a new measurement is made.
In short, after a full cycle, it becomes 360 x 5.78 = 2081 ms. Two full seconds! And all this only if the surrounding obstacles are within one meter. When it is 10 meters, the measurement time jumps up in order of magnitude.
An ultrasound rangefinder is a typical example of a ToF (fight time) measurement. The distance is estimated according to the time between signal transmission and reception after echoing from an obstacle.
The lidar should be optical
The ultrasound rangefinder is really only suitable for slow measurement of objects over a relatively short distance of up to a few meters. After all, if the obstacle is further away, the surrounding space will weaken the sound wave so that the detector is still unable to detect it. The cone of the ultrasound pulse is also relatively wide, so just forget about some decent resolution of the spatial data captured.
A laser rangefinder is another type of ToF measurement. This time we are not calculating the flight time of the ultrasound pulse train, but the flight time of the laser – usually safe infrared.
We need something better, and that of course is the light. Its speed in the surrounding air is about 299,702,547 meters per secondTherefore, one meter will travel in about 3.3 nanoseconds. Then it takes 1 meter to reach the obstacle and turn back 6.7 nanoseconds. That’s a million times shorter than the sound.
The continuation of the article belongs to the premium content
Get unlimited access and live truly ad-free 41 CZK monthly