GRBL Based Coil Winder From Water Pipe

by tuenhidiy in Circuits > Arduino

18410 Views, 130 Favorites, 0 Comments

GRBL Based Coil Winder From Water Pipe

Title Final.jpg
Title 4.jpg

When I was working on the Toy Magnetic Levitation project with a solenoid coil, I thought to myself, why didn't I make a coil winder. So I took my times to build a simple coil winder based on GRBL firmware and it was made from PVC pipes. I'm willing to share how I made it, please check out video below and let's get started.

Supplies

Main components:

The pipe and its fittings are shown below:

Tools:

  • Drilling machine with drill bit hole 22mm.
  • Hand saw.
  • Soldering machine.
  • Big scissor.

Schematic

The connection diagram is very simple. I just plugged the CNC shield onto the Arduino Uno R3 and connected the cables to 2 stepper motors. Two stepper motor drivers A4988 were also plugged on the CNC shield at X and Y position.

There are 2 axes for a coil winder which are called:

  • Feeder axis: connecting to X axis marked on CNC shield.
  • Spindle axis: connecting to Y axis marked on CNC shield.

The NEXTPCB support me for this project. If you have a PCB project, please visit the NEXTPCB website to get exciting discounts and coupons.

Here are mid-summer sales at NextPCB:

  • Up to 30% off for the PCB orders.
  • Up to 20% off for the PCBA orders.

Assembly Work

Firstly, I’ve tried to figure out how to build the coil winding machine. And it seems easy with PVC pipes. What we need is patience and carefulness.

1. Building a coil winder frame:

I assembled a square frame, dimension about 480 x 480mm. It was made of 7pcs x tees, 4pcs x elbows and connecting pipes.

Connecting pipes should be cut in suitable length so that when we connect elbow to tee or tee to tee, there is no gap between them. With this connecting way, we don't need to do any measurements or alignments later because they are the same size and completely symmetrical each other. As the picture above, we have 3 pairs of pipe that are completely symmetrical each other.

2. Drilling holes on the end caps for bearings and cooper nut:

Since I used a hand drilling machine, it was a bit difficult at the beginning. My goal was to drill about 12pcs x end caps with a 22mm diameter punch drill bit.

They should be drilled in the center of the end caps. When the drilling is complete, the bearings cannot be inserted into the holes. I've used this trick: using scissor's back to cut around the hole by rotating in circle, it made the hole a little wider, checked them thoroughly with bearings, until bearings could be tightly inserted to the holes.

We should turn the end cap upside down, we would see the concentric circles inside the end cap and mark its center before drilling.

It is better to use flanged bearings. I only have a few of this type, the rest are normal bearings but that's okay, when we fit tightly them into the holes, it's strong enough.

For copper nut of leadscrew, I used a drill bit 8mm with above trick.

3. Building a feeder axis:

Feeder axis was built from 1pcs x PVC tee and 1 pcs x PVC cross. I installed end caps with bearings & copper nut at the two ends of PVC tee and cross. It looked like this.

I had one roller with 2 bearings at the ends, diameter about 42mm. I tried to put it inside the PVC tee for sliding the shaft. If we don't have it, we can use one tee plus 2 pcs x end caps with bearings.

The leadscrew and shaft were inserted into bearings of feeder axis.

The other side view of feeder axis.

I temporarily mounted feeder axis on the coil winder frame and checked by hand how it worked.

4. Drilling stepper motors frame base

I cut one acrylic plate size 100 x 230mm, drilled 8 small holes for mounting 2 x stepper motors on it. This acrylic plate was then attached on the frame by 2 big holes whose diameter is equal outer diameter of pipe 42.

I have installed 2pcs x end caps with bearings on the front side of the stepper motors where they will be connected to the feeder axis and spindle axis.

Conecting pipes at back side would be connected to the frame. By this way, it looks neat and solid.

5. Building and mounting the spindle axis

I had some screw bolts with length x diameter about 16 x 8mm and I used them for spindle shaft. Or we can use shaft rods 200 x 8mm as mentioned on BOM list.

Acrylic base was mounted on the main frame. I installed 20 teeth pulley to the motors; 60 teeth pulley to spindle shaft; and closed timing belt 200mm.

Feeder axis was mounted on the main frame. Its pulleys and timing belt was as same as the spindle axis.

I mounting 1 screw bolts on the main frame at the other side of spindle axis and locked it by one bearing.

6. Building a uncoiling part

For uncoiling part, I used a bolt and tighten the copper coil by 2 end caps. It can rotate with a specific friction based on tighten force.

One empty spool was also connected to spindle shaft.

It looks not bad!!!

7. Building tension guide roller and copper feeder pipe.

I used some L steel supports to mount 2 rubber rollers on one acrylic sheet, then installed this tension guide roller to feeder axis

To feed the copper wire to spindle, I used one small steel pipe and inserted 2 plastic pen tips at 2 ends.

Plastic pen tips was taken from this.

Finally, I connected wires from stepper motors to CNC shield.

DONE!!!

The uncoiling part can be arranged like this, by adding one more PVC elbow. It's easy to be rotated to get the best feeding direction.

GRBL & UGS

1. GRBL parameters for my coil winder are as follows:

$010.000Step pulse time
$125.000Step idle delay
$20.000Step pulse invert
$30.000Step direction invert
$40.000Invert step enable pin
$50.000Invert limit pins
$60.000Invert probe pin
$101.000Status report options
$110.010Junction deviation
$120.002Arc tolerance
$13

0.000

Report in inches
$20

0.000

Soft limits enable
$21

0.000

Hard limits enable
$22

0.000

Homing cycle enable
$23

0.000

Homing direction invert
$2425.000Homing locate feed rate
$25500.000Homing search seek rate
$26250.000Homing switch de-bounce delay
$271.000Homing switch pull-off distance
$301000.000Maximum spindle speed
$310.000Minimum spindle speed
$320.000Laser-mode enable
$100600.000X-axis travel resolution
$1014800.000Y-axis travel resolution
$102250.000Z-axis travel resolution
$110500.000X-axis maximum rate
$111500.000Y-axis maximum rate
$1122000.000Z-axis maximum rate
$1205.000X-axis acceleration
$1215.000Y-axis acceleration
$12210.000Z-axis acceleration
$130200.000X-axis maximum travel
$131200.000Y-axis maximum travel
$132200.000Z-axis maximum travel

The important parameters which I have done the calibrations are highlighted in table above.

Details of parameters $100 and $101 are discussed in the next step.

The acceleration parameters $120 and $121 should be set to a small value, depending on the wire diameter, to prevent copper wire breakage.

2. Universal GCode Platform (UGS):

  • Open Universal Gcode Platform, select Port and set Baud to 115200, click on Connect tab.
  • Select the appropriate position by moving X axis left - right, rotating Y axis clockwise - counter clock wise.
  • Set the original coordinates by button Reset Zero.

How It Works

My winder works with cylindrical coils and based on GRBL firmware. To wind a copper wire in the cylindrical shape, we need the following parameters, I should give specific example:

  • No. of turn: 1000.
  • Coil length: 47 (mm).
  • Original bobbin diameter: 27.7 (mm).
  • Wire diameter: 0.3 (mm).
  • Speed: 50 (rpm).

Thus, we need to stack 1000 turns of wire diameter 0.3mm in layers on a empty spool that has a length 47mm and an original diameter 27.7mm.

The major calculation is as below:

  • No. of turn per one layer = Coil length/ Wire diameter = 47 / 0.3 = 156.67.
  • No. of layers = Total no. of turn/ No. of turn per one layer = 1000 / 156.67 = 6.38.

To use GRBL firmware, my idea is like this:

  • Feeder axis: will move right and left in the range from 0 to 47mm, with 6.38 times and its STEP/mm parameter is precisely defined according to the GRBL firmware. It will reverse when the spindle axis rotates exactly by a multiple of 156.67, that means, when one layer is completed.
  • Spindle axis: will rotate exactly 1000 revolutions and then stop. Its setting in the GRBL firmware is STEP/rev. Note that is STEP/revolutions, not STEP/mm.

Because the copper wire diameter is 0.3mm, so the feeder axis would move between 0.15 and 46.85mm (minus the wire radius at 2 edges).

G-code

Following to the example above, there are a total of 6.38 layers, so the last 0.38 layer (layer 7) has 0.38 x 156.667= 60 revolutions. That means spindle axis will rotate 60 revolutions and feeder axis will move to (60*0.3 - 0.15) = 17.85 from 0.15. The feeder movement rule is:

  • Odd Layer: From 0.15 to 46.85 (Move Right).
  • Even Layer: From 46.85 to 0.15 (Move Left).

Coil winder G-Code can be specified as follows, with feed rate 50. On the next step, I will explain how to generate G-code automatically by Excel template.

COMMENTG-CODEXYSPEED

(Starting...…)

G01

X0.1500

Y0.0000

F50.0000

(Layer 1 of 7)

G01

X46.8500

Y156.6667

F50.0000

(Layer 2 of 7)

G01

X0.1500

Y313.3333

F50.0000

(Layer 3 of 7)

G01

X46.8500

Y470.0000

F50.0000

(Layer 4 of 7)

G01

X0.1500

Y626.6667

F50.0000

(Layer 5 of 7)

G01

X46.8500

Y783.3333

F50.0000

(Layer 6 of 7)

G01

X0.1500

Y940.0000

F50.0000

(Layer 7 of 7)

G01

X17.8500

Y1000.0000

F50.0000

GRBL parameters

  • Feeder axis: The value $100 was set to 600 STEP/mm.
  • Spindle axis: My stepper motor had 200 steps per rotation and 20 teeth pulley. It was connected to rotation shaft via 60 teeth pulley and 1/8 micro stepping was enabled. So, the value $101 was set to: 200 x (60/20) x 8 = 4800 STEP/rev.

We can check whether the spindle axis is working properly by using UGS and instructing it to move 1mm. If it turns exactly one revolution then our setting is correct.

Please look back at the 2 command lines at the top of table above, the "G01" command will command the feeder axis move from 0.15 to 46.85 and the spindle rotates 156.67 revolutions.

(Starting……  )    G01       X0.1500             Y0.0000           F100.0000
(Layer 1 of 7)    G01       X46.8500            Y156.6667         F100.0000

I'm not familiar with G-Code but after reading the manual, I knew that "G01 X Y F" is a linear move command to coordinates (X, Y) with feed rate F, which means both feeder and spindle axes will move linearly together. In my case, the feeder will move to the end point 46.85 at the same time the spindle completes 156.67 revolutions.

So coil winder based on GRBL has been made easy.

G-Code for Coil Winder

I wrote a small program in Microsoft Excel to generate G-Code and it worked fine with my coil winder. We can change the input parameters: no. of turns, coil length and diameter, wire diameter and speed to get corresponding G-code. If you want to try it, you should lower the feed rate and run the simulation before attaching the copper wire to the spindle axis.

After entering the necessary parameters, Excel will generate command lines containing G-code. I just copied them into Notepad++ and opened it in UGS then run the program.

It looked like this when I opened G-code file in UGS. Its graphs are linear lines, with 2 end operating points: 1000mm and 46.85mm in Y and X axis. As discussed in the previous steps, 1000mm in this case is 1000 revolutions since I have set $101 as STEP/rev (4800).

In the Excel program, I have added some more calculations in the "REPORT" field.

  • Total wire length.
  • Diameter after coiling.

Regarding to the number of command lines, it is no problem with Excel at all.

Testing & Tips

I tested with copper wire diameter 0.5mm with 4 layers, and total no. of turns 345, as below picture . The wire diameter entered into the Excel file should be slightly bigger than the actual diameter, in my case: 0.545mm. Because two adjacent turns of wire could not be able to touch each other exactly 100%, there is always a small gap between them.

Then I copied the G-codes from Excel to Notepad++ and run them in UGS.

We should watch out when the coil winder works in the first layer. If it has a big gap between two adjacent turns, then in the second layer, copper wire will insert into this gap due to tension and affect the whole coil structure.

If you want a perfect coil, then you need to pay attention when the feeder axis reverses because the wire can get tangled at that time. And we can add a G-code command to stop the machine for a specific time, at each feeder reversal time, and make correction, like this:

G04 P5 (It makes the coiling winder stop for a specified time - 5 seconds in this case)

Results achieved as far as the parameters above.

Conclusion

Title 3.jpg
Finish 7.jpg
Finish 5.jpg
One Coil 1.jpg
Finish 1.jpg

If you have a CNC machine that worked with GRBL firmware, you can make a coil winder easily by adding a spindle axis and configuring it to operate in STEP/revolutions unit.

Thank you for reading my work!!!