What Is 5G and How Does It Work?

By: Daniel Tomlinson
Project Engineer

18th July 2019

5 minute read

Home » Engineering

As a society that is becoming increasingly dependent on data driven applications, 5G promises to provide better connectivity and faster speeds for our network devices. However, whilst the previous generations of mobile communications have been fairly analogous to each other in terms of distribution and multiple user access, 5G will be drastically different – making it a challenging system to implement. So, how does it work?

Initial Concept

Enhanced Mobile, Massive iot, low latency, the 5G Triangle
Fig 1 – The 5G Triangle

 

As with any concept, 5G was initially based on a very broad and ambiguous set of standards, which promised low latency, speeds in the region of Gbps and better connectivity. Whilst no intricacies of the system were known at the time, we knew that in order to achieve faster data rates and larger bandwidths we would have to move to higher frequencies – and this is where the problem occurs. Due to the severe amounts of atmospheric attenuation that’s experienced by high frequency signals, range and power become serious issues that our current systems aren’t capable of handling.

Range & Power

A modern GSM tower features multiple cellular base stations, that together, are designed to transmit 360⁰ horizontally and at a range in the order of tens of miles, depending on the terrain. However, if you were to consider that the received power transmitted from a cellular base station degrades with distance at a rate of…

And that by factoring in frequency, this effect worsens…

…it becomes obvious that transmitting over larger distances and at higher frequencies becomes exponentially inefficient. Therefore, a key part of the 5G overhaul would require thousands of miniature base stations to be strategically placed in dense, urban environments in order to maximise capacity with minimal obstructions.

Directivity

5G Radiation pattern
Fig 2 – Radiation Pattern of an Isotropic Antenna versus an Antenna with Gain (Dipole)

 

One way to increase the range of a transceiver, whilst keeping the power output the same, is to incorporate gain into the antenna. This is achieved by focusing the transmitted power towards a particular point as opposed to equally in all directions (isotropic).

Figure 1 shows such a comparison, in which, a dipole antenna’s energy is being focused in the direction of 180 and 0 degrees. Equation three reflects this additional factor:

However, as the essence of a wireless handset is portability, it is likely to move around a lot with the user. Therefore, a high gain 5G transmitter would still require a tracking system to ensure that it stays focused directly at the end user’s handset.

User Tracking

One solution for tracking devices could be to employ a high frequency transceiver with a phased array antenna structure. This would act as a typical base station, capable of transmitting and receiving, but an array of hundreds of small scale patch antennas (and some DSP magic) would make it capable of beamforming. This would not only allow the structure to transmit high gain signals but to also steer the beam by changing the relative phase of the output.

However, as this is a technically complex system that has yet to be implemented on such a large scale, the technology is still in its infancy and is currently being trialled in select areas only. Considerable efforts will have to be made to ensure that such a transceiver could operate in a bustling environment where multipath and body-blocking would cause strong interference.

5G in 2019

3GPP (the 3rd Generation Partnership Project) is an organisation that was established in 1998 and helped to produce the original standards for 3G. It has since gone on to produce the specs for 4G, LTE and is currently working to achieve a 5G “ready system” in 2020.

With certain service carriers already having released 5G this year in certain parts of America, 2019 will be welcoming numerous 5G handsets from several of the flagships giants like Samsung, LG, Huawei and even Xiaomi – a budget smartphone manufacturer.

As with previous generations though, only limited coverage will be available at first (and at a hefty premium), but in practice, it will be fairly similar to Wi-Fi hot-spotting. A lot of work is still required to overcome the issues as discussed above.

As a society that is becoming increasingly dependent on data driven applications, 5G promises to provide better connectivity and faster speeds for our network devices. However, whilst the previous generations of mobile communications have been fairly analogous to each other in terms of distribution and multiple user access, 5G will be drastically different – making it a challenging system to implement. So, how does it work?

Initial Concept

Enhanced Mobile, Massive iot, low latency, the 5G Triangle
Fig 1 – The 5G Triangle

As with any concept, 5G was initially based on a very broad and ambiguous set of standards, which promised low latency, speeds in the region of Gbps and better connectivity. Whilst no intricacies of the system were known at the time, we knew that in order to achieve faster data rates and larger bandwidths we would have to move to higher frequencies – and this is where the problem occurs. Due to the severe amounts of atmospheric attenuation that’s experienced by high frequency signals, range and power become serious issues that our current systems aren’t capable of handling.

Range & Power

A modern GSM tower features multiple cellular base stations, that together, are designed to transmit 360⁰ horizontally and at a range in the order of tens of miles, depending on the terrain. However, if you were to consider that the received power transmitted from a cellular base station degrades with distance at a rate of…

And that by factoring in frequency, this effect worsens…

…it becomes obvious that transmitting over larger distances and at higher frequencies becomes exponentially inefficient. Therefore, a key part of the 5G overhaul would require thousands of miniature base stations to be strategically placed in dense, urban environments in order to maximise capacity with minimal obstructions.

Directivity

5G Radiation pattern
Fig 2 – Radiation Pattern of an Isotropic Antenna versus an Antenna with Gain (Dipole)

One way to increase the range of a transceiver, whilst keeping the power output the same, is to incorporate gain in to the antenna. This is achieved by focusing the transmitted power towards a particular point as opposed to equally in all directions (isotropic).

Figure 1 shows such a comparison, in which, a dipole antenna’s energy is being focused in the direction of 180 and 0 degrees. Equation three reflects this additional factor:

However, as the essence of a wireless handset is portability, it is likely to move around a lot with the user. Therefore, a high gain 5G transmitter would still require a tracking system to ensure that it stays focused directly at the end user’s handset.

User Tracking

One solution for tracking devices could be to employ a high frequency transceiver with a phased array antenna structure. This would act as a typical base station, capable of transmitting and receiving, but an array of hundreds of small scale patch antennas (and some DSP magic) would make it capable of beamforming. This would not only allow the structure to transmit high gain signals but to also steer the beam by changing the relative phase of the output.

However, as this is a technically complex system that has yet to be implemented on such a large scale, the technology is still in its infancy and is currently being trialled in select areas only. Considerable efforts will have to be made to ensure that such a transceiver could operate in a bustling environment where multipath and body-blocking would cause strong interference.

5G in 2019

3GPP (the 3rd Generation Partnership Project) is an organisation that was established in 1998 and helped to produce the original standards for 3G. It has since gone on to produce the specs for 4G, LTE and is currently working to achieve a 5G “ready system” in 2020.

With certain service carriers already having released 5G this year in certain parts of America, 2019 will be welcoming numerous 5G handsets from several of the flagships giants like Samsung, LG, Huawei and even Xiaomi – a budget smartphone manufacturer.

As with previous generations though, only limited coverage will be available at first (and at a hefty premium), but in practice, it will be fairly similar to Wi-Fi hot-spotting. A lot of work is still required to overcome the issues as discussed above.

Further Reading

The Virtue of Failure

By: Polly Britton
Project Engineer, Product Design

25th June 2019

3 minute read

Home » Engineering

The Virtues of Failure

In order to innovate, we must accept the possibility of failure. Since the vast majority of inventions and ideas are doomed to fail, failure is inevitable, even for the most successful companies. And yet, businesses try to hide their mistakes in an attempt to appear perfect in the public eye. I started thinking about this when I heard about the Museum of Failure in Sweden, which exhibits the products invented by companies that their customer-base didn’t want, and certainly wouldn’t pay for.

Being ashamed of our mistakes may be a natural human behaviour, or it might be cultural, but there are times when it is advantageous to embrace failure.

Toyota’s Andon Cords

On Toyota’s factory floor, the cars are assembled on a conveyor belt, lined with employees assembling the cars bit-by-bit as they go past on the assembly line. Each employee on the assembly line has a big yellow button at arms-reach, which they are taught to push every time they detect a problem with the assembly. When pushed, the button alerts the rest of the team, bringing their attention to the issue immediately.

In earlier days of Toyota’s manufacturing, there were ropes hanging above the assembly line that served this function, called “Andon cords”. Pulling the cord halted the conveyor, bringing all work to a complete stop until the problem was solved. Although it might sound like a waste of time, it actually increased Toyota’s efficiency and the technique was adopted by other auto manufacturers.

Toyota keeps track of the number of times the button/cord is used each day. When the rate of alarms decreases it is considered a serious problem since it indicates the employees are not being observant enough.

“A stitch in time saves nine”

It’s much easier to solve problems when you to attend to them as early as possible. But to attend to problems, you have to acknowledge their existence, which sometimes means admitting to a mistake. If it’s your own mistake you’re likely to feel ashamed of it, and if it’s someone else’s mistake you may feel guilty about pointing it out and embarrassing them. That reaction is natural but somewhat irrational; we all make mistakes, and everyone knows that. It’s easy to forgive a mistake if you can catch it early, but it’s harder to forgive later when the damage is already done.

Product Design

In the world of product design, each new project is an opportunity to make many mistakes. The project itself might even be a mistake, as was the case for many exhibits in the Museum of Failure. As designers and engineers, it’s important, to be honest about our mistakes and the mistakes of our peers – even our superiors. Our projects might benefit greatly from a culture of forgiveness where we feel less ashamed of admitting to mistakes, or maybe even a culture like Toyota’s where detecting problems is encouraged and a lack of problems is looked on with suspicion.

The Virtues of Failure

In order to innovate, we must accept the possibility of failure. Since the vast majority of inventions and ideas are doomed to fail, failure is inevitable, even for the most successful companies. And yet, businesses try to hide their mistakes in an attempt to appear perfect in the public eye. I started thinking about this when I heard about the Museum of Failure in Sweden, which exhibits the products invented by companies that their customer-base didn’t want, and certainly wouldn’t pay for.

Being ashamed of our mistakes may be a natural human behaviour, or it might be cultural, but there are times when it is advantageous to embrace failure.

Toyota’s Andon Cords

On Toyota’s factory floor, the cars are assembled on a conveyor belt, lined with employees assembling the cars bit-by-bit as they go past on the assembly line. Each employee on the assembly line has a big yellow button at arms-reach, which they are taught to push every time they detect a problem with the assembly. When pushed, the button alerts the rest of the team, bringing their attention to the issue immediately.

In earlier days of Toyota’s manufacturing, there were ropes hanging above the assembly line that served this function, called “Andon cords”. Pulling the cord halted the conveyor, bringing all work to a complete stop until the problem was solved. Although it might sound like a waste of time, it actually increased Toyota’s efficiency and the technique was adopted by other auto manufacturers.

Toyota keeps track of the number of times the button/cord is used each day. When the rate of alarms decreases it is considered a serious problem since it indicates the employees are not being observant enough.

“A stitch in time saves nine”

It’s much easier to solve problems when you to attend to them as early as possible. But to attend to problems, you have to acknowledge their existence, which sometimes means admitting to a mistake. If it’s your own mistake you’re likely to feel ashamed of it, and if it’s someone else’s mistake you may feel guilty about pointing it out and embarrassing them. That reaction is natural but somewhat irrational; we all make mistakes, and everyone knows that. It’s easy to forgive a mistake if you can catch it early, but it’s harder to forgive later when the damage is already done.

Product Design

In the world of product design, each new project is an opportunity to make many mistakes. The project itself might even be a mistake, as was the case for many exhibits in the Museum of Failure. As designers and engineers, it’s important, to be honest about our mistakes and the mistakes of our peers – even our superiors. Our projects might benefit greatly from a culture of forgiveness where we feel less ashamed of admitting to mistakes, or maybe even a culture like Toyota’s where detecting problems is encouraged and a lack of problems is looked on with suspicion.

Making a LiDAR – Part 5

Unity Point Cloud Rendering

By: David
Principal Consultant, Data Exploration

12th April 2019

4 minute read

Home » Engineering

Unity Point Cloud Rendering

Now we’ve got our LIDAR finished, and our first scan completed, we are left with an SD card with some data on it. The data is a list of several million points (called a point cloud) represented in polar spherical coordinates. Each point represents a target distance from the centre of the LIDAR scan. In its own right, this isn’t very exciting, so we need to find a way to visualise the data. Quite a few people have contacted me to ask how I did this, so unlike the previous “philosophical” LIDAR blogs, this one will go into a little more technical detail. So, if you’re not interested in driving 3D rendering engines, then skip the text and go straight to the video!

I’ve chosen to use the Unity game engine, and this is a software tool targeted at creating 3D video games. It handles the maths and graphics of 3D rendering, it provides a user interface for configuring the 3D world, and it uses the C# programming language for the developer to add “game logic”. If you know Unity, this blog should give you enough information to render a point cloud.

An object in the Unity world is called a GameObject, and each game object represents a “thing” that we can see in the 3D world. We also need to create a camera, and this gives the user the view of the 3D world. It’s straight forward enough to write some C# code that moves and rotates the camera in accordance with mouse and keyboard input. If we fill the world with GameObjects, and we move the camera through the world, then Unity takes care of the rest.

A GameObject is made of a 3D mesh of points to define its shape. The mesh can be anything from a complicated shape like a person, to a simple geometrical shape like a sphere. The developer needs to define a Material which is rendered on the GameObject surface, and a Shader to determine how the Material surface responds to light.

The obvious way to render the LIDAR data is to create a sphere GameObject for each LIDAR data point. This produces wonderful 3D images, and as the user moves through the point cloud each element is rendered as a beautifully shaded sphere. Unfortunately, because each sphere translates into many points of a 3D Mesh, and because we have several million LIDAR data points, that’s a huge amount of work for the computer to get through. The end result is a very slow frame rate which isn’t suitable for real time. For video generation, I configured Unity to generate frames offline, but 1/24th of a second apart in game time. The result is a series of images that can be stitched together to make a fluid video sequence.

I thought it would be fun to view the LIDAR world through the Oculus Rift headset, but here we require very high frame rates so offline rendering isn’t going to work. Rather than plotting each LIDAR point as a GameObject, I used a series of LIDAR points (about 60k worth) to define a single Mesh to make one GameObject. The GameObject then takes the shape defined by the 60K set of scanned LIDAR points. The GameObject Mesh requires a custom Shader to render its surface as transparent, and each Mesh vertices as a flat 2D disk. This allows us to reduce the number of GameObjects by a factor of 60K with a massive drop in CPU workload. The total number of GameObjects is then the number of LIDAR data points divided by 60K. The downside is that we lose the shading on each LIDAR data point. From a distance that still looks great, but if the user moves close to a LIDAR point the image is not quite so good. The advantage is a frame rate fast enough for virtual reality.

As a final node, it is quite a surreal experience to scan an area, and then view it in virtual reality through the Oculus Rift headset. It is quite the shame that the reader can only see the 2D video renders. The best way I can describe it is analogues to stepping into the Matrix to visit Morpheus and Neo!

Now we’ve got our LIDAR finished, and our first scan completed, we are left with an SD card with some data on it. The data is a list of several million points (called a point cloud) represented in polar spherical coordinates. Each point represents a target distance from the centre of the LIDAR scan. In its own right, this isn’t very exciting, so we need to find a way to visualise the data. Quite a few people have contacted me to ask how I did this, so unlike the previous “philosophical” LIDAR blogs, this one will go into a little more technical detail. So, if you’re not interested in driving 3D rendering engines, then skip the text and go straight to the video!

I’ve chosen to use the Unity game engine, and this is a software tool targeted at creating 3D video games. It handles the maths and graphics of 3D rendering, it provides a user interface for configuring the 3D world, and it uses the C# programming language for the developer to add “game logic”. If you know Unity, this blog should give you enough information to render a point cloud.

An object in the Unity world is called a GameObject, and each game object represents a “thing” that we can see in the 3D world. We also need to create a camera, and this gives the user the view of the 3D world. It’s straight forward enough to write some C# code that moves and rotates the camera in accordance with mouse and keyboard input. If we fill the world with GameObjects, and we move the camera through the world, then Unity takes care of the rest.

A GameObject is made of a 3D mesh of points to define its shape. The mesh can be anything from a complicated shape like a person, to a simple geometrical shape like a sphere. The developer needs to define a Material which is rendered on the GameObject surface, and a Shader to determine how the Material surface responds to light.

The obvious way to render the LIDAR data is to create a sphere GameObject for each LIDAR data point. This produces wonderful 3D images, and as the user moves through the point cloud each element is rendered as a beautifully shaded sphere. Unfortunately, because each sphere translates into many points of a 3D Mesh, and because we have several million LIDAR data points, that’s a huge amount of work for the computer to get through. The end result is a very slow frame rate which isn’t suitable for real time. For video generation, I configured Unity to generate frames offline, but 1/24th of a second apart in game time. The result is a series of images that can be stitched together to make a fluid video sequence.

I thought it would be fun to view the LIDAR world through the Oculus Rift headset, but here we require very high frame rates so offline rendering isn’t going to work. Rather than plotting each LIDAR point as a GameObject, I used a series of LIDAR points (about 60k worth) to define a single Mesh to make one GameObject. The GameObject then takes the shape defined by the 60K set of scanned LIDAR points. The GameObject Mesh requires a custom Shader to render its surface as transparent, and each Mesh vertices as a flat 2D disk. This allows us to reduce the number of GameObjects by a factor of 60K with a massive drop in CPU workload. The total number of GameObjects is then the number of LIDAR data points divided by 60K. The downside is that we lose the shading on each LIDAR data point. From a distance that still looks great, but if the user moves close to a LIDAR point the image is not quite so good. The advantage is a frame rate fast enough for virtual reality.

As a final node, it is quite a surreal experience to scan an area, and then view it in virtual reality through the Oculus Rift headset. It is quite the shame that the reader can only see the 2D video renders. The best way I can describe it is analogues to stepping into the Matrix to visit Morpheus and Neo!

Making a LiDAR – Part 4

Electronics Prototyping, and getting a graduate job at Plextek

By: David
Principal Consultant, Data Exploration

11th April 2019

3 minute read

Home » Engineering

Electronics Prototyping, and getting a graduate job at Plextek

Since I first picked up a soldering iron I’d say there have been two significant changes in electronics; the parts have got smaller, and my eyesight has got worse. With the advent of surface mount, I did fear we were entering an educational dark age. It became beyond the scope of the hobbyist to create PCBs and solder the parts. Luckily, I think all that’s changed, and there has never been a better time for both commercial prototyping and hobbyist experimentation.

As I described in the previous blog, I’m very much a fan of the STM32 platform, and ST Microelectronics have produced some terrific prototyping boards. In fact, the same is true for every major player in the microcontroller market. All these boards have in common low cost and bring out fine pitch surface mount packages to user-friendly headers.

For around £10 I can visit RS components, and buy a very capable STM32 prototyping board with all of the microcontroller’s features our LIDAR will need. With the addition of a few breakout boards, we can test and prototype all the electronics for our LIDAR without ever having to touch a soldering iron or make a PCB.

We do still have one problem, and that’s because our initial prototype can end up a bit of a mess. All those prototype and breakout boards can leave a “rats nest” of wires, it’s fragile, and it’s probably too big. Luckily, rapid and low-cost PCB production has also come a long way. We’ll take advantage of this for our LIDAR electronics.

A quick visit to one of the far Eastern PCB prototyping houses shows I can get 10 copies of a small custom two-layer PCB for $5 plus shipping. Pushing to 4 layers and it’s only $49 plus shipping. I really have no idea how they make it commercially viable! If you’re concerned about quality and security, a European PCB house isn’t that much more expensive. Of course, you still have to design and solder the PCB, but with a copy of Eagle, a visit to YouTube, a low-cost USB microscope, and a rework gun, you’d be surprised how easy it is. Surface tension is your friend!

So what’s my message from this Blog? Well, over the years I’ve become more and more involved with graduate recruitment, and it’s often a long and frustrating process. I’ve become very impressed by the extent of knowledge and understanding our young potential recruits have, but they generally are not so confident about demonstrating these abilities. So, if you’re keen on a career in embedded electronics, then my challenge to you is to get yourself noticed. Buy yourself some prototyping boards, build some embedded projects, and look on the internet to find out how to do it. Bring them with you to your interview, and show us what you’ve done. I promise if you do that, you will stand head and shoulders above the crowd.

Since I first picked up a soldering iron I’d say there have been two significant changes in electronics; the parts have got smaller, and my eyesight has got worse. With the advent of surface mount, I did fear we were entering an educational dark age. It became beyond the scope of the hobbyist to create PCBs and solder the parts. Luckily, I think all that’s changed, and there has never been a better time for both commercial prototyping and hobbyist experimentation.

As I described in the previous blog, I’m very much a fan of the STM32 platform, and ST Microelectronics have produced some terrific prototyping boards. In fact, the same is true for every major player in the microcontroller market. All these boards have in common low cost and bring out fine pitch surface mount packages to user-friendly headers.

For around £10 I can visit RS components, and buy a very capable STM32 prototyping board with all of the microcontroller’s features our LIDAR will need. With the addition of a few breakout boards, we can test and prototype all the electronics for our LIDAR without ever having to touch a soldering iron or make a PCB.

We do still have one problem, and that’s because our initial prototype can end up a bit of a mess. All those prototype and breakout boards can leave a “rats nest” of wires, it’s fragile, and it’s probably too big. Luckily, rapid and low-cost PCB production has also come a long way. We’ll take advantage of this for our LIDAR electronics.

A quick visit to one of the far Eastern PCB prototyping houses shows I can get 10 copies of a small custom two-layer PCB for $5 plus shipping. Pushing to 4 layers and it’s only $49 plus shipping. I really have no idea how they make it commercially viable! If you’re concerned about quality and security, a European PCB house isn’t that much more expensive. Of course, you still have to design and solder the PCB, but with a copy of Eagle, a visit to YouTube, a low-cost USB microscope, and a rework gun, you’d be surprised how easy it is. Surface tension is your friend!

So what’s my message from this Blog? Well, over the years I’ve become more and more involved with graduate recruitment, and it’s often a long and frustrating process. I’ve become very impressed by the extent of knowledge and understanding our young potential recruits have, but they generally are not so confident about demonstrating these abilities. So, if you’re keen on a career in embedded electronics, then my challenge to you is to get yourself noticed. Buy yourself some prototyping boards, build some embedded projects, and look on the internet to find out how to do it. Bring them with you to your interview, and show us what you’ve done. I promise if you do that, you will stand head and shoulders above the crowd.

Making a LiDAR – Part 3

Embedded Software and Platform Choice

By: David
Principal Consultant, Data Exploration

10th April 2019

3 minute read

Home » Engineering

Embedded Software and Platform Choice

Do you remember as a child counting how long it took for thunder to arrive after the lightning flash, and then working out how far away the storm was? Well, a LIDAR uses the same principle but with light rather than sound. I think that’s amazing. Imagine switching a torch on, pointing it at the wall in front of you, and using a stopwatch to time how long it takes for the light to get reflected back to you. That seems ludicrous, but that’s exactly what our laser range finder is doing. (Did you know that one light Nanosecond is approximately one foot in length? So, I’m about 5.66 light Nanoseconds tall.)

Now, at the back of our laser range finder we have some wires that carry the measured distance data (I2C for the technically minded), so the first job of our software is to read the data, and just like a digital camera we need to write it back to an SD card. We also need to worry about controlling the scanning stepper motors. If you’ve no experience of stepper motor control, it’s quite straight forward; each time you generate a pulse the motor moves a tiny fraction. If you generate a continuous pulse train the motors spins. If you count the number of pulses you know how far the motor has moved. It’s all very straight forward, and just the sort of task a microcontroller was made far.

However, before we get started we need to pick a microcontroller, and this is where it can get contentious. Whatever you choose; somebody else will tell you that you should have done it their way instead. In my opinion, that’s frustrating, and they are usually wrong. I’ll defend that by saying only one thing matters. You need to pick a technical solution that’s within your capability to deliver to, and ideally exceed, the expectations of the people paying you. The great thing about engineering is that there will be many equally good ways of doing that, so you’re only wrong if your way isn’t one of them!

Personally, I’m not too keen on Arduino. It’s great for hobbyists and proof of concepts, but I do find its “simple educational” environment constraining. Likewise, the thought of days wading through thousands of pages of data sheets is equally unattractive. I want to write the embedded code to make the LIDAR work; I’m not interested in writing the code to make the microcontroller work. That’s why my own choice is the STM32 microcontroller family and the STM32CubeMx tool. It lets me “auto-generate” the framework to configure the microcontroller, I don’t have to read every minutia of detail in the datasheet, and it gives me a professional IDE development chain with full visibility of exactly what the hardware is doing if I should need it..

To sum up, with an STM32 I can get the job done, and I can meet all expectations. But importantly, if a BeagleBone running a Python interpreter lets you get the job done, and leads your customers to success, then don’t let anyone tell you that you’re wrong. Of course, don’t be closed to new ideas either. Learning and exploration are what makes life interesting!

Do you remember as a child counting how long it took for thunder to arrive after the lightning flash, and then working out how far away the storm was? Well, a LIDAR uses the same principle but with light rather than sound. I think that’s amazing. Imagine switching a torch on, pointing it at the wall in front of you, and using a stopwatch to time how long it takes for the light to get reflected back to you. That seems ludicrous, but that’s exactly what our laser range finder is doing. (Did you know that one light Nanosecond is approximately one foot in length? So, I’m about 5.66 light Nanoseconds tall.)

Now, at the back of our laser range finder we have some wires that carry the measured distance data (I2C for the technically minded), so the first job of our software is to read the data, and just like a digital camera we need to write it back to an SD card. We also need to worry about controlling the scanning stepper motors. If you’ve no experience of stepper motor control, it’s quite straight forward; each time you generate a pulse the motor moves a tiny fraction. If you generate a continuous pulse train the motors spins. If you count the number of pulses you know how far the motor has moved. It’s all very straight forward, and just the sort of task a microcontroller was made far.

However, before we get started we need to pick a microcontroller, and this is where it can get contentious. Whatever you choose; somebody else will tell you that you should have done it their way instead. In my opinion, that’s frustrating, and they are usually wrong. I’ll defend that by saying only one thing matters. You need to pick a technical solution that’s within your capability to deliver to, and ideally exceed, the expectations of the people paying you. The great thing about engineering is that there will be many equally good ways of doing that, so you’re only wrong if your way isn’t one of them!

Personally, I’m not too keen on Arduino. It’s great for hobbyists and proof of concepts, but I do find its “simple educational” environment constraining. Likewise, the thought of days wading through thousands of pages of data sheets is equally unattractive. I want to write the embedded code to make the LIDAR work; I’m not interested in writing the code to make the microcontroller work. That’s why my own choice is the STM32 microcontroller family and the STM32CubeMx tool. It lets me “auto-generate” the framework to configure the microcontroller, I don’t have to read every minutia of detail in the datasheet, and it gives me a professional IDE development chain with full visibility of exactly what the hardware is doing if I should need it..
To sum up, with an STM32 I can get the job done, and I can meet all expectations. But importantly, if a BeagleBone running a Python interpreter lets you get the job done, and leads your customers to success, then don’t let anyone tell you that you’re wrong. Of course, don’t be closed to new ideas either. Learning and exploration are what makes life interesting!