cancel
Showing results for 
Search instead for 
Did you mean: 

STM3210E-EVAL motor control example

sebastianr
Associate II
Posted on January 18, 2012 at 17:00

Hi,

I'm trying to get a motor control example running on the mentioned board - without success.

My main function looks like this:

int main(void)

{

  SystemInit();

  Demo_Init();

  //initialize motor control lib

  MCboot(oMCI, oMCT);

 

  GetMCIList(oMCI);

  GetMCTList(oMCT);

  SysTick_Configuration();

  //Execute a start speed ramp

  MCI_ExecSpeedRamp(oMCI[0],100,1000);

  MCI_StartMotor(oMCI[0]);

 

  //...

}

Some of the called methods, I used from the IAR example project included in the motor control library. I didnt build and programmed this one, because of the code size (working with Lite version IDE).

I commented out all useless functions like LCD and so on.

Some further important information:

- I wrote a minimal main function with a switch-case where I switched the 6 GPIOs wired to the three phase-PWMs. I just commutated the the GPIOs according to the 6 commutation states. In this way, the motor was driving! Of course this is a very quick and dirty way, but it was only to check the HW!

- I checked all jumper settings with collegues several times. they should be correct.

- by calling MCI_GetSTMState, I could determine, that the state machine is in START mode.

Has someone a minimal MC example using the FOC MC library and could give me a hint? I some initialization missing? I think this is all done in MCboot?

As the power stage I use the STEVAL-IHM031V1 board.

thanks in advance

sebastian

5 REPLIES 5
Gigi
ST Employee
Posted on January 26, 2012 at 11:51

Probably is sufficient to add a little delay between the

MCI_ExecSpeedRamp(oMCI[0],   1000,  5000);

 

and the

MCI_StartMotor(oMCI[0]);

 

this to give to the tasks to be executed at least once.

For instance like this

// time delay

slong0=0;

slong1=0;

while(slong0<10000000)

{

slong1=0;

while(slong1<100000000) slong1++;

slong0++ ;

}

or similar...

Ciao

Gigi

sebastianr
Associate II
Posted on January 31, 2012 at 10:50

Hi,

could someone provide an executable (.bin or .hex) for the STM3210E-EVAL Board, which is actually working (especially motor drive)?

We are trying for weeks and can't be sure, that something with the hardware configuration is wrong. As we just have one board on none other working reference hardware, a working binary would be extremly helpful.

The compiled binary for example could be out of the IAR project, which is delivered with the stm motor library v3.0. It is an example project with LCD-UI to control the motor.

Can someone provide that as a binary?

edit: the file LCD project\HEX\STM3210E_EVAL_SINGLEDRIVE.hex delivered with the library doesn't work either!

Thanks a lot in advance

Sebastian
bille.stello
Associate III
Posted on February 02, 2012 at 16:15

Hello Sebastian,

the binary file you're asking for, needs to be generated according to your control stage (you mentioned STM32F10E-EVAL, this is fine), power section (r u using any standard STEVAL?) and motor (if not using Shinano motor, must have motor parameters required by the configuration tool STMC Workbench).

The .Hex you mentioned only work in conjunction with motor control example... Basically the two programs must reside in the same MCU (different flash memory regions of course) so it's normal you don't see anything on the LCD

 

Best Regards,

Billino

sebastianr
Associate II
Posted on February 21, 2012 at 13:32

Hi,

we still have problems with the motor control library.

Can someone tell me exactly, which files I have to modify/touch, to get initialized the right GPIOs connected to the PWM-Timer channels?

Of course, one thing is the ''Control stage parameters.h'' with:

#define PHASE_UH_GPIO_PORT GPIOC

#define PHASE_UH_GPIO_PIN GPIO_Pin_6

etc.

But what else do I have to do, to see the PWM-Signals with a oscilliscope? When I initialize the TIM8 Timer by hand in PWM mode (that, what MCboot() should do?) then I can see the PWM signal!

thanks in advance.

best regards,

sebastian
Laurent Ca...
Lead II

The question has been moved from the "Motor Control Hardware" section to the "STM32 Motor Control" section (the question is about the STM32 MC SDK). 

Best regards