Hi there!
I’ve been running into some issues getting a simple open loop motor spinning example working on my setup where the driver initialization fails. I have an ESP32-C6 dev board (CodeCell C6) connected to a TMC6300 driver board and SparkFun’s brushless gimbal motor (OT-EM3215). The driver board is connected to a 6V 1200mAh, NiMH RC battery.
Setup
Motor Pinout: UH = 1, UL = 2, VH = 3, VL = 21, WH = 22, WL = 23
Software
- Arduino IDE
- SimpleFOC 2.4.0
- SimpleFOCDrivers 1.0.9
- esp32 3.3.11
Issue
I enabled debug logging over Serial, and it appears that SimpleFOC is able to detect and configure my board’s MCPWM peripheral, only to fail by (apparently) attempting to set it up again:
ESP32-DRV: Configuring 6PWM in group: 0 on timer: 0
ESP32-DRV: Configuring 3 operators.
ESP32-DRV: Configuring 6PWM with hardware dead-time
ESP32-DRV: Configuring 3 comparators.
ESP32-DRV: Configuring 6 generators.
ESP32-DRV: Configuring Center-Aligned 6 pwm.
ESP32-DRV: Configuring dead-time.
ESP32-DRV: Enabling timer: 0
ESP32-DRV: MCPWM configured!
ESP32-DRV: Not enough pins available for 6PWM!
Looking through esp32_driver_mcpwm.cpp, the configuration log lines appear to indicate successful configuration, as otherwise I (should?) see errors per configuration, like these:
for (int i = 0; i < no_operators; i++) {
CHECK_ERR(mcpwm_new_comparator(params->oper[i], &comparator_config, ¶ms->comparator[i]),"Could not create comparator: " + String(i));
CHECK_ERR(mcpwm_comparator_set_compare_value(params->comparator[i], (0)), "Could not set duty on comparator: " + String(i));
}
I tried to trace this back and see if there would be any reason as to why the init would be attempted twice, but I don’t think I see anything, so I’m a bit at a loss.
Is it possible some power issue is causing it to be attempted twice? Or some flag that is being ignored?
Thanks in advance for any thoughts/suggestions
If there’s anything additional context that would be of use, do let me know.