I’m trying to pass the 3PWM open-loop test with the following setup:
MCU: Arduino Mega 2560
Driver: Trinamics TMC6200-BOB
Motor: iPower Motor GM3506
Unfortunately, I cannot manage to make it work. The Trinamics TMC6200-BOB has a fault detection feature that triggers as soon as I power my setup, disabling the power stage of the driver. I supply the motor with a lab power bench set on +12V, and no overcurrent is detected.
Is there something wrong with my setup? I’d be grateful for any help!
I have TMC6200 and TMC6300, they are 6PWM logic and i had no success running them on 3PWM,
it seem that whenever i tried to save some PWM I/O with 3PWM i had the DIAG led turned on.
What you can do is hook up BOB to Motor without logic, and try spin BLDC motor, the diag should lit white.
Also you need DRV_EN to be high, if its driven too low it will produce fault and will trigger DIAG led on,
Although with SimpleFOC the driver enable is optional and so is for some of the IC’s, the TMC’s on high power chips require EN to be driven hight and mandatory.
I also tried the 6PWM with no better luck. This time, the FAULT pin stays low but the motor doesn’t move and stays very stiff, and my power bench voltage drops and current limit triggers… I checked that the PWM pins I used were from the same timer for the Arduino Mega 2560:
The disable() function depends on a hardware enable/disable function in the driver, and the enable pin being connected to the MCU and passed to the driver, for it to actually be able to physically disable the driver… otherwise, the disable() function just sets the PWM to zero, which normally will close all the high side FETs, open all the low side FETs, but leave everything else “on”, so to speak.
Thanks, I see!
I tied pin 5 of the Arduino Mega to the DRV_EN pin of the TMC6200-BOB and declared it as the “enabled pin” in the BLDCDriver6PWM declaration, but nothing happened… Then I removed the jumper from pin 5 to DRV_EN and left it unconnected, and the motor started to move randomly (jitter), and the PSU voltage dropped from 12V to around 9V…
It’s quite complicated to troubleshoot as I do not have an oscilloscope.
I have the following configurations on the TMC6200-BOB:
Driver Strength: 0.5A (following the recommendations in the introduction of the TMC6200-BOB’s datasheet)
Also, I tried to visualize the PWM signals out of the Arduino using a logic analyzer, with the code provided in my previous answer. I do not see any PWM modulation with this code on the specified pins.
However, I do see PWM modulation on the driver with the blcd_driver_3pwm_standalone example!
This is very strange, as the chennales VH an dVL aren’t neither in syn nor inverted. Could you test the standalone driver example in the library examples and set show us all the signals using your logic analyser?
It is possible that there is a bug in the low lever mega2560 library code.
Yes sure, here are two screenshots showing the high and low sides PWMs (I only have 4 channels on my logic analyzer), with the standalone example code. I only modified the pins to match Runger’s answer.
Phase U and W seems fine though, as we can clearly see the phase inversion and the dead time. The problem really seems to come from V. It almost seems like the high side is somehow synced with U: it goes low as UL goes low and then goes high as UH goes high after the dead- time.
This is very strange as these pins cannot belong to the same timer. So I’ve updated the code in the dev branch to allow for more timer high-low pair combinations. It would be really cool if you could try it out.
Now allowed pairs will be:
PWM pin pairs
It would be awesome if you could let us know if some other pin combination will work for you.
If you are not sure how to use the dev branch, you can also only copy paste the changes that I’ve made. Ony thing that you need to do is go to your SimpleFOC library code and navigate to src\drivers\hardware_specific\atmega2560_mcu.cpp and replace the function _configureComplementaryPair with this code
Thank you for your help! The standalone example works fine with the pins (5,2) instead of (11,12). I didn’t had the time to test the other combinations yet. I’m not sure what is up with (11,12) but every time I use those pins in the configuration I ended up with the weird signal I showed in my previous post.
I also tried the open-loop example that I sent earlier in the discussion with no luck: the FAULT pin of the TMC6200 still goes high and the register still blames short circuits on phases. This time I don’t really understand why since the PWM signals looks fine with the new pins.
I was tempted to blame the TMC6200-BOB board but after a simplistic trial with a handwritten driver code, the motor spins fine, so it seems like there is still something going on with the usage of the library with the Mega and the TMC6200.
I’ll try the other pins configurations with the standalone code and let you know if I come across the problem that I had with pins (11,12)!