Here are my thoughts based on what I have seen in real life.
But one thing I have seen in real life that we don't have here is: traffic lights at adjacent intersections working together.
In general there are 4 states that the intersection can be in, and we can cycle through them in order.
The states are:
A) vertical (top to bottom or bottom to top) traffic, including pedestrian traffic
B) left turn from horizontal to vertical (also allows horizontal U-turns)
C) horizontal traffic, including pedestrian traffic
D) left turn from vertical to horizontal (also allows vertical U-turns)
There are also intermediate states if we want to get more complicated. In state B we are allowing two left turns: left-to-up and right-to-down. We might decide to stop the left-to-up traffic (in order to allow right-to-left traffic) but keep the right-to-down traffic going. So this is a state between B and C.
How long to stay in each state? We need all of these criteria to be met in order to be done with the state:
We can leave state A when all the cars have gone through, and X seconds have passed*, and the pedestrian time has passed (only applies if a pedestrian pressed the button)
We can leave state B when all the cars have gone through
We can leave state C when all the cars have gone through, and Y seconds have passed*, and the pedestrian time has passed (only applies if a pedestrian pressed the button)
We can leave state D when all the cars have gone through
*Example X and Y calculations:
X = 60 seconds during rush hour, 20 seconds otherwise
Y = 10 seconds
We could also put a time limit on each state.
In my drawing I show the 4 states. Black = the main flow. Blue = right turn traffic that is always allowed. Brown lines = pedestrian traffic.
https://github.com/Skullbash27/trafficemgmt/tree/master/Traffic%20Management