#18519 Incorrect positions during race

Closed Created by @jeroen - 9 comments

From @jeroen 17.02.2025, 00:02

I've only just run a race with the announcements on and I noticed there where announcements of changes in the lead position when there where no changes.

We did a test race of 10 laps with one car always in front and the other around 20-30 cm behind; as you can see in the Statistics here https://www.smartrace.de/en/results/?share_id=2048 something is not going quite right. 

We even had one race where the car in position number 2 was called as race winner, but didn't save that race so no statistics. 

@jeroen updated the description 17.02.2025, 00:22
@jeroen added the label iOS 17.02.2025, 00:22
#1 From @smartrace 17.02.2025, 09:04 Owner

@razamanaz - could you please take a look at my explanation if you have time and see if that makes sense from your experience with the ARC protocol?

@jeroen - I think I have witnessed this myself at a certain point during testing. I think the reason is how the ARC protocol works. Since the track delivers the timer information in a round robin fashion for all 6 cars all the time, it could happen that although car 1 crosses the line first, the timer information for car 2 is transmitted to the app first. There is a 300ms delay between each transmission, so it could happen like this:

  • Transmission for car 1
  • Car 1 crosses the line
  • Transmission for car 2
  • Transmission for car 3
  • Transmission for car 4
  • Transmission for car 5
  • Transmission for car 6
  • Transmission for car 1 (now the app would pick up on the last lap that was done by car 1 and then correct the positions accordingly)

Until the timer information is there, the app doesn't know that car 1 crossed the line before car 2.

I think this is a major flaw in how the protocol works.

Basically this means that the option "the race should end immediately when the leader completed their last lap" doesn't work with ARC. Am I right?

 

#2 From @jeroen 17.02.2025, 11:43

Seems like a logical explanation and a major flaw in the protocol indeed. For the race option I think you are right.

For the "real time" race information (and the ticker, graphics, Laps lead etc) the only solution would be to update this only once every 1800 ms correct? Otherwise you could end up with 2 cars leading at the same time. In my example the total laps lead is higher than the total number of laps, and in the positions graphic you can see this as well.

#3 From @razamanaz 17.02.2025, 16:54

@smartrace, I would say that your problem analysis is correct (and @jeroen that your problem description is correct). oXigen works the same way, the difference is that in that case the round-robin period is 300ms instead of 1800ms.

The 1800ms is there when using the Scalextric ARC PRO in digital mode, and that is there regardless of how many controllers are currently connected to the powerbase. For ARC AIR and ARC PRO in analog mode, the round-robin period is 600ms (as there are only two cars at most).

They could of course have designed it in another way, and instead send data directly when things happens. I guess they did it the way they did in case data would be lost; with this design it gets resent until the next lap. Well, it is what it is...

But with this design, all positions need to be revaluated every time a timestamp is received from any car.

The option (if its there) "the race should end when all cars has crossed the finish line" should still work, but you need to wait at least 1.8 seconds before declaring a winner, etc.

The option "the race should end immediately when the leader completed their last lap", would not work 100%, no.

#4 From @razamanaz 17.02.2025, 17:03

This will be the first version of SmartRace for the Scalextric ARCs, and I think it will be great, and you need to start somewhere.

Even if it maybe hasn't been so lately, at least previosly the "Scalextric community" has been very innovative to add gadgets to SSD. E.g, there have been several different custom sensor projects that let you add pit entry and pit exit functionality. The same sensors could also be used for the Start/Finish line to bypass the above functionality and get really quick response times. It's a bit like Cockpit XP having support for custom Carrera Digital sensors.

Of course, that takes away a little bit the beauty of installing SmartRace and be up & running in a few minutes. But I think the Scalextric hobbyists would accept it anyway.

We in the "Scalextric community" simply need to find someone that want to develop custom BLE SSD sensors. If there's a need for it, it will happen. And the first version of SmartRace for the Scalextric ARCs is a step towards creating that need.

#5 From @smartrace 24.02.2025, 16:51 Owner

This is causing a bigger headache than I first thought it would...

I don't think just waiting 1.8s for the whole thing to be finished is not an option, because the way it works right now this will still lead to other issues as well, such as tracking the wrong leader during a race (and declaring it through voice overs), which will be very irritating and cause a load of support requests.

I think updating the information for all cars at the same time once the whole round robin is finished is the only solution that will work, although its terribly ugly and will make the whole thing look even more delayed as it does right now...

Do you guys have any other good idea how this could work? 

#6 From @smartrace 25.02.2025, 11:35 Owner

Beta-0.0.6 will change this to the second approach I mentioned in my last comment. This will be for races only, since in free practice and qualifying it doens't really matter when the laptime was done, but only how fast it fast.

As I said, I think this is the only way to really fix this. :-(

#7 From @jeroen 25.02.2025, 11:56

Yeah, I've been thinking about this but can't come up with any other solution.This way you will at least get reliable information and correct statistics of positions during the races. I think it is a smart idea to make a distinction between races and the other type of events, where you want laptimes communicated as "quickly" as possible. 

@smartrace closed this 25.02.2025, 12:17
#8 From @razamanaz 25.02.2025, 13:12

I would assume that waiting for a whole round-robin sequence to “complete”, i,e, waiting for data for the 6th car, won’t do the trick. E.g, if the data has been sent for car 1, then car 1 passes the S/F-line, then car 6 passes the S/F-line, then data for car 6 is sent, you would think that car 6 passed the S/F-line before car 1. I would assume that this is how it would work, but I haven’t tried it. 

With some limitations of course, a more sophisticated logic could solve the problem (but I would myself need to think of this in more detail). 

#9 From @smartrace 25.02.2025, 14:00 Owner

My change includes a lap times cache which the lap times from the round robin are pushed to until the round is complete. Only then is the timing screen being updated and all other things are triggered. Cache is deleted afterwards and refilled with the new data. This way no timing information gets lost and the app can correctly react to it. 

You need to be logged in to add a comment.