cancel
Showing results for 
Search instead for 
Did you mean: 

Can FreeRTOS software timer generate PWM?

HMSEdinburge
Associate II

Hello, i am using F446 and i am contemplating using FreeRTOS CMSIS V2 software timer to generate PWM to control motors via motor drivers (IC  chipset). Is this possible? Or must I use the hardware timer, TIM1~7 ?

21 REPLIES 21

@HMSEdinburge wrote:

These are the motors i m using, BLDC, stepper, servo actuators, stepper motor need 1/32 steps, BLDC needs PWM, and their various motor drivers, gate drivers etc. Total 63 motors. 


Already said that's not possible.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
  • Software PWM is limited in frequency/resolution. If you want 0-100 steps and use a 1 ms tick your frequency will be 10 Hz. 
  • You can share timers and handle things in software. But this results in dither as interrupt latency is not always predictable. Also can be a high load to CPU
  • Best is to use hardware timer
  • second best is to use external PWM IC. For example a SPI or I2C PWM IC. Such as the 16 channel PCA9685. Note that the PCA9685 is optimized for LEDs, but you can can connect it to a transistor switching a DC motor. Or to the enable pin of an H-bridge and use software to switch direction.

 


@HMSEdinburge wrote:

These are the motors i m using, BLDC, stepper, servo actuators, stepper motor need 1/32 steps, BLDC needs PWM, and their various motor drivers, gate drivers etc. Total 63 motors.


  • BLDC needs 3 phase control synchronized with back-emf detection. An MCU is not powerful enough to do several of these. Get a dedicated motor control IC/complete motor driver for each BLDC motor.
  • Get a dedicated motor control IC/complete motor driver for each stepper motor.
  • If they are RC servos you can use the PCA9685 for the 1-2ms pulse

 

63 motors seems like a lot. If the MCU has to do additional processing it may be underpowered. It's also rather ambitious for a beginner such as yourself. What is the application?

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.