ElektronikaBa dualCH Configurator
ElektronikaBa dualCH Configurator
PC Configurator Software
https://github.com/elektronika-ba/dual-loop-detector-configurator
This software is open source. You can download source code at:
https://github.com/elektronika-ba/dual-loop-detector-configurator
www.elektronika.ba
1 doc ver – 2017-08-17
Contents
Introduction............................................................................................................................................. 3
Initiating the communication .............................................................................................................. 3
Get config packet............................................................................................................................. 3
Set config packet ............................................................................................................................. 4
Toggle event logging mode ............................................................................................................. 4
Read errors (if any) from device ...................................................................................................... 6
Get current frequencies of both loops ............................................................................................ 7
Toggle real-time frequency reporting mode ................................................................................... 7
Read current operating mode of device ......................................................................................... 7
Restore factory settings in device ................................................................................................... 8
Read hardware DIPs as read at start-up (power-up) ...................................................................... 8
Soft-reset the device and return to communication mode ............................................................ 8
Soft-reset the device and return to running mode ......................................................................... 8
Exit communication mode and return to running mode ................................................................ 8
Format of config packet ...................................................................................................................... 9
Event logging and real-time signal reporting .................................................................................... 11
Using the configurator software ........................................................................................................... 12
Connecting to device ......................................................................................................................... 12
Menu bar ........................................................................................................................................... 12
Status bar........................................................................................................................................... 13
Parameters (sections)........................................................................................................................ 13
Operating mode ............................................................................................................................ 14
Sampling speed ............................................................................................................................. 15
Sensitivity levels ............................................................................................................................ 16
Filtering levels................................................................................................................................ 17
Relay pulse durations .................................................................................................................... 18
Permanent presence cancellation ................................................................................................. 19
Detect stop .................................................................................................................................... 20
Drift compensation during detection ............................................................................................ 21
Speed trap ..................................................................................................................................... 22
Event viewer .................................................................................................................................. 23
Real-time frequency reporting ...................................................................................................... 24
www.elektronika.ba
2 doc ver – 2017-08-17
Introduction
This software is used to configure and fine-tune the Dual Channel Inductive Loop Vehicle Detector.
Communication with the device is done via UART at 4 possible speeds 8N1, no flow control. Baud
rate speeds that device support are: 9600, 19200, 57600 and 115200 (default).
READY>v1
END>
In case device does not receive another command within 25 seconds, it will automatically return to
“running mode”.
Notes: Each command that device sends is terminated with: “END>” following carriage return and
line feed characters (0x0D and 0x0A respectively). Master device must not terminate their own
commands with carriage return and line feed characters!
GET>96
AA0808049D9D085050003C00320032002A00280022001E001A00140010000A000800
08000600040002003C00320032002A00280022001E001A00140010000A0008000800
0600040002C802040001004308050A14C80219C819C8639C00C83200
END>
Note: Reply contains number of bytes that follow (96). Bytes are encoded as hexadecimal ASCII.
www.elektronika.ba
3 doc ver – 2017-08-17
Set config packet
In order to send new config packet to device, command “S” should be issued. The device will answer
with:
SET>96
END>
SET><
END>
Number 96 is the number of bytes that device now expects. Right after that, device will send “<”
which is a flow-control character. This means that device is ready to receive next byte (actually next
two hexadecimal ASCII characters). Device will keep sending this character after every byte it
receives until the last one.
ERR>
END>
After successful programming of new config packet, device will reply with:
OK>
END>
Note: Device needs to be reset (by issuing “X” or “Y” command, or by pressing the hardware reset
button) for new configuration packet to activate.
LOG>1
END>
or
LOG>0
END>
…depending on whether event logging has been enabled or disabled. When enabled, it is required to
exit the “communication mode” and return to “running mode” with command “Q” or by waiting for
internal communication timeout to happen, in order to start receiving events. When an event
happens, device will report it in format (example):
EVENT[1]>08
END>
Some events have an additional parameter after the event code and it is always separated by
comma:
www.elektronika.ba
4 doc ver – 2017-08-17
EVENT[0]>01,041.129
END>
Brackets “[ ]” identify which loop produced an event. Loop A will be marked as [0] and loop B with
[1]. For some “joined” events such as directional logic reporting, these brackets will have value “X”.
Example:
EVENT[X]>15
END>
List of all events that device can send is in the following table:
Parameter
format
Event Joined (where
Code event applicable) Description Example
01 No XXX.YYY Un-detect EVENT[1]>01,012.333
Parameter shows the strength of
detection in percentages in fixed format
000.000
02 No XXX.YYY Rollaway, did not stop EVENT[0]>02,022.236
Parameter shows the strength of
detection in percentages in fixed format
000.000
03 No XXX.YYY Un-detect, because of PPC EVENT[1]>03,052.236
Parameter shows the strength of
detection in percentages in fixed format
000.000
04 No XXXXX Movement while stopped EVENT[0]>04,00023
Parameter shows the strength of
movement while vehicle was stopped, in
same units as sensitivity. Parameter is in 5
digits fixed format.
05 No XXXXX Movement before stopped EVENT[1]>05,00009
Parameter shows the strength of
movement before vehicle has possibly
stopped, in same units as sensitivity.
Parameter is in 5 digits fixed format.
06 No XXX.YYY Repeated stop detected EVENT[0]>06,014.122
Parameter shows the strength of
detection in percentages in fixed format
000.000
07 No XXX.YYY Initial stop detected EVENT[0]>07,015.122
Parameter shows the strength of
detection in percentages in fixed format
000.000
08 No Detect EVENT[1]>08
(Detection strength cannot be calculated
at this stage)
09 No Movement detected after PPC event EVENT[0]>09
10 Yes XXX Speed measured EVENT[1]>10,080
www.elektronika.ba
5 doc ver – 2017-08-17
Parameter shows vehicle speed in km/h
or mile/h and is in fixed format 000.
Brackets “[ ]” identify which loop was first
triggered (direction).
Note: Unit of value can be known by
reading the device configuration packet.
11 Yes Cancelled A->B direction EVENT[X]>11
12 Yes Going back B->A direction EVENT[X]>12
13 Yes Passed B->A EVENT[X]>13
14 Yes Cancelled B->A direction EVENT[X]>14
15 Yes Going back A->B EVENT[X]>15
16 Yes Passed A->B EVENT[X]>16
17 No XXX Speed over defined limit EVENT[1]>17,031
Parameter shows vehicle excess speed
over set limit in km/h or mile/h and is in
fixed format 000.
Note: Unit of value can be known by
reading the device configuration packet.
18 No XXX Speed under or equal to limit EVENT[1]>18,005
Parameter shows vehicle speed under set
limit in km/h or mile/h and is in fixed
format 000.
Brackets “[ ]” identify which loop was first
triggered (direction).
Note: Unit of value can be known by
reading the device configuration packet.
Table 2 - Event list
Note: Percentage of signal strength is calculated as frequency change in same units of value as
sensitivity setting, over maximum possible sensitivity that can be set.
…where:
frequency_change is the change in oscillator frequency but in same units of value as sensitivity
setting;
maximum_possible_sensitivity = 1000.
ERROR[0]>0
ERROR[1]>2
END>
FREQ[0]>80.60352
FREQ[1]>75.98752
END>
ANA>1
END>
or
ANA>0
END>
…depending on whether frequency reporting has been enabled or disabled. When enabled, it is
required to exit the “communication mode” and return to “running mode” with command “Q” or by
waiting for internal communication timeout to happen, in order to start receiving signal frequency
information. Device will report frequency (for every active loop) on every 8 collected samples from
loop oscillator.
ANA[1]>50.2122,50.2122,50.2122,-48.3212,-48.3213,-48.3213,-48.3213,-48.3213
END>
ANA[1]>-48.3212,-48.3213,-48.3212,-48.3213,-48.3213,-48.3213,-48.3212,-48.3213,-48.3213
END>
ANA[1]>-48.3212,-48.3213,-48.3212,-48.3213,-48.3213,50.2122,50.2122,50.2122
END>
Note: Unit of value is kHz. Values are always in 0.0000 format. Negative value means that there is
currently no detection, and positive values mean that there is a detection present.
Important note: Using this feature is recommended only when UART baud rate is set to maximum
speed: 115200 bps. Slower UART speed will slow down device response!
MODE>1
END>
Parameter Mode
0 Single Channel (A)
www.elektronika.ba
7 doc ver – 2017-08-17
1 Dual Channel Independent (A) and (B)
2 Dual Channel Directional Logic (A + B)
3 Speed Trap (A + B)
Table 4 - Operating modes
FACTORY>OK
END>
DIP[0]>4F
DIP[1]>0C
END>
Values are encoded in hexadecimal ASCII. “[0]” marks DIP 1 (red) and “[1]” marks DIP 2 (blue).
RESET>
END>
RESUME>
END>
READY>v1
END>
At this moment, device is in the same state as it was before issuing the reset command.
RESET>
END>
RESUME>
END>
www.elektronika.ba
8 doc ver – 2017-08-17
QUIT>
END>
RESUME>
END>
AA080804C8C8085050003C00320032002A00280022001E001A00140010000A00080008000600040
002003C00320032002A00280022001E001A00140010000A00080008000600040002C803040001FF
0130050A14C80319641964753000C83200
Table 5 - Example of config packet
www.elektronika.ba
9 doc ver – 2017-08-17
refer to configuration of Sampling speed.
C8 Detect stop timer. This is the time that device must Around 1500
not detect more change than defined with Detect milliseconds
stop threshold. The detection of change is done by
second timer called Detect stop slow check timer.
Note: Unit of value is 1 sampling speed period.
03 Detect stop threshold. This is the value of change 03
that device must not detect within the Detect stop
timer time. It is in same units of value as sensitivity
parameters.
0400 Drift compensation during detection start timer. Around 1100 so that
This is part of the no-movement detector in which timer starts after
device detects that vehicle has completely stopped ~10 seconds.
over the loop so it can start compensating for
change.
Example: 0x0400 = 1024 sampling periods.
Note: Unit of value is 1 sampling speed period.
01 Drift compensation during detection threshold. Minimum and maximum
This is the value that must not change within Drift value recommended
compensation during detection start timer period. is 01
FF 01 30 Software defined DIPs. First byte: 00 or
• First byte: software DIPs enabled or disabled FF
• Second byte: DIP 1 value
• Third byte: DIP 2 value
Note: First byte determines whether software DIPs
are used. Value 00 here disables software DIPs and
enables hardware DIPs, and value FF enables
software DIPs and disables hardware DIPs.
05 0A 14 Permanent presence canceller (PPC) timers. 01-FF
• First byte: PPC level 1 (short)
• Second byte: PPC level 2 (medium)
• Third byte: PPC level 3 (long)
Note: Unit of value is 1 minute. Example: 05 equals
to 5 minutes.
C8 03 Detection of loop activity absence. This is required First byte: around
for PPC option in order to start recalibration 2 seconds
process once previously stopped vehicle leaves.
• First byte: time of no-activity Second byte: around
3
• Second byte: threshold of no-activity
These two parameters have the same meaning as
in Detect stop option (timer and threshold).
Note: Unit of value for first byte is 1 sampling
speed period. Unit of value for second byte is same
as in sensitivity setting.
1964 1964 Relay pulse durations for relay A and relay B.
• First byte: normal pulse duration
• Second byte: extended pulse duration
Note: Unit of measure is 10ms. Example: 0x19 = 25
which equals to 250ms
7530 Signal sampling speed. Very important parameter 639C- C350
that should be kept in recommended value range.
Many device parameters depend on chosen
sampling speed value.
Example: 0x7530 = 30000.
Sampling speed = ((1/4000000)*30000)*1000 = 7.5
www.elektronika.ba
10 doc ver – 2017-08-17
ms
00C8 Distance between loop A and loop B. Used for
speed measurement.
Example: 0x00C8 = 200 cm
Note: Unit of value is 1 cm
32 Detect stop slow check timer is timer that device 32
uses to sample the signal in order to detect the
change.
Note: Unit of value is 10ms
00 Baud rate for UART communication. 00-03
0x00 = 115200 bps
0x01 = 57600 bps
0x02 = 19200 bps
0x03 = 9600 bps
Table 6 - Explanation of config packet fields
Note: The device does not perform validation of received config packet so in case invalid values are
programmed it is possible to reset the device to factory values by using sensitivity-change buttons at
power-up or by using command “W” in communication mode.
These options are explained in Toggle event logging mode and Toggle real-time frequency reporting
mode.
www.elektronika.ba
11 doc ver – 2017-08-17
Using the configurator software
Please connect your device to PC via provided USB<->UART(TTL) programming cable. This
configurator software requires Microsoft .NET 4.0 to be installed on PC.
Connecting to device
To connect to device, click “Connect/Disconnect” button or press F1 on keyboard. This will open
COM port where your device is connected. In case there is an error opening COM port, a popup will
appear where you can select your COM port. On this screen, you can also set the baud rate which
must match the one programmed in the device. If you cannot remember which baud rate your
device is set to, you can try communicating on every baud rate that device supports (9600, 19200,
57600, 115200).
This dialog can also be accessed from the menu bar, “File” -> “Connection settings”.
Menu bar
Menu bar contains list of functions required for setting up the connection, creating, opening and
saving profiles, connecting to device and performing programming.
Item “File” contains option to create blank profile with default values for the device, opening
previously saved profile and saving profile to a new file. By using profiles, it is easy to save settings to
file and transfer them to a different location in order to program other remote devices.
www.elektronika.ba
12 doc ver – 2017-08-17
Figure 4 - Item “Device” in menu bar
Item “Device” contains options for communication with the device, such as reading current
configuration, programming and restarting.
There is also an additional menu bar with shortcuts for most frequently used options.
Status bar
Status bar contains information about current connection status, current loop frequency (refresh on
click), current operating mode (as set by dropdown list in section “Operating mode”), and current
device state (“communication mode” or “running mode”).
Parameters (sections)
Device parameters are divided in sections which can be accessed by clicking on each item in the left-
hand list. Each section is separately described.
www.elektronika.ba
13 doc ver – 2017-08-17
Operating mode
In this section, it is possible to configure device operating mode by method called “software DIPs”.
This means that it is possible to override hardware DIPs on device and remotely re-configure its
operating mode and all parameters.
By selecting operating mode from the dropdown list, meanings of individual DIP switches are re-
adjusted accordingly. In order for device to accept software DIP settings, it is required to select the
checkbox next to dropdown list (“Use software DIPs”).
To read device’s hardware DIP settings, button “Read from device” can be clicked. It is important to
note that device’s hardware DIP settings are loaded only upon device reset. Changing hardware DIPs
during device operation is ignored.
www.elektronika.ba
14 doc ver – 2017-08-17
Sampling speed
Sampling speed is the most important parameter that can be configured. Sampling speed has an
effect on device sensitivity and response time. Response time has an effect on speed measurement
accuracy/error. Device has a fixed sampling speed across its operating frequency range therefore it is
possible to know how sensitive device actually is in Hz values at current operating frequency.
Response time is affected by sampling speed because device is “blind” during sampling. Only after
sampling has completed, it can perform calculations and decide whether metallic object has come
into range (or moved away).
Sampling speed is important parameter for speed measurement because, as previously stated,
device is “blind” during sampling and for speed measurement it is crucial to know exactly when
vehicle has arrived and left certain loop. For speed measurement, it is best to set device at lowest
possible sampling speed to have minimum error.
www.elektronika.ba
15 doc ver – 2017-08-17
Sensitivity levels
One “sensitivity value” corresponds to amount of frequency change as shown in the table in picture
above. This means that when device’s sensitivity threshold is set to value “4”, it will detect a metallic
object when frequency changes from (for example) 30,000 Hz to 29,996.6 Hz. Value of 29,996.6 Hz
corresponds to base frequency of 30,000 Hz minus the sensitivity value of 4 (which is 4*0.85 Hz at
30,000 Hz for sampling speed shown in the picture below). This yields sensitivity of 0.002834 % of
change in frequency.
Sensitivity can be adjusted for each sensitivity bank for each loop. Currently selected sensitivity bank
from the dropdown will be chosen as current device’s sensitivity for that channel upon device reset.
In order to achieve maximum device reliability of operation, it is not advisable to set “Detect
threshold” to less than “4 units of frequency change”. It is also advisable to set the “Undetect
threshold” at value less than “Detect threshold” by at least 15% - but this value can be experimented
with.
Note: It is important to set maximum sensitivity for bank 8 and least sensitivity for bank 1, because
ABS option will automatically switch to bank 8 when enabled and detection performed.
www.elektronika.ba
16 doc ver – 2017-08-17
Filtering levels
Filtering is very important parameter for device’s reliable operation. There are two filtering levels:
“Normal” and “Additional” filtering.
There are two timers with adjustable period of execution. When timer executes, internal baseline
frequency will be re-adjusted to currently measured frequency. This means that device will “track”
the baseline loop frequency and re-adjust it as device operates. This will prevent device from false-
triggering when ambient temperature slowly changes or loop slowly moves in ground. This re-
adjustment is called drift compensation. Drift is compensated while device is not in “detect state” as
well when it is in “detect state”. When device is in “detect state” there are special additional timers
and algorithms which are explained in Drift compensation during detection section. When baseline
frequency changes slowly, the device will compensate after the negative or positive timer executes,
depending on whether frequency change is negative or positive. Negative frequency change might
result in a detection therefore this timer is always a bit slower than positive drift timer.
Negative and positive drift timer values follow principle: lower timer value means better signal
filtering. Lower timer value also means that vehicle should move faster over the loop area because
we would not want the device to quickly compensate for vehicle movement. We only want it to
compensate for ambient frequency change which (hopefully) happens slowly.
Signal averaging is actually calculation of mean value of collected samples from the loop oscillator.
Value in this parameter can be selected from 1-8 where bigger value means more signal filtering but
a little bit slower response time.
Note: It is advisable to set better filtering values for “Additional filtering” dropdown item.
www.elektronika.ba
17 doc ver – 2017-08-17
Relay pulse durations
When relays are configured to “pulse mode” instead of “presence mode”, durations of these pulses
can be adjusted in this section for both relays individually.
www.elektronika.ba
18 doc ver – 2017-08-17
Permanent presence cancellation
Sometimes it is required for device to cancel-out current detection in case vehicle parks over loop (or
very close to it when sensitivity is set to maximum). The time after which device will cancel-out the
detection can be fine-tuned in this section. After the device cancels-out detection of parked vehicle,
it can now perform detections of other vehicles even though first vehicle has already occupied the
loop (only in cases when loop is laid out so that it is possible additional vehicle to occupy it).
In order for device to cancel-out current detection, it uses parameters described in Detect stop
section. Vehicle must be completely stopped over loop and only then the PPC timer starts the
countdown. Each passing vehicle will reset this timer.
When originally cancelled-out vehicle leaves the loop, the device will recalibrate once again in order
to start detecting new vehicles. For this to happen, there must be no passing vehicles over the loop
for a short period of time. This time is set with “Detect leave parameters” in the same section as
shown in the image bellow. This time is usually 1-2 seconds, and threshold is usually set to “3”.
Threshold has the same unit of value as sensitivity unit.
Note: As level of PPC can be selected from DIP switches, it is advisable to set shortest duration to first
slider and maximum time to last slider.
www.elektronika.ba
19 doc ver – 2017-08-17
Detect stop
Stopped vehicle is a vehicle that did not produce the change in frequency of set threshold in some
amount of time.
There parameters can be fine-tuned, but it is usually enough to have threshold set to “3” and timer
to 1.5 seconds.
The “Slow check” timer should not be less than 0.5 s and it is used to slow down the calculations in
order to better detect the change. This parameter can be experimented with, or left to default value.
www.elektronika.ba
20 doc ver – 2017-08-17
Drift compensation during detection
As mentioned earlier in section Filtering levels, drift compensation is done also when vehicle is
present over the loop. In order to start the tracking of baseline frequency during detection it is
crucial to do this when vehicle has completely stopped over the loop to prevent compensation of
vehicle movement. Parameters for detecting when vehicle has stopped over the loop should be
separated from “Detect stop” parameters and threshold should be kept to a minimum, usually “2”
with timer kept to larger value, usually 6 seconds.
Drift compensation during detection will start when device does not sense change of set threshold
within set timer period. If device senses the change in frequency larger than set threshold, it will
pause the drift compensation and restart it again after it detects that vehicle is not moving again.
www.elektronika.ba
21 doc ver – 2017-08-17
Speed trap
Device can perform speed measurement when vehicle crosses from one loop to another. As stated
earlier, the calculation error is smallest when sampling speed is the fastest. Also, calculation error is
smaller when distance between loops is greater.
Important parameter for accurate speed measurement is distance between loop A and loop B and it
can be set in this section with resolution of 1 cm.
v = measured speed
s = distance between loops
t = time after which vehicle exits second loop after first exiting the first loop
Note: If vehicle does not exit second loop in 2.5 seconds after initially entering first loop, the
measurement will not be performed.
www.elektronika.ba
22 doc ver – 2017-08-17
Event viewer
In this section, device can be switched to “Event logging mode” where it will send various events
during operation. List of events it can send is described in detail in Table 2 - Event list.
This screen parses those parameters and displays them in more human-readable format with
timestamps where it is possible to save entire log into a file.
www.elektronika.ba
23 doc ver – 2017-08-17
Real-time frequency reporting
In this section, it is possible to enable “Real-time frequency reporting” (signal analysis) mode and
view vehicle’s magnetic signature when it passes over the loop. It is possible to save the plotted
graph into file as image by clicking on it, and it is also possible to save the signal value dataset into
text file for further processing. When “Auto save” checkbox is ticked, each detection (each new
dataset) will be automatically saved into the last directory used for saving.
www.elektronika.ba
24 doc ver – 2017-08-17