Welcome to Robot Rebels, an online robot maker community.

Register today to post your projects, ask questions, share knowledge and meet like-minded people from around the world.

The Community

Author Topic: Motor rewinding machine  (Read 3331 times)


  • Member
  • ****
  • Posts: 46
  • Have fun every day!
Motor rewinding machine
« on: June 30, 2018, 07:24:39 AM »
<a href=";s=9" target="_blank" class="new_win">;s=9</a>

I have posted this project on the CNC board because essentially the machine is a 3 axis CNC machine. It has X, Z and A axes.Currently it is only programmed for 1 type of motor but in the future I will change the program so that it can read simple G-code instead.

Why I built it:
I have been building a prosthetic hand for my company. I was asked to have all motors, sensors and control circuitry in the hand (not the wrist).
This means everything needs to be as small as possible. The hand must also be as strong as possible so I need small but powerful motors.

My first prototype used brushed DC motors with planetary gears from Maxon. This was my bosses choice as another company had used them before.
They were anything but powerful at 1.5W. To make things worse the gearbox was only 33% efficient (according to their own data) so the output power was only 0.5W.
The end result was a hand that moved well but had no strength. Another problem was that the planetary gearboxes were very noisy.

After that attempt I started looking for brushless motors like they use for small drones. I found some nice motors that were only 10.4mm diameter.
There are slightly smaller motors available but their magnets are significantly smaller giving them less torque.

At this stage I ran into a bit of a problem. These drone motors are designed to spin a propeller as fast as possible from a single lithium cell (about 4V).
Each winding of the motor had only 4 turns of 0.2mm diameter wire. Essentially a dead short.

I wanted motors that let me precisely control the position of the fingers and I wanted to run these motors from a higher voltage (preferably 24V) with a lower current draw.
I need to convert these high speed drone motors into high torque, 3 phase stepper motors.

As mentioned previously the motor had 4 turns of 0.2mm wire on each pole and normally ran at about 4V.
Since I wanted to run at 24V it seemed like 24 turns of wire on each pole would be a good starting point.

I did a rough calculation based on the cross sectional area of 0.2mm wire and decided that I should be able to fit 24 turns of 0.04mm diameter wire on each pole.
I bought a roll of 0.04mm. For the sake of experimentation I also bought 0.03mm and 0.06mm.

So I stripped down a motor and here is the stator I need to rewind.

The damn thing is tiny and the 0.04mm wire is so thin that it breaks if you look at it the wrong way.
It was going to take forever to wind 6 motors by hand and probably drive me mad in the process.


First I searched for a video of a machine used to wind motors so I could see how the factories made the machine.
My machine is a simpler design and much slower but I do not want to make hundreds of motors every day.

Then I went to Taobao to find suitable stepper motors to make my machine with. I can't read or write Chinese so I depend on Bing Translator a lot.
Occasionally I get some strange results so it takes a bit of experimenting and patience.

These small linear drives have an 8mm diameter stepper motor with 20 steps per revolution. The M2 thread has a 0.4mm pitch.
By using half steps we get 0.4mm / 40 half steps per revolution = 0.01mm per half step. Perfect for small, delicate work.
My machine uses 1 of these linear drives to move the wire towards or away from the stator. A second linear drive moves the wire up and down.
Admittedly they are only just strong enough to do the job so I recommend using larger motors if you build your own machine.

I used a 400 step per revolution stepper motor to rotate the stator. You could also use a 200 step motor with 1/4 steps.

I ordered some GY-4988 stepper motor driver PCBs. These are breakout boards for the Allegro A4988 stepper motor driver.

The GY-4988 is ideal for driving small stepper motors and these breakout boards include a small potentiometer to let you adjust the motor current.
These boards let you use full steps, half steps, 1/4 steps, 1/8 steps and 1/16 steps.

For sensing the home position of the X and Z axes I used some optical sensors from Vishay.

To make my X and Z axes move smoothly I bought some small linear ball bearings (LM3UU) and 3mm diameter polished steel rod for guide rails.

To hold the wire I found some cool silicone rubber spools that can close up when not used to prevent the wire getting tangled.

The brains of my motor winding machine is a DAGU mini driver which is essentially a small Arduino NG or older with built in dual motor drivers.
The ATmega8A is ideally suited to small machines like this. The A4988 motor driver will work with 3.3V or 5V logic so you can use any MCU you want.

To make my nozzle I bought some FEP (clear teflon) tube with an outside diameter of 3mm and an inside diameter of 1 mm.
I heated it with a cigarette lighter and stretched it so that the outside diameter shrunk down to about 1mm.
It took a few attempts to get a nozzle I was happy with.

Originally I was trying to make most of the parts from 15mm thick stock as you can see in the Sketchup drawing below.
This is how I lay things out for the CNC. All the parts have small supports at the bottom which are cut off once the parts are made.
I then export the entire piece as an STL file.

I use MeshCam to convert the STL files to G-code. In most cases I can generate good quality parts using just the roughing pass.
It is much quicker than using 2 or more passes even if it means using a smaller tool and slower cutting speed.

The type of tool used is also very important if you want to get good quality parts. For the plastic parts I use a single edge end mill.

For metal parts I use a 4 flute end mill. These TAPC end mills have a coating that allows them to stay sharp for much longer.

For carbon fiber or fiber glass I use diamond pattern router bits. I have also used these bits on aluminium when making very small parts.
It is not easy to find a 4 flute end mill with a 0.4mm diameter however you can get 0.4mm cutting tools for PCBs.

As you can see it's a tight fit inside the machine with all those wires. My earlier design did not allow enough room for the header pins.
To get enough room I had to make the bottom part from 20mm stock with a separate base plate.

Originally I tried running the machine from a 9V power supply but the X-axis motor was not getting enough power. I had to use 12V.
Although the motors look similar the X-axis motor windings have 56Ω resistance. The Z-axis motor windings have 33Ω resistance.
These motors were all dirt cheap because they are surplus stock. They were all less than 1 RMB each.

At 12V the 5V regulator starts to get pretty warm so I added a small heat sink and mounted an 18 x 18 x 4mm cooling fan on the body.
I also drilled a number of small holes in the body so that air could flow through it.

It was only at this point I realized I had not added any controls or display. The machine would need to be controlled by the USB cable.
I did not like that idea so I added a single button and a bi-colour LED.

The button allows me to start/stop the machine at any time so I can fix any mistakes. If I hold the button for more than 1.5 seconds it resets the machine.
To make the software reset the machine I connected one of the I/O pins to the reset button of the Mini Driver.

The bi-colour LED flashes red and blue when the machine is returning to home position.
The LED is then blue while running and red if you pause the machine.The LED flashes blue if the machine is waiting for you to do something like homing the A axis.
The A axis does not have a home sensor. You must align the stator manually when the machine first starts.

I did originally have an adjustable tension for the wire but I found it was not necessary and only caused problems.
Now I just use a felt washer between the wingnut and the wire spool.

After some code tweaking the machine works very well although I need to watch it carefully as occasionally the wire does not wrap around the pole properly.
I found I could get 30 turns of the 0.04mm wire or 20 turns of 0.06mm wire. I have made 1 of each for testing.

« Last Edit: June 30, 2018, 08:06:59 AM by OddBot »


  • Member
  • ****
  • K
  • Posts: 22
Re: Motor rewinding machine
« Reply #1 on: June 30, 2018, 02:52:28 PM »
What an amazing world we live in.  If a machine was even available to do the very specific thing you needed it to do, it would probably cost upwards of $1000 or more.
But through the magic of 3D printing, small MCUs like the one you used, and the amazing variety of off the shelf parts available, you can fabricate a machine yourself for considerably less and make it do exactly what you need it to do.

Amazing build!


  • Member
  • ****
  • Posts: 46
  • Have fun every day!
Re: Motor rewinding machine
« Reply #2 on: June 30, 2018, 03:12:44 PM »
Xie xie (Chinese for thank you).

I agree we are living in an amazing world. Especially for Makers.

1 what

  • Member
  • *
  • Posts: 43
Re: Motor rewinding machine
« Reply #3 on: July 01, 2018, 03:54:11 AM »
Very nice OddBot.
I've got a feeling you would do this even if they didn't pay you!
Please keep us updated on your "hands".


  • Member
  • ****
  • t
  • Posts: 45
Re: Motor rewinding machine
« Reply #4 on: July 01, 2018, 03:56:16 AM »
Great project OddBot, very interesting approach to building brushless micromotors wondering how the custom ones workout.


  • Member
  • ****
  • Posts: 46
  • Have fun every day!
« Reply #5 on: July 01, 2018, 10:40:17 AM »
@ 1W
I'm not sure I'll ever be able to post the hands because they are a work project but I can give you a hint.
I am making a cycloidal drive 12mm x 12mm. I'm currently using a 0.4mm endmill to cut the gears.


  • Member
  • ****
  • Posts: 46
  • Have fun every day!
Custom motors
« Reply #6 on: July 01, 2018, 10:43:05 AM »
Once I have finished testing the motors I will do a separate post about modifying motors and how to control them.

1 what

  • Member
  • *
  • Posts: 43
Re: Motor rewinding machine
« Reply #7 on: July 01, 2018, 05:34:06 PM »
Quote: ''I am making a cycloidal drive 12mm x 12mm. I'm currently using a 0.4mm endmill to cut the gears."

I suggest that your next career is to move from China to Switzerland so you can revive the mechanical watch industry. I'm tempted to ask how you can even see this stuff let alone position anything by hand.
Once again, very impressive.


  • Member
  • ****
  • Posts: 58
    • opamps sensors audio amplifier
Re: Motor rewinding machine
« Reply #8 on: July 06, 2018, 01:00:04 PM »
very nice


  • Member
  • ****
  • Posts: 55
Winding things up.
« Reply #9 on: July 09, 2018, 11:01:18 AM »
Nice one OB1...
Great approach to building the chassis... looks like a very study solution.
The small finger motors (servos I guess in the end) would be interesting for the InMoov crew over @
Super small strong motors are not so readily available.
Highest regards .... the Gman


  • Member
  • ****
  • Posts: 46
  • Have fun every day!
Re: Motor rewinding machine
« Reply #10 on: July 10, 2018, 09:17:33 AM »
Small powerful motors are a difficult thing to achieve.
Until we get room temperature superconductors, more power will always equal more heat.

When the magnets get too hot (above 75° Celcius) they loose strength.
Torque is limited by the size of the iron core and the strength of the magnets.

In the end it is more important to increase the efficiency of the transmission.
Gearboxes are typically very inefficient so I am trying to eliminate their need as much as possible.

My ultimate goal is a humanoid robot without gears.

1 what

  • Member
  • *
  • Posts: 43
Re: Motor rewinding machine
« Reply #11 on: July 10, 2018, 06:03:46 PM »
Would "OB Brand" miniature stepper motors be the answer?
With enough small steps they could give what looks like smooth motion and rotational speed doesn't need a gearbox.
Just send me half of your bonus!

Please ignore the above post...... I've just remembered that you are working with stepper motors already. Whoops.
« Last Edit: July 10, 2018, 11:34:58 PM by 1 what »


* Search

* Recent Topics

Servo Calibrator by BaldwinK
[Today at 10:20:42 AM]

MKS Gen L 1.0 by jinx
[Today at 05:09:27 AM]

ESP32 "Life is Life" 64x32 flexible P4 RGB LED by jinx
[May 18, 2019, 11:19:44 AM]

Warco HV-4" Rotary Table by jinx
[May 08, 2019, 03:12:58 PM]

Warco WM14 milling machine by jinx
[April 28, 2019, 09:41:40 AM]

MKS GEN L Servo Issue by Reywas
[April 22, 2019, 09:10:08 PM]

Meowth Abandoned by Nemesis
[April 11, 2019, 11:08:00 AM]

Bench Power: Help a rebel out by jinx
[April 03, 2019, 04:20:10 AM]

Just a short intro... by MEgg
[March 18, 2019, 05:49:28 PM]

Yes I am alive! by jinx
[March 10, 2019, 04:38:53 AM]

CZ-1 2.0: problems, calibration and printing, part2 by MEgg
[February 26, 2019, 03:35:15 PM]

Hi, Mushroom glue here. by nschreiber0813
[February 25, 2019, 02:09:13 PM]

Arduino IK by BaldwinK
[February 25, 2019, 05:54:44 AM]

Raspberry Pi / Python eBook - free for the next 11 hours! by MEgg
[February 24, 2019, 09:49:43 AM]

Fun Fact by Impala
[February 13, 2019, 11:05:01 PM]

* Recent Posts

Servo Calibrator by BaldwinK
[Today at 10:20:42 AM]

Re: MKS Gen L 1.0 by jinx
[Today at 05:09:27 AM]

Re: MKS Gen L 1.0 by Bappi
[Today at 03:34:54 AM]

Re: MKS Gen L 1.0 by jinx
[Today at 02:28:17 AM]

Re: MKS Gen L 1.0 by Bappi
[May 20, 2019, 07:11:31 PM]

Re: MKS Gen L 1.0 by jinx
[May 20, 2019, 03:16:02 PM]

Re: MKS Gen L 1.0 by Bappi
[May 20, 2019, 02:53:00 PM]

Re: MKS Gen L 1.0 by jinx
[May 20, 2019, 03:31:49 AM]

Re: MKS Gen L 1.0 by Bappi
[May 19, 2019, 07:16:21 PM]

Re: MKS Gen L 1.0 by Bappi
[May 19, 2019, 04:04:47 PM]

Re: MKS Gen L 1.0 by jinx
[May 19, 2019, 08:50:41 AM]

Re: MKS Gen L 1.0 by Bappi
[May 18, 2019, 04:38:59 PM]

Re: MKS Gen L 1.0 by Bappi
[May 18, 2019, 04:25:37 PM]

Re: MKS Gen L 1.0 by jinx
[May 18, 2019, 04:10:22 PM]

Re: MKS Gen L 1.0 by Bappi
[May 18, 2019, 02:01:41 PM]