How To Control Brushless Drill With Arduino

Hello all,

I got a knock off Dewalt drill for a project, and I'm using it as a motor to drive an RC vehicle.

I'm wondering if it's possible to use an Arduino to control the motor's variable speed, and forward/reverse direction using the trigger wires on the existing motor control board that came with the drill instead of using a separate ESC controller.

Has anyone successfully done this, and how would I go about wiring the connections to the Arduino board?

Thanks in advance.


Are all drills just like your Dewalt? Probably not.
If you are going to proceed with doing it yourself, the first step is to identify the voltages and currents of the current wiring in your drill. Then develop the circuitry to allow your Arduino to be able to control the circuit controlling the motor. Obviously cannot connect it directly to any Arduino pins!

Maybe, but I have to ask why you would? Have you first determined that the motor shaft will accommodate the pinion gear you intend to use if it's a typical RC hobby type pinion/spur gear to drive some transmission? Or if you are thinking of a differential drive type RC, do you have gearboxes or were you just hoping to use the gearbox on the drill?

Not to discourage you, but the mechanical marriage between an arbitrary drill and your intended RC platform should be worked out before spending time figuring out how to control the motor with an Arduino, which is frankly going to be easier just using an appropriate TX/RX that feeds to the Arduino, where you either pass the servo pulses as is or trim them to suit your needs.

If you work out the voltages and whatever else @Paul_KD7HB was driving at (pun intended) in post #2, it will be up to you to determine how the Arduino will translate that into what you need. It may be as simple as 10-bit analog resolution between 0-5 volts and if so, happy days. Or it may not. Frankly, I don't know.

I do know that a brushless ESC will drive the drill motor though, and using the Servo library with Arduino (or comparable) will work, as long as the ESC (or motor driver, same thing different name) can handle the voltage you intend on using.

EDIT: changed "brushed" to brushless.

I can't help you but it is an interesting idea. I have two DeWalt (actual name brand) cordless grinders that both quit after about 1-1.5 years of service. One is a 60 volt brushless and the other is a 20 volt grinder that I think is brushless, though I do not remember for sure. A quick look at the model number and specs would remind me.

Anyway, I don't remember what happened to the 20 volt one, but the 60 volt one will run for a split second and stop, like the eBrake control is kicking in. I think the 20 volt one is doing the same thing, or something similar.

I can't bear to throw them away. They just cost to much. I have kept them on the shelf for over a year, thinking I might figure out an arduino program for them, rewire them, and get them running again.

I will be interested to see what others have to say about this.

If the drill does forward and backward and variable speed, then it already has an ESC; that's what an ESC is. If you, for some reason, want to replace the ESC the drill came with, then basically yes, an Arduino can be at the heart of the ESC. That is how an ESC is built: it is a circuit with an MCU and supporting circuitry, plus software.

So I opened up the trigger mechanism and I have 20V sitting there for use. Now I know the Arduino can't handle the 20V but is there a module or something that can, that way I can use it as an electronic trigger switch instead of a physical one?

(Worst case scenario, I was planning on making a jig that holds a servo, so the servo would control the trigger, but I was hoping for more of a direct electronic control).

Looking at the board, it looks like it has 8 resistors for the variable speed, A set of two contacts to send power through (like an on switch), the contacts for the variable speed that goes through the resistors at each position, and the direction contacts. Is there some way/board that can handle all this electronically?


Does the drill motor only spin at eight different speeds?

Can you make a schematic of the control mechanism? It may be possible to get a continuous speed control going, which I would think necessary for any r/c deployment.

a7

I traced the PCB and got this (I also get continuity on 3,5 with a reading of 2.6ohms):

The trigger seems to be a switch with several contacts, so the actual speed control is in the motor, and not Arduino compatible.

I have used these to step 28 volts down to 5 volts.

@ClassifiedSecret mentioned

So now the questions are many. The trigger switch might be providing a stepped control voltage, or it might be interpreted digitally.

In one case you might be able to get continuous control, in the other you'd be stuck with what are, presumably, the eight speeds it can run at presently.

Your next step is to determine the voltage and current in the resistor ladder for the different switch positions.

Your drawing is nice, but is on,y the beginning step to drawing a schematic.

Worst case, relays could be used to perform the same switching the trigger grip afffords. Next might be using a control voltage to set a voltage at one of the eight recognized values (digital interpretation). If you are lucky, a continuously varied voltage that is made to look like it comes from the trigger switch would allow full speed control.

If that all doesn't make sense, maybe you shouldn't try to be messing with this. It might be faster and easier to salvage only the motor, and find an appropriate ESC to use directly.

a7

Maybe. We haven't seen a pic of the motor. I have tried to salvage many of these types of motors over the years. Grinders, drills, routers, sanders, etc... Often times they are not a standalone motor inside the housing. Sometimes the plastic tool housing doubles as the motor case. When that is the case, the windings are just housed in the plastic case and the bearings are simply sandwiched between the two halves of the case. I suppose one could cut the case and save the "motor area" as a complete unit but mounting it to another project would be very difficult.

Are you sure it is brushless? Remove the armature and inspect (or, see if the user manual says "brushless"... I would trust the armature first).

So: we have a resistor ladder. Tapped by the speed handle. Resulting voltage controls the motor speed.
Problem: voltage range up to 20V.
So needed: arduino with pwm and capacitor to produce variable voltage. 4× amplifying opamp to crack that up to 20V.
If that works: organize the backward option. Maybe an optocoupler will do...

By the way: what is the resistance of the resistors in the resistor ladder ? I presume higher than 1000 ohm. But worth a check...

Haha, from what I've had to do, that's the easy part. It's a drill with a beautiful mechanism for grabbed a good hold of cylinders of a wide range of diameters.

a7

Yeah...I thought about that AFTER I posted it. I was thinking more along the path of mounting ONLY the motor section in a project. Not necessarily zip-tying or hose clamping the entire drill. That would be to easy!

So I measured each resistor and they are all 10k ohms (totalling to 80k ohm).

Is it possible to use a potentiometer (0-100k ohm pot) to control the speed of the motor rather than the trigger; This way I can get better gradual acceleration/deceleration instead of fixed 8 speed.

P.S:
For those of you interested, this is how I'm using the drill (Yes, I have tested it and the tank moves 150lbs with ease)


This is the motor:



(I tried it with this ESC but i couldn't get it to move. It just beeped at me the whole time. I used a servo tester (Like this one) to try and control it and gave the ESC constant power from my bench power supply. Do I have to do something different; Or is it just not compatible?

My guess:
Red is plus
Black is minus.
R ladder is voltage divider
Yellow is pick up...
So, dismount yellow and put a voltage from 0-20V on it (tapped from black and red). The drill should run (after making contacts 2-3) with variable speed.
Buy a 20V opamp (rail to rail). Use arduino (0 to 5V pwm with resistor and cap) to control the output voltage. from 0-20V (gain=4)

Have you made any progress? I agree with build_1971. I would try to PWM the power leads before trying something else. I wonder what the current requirements would be for that motor?

Thanks for all the help & guidance.

I finally had time to play around with the drill and was able to successfully get a 100K potentiometer to better control the drill’s speed.

Now I have to test it under load to get some amperage readings and then, when I have some more time, I’ll play around and try to get it to work with an op-amp:)

But at least now I have a starting point.

Once again, thank you all very much.

Drawing of what I did: