mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 05:34:32 +02:00
mcpwm: update bldc example
This commit is contained in:
@@ -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)
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user