KEMBAR78
Comtek 151 - P1 | PDF | Traffic | Traffic Congestion
0% found this document useful (0 votes)
14 views21 pages

Comtek 151 - P1

Uploaded by

wbjerglund
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views21 pages

Comtek 151 - P1

Uploaded by

wbjerglund
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Project DRIVE

Project Report
ComTek 151

Aalborg University
Computer Engineering
Computer Engineering
http://www.aau.dk

Title: Abstract:
P1 - DRIVE
Kode:
Theme: https://github.com/DNIIBOY/DRIVE
Semester project Læsevejledning:
Der er primært fokuseret på problem-og-
Project Period: interessantanalysen og derfor skal dette
Fall semester 2024 læses. Kom gerne med nogle forslag/tanker
på hvad der kunne skrives mere til eller evt.
Project Group: ændres.
Comtek 151 3. spg:
1. Har i nogle andre kilder der måske kan
Participants:
hjælpe os lidt med at udfolde problemanal-
Casper Dahlin Holst (20194810)
yse? 2. Nu implementerer vi jo hardware
Daniel Nettelfield (20244091)
hvor brugeren for noget forvarsel (i form
Mads Gjellerod (20244092)
af LED) til at der kommer en bremsebølge.
Mathias Kollerup Sørensen (20244097)
Dette er et alternativ til integration direkte i
Rasmus Guldager (20245267)
en fartpilot. Kan i komme på andre forslag
Søren Markvard Christensen (20203469)
til en implementering? 3. Hvilke poten-
tielle risici eller udfordringer ser I ved imple-
Supervisor:
menteringen af advarselssystemet, og hvor-
Rasmus L. Olsen
dan kan vi bedst adressere dem i vores de-
Copies: 1 sign?

Page Numbers: 00

Date of Completion:
November 11, 2024
Table of Content

1 Introduction 4

2 Problem Analysis 5
2.1 Human Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Reasons why Traffic Congestion Occurs . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Reasons why mitigating congestion is important . . . . . . . . . . . . . . . . . . . . 6
2.4 Traffic flow theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.5 Environmental Impact of Congestion . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.6 Scope of project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.7 Stakeholder Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.7.1 Complicity and influence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.7.2 Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.8 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3 Requirement specifications 11
3.1 Cost-effectiveness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

4 Theory 12
4.1 Realistic Simulation of Cars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.1.1 Variables in Traffic Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.1.2 Selection of Algorithm to Imitate Human Conduct . . . . . . . . . . . . . . 12
4.1.3 Challenges in Simulation Accuracy . . . . . . . . . . . . . . . . . . . . . . . 12

5 Design 13

6 Implementation 14
6.1 Simulation Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2 Construction of Webserver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2.1 Real-time Data Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2.2 Valkey Data Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2.3 Websockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.3 Hardware Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.3.1 Design of Controller Prototype on Breadboard . . . . . . . . . . . . . . . . . 15
6.3.2 Embedded Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.3.3 Design of PCB in Altium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.4 Visualisation of Simulated Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.4.1 Godot Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.4.2 Interaction with the Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . 16

7 Discussion 17
7.1 Integration in Autonomous Vehicles . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7.2 Further Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

8 Conclusion

Bibliography

9 Appendix
Comtek 151

1 Introduction
In Denmark, the increasing number of cars on the road is leading to more frequent and pro-
longed traffic congestions on highways. This affects travel time and contributes to higher fuel
consumption, emissions, and general road inefficiency. Every weekday on the highways around
Copenhagen, drivers spend around 30.000 hours extra in the traffic, because of jams [1]. These
congestions are caused by various factors but the primary cause is dense traffic.

This problem is not only about lost time for citizens but also about the cause of considerable
delays to production pipelines. In 2017, Danish Industry reported 20 billion DKK of lost rev-
enue due to traffic congestion, every year.[2] There are many different possibilities for solutions
to accommodate this problem, but currently, no such software that focuses directly on solving
the problem of stop waves is implemented in modern vehicles.

This project will focus on researching the area of stop waves, why they appear seemingly
out of nothing, and how they can be avoided. In this manner, the project aims to come up
with a theoretical possible solution to reducing motorway queue times. This software will
hypothetically be applicable to modern vehicles to help reduce time spent in traffic.

4
Comtek 151

2 Problem Analysis
2.1 Human Component
Humans have a slower reaction time than modern computers, which can lead to different
unwanted situations in traffic. Inattentive drivers performing hard breaking because of insuffi-
cient distance to the car in front can result in both dangerous accidents and "stop waves". The
"stop wave" phenomenon, is a phenomenon where a traffic jam is caused by a single driver
slowing down drastically, and the following drivers being forced to slow down, to prevent a
collision. This traffic jam then propagates backward, like a wave. These stop waves can be
caused by just one driver over-braking and in tight traffic conditions congestion can cause a
bottleneck which can end up in thousands of lost man-hours. [1].

These jams can be set off in numerous situations. One of which is overtaking. When a car
overtakes another car but merges onto the lane too close to the car behind it, it can force the
vehicle behind to slow down fast, setting off a stop wave. Other causes are a sudden decrease in
visibility or changes in road conditions. This requires further headway between cars, resulting
in cars braking, possibly surprising the driver behind it [3].

2.2 Reasons why Traffic Congestion Occurs

Overcrowded Roads
Traffic congestion can arise in several ways. The first occurs when there are too many vehicles
on roads that are not designed to handle such volume, a problem that is particularly common
during rush hour.

Seeing as traffic congestion is mostly caused by an imbalance between the capacity of the road,
and the amount of vehicles on it, an effective solution is to increase the capacity of the road.
Though effective, this has considerable costs associated with it. As an example from a Danish
context, an overhaul of the road network around Aalborg on the E45 highway, and connected
roads that started in 2013 is slated to be finished in 2030, with a cost of 116 billion DKK (kilde).

Roadwork
Roadwork is another frequent cause of congestion. During construction, speed limits are typi-
cally reduced, and lanes are often closed, creating bottlenecks that disrupt the normal flow of
traffic.

5
Comtek 151

Accidents
A second cause is accidents, which often lead to congestion due to debris on the road, emer-
gency vehicles attending the scene, and the phenomenon known as "rubbernecking," where
drivers slow down to observe the accident. [kilde]

Poorly Designed Roads


Similarly, merging or lane-splitting areas can lead to congestion when drivers are unable to
merge efficiently or follow the intended flow, causing traffic to slow down or back up.

2.3 Reasons why mitigating congestion is important


Providing drivers with reliable travel times and minimal wasted time in traffic has several ad-
vantages. Firstly wasted time in traffic leads to higher usage of fuel and thus higher vehicle
emissions [4].

Secondly, reliable traffic is generally safer and lowers the number of accidents, or rather the
variability and thereby, the chance of accidents is reduced. Lastly, drivers put a high value
on reliably estimating travel time and mitigating congestion can also help prevent road rage
incidents which in turn provides an even safer driving experience and where traffic can be
optimized.
Various emergency services, such as police, fire departments, and ambulances, require the
highway to reach their destinations on time. Even by using the emergency lane, traffic jams can
cause unacceptable delays for these services, which can ultimately result in the loss of life.

2.4 Traffic flow theory


Within the field of traffic flow, there is no widely agreed consensus to model all the complex
behavior of traffic flow. In complexity, it is linked by some to fluid dynamics - although each
vehicle and driver present in traffic exhibit different characteristics, making it more similar to
cellular automata. It also differs from fluid, in that every driver has intention.

To accommodate the complex behavior of traffic flow, instead of trying to make a complicated
model imitating traffic, a mathematical simulation is a much better choice, since it is better at
including the randomness of drivers.

2.5 Environmental Impact of Congestion


According to the U.S. Department of Energy, vehicles are most fuel-efficient when driving
between 45 - 55 mph (72 - 88 km/h) [5]. Traffic congestion on motorways can cause frequent
stops and starts, leading vehicles to operate well below these optimal speeds. Ultimately this
will lead to excessive fuel consumption and higher emissions per Km.

6
Comtek 151

This issue directly relates to goal 9 of the United Nations Sustainability Goals (SDGs). This
goal with the title "Industry, Innovation and Infrastructure" focuses on, among many other
things, smart traffic technologies and innovative infrastructure to reduce both congestion and
pollution[6]. Implementing a technology to streamline traffic on motorways will certainly im-
prove travel reliability, but the question of how it will reduce fuel consumption is much more
complex.

This problem has been researched thoroughly by The Danish Road Directorate [7]. The study
researches how much CO2 /km cars emit compared to their speed and if congestion typically
leads to less or more pollution. The study shows that when cars drive at speeds below 60
km/h, common in congestion, emissions increase due to frequent braking and acceleration.
This phenomenon is visible in figure 2.1 where it is noticeable that when cars are driving below
20 km/h the standard deviation gets high because of the frequent stops and starts. Beyond 100
km/h, emissions rise again as fuel consumption increases with speed because of air resistance.

Figure 2.1: Data collected by the Danish Road Directorate showing the correlation between speed and CO2 emission
per kilometer driven [7]

In conclusion, reducing traffic congestion is a complex issue when it comes to minimizing


pollution. While improving traffic flow could potentially reduce emissions by avoiding the
frequent braking and acceleration seen at low speeds, it can also lead to higher speeds where
CO2 emissions rise again, as shown in the figure.

2.6 Scope of project


Phantom waves are complex and are caused by many factors. Simulating multiple vehicle types
along with multiple lanes adds further complexity. Therefore, this project will focus on straight
single-lane behavior using standard vehicle types, without turns, intersections, on-ramps, off-
ramps, or unusual road conditions.

7
Comtek 151

2.7 Stakeholder Analysis

Stakeholders
This problem affects many stakeholders, the biggest of these stakeholders, along with their
reason for relevance and their expected level of interest have been listed here:

Private Commuters
Reason for relevance: Private commuters make up a large portion of vehicles on crowded
roads. Those who drive during rush-hour are directly affected by congestion every day.
Expected level of interest: High interest, due to the volume of affected users.

Transportation businesses
Reason for relevance: Businesses who rely on being able to traverse the danish road networks
efficiently, are directly dependent on the efficiency of traffic.
Expected level of interest: High interest, due to the direct effect road efficiency has on their
business.

Danish Industry
Reason for relevance: Reported losses of up to 20 billion DKK per year, due to congestion.[2]
Expected level of interest: High interest, due to the massive loss in revenue.

The Danish Road Directorate


Reason for relevance: The Road Directorate is responsible for roads and traffic in Denmark.
Expected level of interest: High interest, as they are responsible for implementing solutions to
streamline infrastructure in Denmark.

The Danish Environment Agency


Reason for relevance: Vehicles driving in congested traffic can cause higher emissions.
Expected level of interest: Medium interest, since slight congestion as mentioned earlier actu-
ally can cause less emissions.

Emergency Services
Reason for relevance: Traffic congestion can delay emergency services, risking lives even when
using emergency lanes.
Expected level of interest: High interest, as congestion also causes more accidents.

8
Comtek 151

2.7.1 Complicity and influence


To decide which stakeholders are more important, they can be placed in a matrix, plotting
complicity and influence of each stakeholder. This matrix can be seen on figure 2.2.

Figure 2.2: Complicity and influence matrix

Transportation Businesses and Private Commuters are both very affected by highway traffic
congestion, but an individual trucking company or private commuter doesn’t have much in-
fluence on traffic as a whole. Danish Industry reported huge losses, due to congestion[2], but
can’t affect traffic across the danish highway system. Emergency Services aren’t quite as af-
fected by highway congestion, because they make other cars move aside, or use the emergency
lane. However, traffic accidents are more likely to happen when cars drive faster, which makes
emergency services both more and less complicit. The Danish Road Directorate has a lot of

9
Comtek 151

influence over the danish highways, but the directorate themselves aren’t directly affected by
congestion.

2.7.2 Priorities
Since private commuters constitute a large portion of road traffic, they are a key focus for im-
pact. However, their individual influence on overall traffic conditions is limited. Our solution,
based on vehicle-to-vehicle communication, can be implemented independently of additional
infrastructure, making it feasible and accessible for widespread use among commuters. There-
fore, the primary emphasis will be on stakeholders with higher complicity and systemic influ-
ence, as these groups are integral to achieving scalable and sustainable improvements in traffic
flow.

2.8 Problem statement


As described in the preceding analysis, traffic congestion costs society time and money. The
design will be validated through simulation.

How can the severity of spontaneous stop waves effectively


be limited with computer technologies?

10
Comtek 151

3 Requirement specifications
3.1 Cost-effectiveness
For the product to be able to make a difference, it should be relatively cost-effective. As an
extreme example, populating the entire danish road-network with self-driving vehicles could
potentially solve the issue. This would require widespread adoption of a very expensive tech-
nology. Not only is this not technologically feasible yet, it isn’t socially feasible.
For widespread adoption, a wide array of drivers should want to, and be able to, adopt the
technology. If they need to purchase an entirely new vehicle, there is little potential for effect
on a measurable scale.

3.2 Simulation

11
Comtek 151

4 Theory
4.1 Realistic Simulation of Cars

4.1.1 Variables in Traffic Simulation


4.1.2 Selection of Algorithm to Imitate Human Conduct
PID

IDM

4.1.3 Challenges in Simulation Accuracy

12
Comtek 151

5 Design

Figure 5.1: System Diagram

13
Comtek 151

6 Implementation
6.1 Simulation Server

6.2 Construction of Webserver

6.2.1 Real-time Data Handling


6.2.2 Valkey Data Store
6.2.3 Websockets
Dataformats

Output to Visualization

Bits 31-22 Bits 21-18 Bit 17 Bit 16 Bits 15-0


10-Bit Car ID (0-1023) 4-Bit Other Stuff HW2 Select HW1 Select 16-Bit Position (0-65535, dm)

• 10-Bit Car ID: Identifies each car with a unique ID ranging from 0 to 1023.

• 4-Bit Other Stuff: Reserved for other data or flags.

• HW2 Select and HW1 Select: Hardware selection bits.

• 16-Bit Position: Represents the car’s position on the road, measured in decimeters (dm),
with values ranging from 0 to 65535.

Output to Hardware

Bits 31-24 Bits 23-12 Bits 11-0


8-Bit Warning Data 12-Bit Recommended Speed (0-4095, dm/s) 12-Bit Current Speed (0-4095, dm/s)

• 8-Bit Warning Data: Provides warning signals, potentially for various alerts.

• 12-Bit Recommended Speed: Recommended speed in decimeters per second (dm/s),


with a range of 0 to 4095.

• 12-Bit Current Speed: Current speed of the car, also in dm/s, ranging from 0 to 4095.

14
Comtek 151

Bit 15 Bit 14 Bits 13-8 Bits 7-0


Increment Car ID Decrement Car ID 6-Bit Other Stuff 8-Bit Current Brake Pressure (0-255)

Input from Hardware

• Increment Car ID: Bit to control increment of the Car ID.

• Decrement Car ID: Bit to control decrement of the Car ID.

• 6-Bit Other Stuff: Reserved for additional data.

• 8-Bit Current Brake Pressure: Indicates current brake pressure, ranging from 0 to 255.

6.3 Hardware Design

6.3.1 Design of Controller Prototype on Breadboard

Figure 6.1: This picture shows testing of circuit on breadboard

Components

ESP-C3-DEVKIT-02 - ESP-IDF (ESP IoT Development Framework)

Testing and calibration

There are a lot of ways to test the code and debug the device and circuit. But the most used
thing in this project is the esp-idf monitor. Because the development board has a USB-TO-
UART bridge it can easily be used by connecting it to a pc. for debugging signals a usb logic
analyzer was used and the program salae-logic2 to view the signals and timings.

15
Comtek 151

6.3.2 Embedded Software


Esp-idf Framework

To program the ESP32-C3, we use the ESP-IDF (Espressif IoT Development Framework), a pow-
erful IoT framework based on a modified version of FreeRTOS, which is a real-time operating
system (RTOS) designed specifically for microcontrollers. The ESP-IDF framework provides an
extensive suite of tools, libraries, and APIs that enable efficient development for IoT applica-
tions on Espressif’s ESP32 series microcontrollers.
FreeRTOS, the underlying OS, supports multitasking, allowing multiple tasks to run concur-
rently, which is crucial for handling various IoT functionalities like managing sensors, process-
ing data, and handling network communication.

Rotarty Encoder Driver

The rotary encoder is used to select a specific car in the simulation. To read if the rotary encoder
is rotated either clockwise or opposite, to signals are directed from the devise into two digital
pins in the Esp. The two signals are CLK and DT

Figure 6.2: Binary representation of the values when rotating the encoder clockwise and counter clockwise.
From: https://howtomechatronics.com/tutorials/arduino/rotary-encoder-works-use-arduino/

Pressure Sensor

6.3.3 Design of PCB in Altium


Schematics

PCB layout

Manufactur of pcb

6.4 Visualisation of Simulated Data

6.4.1 Godot Engine


6.4.2 Interaction with the Simulation

16
Comtek 151

7 Discussion
7.1 Integration in Autonomous Vehicles

7.2 Further Development

17
Comtek 151

8 Conclusion
Comtek 151

Bibliography
[1] Selv en kort opbremsning kan give lange køer på motorvejen. DR. Dec. 13, 2017. url: https:
//www.dr.dk/nyheder/penge/selv-en-kort-opbremsning-kan-give-lange-koeer-paa-
motorvejen (visited on 10/24/2024).
[2] Niels Petersen. Vi spilder 20 mia. kr. på trafikforsinkelser - DI. Dansk Industri. Nov. 30, 2017.
url: https : / / www . danskindustri . dk / di - business / arkiv / nyheder / 2017 / 12 / vi -
spilder-20-mia.-kr.-pa-trafikforsinkelser (visited on 10/24/2024).
[3] Yichuan Peng et al. “Analysis of the Impact of Fog-Related Reduced Visibility on Traffic
Parameters”. In: Journal of Transportation Engineering, Part A: Systems 144 (Feb. 1, 2018),
p. 04017077. doi: 10.1061/JTEPBS.0000094.
[4] Traffic Congestion and Reliability: Trends and Advanced Strategies for Congestion Mitigation:
Chapter 2. url: https://ops.fhwa.dot.gov/congestion_report/chapter2.htm (visited
on 10/28/2024).
[5] Alternative Fuels Data Center: Maps and Data - Fuel Economy at Various Driving Speeds. url:
https://afdc.energy.gov/data/10312 (visited on 11/07/2024).
[6] THE 17 GOALS | Sustainable Development. url: https://sdgs.un.org/goals (visited on
11/08/2024).
[7] Thomas A. Sick Nielsen. Betydningen af trængsel for CO2-udledningen. Opgørelse for hele
motorvejstrafik- ken baseret på trængselsopgørelsen. Jan. 24, 2022. url: https://www.ft.dk/
samling/20211/almdel/TRU/bilag/228/2553032.pdf (visited on 10/24/2024).
Comtek 151

9 Appendix

You might also like