cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 FOC PMSM SDKv3.0 : Driving different motors

n239955_stm1_stmicro
Associate II
Posted on March 22, 2012 at 02:32

Hi

I have several different motors that I would like to drive (one at a time) using the same hardware and firmware based on the STM32 FOC PMSM libraries. The motor selection is indicated to the processor with a DIP switch so that the software can determine which motor is connected.

The motors have different stator inductances, resistances and voltage constants so I need to change the dependent parameters C1 to C6 of the STO object.

Does anybody have any suggestions of how this can be achieved?

Thank you,

Nick
2 REPLIES 2
Dino COSTANZO
Associate II
Posted on May 16, 2012 at 10:57

Hello Nick,

do you mean: after the reset, the microcontroller reads the DIP and configures the MC application layer for the selected motor? configuration can be changed only through reset?

If yes, here it's the how to:

- STMCWB generates header files for each configuration;

- rename PMSM motor parameters.h and Drive parameters.h adding a postfix Motor1, Motor2...

- rename each parameter in those files adding a postfix Motor1,Motor2 (#define SINGLEDRIVE should not be modified of course)

- modify SystemNDriveParams.h, adding inclusion of new parameter files (M1,M2...); each parameter structure that contains defines from PMSM_.h and Drive_.h should be multiplied and renamed adding postfix;

- modify function MCboot() (SINGLE DRIVE) so as that for each DIP configuration the right object is created, eg:

 oPIDSpeed[0] = (CPI)PI_NewObject(&PISpeedParamsM1);

 ...

becomes

if (DIP POSITION 3)

{

.....

    oPIDSpeed[0] = (CPI)PI_NewObject(&PISpeedParamsMotor3);

#if (defined STATE_OBSERVER_PLL_M3)

    oSpeedSensor[0] = (CSPD)STO_NewObject(&SpeednPosFdbkParamsMotor3,&STOParamsMotor3);

.....

}

Best regards,

Dino

Hi

I have several different motors that I would like to drive (one at a time) using the same hardware and firmware based on the STM32 FOC PMSM libraries. The motor selection is indicated to the processor with a DIP switch so that the software can determine which motor is connected.

The motors have different stator inductances, resistances and voltage constants so I need to change the dependent parameters C1 to C6 of the STO object.

Does anybody have any suggestions of how this can be achieved?

Thank you,

Nick
n239955_stm1_stmicro
Associate II
Posted on May 22, 2012 at 00:01

That is exactly it, thank you Dino!

Nick