2012-03-21 06:32 PM
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, Nick2012-05-16 01:57 AM
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,
DinoHi
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, Nick2012-05-21 03:01 PM
That is exactly it, thank you Dino!
Nick