Hi all
I'm using an ESP32 to control a mecanum wheel chassis, and for that I need to control the speed of the 4 motors (each connected to one of the wheels). I'm using Toshiba's TC78H620FNG as an H-Bridge to control each motor (2 motors per IC), and 2 GPIO pins per motor (direction + enable). The plan is to have the direction (PHA_x) pin directly set with digitalWrite(), and use PWM on the enable pin to control speed. I have no feedback signal from the motors
I see that I have 2 ways of doing PWM in ESP32, and in case this is important I'm using the ESP32-S3, I can go with the LEDC PWM or the MCPWM modules:
- The LEDC PWM module seems simpler to use, is the most widely used system out there to control motors, and according to the data sheet is used to control LEDs and "other uses", whatever that means
- MCPWM is harder to use, and has fewer examples out there, but it's specifically designed to control motors
What would I be missing if I used LEDC PWM instead of MCPWM for this application?
My motors are currently 6V 250mA, but I foresee them potentially growing up to 12V 1A in the future, but that is handled by the H-Bridge, not the ESP32. I do have separate power rails for motors and the electronics