How many motors can the MCPWM peripheral control?

MrOngCW
Posts: 4
Joined: Sun Jan 02, 2022 1:27 pm

How many motors can the MCPWM peripheral control?

Postby MrOngCW » Sun Jan 02, 2022 2:38 pm

Hi,

I am new to ESP32, and trying to learn MCPWM for motor control.

1. Am i correct to say that each MCPWM Unit can control 3 motors and hence 6 as there are 2 units?

2. Does it work such that
MCPWM Unit 0
PWM0A & PWM0B controls 1 motor independently
PWM1A & PWM1B controls 1 motor independently
PWM2A & PWM2B controls 1 motor independently

MCPWM Unit 1
PWM0A & PWM0B controls 1 motor independently
PWM1A & PWM1B controls 1 motor independently
PWM2A & PWM2B controls 1 motor independently

3. Will using MCPWM reduce the ledc channels available?

ESP_Sprite
Posts: 9770
Joined: Thu Nov 26, 2015 4:08 am

Re: How many motors can the MCPWM peripheral control?

Postby ESP_Sprite » Sun Jan 02, 2022 11:49 pm

It depends on the type of motor; for instance, if you have a BLDC which needs 3 channels, I'd imagine you can only control 2 motors. If your motors have only one channel (so each motor can only go in one direction; no H-bridge), you can control 6 per MCPWM, I think. The MCPWM and the LEDC are entirely independent; how you use MCPWM does not affect what LEDC channels are available.

MrOngCW
Posts: 4
Joined: Sun Jan 02, 2022 1:27 pm

Re: How many motors can the MCPWM peripheral control?

Postby MrOngCW » Mon Jan 03, 2022 3:37 am

I'm using the typical yellow TT motors, which only requires 2 connections so i presume a total of 6 can be controlled in this case?

Who is online

Users browsing this forum: No registered users and 22 guests