JochiSt / OpenFlowMeter

Measuring Flow
GNU General Public License v3.0
6 stars 0 forks source link

Problem getting I gains from configuration #21

Closed JochiSt closed 1 year ago

JochiSt commented 1 year ago

There is a problem getting the gains via CANbus from the OFM

The log of the address and content:

Getting the configuration from OFM
0 1
1 4
2 8
3 16
4 255
5 15
6 16
7 0
8 0
9 0
10 32
11 66
12 0
13 0
14 0
15 0
16 0
17 0
18 0
19 0
20 0
21 0
22 0
23 0
24 0
25 0
26 32
27 66
28 0
29 0
30 0
31 0
32 0
33 0
34 0
35 0
36 0
37 0
38 0
39 0
40 73
41 146
42 220
43 64
44 37
45 73
46 22
47 65
48 73
49 146
50 220
51 64
52 37
53 73
54 22
55 65

Which then gets converted into:

Board ID: 1
Intervals:
    CAN ADC    4
    Print UART 8
        I2C TMP100 16
        I2C BME680 255

PIDflags 0x0
PID 0   deactivated
    T: 40.000000
    P: 0.000000
    I: 0.000000
    D: 0.000000

PID 1   deactivated
    T: 40.000000
    P: 0.000000
    I: 0.000000
    D: 0.000000

Smoothing:
    SMOO     15
    SMOO_MAX 16

Amplification:
    U0: 6.892857
    I0: 8.000000
    U1: 6.892857
    I1: 0.000000

The gain for U0 and U1 are fine but the gains for the currents are somehow strange. They do not match the default configuration, which is stored inside the OFM.

Especially the gain for I1 is zero in the parsed configuration but nonzero in the raw packets. (Should be the last 4 bytes).

JochiSt commented 1 year ago

This issue could be fixed using commit 5c1b0ffcbd467b752efde9fe7353595dff08f398.