A Virtual Instrument for Road Vehicle Classification Based on Piezoelectric Transducers

This paper describes a virtual instrument capable of the automatic and quasi-instantaneous classification of a vehicle according to category when it is driving along the road. The vehicle’s classification is based on accurate measurements of both the vehicle’s speed and its wheelbase. Our research is focused on achieving accurate speed and wheelbase measurements and then determining the category of the vehicle through the developed software. The vehicle categorization is based on the wheelbase measurements and the number of axles and metal masses of the vehicle. The system has a complementary magnetic sensor, which helps in classifying the vehicle when the wheelbase measurement could be representative of different categories, and a camera to confirm the results of the experiment. The proposed measurement system presents a novel method for classifying vehicles according to type using piezoelectric transducers (piezo sensors). In addition, no system references have been found that encompass the functionalities of the presented system based on the information of only two piezoelectric transducers. The system has important advantages over current alternatives (systems based on inductive loops, cameras, fiber optic sensors or lasers), the installation is simple and non-invasive and with a success rate of the classification greater than 90%. The system consists of a signal acquisition point on the pavement, signal conditioning hardware and a data acquisition (DAQ) module, which links the hardware and the virtual instrument developed in LabVIEW®. Finally, the system has been tested on the road with real traffic, and the experimental results are presented and discussed in this paper.


Introduction
In recent decades there has been a considerable increase in intelligent electronic systems applied to vehicles and infrastructure. The evolution of Intelligent Transportation Systems (ITS) has introduced a wide range of systems and software applications [1] with the aim of improving safety and efficiency in road transport. These systems obtain information from the different elements of the roads and process it and are used to improve driver safety, traffic and travel comfort.
Among others, ITSs are present in the development of: • Systems to increase driver safety, such as Advanced Driver Assistance Systems (ADAS) [2][3][4].

•
Traffic information systems, variable signage panels, Vehicle-to-Infrastructure (V2I) communication or free-flow tolls.
• Sensors should be easy to install, preferably with non-invasive installation.

•
When sensors are to be installed under the pavement, it should be possible to do so with little impact on the road (in terms of road works or service interruption). • Data processing should be fast, with low computational costs. • It should be possible to extend the functionalities to the system without the need to increase the number or type of sensors. • Measurements should be sufficiently accurate to reduce the probability of error in the vehicle category classification.

•
Signal conditioning and data acquisition hardware should have low costs and low power consumption.

•
The system must be able to catalog multi-axle vehicles.

•
The system must store the collected data for later use in a back-office process. The description of the designed and built system has been organized as follows: • System blocks: The system blocks are described, and their nature, hardware or software is specified. The virtual instrument and its blocks are defined. The installation of the measuring system designed for the road is described.

•
System hardware: All hardware elements of the measurement system are described: transducers, signal conditioners, data acquisition (DAQ) systems (DAQ module) and camera.

•
System software: The software architecture (pattern design) of the developed application is described. The application developed and the calculation methodology used to achieve the results are described.

•
Experimental results: The results obtained are shown and the results are discussed.

•
Error estimation: An analysis of the sources of error is carried out and the estimate of the maximum error is calculated. • Conclusions: The final conclusions of the designed system are shown after being tested with real traffic.

Built Measurement System Blocks
The system was conceived as a virtual instrument consisting of a hardware part and a software part running on a computerized system (PC), so that changes in the software can make the virtual instrument expandable in its functionalities and maintainable.
A virtual instrument consists of an industry-standard computer or workstation equipped with powerful application software, cost-effective hardware such as plug-in boards, and driver software, which together perform the functions of a measurement instrument [13].
Virtual instruments represent a fundamental shift from traditional hardware-centered instrumentation systems to software-centered systems that exploit the computing power, productivity, display and connectivity capabilities of popular desktop computers and workstations.
In the virtual instrumentation, the "software is the instrument" [14]. The software, using the appropriated hardware, defines the functions of the instrument.
In the Figure 1, the virtual instrument block is formed by the developed software and a National Instruments general purpose multi-function DAQ module. Obviously, signal conditioners for the transducers are also necessary. The system block diagram is shown in Figure 1. Figure 2 shows an example of installation. Piezo sensors can be installed above the pavement (non-intrusive) or below the pavement (intrusive).

System Hardware
The following describes the transducers used, their signal conditioners, the data acquisition (DAQ) board used and the camera used to capture the images.

System Hardware
The following describes the transducers used, their signal conditioners, the data acquisition (DAQ) board used and the camera used to capture the images.

System Hardware
The following describes the transducers used, their signal conditioners, the data acquisition (DAQ) board used and the camera used to capture the images.

Piezo Sensors
The piezoelectric transducers used are piezoelectric cables. These piezoelectric devices are commonly used in traffic management and have, in recent years, also been used in the development of road traffic infrastructure [15][16][17][18][19][20][21]. This type of transducer is usually used in electronic instrumentation dedicated to traffic management for vehicle counting and weighing (only if the vehicle is traveling at low speed). However, they are used in a new way in this design to measure the speed of the vehicle with high accuracy. The procedure for obtaining the speed and wheelbase measurements is described in Section 5.
Piezoelectric cables [22,23] are coaxial with 20 AWG stranding in which the cable insulation is a PVDF film. The most important characteristics are shown in Figure 3 and Table 1. Piezoelectric performance specifications.
Sensors 2020, 20, x FOR PEER REVIEW 5 of 20 The piezoelectric transducers used are piezoelectric cables. These piezoelectric devices are commonly used in traffic management and have, in recent years, also been used in the development of road traffic infrastructure [15][16][17][18][19][20][21]. This type of transducer is usually used in electronic instrumentation dedicated to traffic management for vehicle counting and weighing (only if the vehicle is traveling at low speed). However, they are used in a new way in this design to measure the speed of the vehicle with high accuracy. The procedure for obtaining the speed and wheelbase measurements is described in Section 5.
Piezoelectric cables [22,23] are coaxial with 20 AWG stranding in which the cable insulation is a PVDF film. The most important characteristics are shown in Figure 3 and Table 1. Piezoelectric performance specifications.  Piezo sensors, due to the direct piezoelectric effect of the PVDF piezo film tape, respond with an analog voltage. The peak values when the vehicle passes over them depend on whether the cable is on or under the pavement. The margins are 20~40 V when the installation is on the pavement and 2~4 V when the installation is under the pavement, at a 2 cm distance. It is necessary to attenuate and adapt this value so that the signal is within the input range of the DAQ module. Figure 4 shows a typical response signal from the piezo sensors when they are driven over by the vehicle.  Piezo sensors, due to the direct piezoelectric effect of the PVDF piezo film tape, respond with an analog voltage. The peak values when the vehicle passes over them depend on whether the cable is on or under the pavement. The margins are 20~40 V when the installation is on the pavement and 2~4 V when the installation is under the pavement, at a 2 cm distance. It is necessary to attenuate and adapt this value so that the signal is within the input range of the DAQ module. Figure 4 shows a typical response signal from the piezo sensors when they are driven over by the vehicle.

Magnetic Sensor
A magnetoresistive transducer [24,25], the HMC2003 transducer of the HMC series of Honeywell, is used. It is able to determine the variations in the magnetic field of the Earth induced by the approach and presence of metallic masses in the three axles-X, Y, Z. Figure 5 shows a block

Magnetic Sensor
A magnetoresistive transducer [24,25], the HMC2003 transducer of the HMC series of Honeywell, is used. It is able to determine the variations in the magnetic field of the Earth induced by the approach and presence of metallic masses in the three axles-X, Y, Z. Figure 5 shows a block diagram of the magnetic sensor, and some of the specifications are shown in Table 2.

Magnetic Sensor
A magnetoresistive transducer [24,25], the HMC2003 transducer of the HMC series of Honeywell, is used. It is able to determine the variations in the magnetic field of the Earth induced by the approach and presence of metallic masses in the three axles-X, Y, Z. Figure 5 shows a block diagram of the magnetic sensor, and some of the specifications are shown in Table 2.  These three axles use permalloy magnetoresistive sensors. These sensors produce an imbalance in the Wheatstone bridge (see Figure 6. HMC2003 set-reset.) when the magnetic dipoles are oriented to the passage of the metal mass. Two control actions are required to achieve the maximum sensitivity  These three axles use permalloy magnetoresistive sensors. These sensors produce an imbalance in the Wheatstone bridge (see Figure 6. HMC2003 set-reset.) when the magnetic dipoles are oriented to the passage of the metal mass. Two control actions are required to achieve the maximum sensitivity and input range from these sensors. The first is the establishment of a set-reset command (introducing SR+ and SR− pulses) [24,25] to disorientate the magnetic dipoles and thus "erase" the memory of the last measurement (the dipoles tend to remain oriented). The second is the correction of the offset voltage to approximately 2.5 V when there is no metal mass to unbalance the Wheatstone bridge. The control actions are dictated by the software through the DAQ module. Digital set-reset control signals are applied to a driver made up of MOSFET transistors that introduce two SR+ and SR− pulses. An analog voltage is generated, which is subtracted from the output voltage in the absence of metal mass. Figure 7 shows the signals of a vehicle of three axles: magnetic sensor, piezo sensor 1 and piezo sensor 2 after its conditioning. The shape and area under the magnetic sensor graph provide additional information for distinguishing between doubtful cases in the category classification, although this procedure is still being developed.
Sensors 2020, 20, x FOR PEER REVIEW 7 of 20 and input range from these sensors. The first is the establishment of a set-reset command (introducing SR+ and SR− pulses) [24,25] to disorientate the magnetic dipoles and thus "erase" the memory of the last measurement (the dipoles tend to remain oriented). The second is the correction of the offset voltage to approximately 2.5 V when there is no metal mass to unbalance the Wheatstone bridge. The control actions are dictated by the software through the DAQ module. Digital set-reset control signals are applied to a driver made up of MOSFET transistors that introduce two SR+ and SR− pulses. An analog voltage is generated, which is subtracted from the output voltage in the absence of metal mass. Figure 7 shows the signals of a vehicle of three axles: magnetic sensor, piezo sensor 1 and piezo sensor 2 after its conditioning. The shape and area under the magnetic sensor graph provide additional information for distinguishing between doubtful cases in the category classification, although this procedure is still being developed.    Table 3 and Figure 8.

Camera
The system has a camera that takes an image of the vehicle. This image is associated with the measurements taken. The initial objective is to verify that the classification method implemented in the IV works correctly. A Logitech C920 HD 1080P USB camera connected to the PC is used. Figure 9 shows images of the built equipment.

Camera
The system has a camera that takes an image of the vehicle. This image is associated with the measurements taken. The initial objective is to verify that the classification method implemented in the IV works correctly. A Logitech C920 HD 1080P USB camera connected to the PC is used. Figure 9 shows images of the built equipment.

Camera
The system has a camera that takes an image of the vehicle. This image is associated with the measurements taken. The initial objective is to verify that the classification method implemented in the IV works correctly. A Logitech C920 HD 1080P USB camera connected to the PC is used. Figure 9 shows images of the built equipment.
(a) (b) The sensor signal conditioners (for piezo sensors and magnetic sensor) were designed by the authors. For each piezo sensor, an active attenuator was designed and for the magnetic sensor, an amplifier, MOSFET drivers to set-reset the signal and a circuit to adjust the zero level in the magnetic sensor response were designed.

Software System
The system's software was written with LabVIEW ® (National Instruments, Austin (Texas) USA), a graphical programming language that is the most widely used language in virtual instrumentation. The LabVIEW ® program consists of two main windows, the front panel (user interface) and the block The sensor signal conditioners (for piezo sensors and magnetic sensor) were designed by the authors. For each piezo sensor, an active attenuator was designed and for the magnetic sensor, an amplifier, MOSFET drivers to set-reset the signal and a circuit to adjust the zero level in the magnetic sensor response were designed.

Software System
The system's software was written with LabVIEW ® (National Instruments, Austin (Texas) USA), a graphical programming language that is the most widely used language in virtual instrumentation. The LabVIEW ® program consists of two main windows, the front panel (user interface) and the block diagram (program code). The programming is modular, and each module is built with one or more files called "SubVIs" [28].
The virtual instrument for measurement and control was designed with a state machine architecture. This design pattern is indicated for the design of complex measurement equipment that is required to have different functionalities. A state is a situation in which the machine can be found. Usually, in a state, the actions or operations associated with it are carried out. There is also a decision code, which determines the next state to which the machine must evolve. A state machine is described graphically with a state diagram in [29]. The LabVIEW ® programming language allows for the implementation of a state machine with a simple design pattern, which allows for the development of complex programs, making the virtual instrument scalable, maintainable and readable. Figure 10 shows the skeleton of a state machine where the strategy described in the previous paragraph can be clearly seen. Usually, in a state, the actions or operations associated with it are carried out. There is also a decision code, which determines the next state to which the machine must evolve. A state machine is described graphically with a state diagram in [29]. The LabVIEW ® programming language allows for the implementation of a state machine with a simple design pattern, which allows for the development of complex programs, making the virtual instrument scalable, maintainable and readable. Figure 10 shows the skeleton of a state machine where the strategy described in the previous paragraph can be clearly seen.  Figure 11 shows the state diagram of the built virtual instrument.   Usually, in a state, the actions or operations associated with it are carried out. There is also a decision code, which determines the next state to which the machine must evolve. A state machine is described graphically with a state diagram in [29]. The LabVIEW ® programming language allows for the implementation of a state machine with a simple design pattern, which allows for the development of complex programs, making the virtual instrument scalable, maintainable and readable. Figure 10 shows the skeleton of a state machine where the strategy described in the previous paragraph can be clearly seen.  Figure 11 shows the state diagram of the built virtual instrument.  The states of the virtual instrument are described below and shown in Table 4. Virtual instrument states.

Speed Vehicle Calculation
The designed virtual instrument has two keys that ensure a reliable measurement with a high degree of accuracy: -Acquisition of the signal from the piezoelectric sensors at an acceptable level. -Highly accurate calculation of vehicle speed.
Speed, v, is calculated using Equation (1): where v is the speed, expressed in km/h; d is the distance between the piezoelectric sensors, expressed in meters (m); Delay 2,1 s the time from the vehicle passing over piezo sensor 1 to the vehicle passing over piezo sensor 2, expressed in seconds (s). Figure 12 shows the signals captured by piezoelectric sensors 1 and 2, respectively. As can be seen, the signals are similar but vary in shape and amplitude. These factors make the uncertainty in the estimation of the Delay 2,1 quite high (in the order of ms). Therefore, the need arises to perform the Delay 2,1 estimation by a method that provides a lower error [30].
The estimation method used is cross correlation, which considerably reduces the error rates in the estimation of the delay between signals [31,32]. This has been implemented in SubVI Cross correlation.vi. Figure 13 shows the code extract from Cross correlation.vi. This SubVI has input data (signals) acquired from piezoelectric sensors 1 and 2 and the distance between them. The SubVI provides a graph of the cross correlation and the estimated speed (in km/h). Sensors 2020, 20, x FOR PEER REVIEW 11 of 20 The estimation method used is cross correlation, which considerably reduces the error rates in the estimation of the delay between signals [31,32]. This has been implemented in SubVI Cross correlation.vi. Figure 13 shows the code extract from Cross correlation.vi. This SubVI has input data (signals) acquired from piezoelectric sensors 1 and 2 and the distance between them. The SubVI provides a graph of the cross correlation and the estimated speed (in km/h). Although the signals from the piezo sensors were conditioned beforehand, the sensitivity of each piezo cable does not match; in the same way, the acquired signal levels also do not match. The solution implemented to make the acquired signals from the sensors valid is the standardization of these signals. The next step is to determine the cross correlation of both signals, which is calculated according to Equation (2): where x(t) is signal piezo 1 (normalized) and y(t) is signal piezo 2 (normalized). However, since the signals are discrete, Equation (3) is implemented.
x j = 0, j < 0 or j ≥ N Signal Piezo 1 (sampled and normalized) y j = 0, j < 0 or j ≥ M Signal Piezo 2 (sampled and normalized) The implementation of this equation provides the sequence of expression (4): The result of cross correlation for signal piezo sensor 1 and signal piezo sensor 2 is shown in Figure 14. Therefore, the delay between the vehicle steps according to the piezoelectric sensors is calculated using Equation (5).  The estimation method used is cross correlation, which considerably reduces the error rates in the estimation of the delay between signals [31,32]. This has been implemented in SubVI Cross correlation.vi. Figure 13 shows the code extract from Cross correlation.vi. This SubVI has input data (signals) acquired from piezoelectric sensors 1 and 2 and the distance between them. The SubVI provides a graph of the cross correlation and the estimated speed (in km/h). Although the signals from the piezo sensors were conditioned beforehand, the sensitivity of each piezo cable does not match; in the same way, the acquired signal levels also do not match. The solution implemented to make the acquired signals from the sensors valid is the standardization of these signals. The next step is to determine the cross correlation of both signals, which is calculated according to Equation (2): where x(t) is signal piezo 1 (normalized) and y(t) is signal piezo 2 (normalized). However, since the signals are discrete, Equation (3) is implemented.
x j = 0, j < 0 or j ≥ N Signal Piezo 1 (sampled and normalized) y j = 0, j < 0 or j ≥ M Signal Piezo 2 (sampled and normalized) The implementation of this equation provides the sequence of expression (4): The result of cross correlation for signal piezo sensor 1 and signal piezo sensor 2 is shown in Figure 14. Therefore, the delay between the vehicle steps according to the piezoelectric sensors is calculated using Equation (5). Although the signals from the piezo sensors were conditioned beforehand, the sensitivity of each piezo cable does not match; in the same way, the acquired signal levels also do not match. The solution implemented to make the acquired signals from the sensors valid is the standardization of these signals.
The next step is to determine the cross correlation of both signals, which is calculated according to Equation (2): where x(t) is signal piezo 1 (normalized) and y(t) is signal piezo 2 (normalized). However, since the signals are discrete, Equation (3) is implemented.
x j = 0, j < 0 or j ≥ N Signal Piezo 1 (sampled and normalized) y j = 0, j < 0 or j ≥ M Signal Piezo 2 (sampled and normalized) The implementation of this equation provides the sequence of expression (4): The result of cross correlation for signal piezo sensor 1 and signal piezo sensor 2 is shown in Figure 14. Therefore, the delay between the vehicle steps according to the piezoelectric sensors is calculated using Equation (5).
where t 1 and t 2 are the moments of time at which the vehicle moves over piezoelectric sensors 1 and 2, respectively. t corr is the waveform duration of the cross correlation result; t max is the moment in time at which the cross correlation reaches the maximum value.
Sensors 2020, 20, x FOR PEER REVIEW 12 of 20 Delay 2,1 = t 2 − t 1 = t corr − t max (5) where t1 and t2 are the moments of time at which the vehicle moves over piezoelectric sensors 1 and 2, respectively.
tcorr is the waveform duration of the cross correlation result; tmax is the moment in time at which the cross correlation reaches the maximum value.

Vehicle Category Determination
The automatic classification of the vehicle category is done by estimating the number of axles of the vehicle and the wheelbase or the distance between axles. The category is then assigned as shown in Table 5. This strategy is novel compared to other methods for the classification of vehicles used by other authors [33].
The classification shown in Table 5 is based on a classification made according to the size of the vehicle and published in Traffic Detector Handbook Vol. 1 [7].
The wheelbase categorization strategy is one of the key factors for achieving a high probability of success regarding the system's automatic classification.

Vehicle Category Determination
The automatic classification of the vehicle category is done by estimating the number of axles of the vehicle and the wheelbase or the distance between axles. The category is then assigned as shown in Table 5. This strategy is novel compared to other methods for the classification of vehicles used by other authors [33]. The classification shown in Table 5 is based on a classification made according to the size of the vehicle and published in Traffic Detector Handbook Vol. 1 [7].
The wheelbase categorization strategy is one of the key factors for achieving a high probability of success regarding the system's automatic classification.
The calculation of the distance between two axles of the same vehicle is done via Equation (6): where d axles is the distance between two consecutive axles, expressed in meters (m); v is the speed, expressed in km/h; Delay i,i+1 is the time from when the i axle of the vehicle drives over a piezoelectric sensor until the i + 1 (next) axle drives over the same sensor, expressed in seconds (s); Delay i,i+1 is estimated by measuring the time instants of the signal from one of the sensors when a certain threshold value is exceeded. In this case, Delay i,i+1 is not calculated using the cross correlation method. This would necessitate adding another sensor to establish the signal start trigger. The classification of the vehicle is done based on ranges of the vehicle wheelbase, as shown in Table 3. These calculations are performed in the SubVI Axles distance.vi. Figure 15 shows a code extract from Axles distance.vi. This SubVI has, as interesting input data, the signals acquired from the piezoelectric sensors 1 and 2, the selection of the observed sensor (piezo sensors 1 or 2) and the estimated speed in (km/h) calculated by the SubVI Cross correlation.vi, described in the previous section. The data of interest provided by Axles distance.vi are the value of the number of axles of the vehicle (#founds), an array with the instants of the time of step (locations) and the array with the distance between the axles of the vehicle (distance axles array (m)).
The calculation of the distance between two axles of the same vehicle is done via Equation (6): where daxles is the distance between two consecutive axles, expressed in meters (m); v is the speed, expressed in km/h; Delayi,i+1 is the time from when the i axle of the vehicle drives over a piezoelectric sensor until the i + 1 (next) axle drives over the same sensor, expressed in seconds (s); Delayi,i+1 is estimated by measuring the time instants of the signal from one of the sensors when a certain threshold value is exceeded. In this case, Delayi,i+1 is not calculated using the cross correlation method. This would necessitate adding another sensor to establish the signal start trigger. The classification of the vehicle is done based on ranges of the vehicle wheelbase, as shown in Table 3. These calculations are performed in the SubVI Axles distance.vi. Figure 15 shows a code extract from Axles distance.vi. This SubVI has, as interesting input data, the signals acquired from the piezoelectric sensors 1 and 2, the selection of the observed sensor (piezo sensors 1 or 2) and the estimated speed in (km/h) calculated by the SubVI Cross correlation.vi, described in the previous section. The data of interest provided by Axles distance.vi are the value of the number of axles of the vehicle (#founds), an array with the instants of the time of step (locations) and the array with the distance between the axles of the vehicle (distance axles array (m)).
The data for the distance axles array (m) and #founds are used to determine the vehicle category. Regarding the vehicle category, a study was performed of the wheelbase of common vehicles circulating in Spain. The authors added the typical wheelbase and the result is the information shown in Table 5.
The subVI in charge of performing the automatic classification is called Category.vi. Figure 16 shows the flowchart of this subVI. The data for the distance axles array (m) and #founds are used to determine the vehicle category. Regarding the vehicle category, a study was performed of the wheelbase of common vehicles circulating in Spain. The authors added the typical wheelbase and the result is the information shown in Table 5.
The subVI in charge of performing the automatic classification is called Category.vi. Figure 16 shows the flowchart of this subVI.
When Category.vi returns the value unknown, a sensor measurement error exists, or the measured values are not included in the values of Table 5. Remember that the values in Table 5 are written in the file Categories.ini (ASCII file). In any case, the measured values of the number of axles (#founds), the distance between axles (distance axles array (m)) and the photograph of the vehicle are always recorded. This allows the user to check, at a later stage, if there are errors in the sensors or if the sensor measurements recorded a vehicle not covered by the categories in Table 5. If you want to add new vehicle categories, just edit the file Categories.ini. Figure 17 shows a vehicle with a wheelbase of approximately 2.57 m, corresponding to the urban/subcompact category.  Table 5. Remember that the values in Table 5 are written in the file Categories.ini (ASCII file). In any case, the measured values of the number of axles (#founds), the distance between axles (distance axles array (m)) and the photograph of the vehicle are always recorded. This allows the user to check, at a later stage, if there are errors in the sensors or if the sensor measurements recorded a vehicle not covered by the categories in Table 5. If you want to add new vehicle categories, just edit the file Categories.ini. Figure 17 shows a vehicle with a wheelbase of approximately 2.57 m, corresponding to the urban/subcompact category.

Test Conditions on Road
Tests were conducted with actual road traffic according to the recommendations given in ASTM 1318-09 regarding geometric design and pavement conditions [34]. To ensure the alignment of the

Test Conditions on Road
Tests were conducted with actual road traffic according to the recommendations given in ASTM 1318-09 regarding geometric design and pavement conditions [34]. To ensure the alignment of the different elements on the road, two laser levels and their signal receivers were used, ensuring an error of ± 0.01 m in the measurement of the distance between piezo sensors 1 and 2.
The test was carried out as shown in Figure 18.

Test Conditions on Road
Tests were conducted with actual road traffic according to the recommendations given in ASTM 1318-09 regarding geometric design and pavement conditions [34]. To ensure the alignment of the different elements on the road, two laser levels and their signal receivers were used, ensuring an error of ± 0.01 m in the measurement of the distance between piezo sensors 1 and 2.
The test was carried out as shown in Figure 18. The piezo sensors were mounted non-intrusively (on the floor), and the piezo cable was covered with a ProTech-branded cable protector for the floor. Below is an example (Figure 19) of a vehicle measurement, resulting in a "rigid truck (three axles)" classification. The piezo sensors were mounted non-intrusively (on the floor), and the piezo cable was covered with a ProTech-branded cable protector for the floor. Below is an example (Figure 19) of a vehicle measurement, resulting in a "rigid truck (three axles)" classification.

Proccessing/Compute Time
LabVIEW ® profile performance [35] was used to quantify the software processing time when performing the measurements.
In the measurement process, the execution times of the subVIS involved in the machine states were quantified when carrying out the measurement (see Table 6). Ten runs were done to estimate

Proccessing/Compute Time
LabVIEW ® profile performance [35] was used to quantify the software processing time when performing the measurements.
In the measurement process, the execution times of the subVIS involved in the machine states were quantified when carrying out the measurement (see Table 6). Ten runs were done to estimate the processing time. Stand by status is a waiting status and does not affect the processing time to present the measurement.
Configure DAQ status is a state prior to reading the sensors and therefore does not affect processing. Set-reset status is executed every time a measurement is made and has a fixed execution time of 25 ms, this is the time programmed for the digital pulse applied to the magnetic sensor.
The time between average measurements can be estimated as T between measurements (ms) = 655 + 7.9 + 25 = 687.9

Error Estimation
This section concerns the estimation of the error in the measurements, speed and distances between the axles provided by the virtual instrument.
The sources of error were estimated based on the characteristics of the equipment used and tests carried out in the laboratory.
In terms of the speed measurement, three significant sources of error were determined: • Inaccuracy in the measurements between wires, d b .

•
The different waveforms in the received signals, which can cause a maximum shift in the calculation of the cross correlation.

•
The error due to the signal sampling instant that can cause the maximum point of the cross correlation to be shifted by Ts = 1/f s , where f s is the sampling frequency for the acquisition of the analog signals from piezo sensor 1 and piezo sensor 2.
Regarding the wheelbase measurement, two significant sources of error were determined: • The uncertainty in the speed measurement.

•
The uncertainty in the Delay i,i+1 calculation (defined in Section 4.1), which depends on how accurately the moment at which the vehicle passed over the same piezo sensor for the axle (axle i ) and the adjacent axle (axle i+1 ) was detected. This calculation error is low since the slew rate of the signals in the piezo sensors is approximately 1.5 V/ms. Tables 7 and 8 show the estimated errors for a two-axle vehicle with wheelbase 1 = 1.375 m and wheelbase 2 = 4375 m, respectively, for speeds between 25 km/h and 175 km/h. Loose error values are estimated for the above error sources, and these are as follows: • Distance between piezo sensors, d b = 6 m. Error db = ±0.01 m.

•
The uncertainty in the calculation of Delay i,i + 1 , Error Delayi,i +1 = ±1 ms. In order to estimate the errors due to unrecognized categories or wrong measurements ("Unknown" in Figure 16. Category.vi.) the data from the road tests were analyzed. Two tests were carried out at road M-404 milestone 1 in Madrid (Spain) and two tests at road N-232 milestone 492 in Castilla-León. A total of 457 measurements were taken and the results are shown in Table 9. "Unknown measurement NO OK" is the set of vehicles that drove over only one of the piezo sensors (piezo sensor 1 or piezo sensor 2) or there was a wrong connection at the beginning of the test that was later resolved. Only three vehicles were detected that were not assigned to any category in Table 5.

Conclusions
The designed and built virtual instrument is capable of performing the quasi-instantaneous classification of vehicles circulating on real traffic roads.
The installation can be performed in an intrusive way with a simple intervention on the pavement. A non-intrusive installation can also be carried out, as described in Section 5.
The system is capable of taking measurements with a low level of error in speed measurements and an acceptable level of error in wheelbase measurements.
A classification strategy based on the vehicle wheelbase and number of axles was implemented, allowing for the rapid classification of the most common vehicle types.
A magnetic sensor was included, which generates a magnetic "footprint" that provides information about the type of vehicle. We are developing a line of research regarding this footprint, which complements the classification of the vehicles by category. The magnetic "footprint" can be used to elucidate doubtful cases that may arise in the analysis of the data measured with piezo sensors.
The built hardware and the commercial hardware used are basic performance equipment, so their prices are not high.
The design of the virtual instrument has a defined software architecture. A state machine was used and care was taken in the programming style so that the software is readable, expandable and maintainable. In fact, it would be easy to expand the software to replicate the system in all lanes of a road.
The virtual instrument's user interface is user friendly and simple, making it easy for the system operator to use. The test results are exportable since the data are also saved in text format (ASCII).