Dear Community,
I am trying to implement Mcpwm funcionality to my ESP32 Wroom. Currently I try to understand the included headerfiles for mcpwm for ESP-IDF 5.2.1. I uploaded the example Code from
https://github.com/espressif/esp-idf/bl ... ple_main.c
, simulated the Hallsensor values and changed the gpios for PWM to my desire. I hooked up the PWM outputs and got the predicted sinusodial PWM. My Question is, how do I modulate the frequency of this PWM signal to controll the motor speed. In the example code is mentioned, that the "update_motor_speed_callback()" function should be used for this case. Wich values should be given to the function and how do they affect the frequency?
I have search for a suitable solution for this problem for days and it seems like I am not alone with being confused about how to controll the frequency in esp-idf v5.
I would be happy to receive feedback to this topic! Thanks!
MCPWM module (Changing the Speed of the motor)
-
- Posts: 1705
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: MCPWM module (Changing the Speed of the motor)
Seems like all you'd have to do to change the speed is here: https://github.com/espressif/esp-idf/bl ... ain.c#L173
Who is online
Users browsing this forum: Bing [Bot] and 66 guests