Skip to main content
Low Yik Seong
Associate III
February 23, 2018
Question

st motor control isolated current sensor

  • February 23, 2018
  • 2 replies
  • 905 views
Posted on February 23, 2018 at 09:47

Hi, when I selected using two isolated current sensor in st motor control workbench. The IAR couldn't compile the code and gave the error 

0690X00000609ggQAA.png

May i know is there a solution to the problem? But using 3 shunt resistor current sampling does not have such problem.

    This topic has been closed for replies.

    2 replies

    Andrew Neil
    Super User
    February 26, 2018
    Posted on February 26, 2018 at 10:46

    It's a basic 'C' error - the type of the argument you've supplied does not match what the function requires.

    So look at the function declaration, see what type it is expecting - and make sure you give it something of that type!

    This is basic 'C' stuff - nothing specifically to do with ST.

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    freppa
    Associate II
    February 27, 2018
    Posted on February 27, 2018 at 11:15

    It seems ST have not finished their work on the ICS_F30X_PWMnCurrFdbkClass.

    Why release something half-done and then not clearly comment on this in User Manual UM1052/3 or in the code?

    Could someone from ST please adress this. F30X is a popular platform for motor control so it should be high on the list of priorities to maintain code for this MCU!

    Other people also have this issue:

    https://community.st.com/0D50X00009XkgcTSAR

    True as

    Neil.Andrew

    ‌ points out that this is a common C error, but that is not really the point here.

    Other classes for ICS current feedback uses a particular struct,ICS_DDParamsM1 initiated in SystemNDriveParams.h.

    This struct has of the typeICS_DDParams_t. Thus, for the F4 ICS class the function signature looks is this:

    CIF4XX_PWMC IF4XX_NewObject(pPWMnCurrFdbkParams_t pPWMnCurrFdbkParams,

    pICS_DDParams_t pICS_DDParams);

    and yes, this should then compile and run on a F4 MCU.

    For F30X however it seems that ST started development on it and have not finished. If we see the similar function signature for F30X:

    CIF30X_PWMC IF3XX_NewObject(pPWMnCurrFdbkParams_t pPWMnCurrFdbkParams,

    pICS_F30XParams_t pICS_DDParams

    );

    Ok so there is a mismatch of types, leaving us with two options for a fix:

    1.

    Change the type for the the NewObject function

    CIF30X_PWMC IF3XX_NewObject(pPWMnCurrFdbkParams_t pPWMnCurrFdbkParams,

    pICS_DDParams_t

    pICS_DDParams

    );

    2.

    There is a struct definition for

    pICS_F30XParams_t inICS_F30X_PWMnCurrFdbkClass.h howver no such struct is being initiated in SystemNDriveParams.

    I have looked at both solutions and are currently working on this. 1) fails because the init function of

    ICS_F30X_PWMnCurrFdbkClass requires fields in the structs that are not inpICS_DDParams_t. 2) I have not looked into yet, but initiating a struct of the correct type should be possible.

    Again, to me it seems like ST have started work porting ICS architecture to F30X, but left it unfinished like a complete mess. The UM1052 states that there is no support for ICS for F30X:

    0690X00000609qKQAQ.png

    Yet still the class

    ICS_F30X_PWMnCurrFdbkClass is a part of FOC SDK V4.3

    and in MCTasks.c we find:

    0690X00000609qeQAA.png