Semi automatic transformer winder

The result

The result

I had made one before but the problem was the feed of the wire. It was a lot of work to do that by hand. But I had some more things I wanted to change.

The “feeder” is moved by a steppermotor so all turns come nice next to each other. And because an arduino is the easy way to control that I added some other things to.

The setup is easy by a potentiometer and a pushbutton. I set the number of turns per layer, The number of layers, the wire diameter, the direction of the feeder for the first layer and the speed of the steppermotor.

To count the turns I use a IR sensor on the bobbin pulley. The base for the software is written by my friend Jochem who made first a program to test everything and was very helpful and patient because it took a while to get at the right track. The final program I wrote myself. This is a topic on my favorite forum about this winder: http://www.circuitsonline.net/forum/view/132676/1/stappenmotor

You can see it in action on youtube

winder2

The control panel

winder5

The not so fun part of winding transformers is putting it back together

winder4

In action while winding almost 5000 turns

winder3

Just a picture

The software is an Arduino sketch. I used two stepper controller IC’s I found in my junkbox. (L6203)

#include <LiquidCrystal.h>
#include <Stepper.h>

int pause = 0; // pin 2 atmel is pause, latching
int OKknop = 1; // pin 3 atmel, non latching pushbutton
int richtingKnop = 13; // pin 19 atmel, spdt switch, open (high) and gnd(low)
int motor = A4; // pin 27 atmel, motor relais
int potmeter = A0; // pin 23 atmel, set potmeter
int sluis = 12; // pin 18 atmel, 5V TTL. trigger is high output from sensor

const int stepsPerRevolution = 200; // depending stepper motor
int stepdistance = 625; // 1 turn = 1250 um / 200 = 6,25 um/stap ivm float x100
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

int stepCount = 0; // number of steps the motor has taken
//int potDia ; // wire diameter in micrometer
unsigned int potDia; // wire diameter in micrometer
int turnCount = 0; // counts ir sensor triggers, 1 per turn
int StepsPerTurn; // steps of motor per turn
int richting = 1; // direction of steppermotor HIGH is forward,
int mux = 1; // 1 is FW, -1 BW multiplier
int potLay; // number of set layers
int potTurn; // number of wire-turns
int potSpeed; // speed in RPM, voor 0,11mm is 30 voldoende, voor 0,5 veel sneller (150)
int layer = 1; // counter
int buttonState = 0; // current state of the button
int lastButtonState = 0; // previous state of the button
int teller = 0;
int potVal; // the value of the potentiometer
int setMm = 0;
int mmMove;
int totturn = 0;

//—————————————-
// set up manuele verplaatsing
//—————————————-
void manueel()
{
while (digitalRead(pause) == LOW) // pause all
{
while (digitalRead(OKknop) == HIGH)
{
digitalWrite(motor, LOW);
lcd.setCursor(0,0);
lcd.print(“richting “);
richting = digitalRead(richtingKnop);
if (richting == LOW)
{
lcd.setCursor(0,1);
lcd.print(“Naar voren “);
mmMove = 50;
}
if (richting == HIGH)
{
lcd.setCursor(0,1);
lcd.print(“Naar achter “);
mmMove = -50;
}
}
myStepper.setSpeed(150);
myStepper.step(mmMove);
delay(100);
}
lcd.clear();
}
void setup()
{
lcd.begin(16, 2); // set up the LCD’s number of columns and rows:
lcd.print(“Welkom “);
delay(500);
lcd.clear();

//———————————–
// declaring ports
//————————————
pinMode(pause, INPUT_PULLUP); // standard = HIGH, pause button
pinMode(OKknop, INPUT_PULLUP); // confirm button
pinMode(richtingKnop, INPUT_PULLUP); // direction of stepper motor spdt switch
pinMode(motor, OUTPUT); // relais winder motor
pinMode(sluis, INPUT); // 1 positive puls per revolution

}

void loop()
{
int potVal; // the value of the potentiometer

manueel();
digitalWrite(motor, LOW); // relais winding motor

//—————————————-
// set up number of turns per layer
//—————————————-
while (digitalRead(OKknop) == HIGH)
{
lcd.setCursor(0,0);
lcd.print(“n per laag: “);
lcd.setCursor(12,0);
potVal = analogRead(potmeter);
potTurn = map(potVal, 0, 1023, 0, 1000);
lcd.print(potTurn);
lcd.setCursor(0,1);
lcd.print(“OK to set”);
delay(100);
}
lcd.clear();
delay(500);

//——————————————————-
// set up number of layers
//——————————————————-
while (digitalRead(OKknop) == HIGH)
{
lcd.setCursor(0,0);
lcd.print(“layers=: “);
lcd.setCursor(12,0);
potVal = analogRead(potmeter);
potLay = map(potVal, 0, 1023, 0, 100);
lcd.print(potLay);
lcd.setCursor(0,1);
lcd.print(“OK to set”);
lcd.setCursor(10,1);
totturn = potLay * potTurn;
lcd.print(totturn);
delay(100);
}
lcd.clear();
delay(500);
//———————————
// set first layer direction
//———————————
while (digitalRead(OKknop) == HIGH)
{
lcd.setCursor(0,0);
lcd.print(“direction feed “);
lcd.setCursor(0,1);

richting = digitalRead(richtingKnop);
if (richting == LOW)
{
lcd.setCursor(0,1);
lcd.print(“naar voren “);
mux = 1;
}
if (richting == HIGH)
{
lcd.setCursor(0,1);
lcd.print(“naar achter “);
mux = -1;
}
delay(100);
}
lcd.clear();
delay(500);

//—————————————-
// set up speed
//—————————————-
while (digitalRead(OKknop) == HIGH)
{
lcd.setCursor(0,0);
lcd.print(“steps in rpm “);
lcd.setCursor(12,0);
potVal = analogRead(potmeter);
potSpeed = map(potVal, 0, 1023, 0, 100);
lcd.print(potSpeed);
lcd.setCursor(0,1);
lcd.print(“OK to set”);
delay(100);
}
lcd.clear();
delay(500);

//————————————————
// set up wire diameter to calculate steps/turn
//————————————————
while (digitalRead(OKknop) == HIGH)
{
lcd.setCursor(0,0);
lcd.print(“WireDia – microm”);
lcd.setCursor(0,1);
potVal = analogRead(potmeter);
potDia = map(potVal, 0, 1023, 0, 1000);
lcd.print(potDia);
lcd.setCursor(5,1);
lcd.print(“OK to set “);
StepsPerTurn = (potDia * 100) / stepdistance;
turnCount = 0;
stepCount = 0;
delay(100);
}

lcd.clear();
delay(500);

teller = 0;
layer = 1;
turnCount = 0;
totturn =0;
lcd.clear();

//————————————
// winding motor control
//————————————
myStepper.setSpeed(potSpeed);
while (layer <= potLay ) // proceed upto max number of layers
{
digitalWrite(motor, HIGH); // relais winding motor
StepsPerTurn = StepsPerTurn * mux; // ivm direction , mux inverteert

while (turnCount <= potTurn) // proceed until max number of turns per layer
{
buttonState = digitalRead(sluis);
if (buttonState != lastButtonState) // compare the buttonState to its previous state
{
if (buttonState == HIGH) // if the state has changed, increment the counter
{
turnCount++ ; // if the current state is HIGH then the button wend from off to on:
totturn ++;
myStepper.step(StepsPerTurn);
lcd.setCursor(0,0);
lcd.print(“layer = “);
lcd.setCursor(12,0);
lcd.print(layer);
lcd.setCursor(0,1);
lcd.print(“turns= “);
lcd.setCursor(7,1);
lcd.print(turnCount);
lcd.setCursor(12,1);
lcd.print(totturn);

delay(10);
}
}
lastButtonState = buttonState; // save the current state as the last state

while (digitalRead(pause) == LOW) // pause all
{
while (digitalRead(OKknop) == HIGH)
{
lcd.setCursor(0,0);
digitalWrite(motor, LOW);
lcd.print(“…..WAIT…….”);
lcd.setCursor(0,1);
lcd.print(“OK = manueel “);
delay(100);
manueel();
}

digitalWrite(motor, HIGH);

}

delay(10);

}

delay(10);
layer++;
turnCount=0;
lcd.clear();

}
digitalWrite(motor, LOW);
}

 

This entry was posted in Homebrew Projects, Other projects and tagged . Bookmark the permalink.

Comments are closed.