Skip to main content
msingh
Senior
October 12, 2021
Question

How to select PWM frequency

  • October 12, 2021
  • 3 replies
  • 1379 views

Hardware: NUCLEO-F303RE + X-NUCLEO-IHM07M1

Software: MCWB 5.Y.3 + STM32CubeIde 1.7.0

Motor combination: 200142 + 166935 + 673026 (12V + 21:1 + 1024CPT)

Project requirements: minimum speed: 0.4 RPM max speed: 3000 RPM (motor speeds NOT gearbox output)

I have managed to create a project that sort of works. At this stage I would like to achieve the best performance possible, when creating a project I have guessed the values but now I would like to know if these values are even reasonable? Does anyone know how to select the PWM frequency and other parameters? is there any formula to be used? or any documentation?

Thanks in advance

Kind Regards

Manpreet Singh

This topic has been closed for replies.

3 replies

cedric H
Technical Moderator
October 12, 2021

Hello @msingh​ ,

your question is really dependent of your motor. The best documentation should come from the motor maker, but unfortunately they never provide such level of documentation.

From experience, the less inductive your motor, the highest your PWM frequency should be.

One clue is to use the motor Pilot to look at the current reconstruction coming from the Algorithm. The curent shape will tell you if your motor is properly controlled.

PID settings are dependent of your application, so impossible to help you on this topic.

Please note that 0.4 RPM is very challenging with sensorless algorithm.

Regards

Cedric

Visitor II
October 12, 2021

In addition to cedric H advice: lower PWM frequency allows better use of 16-bit timer resolution.

msingh
msinghAuthor
Senior
October 14, 2021

Thanks to both. @cedric H​ I am using 1024 CPT incremental encoder as a feedback. @Yevgeni Tunik​ your answer made me think that I might need to move to a faster processor so that I can have a faster response to the torque/position adjustments. I have created a quick project with the NUCLEO-G431RB + IHM07M1 and very quickly I achieved a good working project! I have to say that ADC conversion is not yet implemented so it might loose performance one it is implemented but it looks promising. Thanks again

Visitor II
October 14, 2021

" @YevgeniT (Community Member)​ your answer made me think that I might need to move to a faster processor so that I can have a faster response to the torque/position adjustments".

I meant just better resolution of PWM duty cycle in case of higher period of PWM in timer counts.