Question on parameter IDs

Post Reply
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Question on parameter IDs

Post by Pete9008 »

Just looking at adding another parameter and noticed the following (taken from param_prj.h on github master):

Code: Select all

#define VALUE_BLOCK1 \
    VALUE_ENTRY(version,     VERSTR,  2039 ) \
    VALUE_ENTRY(hwver,       HWREVS,  2036 ) \
    VALUE_ENTRY(opmode,      OPMODES, 2000 ) \
    VALUE_ENTRY(lasterr,     errorListString,  2038 ) \
    VALUE_ENTRY(status,      STATUS,  2044 ) \
    VALUE_ENTRY(udc,         "V",     2001 ) \
    VALUE_ENTRY(idc,         "A",     2002 ) \
    VALUE_ENTRY(il1,         "A",     2003 ) \
    VALUE_ENTRY(il2,         "A",     2004 )
and

Code: Select all

#define VALUES_FOC \
    VALUE_ENTRY(id,      "A",     2003 ) \
    VALUE_ENTRY(iq,      "A",     2004 ) \
    VALUE_ENTRY(ifw,     "A",     2048 ) \
    VALUE_ENTRY(ud,      "dig",   2046 ) \
    VALUE_ENTRY(uq,      "dig",   2047 ) \
This looks like il1 and il2 are sharing the same parameter IDs as id and iq.

Does this matter? If so what would the effect be?
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1025 times
Contact:

Re: Question on parameter IDs

Post by johu »

Oh! It means you can't properly Can-map them...
would be a good idea to make them unique
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Question on parameter IDs

Post by Pete9008 »

Would it affect reading il1 or il2 via the Param::Get(Param::il1) function in foc code?

The binary logging was using a parameter read on them and I wasn't convinced they were reading out right. The problem seems to have gone away now they have unique IDs but then I've changed other things too.

Edit - don't think so, it's the order in the param_prj.h file that determines the order of parameters in the internal arrays so the ID shouldn't affect this at all.
davefiddes
Posts: 213
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 38 times

Re: Question on parameter IDs

Post by davefiddes »

That's a good spot. Should have been able to pick them up with openinverter_can_tool if I'd tested it more thoroughly. :(

I have a cunning plan for how to detect this error automatically at compile time. Look for a libopeninv PR later.
Post Reply