cancel
Showing results for 
Search instead for 
Did you mean: 

STEVAL-IPMNG8Q-3h???

Eakso.2
Associate II

Hi,

I have STEVAL-IPMNG8Q-3h and I want to drive PMSM motor.

In the code generated by the ST WORKBENCH, I get this error!!

"Description Resource Path Location Type

unknown type name 'RTC_HandleTypeDef'; did you mean 'I2C_HandleTypeDef'? stm32f3xx_hal_timebase_rtc_alarm_template.c /28.07/Drivers/STM32F3xx_HAL_Driver/Src line 98 C/C++ Problem"

How can I solve?

Have a good day.

4 REPLIES 4
Laurent Ca...
Lead II

The question has been set only to the "STM32 Motor Control" topic (the question is only about the STM32 MC SDK). 

Best regards

Laurent Ca...
Lead II

Dear @Community member​ 

Welcome to the STM32 Community

Could you give more details to the STM32 Community about your setup -the material you use- ?

(HW and also SW: CPU(s), tools and versions, board(s), motor(s) and so on)

And more especially did you use STM32 MC tools (such as MC_suite, STM32 MC Motor Profile, STM32 MC SDK, STM32 MC Workbench, the used example, the origin of the base of your application source code, and so on)?

Best regards

Eakso.2
Associate II

Thank you for answer,

I want to drive PMSM 3-phase motor. So I have STEVAL-IPMNG8Q.

I have STM32F407G discovery board and STEVAL-IPMNG8Q. I want to drive the PMSM motor with my code but I'm having problems.

I'm using six-step control with timer CH1-CH1N pwm.The code I wrote is below.

 int pwmSin[] = {0,18,20,30,40,50,60,70,80,90,80,70,60,50,40,30,20,0,0,18,20,30,40,50,60,70,80,90,80,70,60,50,40,30,20,0,0,18,20,30,40,50,60,70,80,90,80,70};

void motor_control(void) {

///--------- A HIGH- B LOW ---------///

HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);

HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_2);

///--------- A HIGH- C LOW ---------///

HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);

HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_3);

///--------- B HIGH- C LOW ---------///

HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_2);

HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_3);

///--------- B HIGH- A LOW ---------///

HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_2);

HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1);

///--------- C HIGH- A LOW ---------///

HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_3);

HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1);

///--------- C HIGH- B LOW ---------///

HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_3);

HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_2);

}

while (1)

 {

  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */

  for( i = 0; i<64;i++){

  __HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, pwmSin[i]);

__HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_2, pwmSin[i]+16);

__HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_3, pwmSin[i]+32);

 motor_control();

if(i == 63){

i=0;

}

  }

When I run this code the motor is locked. The motor could not move.

I know I need to generate a sine wave using pwm but something is wrong.

I was able to create a 120 degree angle difference between phases but I am getting a square wave output. I will be grateful if you could help me. I wish you good work.

Eakso.2
Associate II

I then used the STM Motor Control Workbench but the IGBT exploded. What could be my problem? How can I control STEVAL-IPMNG8Q?