cancel
Showing results for 
Search instead for 
Did you mean: 

Dual Motor Control with STEVAL - IHM042V1 and FOC SDK 4.0

mail239955_st
Associate
Posted on October 03, 2014 at 13:25

Hi!

I use the STEVAL - IHM042V1 for dual motor control with FOC SDK 4.0

 

My Configuration is:

M1: Single Shunt (TIM1) with OPAMP3 on B13, the hall sensors are on TIM2 A0,B3 and B10

M2: Single Shunt (TIM8) with OPAMP2 on B14, the hall sensors are on TIM3 B4, B5, B0

I removed R72 and R76 and connected SB1 and SB2, the jumpers are all set on pin 1 and 2.

When I try to compile the code, I get an error on line 5088 in file ''SystemNDriveParams.h''

''Error[Pe020]: identifier ''OPAMP3_NonInvertingInput_PA7'' is undefined''

Now I need to change line 206 in ''Control Stage parameters.h'' from

''#define OPAMP2_NONINVERTINGINPUT_PHB           OPAMP3_NonInvertingInput_PA7'' to

''#define OPAMP2_NONINVERTINGINPUT_PHB           OPAMP1_NonInvertingInput_PA7''

to succeed compilation.

Controlled by the Workbench motor 1 runs very nice as well in speed as in torque mode.

But motor 2 does not. In speed mode the motor tries to start but there is immediate an over current error. In torque mode the motor runs but is cogging very heavy. (Torque ref (Iq) = 2000)

I tried to change the configuration. I set TIM3 for Motor 1 and TIM2 for Motor 2. Now Motor 2 runs fine, but motor 1 is cogging. So it seems to me that both output stages are ok, but the problem is with the hall sensor/timer.

I measured the signals from the hall sensors directly on the µC pins. They are ok.

So I think there is a problem with the software.

Do you have any idea?

Btw: In three shunt sensorless configuration both motors run fine too.
4 REPLIES 4
mail239955_st
Associate
Posted on October 15, 2014 at 19:56

No one any idea?

Did someone get both motors running (sensored)?

Need your help! It's important for my project to get both motors running.

Gigi
ST Employee
Posted on October 16, 2014 at 09:03

Ciao,

From what I see all things you did seems correct so I supsect in a FW issue but I hadn't time to test it in lab. I will try asap.

Ciao

Gigi

Gigi
ST Employee
Posted on October 22, 2014 at 08:54

Ciao,

Maybe I discovered the issue.

The problem is that the alternate function of the pin for the three input of the HALL sensor are not correctly managed when using a TIM different from TIM2.

I suggest this workaround: modify the SystemNDrivePArams.h line 3716-3724 like this

#if !defined(H1_GPIO_AF2)

  #define H1_GPIO_AF2 GPIO_

AF_2

 

#endif

#if !defined(H2_GPIO_AF2)

  #define H2_GPIO_AF2 GPIO_

AF_2

 

#endif

#if !defined(H3_GPIO_AF2)

  #define H3_GPIO_AF2 GPIO_

AF_2

#endif

AF_2 is the correct alternate function for TIM3 (I used it for the second motor).

Ciao

Gigi

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