I began by attempting to follow this tutorial: DRV8302 example | Arduino-FOC
I have wired it up as commanded there. I am using a 12V power supply.
— first off, I got an error saying that the sketch was too big. This surprised me, and I saw no reference to it on this forum.
I swapped to a Due and found the “getting started” page to follow instead: Getting started | Arduino-FOC
— I can now see the info coming back from the encoder, but cannot pass the standalone_driver test. I am using the file blcd_driver3pwm_standalone from the installed Examples.
I expect to see the voltages 3V, 6V and 5V between the GND in from the power supply and each of the motor phases respectively. I do not see this, instead all phases show the same voltage, about 8.8V.
I have tried setting driver.pwm_frequency = 32000
, following the comment about atmega328s being fixed to that value. I have obviously corrected the BLDCDriver3PWM driver = BLDCDriver3PWM(9, 5, 6, 8);
line to use the correct PWM pins that match the wiring, BLDCDriver3PWM(9, 10, 11, 8);
I then changed the values of driver.setPwm(3,6,5);
and noted the results. I can’t make head nor tail of them:
Results for driver.setPwm(a,b,c):
given params a b c | measured phase voltages a b c |
---|---|
0 0 0 | 0.67 0.67 0.67 |
1 0 0 | 8.82 8.82 8.82 |
0 1 0 | 8.80 8.80 8.80 |
0 0 1 | 8.80 8.80 8.80 |
1 1 1 | 8.84 8.84 8.84 |
3 0 0 | 8.7 8.7 8.7 |
3 3 3 | 6.8 6.7 6.7 |
5 0 0 | 8.8 8.8 8.8 |
5 5 5 | 6.8 6.8 6.8 |
10 0 0 | 9.96 9.96 9.96 |
0 10 0 | 9.52 9.52 9.52 |
0 0 10 | 9.55 9.55 9.55 |
10 10 10 | 11.34 11.34 11.34 |
When driver.setPwm()
is commented out, the values all take 0.67V.
Can anyone more familiar with the DRV8302 have a guess at what might be happening?