Traffic light dynamic adjustment system based on CAN bus

Publisher:Serendipity99Latest update time:2012-04-12 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In the domestic traffic light control system, the switching time of traffic lights is widely fixed or time intervals that vary in different time periods, or the time interval is adjusted by the traffic control center according to the traffic conditions. It cannot be dynamically switched according to the actual traffic conditions, nor can it intervene in advance according to the road conditions to prevent traffic deterioration. In extreme cases, the red light in the direction with cars may be prohibited, and the green light in the direction without cars may be allowed. This method is inefficient and heavily dependent on the work efficiency of the traffic control department. In general, it can only intervene after the traffic deteriorates, and cannot be prevented in advance. For this reason, this paper proposes a traffic light dynamic adjustment system based on CAN bus , which can adjust the traffic light time in real time according to the actual traffic conditions, reduce the probability of road congestion, and ensure smooth traffic.

1 Overall design scheme
The overall design scheme is shown in Figure 1. Figure 1 (a) is the traffic light controller for each intersection, where the dotted line between the ring coil and the traffic light represents the linkage relationship between the two. Figure 1 (b) is a system block diagram. The traffic light controller at each intersection is connected to the control center via the CAN bus. Generally, four ring coil vehicle detectors are installed in four directions of the intersection. When a vehicle passes through the ring coil vehicle detector, a high-level signal is generated, which is fed to the controller. The controller counts and processes the information, and controls the time of traffic light switching in real time to adjust the road to the best traffic state; at the same time, the controller transmits the calculated relevant data to the control center and relevant departments through the CAN bus. The control center can announce it to the public according to the specific situation, and can also send instructions to the controller for remote manual intervention. The system has the advantages of high real-time, objective and accurate, and can also reduce the labor intensity of the traffic management department.

Overall design plan www.elecfans.com

2 Hardware Design of Traffic Light Dynamic Adjustment System Based on CAN Bus
The system hardware consists of a toroidal coil vehicle detector, a controller and a CAN transceiver module. Among them, the toroidal coil vehicle detector can use the products that have been buried in some sections of the domestic road, which can reduce the capital investment.
2.1 Controller Design
The controller uses ST's STR710 as the central processing unit. STR710 has 14 external interrupt inputs, 256 KB program FLASH memory, 64 KB internal RAM, and 5 timers. It is more suitable for processing occasions where there are multiple external interrupt sources to be processed. The controller circuit block diagram is shown in Figure 3. P2.5 is connected to the DI end of MAX485 through an optocoupler to control the conversion of the traffic light; P2.4 is connected to the DE end of MAX485 through an optocoupler to enable the MAX485 sending function.

CAN transceiver modulewww.elecfans.com


2.2 Design of CAN transceiver module
The CAN transceiver module consists of CAN bus transceiver SN65VD230D and DB9, as shown in Figure 3.
In Figure 3, R4 is the terminal resistor; R1 and R2 are pull-up resistors; and R3 is the pull-down resistor.

3 Software design of road condition information collection system based on ring coil
3.1 Algorithm principle
Let t0 be the starting time, and the detector detects the vehicle flow Q(Si) and road occupancy C(Si) in time period Si with time T as the cycle. Where: Where: tHold(Si) is the time that the vehicle is on the coil in one cycle. Define the relative increment of flow and the relative increment of occupancy . In actual use, as shown in Figure 4, detectors are installed on the upstream A and downstream B of the road at the same time. Define the absolute difference of the average occupancy of the upstream and downstream , and the relative difference of the average occupancy of the upstream and downstream . The necessary condition for traffic congestion to occur on the section between the upstream and downstream detectors is: (1) If the relative increment of flow detected by the upstream detector A is less than the relative increment of occupancy, it is considered that the downstream section may be congested in this cycle or the next few cycles. (2) Based on condition (1), when the absolute difference between the average vehicle occupancy rates of the upstream and downstream detectors is greater than a certain threshold α, and the relative difference between the average vehicle occupancy rates of the upstream and downstream detectors is greater than a certain threshold β, it is determined that a traffic congestion event has occurred. Where: α, β are related to the actual design capacity of the road. (3) If the absolute difference between the average vehicle occupancy rates of the upstream and downstream detectors is less than or equal to a certain threshold α, and the relative difference between the average vehicle occupancy rates of the upstream and downstream detectors is greater than a certain threshold β, it is determined that the traffic congestion is in the process of dissipating.






3.2 Controller software design
The controller software consists of the main program, interrupt processing, data upload, congestion determination, command processing and traffic light control modules.
3.2.1 Main program
The main program cyclically calls the command processing, traffic status determination and traffic light control modules according to the status returned by the interrupt program, and calls the data upload module at regular intervals. The flow chart is shown in Figure 5.


3.2.2 Traffic status determination
The method of traffic status determination has been explained in the algorithm principle of Section 3.1, so it will not be repeated here. In this module, if the system finds that the number of cars passing through different directions in a unit time is quite different or there is a possibility of congestion in the downstream, the traffic light interval will be automatically modified and called by the traffic light control module.
3.2.3 Interrupt processing
The system sets the four external interrupts of STR710 connected to the ring coil oscillator as FIQ to reduce the interrupt response time. When the vehicle passes, the interrupt subroutine counts and then exits. The main calculation is completed in the congestion determination to improve the system response speed. The system receives the command from the control center in interrupt mode. When receiving the command, it only transfers the command and exits. Further processing is performed by the command processing program. Since the CAN controller of STR710 only has AMR and no ACR, STR710 needs to determine whether it is sent to itself according to the ID after receiving the data. Only when the AMR and ID are the same, it starts to receive the command.
3.2.4 Data upload
The program first packages the data into CAN frame format, then writes it into the buffer, and the hardware automatically sends it out.
3.2.5 Command processing
The system refreshes the time interval buffer according to the mark set by the interrupt handler. The traffic light control module performs the adjustment.
3.2.6 Traffic light control
The block diagram of the traffic light control module is shown in Figure 6. This module adjusts the traffic light interval according to the mark made by command processing or congestion determination.

4 Conclusion
According to the characteristics of traffic congestion and dissipation processes, an algorithm for automatically determining road traffic conditions using microcomputer technology is given, and an attempt is made to control the change cycle of traffic lights in real time on this basis, so as to improve traffic conditions without manual intervention. At the same time, the road condition information is sent to the control center through the CAN bus, and the control center can perform remote manual intervention under special circumstances. The system is efficient, real-time, and objective, and is simple and easy to implement, with good application prospects.

Reference address:Traffic light dynamic adjustment system based on CAN bus

Previous article:HDMI interface technology composed of IP4776CZ38
Next article:Design of PCIE bus expansion card based on FPGA

Latest Analog Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号