Wiki source code of Relative engine hours

Last modified by Андрей Калиновский on 2023/04/25 14:41

Hide last authors
Андрей Калиновский 8.1 1 Sensor type **Relative engine hours** allows you to calculate the time of the engine in relation to its revolutions.
Илья Крайнов 7.1 2
Андрей Калиновский 8.1 3 To create a relative engine hours sensor, we first need to create a sensor with the **Engine RPM** type and a sensor that calculates **Engine hours coefficient** .
Илья Крайнов 7.1 4
Андрей Калиновский 8.1 5 ==== **Engine speed** ====
Илья Крайнов 7.1 6
Андрей Калиновский 8.1 7 To create a sensor, you need to specify the type **Simple** , the sensor type **Engine speed** , specify the type and number of the input from which the engine speed values ​​come from, and set an alias. In our example, the alias is specified as  **mh** .
Илья Крайнов 7.1 8
Андрей Калиновский 13.1 9 [[image:image-20230425144047-1.png]]
Илья Крайнов 7.1 10
Андрей Калиновский 8.1 11 ==== **Hour factor** ====
Илья Крайнов 7.1 12
Андрей Калиновский 8.1 13 To calculate the coefficient of engine hours, a sensor is created with the **Virtual type, Arbitrary** sensor type , **Expression** function , **Table** calibration type .
Илья Крайнов 7.1 14
Андрей Калиновский 13.1 15 [[image:image-20230425144054-2.png]]
Илья Крайнов 7.1 16
Андрей Калиновский 8.1 17 The formula contains the following expression:  //(prev(mh)+mh)/2// , where //prev()// is a function that allows you to access the previous message, //mh//  is an alias for the engine speed sensor. This formula allows you to calculate the average value of the engine revolution between the last two messages. Thus, jumps in engine speed at the time the message was created are leveled. We set an alias, in our case  **koef** .
Илья Крайнов 7.1 18
Андрей Калиновский 8.1 19 After we create a calibration that will allow us to correlate the value of engine speed obtained from the formula with the value of the coefficient.
Илья Крайнов 7.1 20
Андрей Калиновский 13.1 21 [[image:image-20230425144100-3.png]]
Илья Крайнов 7.1 22
Андрей Калиновский 8.1 23 ==== **Relative engine hours** ====
Илья Крайнов 7.1 24
Андрей Калиновский 8.1 25 To create a sensor, you must specify its type as  **Virtual** , sensor type ** Relative engine hours , Expression** function , leave the calibration type **as Default** .
Илья Крайнов 7.1 26
Андрей Калиновский 13.1 27 [[image:image-20230425144104-4.png]]
Илья Крайнов 7.1 28
Андрей Калиновский 8.1 29 Specify the following expression in the formula:  //if(unix(prev(time))=0, 0, (unix(time)-unix(prev(time~)~)~)*koef) , where// if //( , , )// , //unix()// , //prev ()// - functions described in [[this>>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/#]] article. //time// - message creation time,  //koef//  - sensor alias **Engine hour factor** . The formula calculates the time between messages, to which the engine hour factor is applied. As a result, we obtain the value of engine hours, taking into account the height of the engine speed.

Menu

GLONASSSoft wiki - 2023 г