From 2105adc19cc2fb3aa8714f0c46218db693ba8dd3 Mon Sep 17 00:00:00 2001 From: Zhang Shuxian Date: Tue, 6 Aug 2024 17:50:45 +0800 Subject: [PATCH] docs: Update the application examples in mcpwm.rst --- docs/en/api-reference/peripherals/mcpwm.rst | 11 ++++++----- docs/zh_CN/api-reference/peripherals/mcpwm.rst | 13 +++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/en/api-reference/peripherals/mcpwm.rst b/docs/en/api-reference/peripherals/mcpwm.rst index 346991c778..e57b1b1d46 100644 --- a/docs/en/api-reference/peripherals/mcpwm.rst +++ b/docs/en/api-reference/peripherals/mcpwm.rst @@ -1031,11 +1031,12 @@ Kconfig Options Application Examples -------------------- -* Brushed DC motor speed control by PID algorithm: :example:`peripherals/mcpwm/mcpwm_bdc_speed_control` -* BLDC motor control with hall sensor feedback: :example:`peripherals/mcpwm/mcpwm_bldc_hall_control` -* Ultrasonic sensor (HC-SR04) distance measurement: :example:`peripherals/mcpwm/mcpwm_capture_hc_sr04` -* Servo motor angle control: :example:`peripherals/mcpwm/mcpwm_servo_control` -* MCPWM synchronization between timers: :example:`peripherals/mcpwm/mcpwm_sync` +* :example:`peripherals/mcpwm/mcpwm_bdc_speed_control` demonstrates how to drive a brushed DC motor using two specific PWM signals, measure the motor speed with a photoelectric encoder, and maintain a stable motor speed using a simple PID algorithm. +* :example:`peripherals/mcpwm/mcpwm_bldc_hall_control` demonstrates how to use the MCPWM peripheral to control a BLDC motor using a six-step commutation scheme, with the motor's spin direction and speed being adjusted based on the readings from a Hall sensor. +* :example:`peripherals/mcpwm/mcpwm_capture_hc_sr04` demonstrates how to use the MCPWM peripheral's capture module to decode the pulse width signals from an HC-SR04 sonar sensor, which can measure distance based on the width of the pulse. +* :example:`peripherals/mcpwm/mcpwm_foc_svpwm_open_loop` demonstrates how to use the MCPWM peripheral to generate three pairs of PWM signals for Field-Oriented Control (FOC), which can be used to drive a BLDC or PMSM motor, or a three-phase power inverter, using an open-loop FOC algorithm. +* :example:`peripherals/mcpwm/mcpwm_servo_control` demonstrates how to control a typical RC Servo by sending a PWM signal using the MCPWM driver, with the servo rotating from -60° to 60° and then turning back again. +* :example:`peripherals/mcpwm/mcpwm_sync` demonstrates how to generate three PWMs in perfect synchronization using MCPWM timers, with options to synchronize the timers via GPIO, Timer TEZ, or software. API Reference diff --git a/docs/zh_CN/api-reference/peripherals/mcpwm.rst b/docs/zh_CN/api-reference/peripherals/mcpwm.rst index d3089cebd9..32ea984d2d 100644 --- a/docs/zh_CN/api-reference/peripherals/mcpwm.rst +++ b/docs/zh_CN/api-reference/peripherals/mcpwm.rst @@ -1031,14 +1031,15 @@ Kconfig 选项 应用示例 -------------------- -* 通过 PID 算法控制有刷直流电机速度::example:`peripherals/mcpwm/mcpwm_bdc_speed_control` -* 控制带霍尔传感器反馈的无刷直流电机::example:`peripherals/mcpwm/mcpwm_bldc_hall_control` -* 使用超声波传感器 (HC-SR04) 测量距离::example:`peripherals/mcpwm/mcpwm_capture_hc_sr04` -* 控制伺服电机角度::example:`peripherals/mcpwm/mcpwm_servo_control` -* 定时器之间的 MCPWM 同步::example:`peripherals/mcpwm/mcpwm_sync` +* :example:`peripherals/mcpwm/mcpwm_bdc_speed_control` 演示了如何使用两个特定 PWM 信号驱动有刷直流电机,通过光电编码器测量电机速度,并通过 PID 算法保持稳定的电机速度。 +* :example:`peripherals/mcpwm/mcpwm_bldc_hall_control` 演示了如何使用 MCPWM 外设,通过六步换向方案控制无刷直流电机,根据霍尔传感器的读数调整电机的旋转方向和速度。 +* :example:`peripherals/mcpwm/mcpwm_capture_hc_sr04` 演示了如何使用 MCPWM 外设的捕获模块,解码超声波传感器 (HC-SR04) 的脉冲宽度信号。HC-SR04 传感器可根据脉冲的宽度测量距离。 +* :example:`peripherals/mcpwm/mcpwm_foc_svpwm_open_loop` 演示了如何使用 MCPWM 外设生成三对 PWM 信号,用于磁场定向控制 (FOC),从而驱动无刷直流电机或永磁同步电机,或驱动三相功率逆变器(使用开环 FOC 算法)。 +* :example:`peripherals/mcpwm/mcpwm_servo_control` 演示了如何使用 MCPWM 驱动程序发送 PWM 信号来控制 RC 伺服电机,它可以在 -60° 到 60° 间来回旋转。 +* :example:`peripherals/mcpwm/mcpwm_sync` 演示了如何使用 MCPWM 定时器生成三个 PWM 同步信号,可以通过 GPIO、Timer TEZ 或软件来同步定时器。 -API Reference +API 参考 ------------- .. include-build-file:: inc/mcpwm_timer.inc