Is the Due fast enough for BLDC commutation?
My question is: Is the Arduino Due able to do the above process in 6.25 micro seconds?
check for that flag in main loop before any other processor intensive tasks (like lcd display, PID calculations etc.)
Drive a pin with PWM and install the same handler on it, on CHANGE
If you're using 2 MOSFETs per leg what sort of current are you driving?
Hi MarkT, Thank you for your reply.QuoteDrive a pin with PWM and install the same handler on it, on CHANGECould you explain more about this? I thought that reacting to the hall state change was enough.
QuoteIf you're using 2 MOSFETs per leg what sort of current are you driving?I want to drive a car alternator as a BLDC motor, I already have it running ok on a sensorless RC ESC, but it loses sync under heavy load or slow rpm. I'm planning to experiment with it at 24V-48V and up to about 100A.I'm looking forward to writing this code, best kind of brain exercise XD
To see how slow digitalWrite is, have a look at this thread http://forum.arduino.cc/index.php?topic=129868.msg1007525#msg1007525. It takes about 2.5us, or about 200 instructions.OTOH, writing to an output port can be one instruction, but it takes 2 cycles for the output pin to be set.
I get 1.07us for digitalRead, 1.25us for digitalWrite, both on version 1.5.6Note that benchmarking the Due is rather hit and miss due to the cache.
Ooh, which alternator? Specs? With that many poles your commutation positioncan be used to implement a servo position loop of sorts.