One Arduino controlling two brushless DC motors

After some changes I have been able to get it working reliably with two motors. But one of the changes I have made is to use a new type of motor that I reckon is better suited to the task. Instead of using brushed motors that are cheaper, I have found other brushless motors that have several advantages: 
  1. Being brushless, there is no other wear than the bearings
  2. They have built-in driving electronics, so they can be controlled with the Arduino digital outputs, which simplifies things and reduces interface costs. 
  3. Motors have built-in encoder disks, 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.
  4. 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. 
Though I am doing my tests with an Arduino UNO, it has to work the same with the Pro Mini (as far as it uses a '328 chip, too). 

The motors I use seem to be manufactured for Ricoh, but I have not yet obtained any decent technical information. However, they are sold as 20W brushless motors with built-in driver electronics and a quadrature encoder.


While they cost around $15 each, these motors have a brilliant behavior, even when powered at 12V (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.

Another interesting detail is that motor electronics will work at 3.3V, too, in case you are driving it from a 3V3 processor. But remember, the output shaft is 6mm and not 5mm, which is a bit of a pain.

Comments

Unknown said…
Im building a cnc router and have the BLDC and 2000line encoders they are small bldc and i thought maybe it i can get the controller of these guys it would simplify everything. Can find those on ebay. Can you send me some pointers as i dont want to spend that much more. I even thought going back to steppers but the frame rails and ball bearings were built for the bldc it has. Shoot me a email if you can.
misan said…
The motors I used are no longer available but thse others are cheap (and do not have the encoder) http://www.ebay.com/itm/DC-Nidec-Brushless-Motor-CW-CCW-PWM-Speed-Control-Urgent-Stop-with-Drive-Circuit-/262638318387?hash=item3d2676b333:g:DtoAAOSwPCVX5JJp
makineci said…
hello are you I'm your fan. I am very impressed with your dc servo motor project. I've run most mcu properly. Can you publish the appropriate code for the new ATtiny841. thank you so much.
misan said…
Hi makineci,

I am not familiar with that processor model. Source code is in my github and most likely can be adapted (have a look at the ATtiny85 code available there): https://github.com/misan/dcservo/blob/master/attiny85.ino

Popular posts from this blog

VFD control with Arduino using RS485 link

How to get sinusoidal s-curve for a stepper motor

Importing OpenSCAD designs into Onshape