rsmp-nordic / rsmp_sxl_traffic_lights

RSMP Signal Exchange List (SXL) for Traffic Controllers
MIT License
12 stars 4 forks source link

ability to read values of loops #76

Open emiltin opened 4 years ago

emiltin commented 4 years ago

Ability to subscribe to actual value of a detector. Perhaps also get min/max value within the last period. Ability to read values would make it easier to adjust the trigger level.

otterdahl commented 4 years ago

We can make a suggestion of how this status can be designed, but we to sync this with the suppliers.

otterdahl commented 4 years ago

I'm unsure how to design this status in a good way. I suppose the following is needed:

The current value can be requested (StatusRequest) but not subscribed to with update on change (because it will change all the time)

Max and min value can be subscribed to with a given interval, but not be requested or subscribed with update on change - since it is not clear which period it refers to.

ObjectType Status Description Name Type Value Comment
Traffic Controller S00XX Current value of detector value real [value]
ObjectType Status Description Name Type Value Comment Name Type Value Comment
Traffic Controller S00XX Max/min value of detector max real [value] Max value of detector since last period min real [value] Min value of detector since last period
emiltin commented 4 years ago

Is is a problem to allow rate=0? If it really changes all the time, then maybe you want to get updates all the time. If you don't want that, use rate=1, rate=60 or some other interval.

Regarding min and max, conceptually it culd make sense to not allow rate=0, since you need sme time interval to aggregate across. But it reality, even when rate=0, updates will be send with (possibly irregular) interval. Min and max could then simply be the min and max value seen since last update was send.

Can value and mix/max be combined into a single StatusUpdate?

emiltin commented 4 years ago

It's a bit unclear what we really want here

emiltin commented 4 years ago

If the controller keeps track of when a car/bicycle is detected, and this is based on where tops in the input value are, then maybe we could subscribe to these tops. Ie. get a list of tops since last status update, with the level of each top. This could then be logged and used for checking if the detector sensitivity is set correcty.

emiltin commented 4 years ago

Range should be defined eg. frm 0-255. Integers are enough. 255 should be the maximum value the sensor can output.

emiltin commented 4 years ago

Looking at equipment, there's a few ways to look at the current loop values:

But we need input from suppliers

emiltin commented 4 years ago

If the controller keeps track of when a car/bicycle is detected, and this is based on where tops in the input value are, then maybe we could subscribe to these tops. Ie. get a list of tops since last status update, with the level of each top. This could then be logged and used for checking if the detector sensitivity is set correcty.

Can we find a clear definition of what "tops" are that works across suppliers? Keeping in mind that it's not simply a treshold, since for adjusting loops we also want to see tops below the treshold

emiltin commented 4 years ago

max value since last update?

rafaelcf2 commented 4 years ago

Some TLCs can provide other kind of information like Frequency, flux or indutance like below

Dynniq TLC (very user-friendly interface) Loop Detector Freq [kHz] Ind [uH] Signal Sens [dL] Hold [min] PH Reset
1-1-1 D1_A1 56 155 0 50 90 0 #
1-1-2 D2_A1 62 124 0 50 90 0 #
1-1-3 D3_A1 47 223 0 50 90 0 #
1-1-4 D4_A1 56 150 0 10 90 0 #

We need also to address the detector to the signal group like D1_A1 or D1_G01

Other way to read the values is just specify a message like:

timestamp, frequency rate in hz, data stream in hex 8 or 16bit with 10 to 2000 interpolated values

/Rafael

SwarcoPalm commented 4 years ago

The configuration parts sound fairly useful to me (like which group does it belong to, what is the sensitivity, maybe the hold or balancing timer). I'm not sure about frequency and inductance? What would you do with these values? Are they of any real use?

rafaelcf2 commented 4 years ago

Only if the loop detectors are in bad shape, very high impedance or very low inductance are sideefects of a bad loop

emiltin commented 3 weeks ago

The simplest starting point might be to work just with a "value", and to send just the min and max, rather than the full data set.