Wiki source code of Analog FLS setting

Last modified by Андрей Калиновский on 2023/04/26 11:17

Hide last authors
Илья Крайнов 18.1 1 (% class="wikigeneratedid" id="H41D43044144244043E43943A43843443044244743843A43044344043E43243D44F44243E43F43B43843243043443B44F43E43144A43543A44243044143043D43043B43E43343E43244B43C43443044244743843A43E43C" %)
2 (((
Андрей Калиновский 39.1 3
4
Андрей Калиновский 38.1 5 {{video url="https://www.youtube.com/watch?v=0lT2iJJK0p0&list=PLnkd3b-WBcpHWYhylpHeysMaTpqLc4Tlm&index=6"/}}
6
Андрей Калиновский 37.1 7 A feature of analog sensors is that when the ignition is turned off and on, according to the parameter from which the readings are taken, messages with false data are received for several seconds until the desired value is reached. It is necessary to cut off the period with false data.
Илья Крайнов 2.1 8
Андрей Калиновский 37.1 9 If data from an analog sensor is received by the parameter **in** * or **adc** *, where * is the input number, then you can use them directly. Otherwise, you must first create a sensor with the type **Simple** , sensor type **Arbitrary** , input type **Analog** . Specify the number of the input through which the data is received. We also specify an alias, in our case **fuel** .
Илья Крайнов 2.1 10
Андрей Калиновский 37.1 11 [[image:image-20230425141934-1.png]]
Илья Крайнов 2.1 12
Андрей Калиновский 37.1 13 When creating a fuel level sensor, we need to set its type ** **to **Virtual** , sensor type to **Fuel Level** , and function to **Expression** , which will allow us to enter **a Formula. ** Specify the type of calibration as **Table** .
Илья Крайнов 2.1 14
Андрей Калиновский 37.1 15 [[image:image-20230425141938-2.png]]
Илья Крайнов 2.1 16
Андрей Калиновский 37.1 17 The formula creates a function that checks for the presence of two conditions: the ignition is on and the speed is higher than the specified one. The function will cut off the period when false values ​​were received in the analog sensor. [[Feature Reference>>url:https://wiki.glonasssoft.ru/bin/view/%D0%9F%D0%B0%D0%BD%D0%B5%D0%BB%D1%8C%20%D1%83%D0%BF%D1%80%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F/%D0%9E%D1%81%D0%BD%D0%BE%D0%B2%D0%BD%D1%8B%D0%B5%20%D1%81%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%D1%87%D0%BD%D0%B8%D0%BA%D0%B8/%D0%A1%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%D1%87%D0%BD%D0%B8%D0%BA%20%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B9%20%D0%B8%20%D0%BF%D0%B0%D1%80%D0%B0%D0%BC%D0%B5%D1%82%D1%80%D0%BE%D0%B2%20%D0%B2%D0%B8%D1%80%D1%82%D1%83%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D0%B3%D0%BE%20%D0%B4%D0%B0%D1%82%D1%87%D0%B8%D0%BA%D0%B0/]] .
Илья Крайнов 2.1 18
Илья Крайнов 27.1 19 //if(ign and ((prev(speed)+speed)/2)>14,adc2,0)//
Илья Крайнов 2.1 20
Андрей Калиновский 37.1 21 here **ign**  is the alias of the ignition sensor, **//((prev(speed)+speed)/2)>14//  - ** checking the condition that the average speed of the object between two messages is greater than 14 km/h. The average speed between messages is calculated to reduce the effect of speed fluctuations due to shielding while stationary. **adc2 is**  the parameter from which the values ​​of the fuel level sensor are read, earlier we created an arbitrary sensor with the alias **fuel** , which can be used in this formula instead of **adc2** . In this formula, you can change the speed, the higher, the more the vehicle needs to accelerate so that the data is not discarded.
Илья Крайнов 2.1 22
Андрей Калиновский 37.1 23 We also enable **Median filtering** , which will allow us to smooth the graph and get fewer fuel surges. You can, as in the example, start with a value of 20, and change depending on how often false fuel surges occur.
Илья Крайнов 2.1 24
Андрей Калиновский 37.1 25 After configuring the **fuel level** sensor , it is necessary to configure the **Filling**  and ** Draining** templates . They are located in the **Templates** tab .
Илья Крайнов 17.1 26
Андрей Калиновский 37.1 27 In the **Filling ** and **Draining ** templates , the settings are the same. It is necessary to change the condition **Parameter value** , circled in blue, reduced to 1 s. Thus, the sensor will be more sensitive to vibrations. If any gas stations are not displayed, set the value to 0 sec or remove this condition.
Илья Крайнов 17.1 28
Андрей Калиновский 37.1 29 [[image:image-20230425141943-3.png]]
Илья Крайнов 17.1 30
Андрей Калиновский 37.1 31 We double-click on the parameter circled in red and **the Conditions for defining an event** window opens . Here we delete the event **Stop (150m)** . This change will allow tracking fillings and drains when **the Stop (150m)** event is inactive .
Илья Крайнов 17.1 32
Андрей Калиновский 37.1 33 [[image:image-20230425141950-5.png]]
Илья Крайнов 26.1 34
35
Андрей Калиновский 37.1 36 )))

Menu

GLONASSSoft wiki - 2023 г