One Arduino controlling two brushless DC motors
- Being brushless there is no other wear than the bearings
- They have built-in driving electronics, so they can be controlled with the Arduino digital outputs, that simplifies things and reduces interface cost.
- Motors have built-in encoder disk too, but the one they carry is just 100 lines per revolution (a bit poor in my opinion) that can turn into 400 "steps" per revolution with the 4x decoding of the program. The lower number of lines per revolution puts less stress on the Arduino interrupt code, which may be one of the reasons it works ok now.
- I have moved all the encoder signals to pins that are monitored with the interrupt on pin change and I have reserved the two external interrupts for the STEP input signals for each motor.
While they cost around $15 each, these motors have a brilliant behavior, even when powered at 12V (they are rated 24V). With power to spare I have to reduce the PID maximum output if I do not want my toothed pulleys to skip in the highest acceleration moves of my tests. The video below shows X and Y axis motion while printing a part controlled with Marlin firmware running on the blue Mega board while the red Arduino UNO board runs this code.
Some other interesting detail is that motor electronics will work at 3.3V too, in case you are driving it from a 3V3 processor. But remember output shaft is 6mm and not 5mm which is a bit of a pain.