20th-Nov-23, 01:22 PM
The experimental lane changers are proving a lot of fun. I now have all four sensors functioning correctly (two per lane - let’s call them SensorA and SensorB). Also I have live serial comms running from the ATtiny3224 via an opto-isolator onto my PC for analysis of vehicles transiting XLC lane changers.
The initial algorithm will use my ‘so called’ A-B-C-D-E-F approach. The letters correspond to:
A = read SensorA
B = read SensorB
C = Calculations
D = Decision time i.e. the point in time when the flipper is to be actuated
E = Entry time - i.e. entering the collision zone
F = Finish time - i.e. exiting the collision zone
So the approach here is that when the vehicle transits SensorA the onboard 24bit clock records the time to 4microsecond accuracy. The same happens at SensorB. LC button status is also determined.
Calculations are then carried out to determine three future points in time, first the latest time for actuating the lane change flipper, second the time when this vehicle enters the zone where collisions may occur and finally the time when the vehicle finishes travelling through this zone. Vehicle speed will also be calculated.
When vehicles are travelling in both lanes the decision on whether to allow a vehicle to change lanes will be determined by whether one car can exit the collision zone before the other car enters the same collision zone. It all comes down to comparing the above calculated time values for the two cars.
That’s the (simple) theory… next to put it to the test. And the serial link will display all the above calculations.
So a nice little project!
c
The initial algorithm will use my ‘so called’ A-B-C-D-E-F approach. The letters correspond to:
A = read SensorA
B = read SensorB
C = Calculations
D = Decision time i.e. the point in time when the flipper is to be actuated
E = Entry time - i.e. entering the collision zone
F = Finish time - i.e. exiting the collision zone
So the approach here is that when the vehicle transits SensorA the onboard 24bit clock records the time to 4microsecond accuracy. The same happens at SensorB. LC button status is also determined.
Calculations are then carried out to determine three future points in time, first the latest time for actuating the lane change flipper, second the time when this vehicle enters the zone where collisions may occur and finally the time when the vehicle finishes travelling through this zone. Vehicle speed will also be calculated.
When vehicles are travelling in both lanes the decision on whether to allow a vehicle to change lanes will be determined by whether one car can exit the collision zone before the other car enters the same collision zone. It all comes down to comparing the above calculated time values for the two cars.
That’s the (simple) theory… next to put it to the test. And the serial link will display all the above calculations.
So a nice little project!
c

![[+]](https://slotracer.online/community/images/bootbb/collapse_collapsed.png)