Simulating Air Traffic With Azure
We as travelers rely on air traffic to conduct all sorts of engagement, business, and ties with family. Pre-Pandemic, millions of passengers were flown all over the world, and numbers were predicted to have linear growth. By a mile, air travel throughout history has been a major success, but with all advances, there are always obstacles.
As the number of commuters tend to increase every year, airports and docks are no longer sufficient to operate smoothly. Congestion can also be caused by airline policies, specific airport layouts, and most of all, delays. The problem with reviving congestion is the lack of simple solutions.
Airline marketing policies directly contribute to the problem of air travel demand and exceeding supply. As a result, the number of aircraft scheduled to depart and arrive can overwhelm the operation systems.
Air Traffic Flow Management (ATFM) has the responsibility of foreseeing the overload of traffic in order to limit delays, avoiding congestion in the air. With ATFM, the air space is arranged in sectors in which air nodes and ground nodes (airports) are attached by routes. Each node has a varying capacity equal to the maximum number of aircrafts that can pass through in a certain time. When the traffic schedule exceeds the node’s capacity, congestion is detected on the node. Each sector is managed by a controller that has to avoid and solve potential congestions.
Research has produced optimization models for adjusting traffic flow, but right now, simulations are our best case since flight traffic isn’t as high due to the pandemic.
The solution: An Air-Traffic Control (ATC) app that shows simulated aircraft flying through an ATC sector and sends out a warning when aircraft get too close to each other.
This project consisted of 4 major key sections, with operations within.
Sending MXCHIP accelerometer data to the Azure IoT hub
Deploying an Azure Function, transforming the data to the IoT Hub into “flight data”, and then connecting a UWP client app to the Event Hub to use the MXChip to simulate an airplane.
- Provision of the Azure Event Hub
- Deployment of the Azure Function
- Connecting the Client App to the Event Hub
Creating a pair of Event Hubs and deploying a Stream Analytics job that analyzes the air traffic. Also deploying a UWP app that shows the traffic.
- Creating 2 Event Hubs for input and output of the accelerometer data
- Creating a Stream Analytics job (connecting it to the Event Hubs)
- Prepare a query and test with sample data (for aircraft that are too close together; the query will analyze all aircraft that are within four miles of each other and then it’ll output a list every 2 seconds)
[A] shows the number of aircraft that are flying and indicates how many are “safe” and how many are “at risk”.
The Altitude panel [B] shows the altitude of the aircraft. (flight data)
The traffic map [C] shows where the aircraft are.
The status bar [D] provides controls for zooming out to show all active flights and shows the grid coordinates.
Modify the Azure Function that was deployed in step 2 and connect the client app to the Stream Analytics output.
- Connecting the Azure Function to the shared input hub
- Connecting the client app to the shared output hub
- Update the client app to communicate to the MXCHIP
I used IoT Hubs, Event Hubs, Azure Functions, Stream Analytics, and Cognitive Services as features to complete this project, and it was simply an amazing learning experience all throughout.
The MXCHIP has been extremely versatile in terms of Azure and data collection. Especially for this project, it's ideal for prototyping.
As accelerometer data from the device is transmitted to an Azure IoT Hub, an Azure Function transforms the raw accelerometer data into flight data; indicating the airspeed, altitude, latitude, longitude, pitch, and roll.
That data is sent to a pair of Event Hubs (private/shared). Through the Azure Portal, I was able to provision my event hub that will ultimately receive data from an Azure Function. The “private” Event Hub is then used by a client app that shows the position and altitude of your aircraft.
The events sent to the “shared” Event Hub go to a Stream Analytics job that analyzes fast-moving data for aircraft that are in danger of colliding, also providing that data to the client app and the ATC app.
The purpose of the Stream Analytics job was to examine all data being transmitted and identify aircraft that are too close together — specifically the type of service that air-traffic controllers provide.
SO when an aircraft came too close to another, it turns red on the screen, and a warning appears on the screen of the MXChip.
This project was really cool because I was able to control the aircraft by tilting the MXChip backward and forward to go up and down, and rotating it left and right to turn!
Overall, I ran into a bunch of problems throughout the process, but it was worth it. I learned a lot about IoT Hubs, Event Hubs, Azure Functions, Stream Analytics, and Cognitive Services all through the use of Azure. It was a great example of building end-to-end solutions with Azure’s Services and tools that support it.
If you enjoyed reading this article or learned something new, I’d love to connect with you on LinkedIn. Also, if you’d like to stay updated on what I’m up to, you can subscribe to my monthly newsletter here!