mcpwm: update bldc example

This commit is contained in:
suda-morris
2021-07-26 22:22:41 +08:00
parent 251afb4a79
commit 039cb93787
2 changed files with 7 additions and 7 deletions

View File

@@ -1,10 +1,10 @@
| Supported Targets | ESP32 | | Supported Targets | ESP32 | ESP32-S3 |
| ----------------- | ----- | | ----------------- | ----- | -------- |
# MCPWM BLDC motor control(hall sensor feedback) Example # MCPWM BLDC motor control (hall sensor feedback) Example
This example will show you how to use MCPWM module to control BLDC motor with hall sensor feedback.
This example will show you how to use MCPWM module to control bldc motor with hall sensor feedback
The following examples uses MCPWM module to control bldc motor and vary its speed continuously The following examples uses MCPWM module to control bldc motor and vary its speed continuously
The bldc motor used for testing this code had hall sensor capture sequence of 6-->4-->5-->1-->3-->2-->6-->4--> and so on The bldc motor used for testing this code had hall sensor capture sequence of 6-->4-->5-->1-->3-->2-->6-->4--> and so on
@@ -13,7 +13,7 @@ IR2136 3-ph bridge driver is used for testing this example code
User needs to make changes according to the motor and gate driver ic used User needs to make changes according to the motor and gate driver ic used
## Step 1: Pin assignment ## Step 1: Pin assignment
* The gpio init function initializes: * The gpio init function initializes:
* GPIO15 is assigned as the MCPWM signal for 1H(UH) * GPIO15 is assigned as the MCPWM signal for 1H(UH)

View File

@@ -215,7 +215,7 @@ static void mcpwm_example_bldc_control(void *arg)
//2. initial mcpwm configuration //2. initial mcpwm configuration
printf("Configuring Initial Parameters of mcpwm bldc control...\n"); printf("Configuring Initial Parameters of mcpwm bldc control...\n");
mcpwm_config_t pwm_config; mcpwm_config_t pwm_config;
pwm_config.frequency = 1000; //frequency = 1000Hz pwm_config.frequency = 14400; //frequency = 1000Hz
pwm_config.cmpr_a = 50.0; //duty cycle of PWMxA = 50.0% pwm_config.cmpr_a = 50.0; //duty cycle of PWMxA = 50.0%
pwm_config.cmpr_b = 50.0; //duty cycle of PWMxb = 50.0% pwm_config.cmpr_b = 50.0; //duty cycle of PWMxb = 50.0%
pwm_config.counter_mode = MCPWM_UP_COUNTER; pwm_config.counter_mode = MCPWM_UP_COUNTER;