Transformer Design Program


C Code - Information Source - Electronics Design Magazine

http://www.elecdesign.com/Articles/ArticleID/4425/4425.html

//=====================================================
// Code Transformer.c
// Prof. (Dr.) Shyam Sunder Tiwari
// www.sensorstechnology.com/
// December 10, 2006

#include "graphics.h"
#include "dos.h"
#include "string.h"
#include "stdio.h"
#include "conio.h"
#include "stdlib.h"
#include "time.h"
#include "math.h"

main()
{
	// Variable definitions
	
int	i;
char	control;	// exit button
float	primv;	// primary voltage
float	sendv;	// secondary voltage
float	primc;	// primary current
float	secndc;	// secondary current
float	primt;	// primary turns
float	secndt;	// secondary turns
float	freq;	// operating frequency
float	powerout;	// output power
float	powerin;	// input power
float	effic;	// core efficiency
float	secarea;	// core cross section
float	bmax = 60000; // magnetic flux density
float	tpv;	// turns per volt

clrscr();
// Request all input parameters
printf("What is the minimum starting primary coil voltage");
scanf("%f", &primv);
printf("What is the maximum secondary coil voltage");
scanf("%f", &secndv);
printf("What is the secondary output power in Watts");
scanf("%f", &powerout);
printf("What is the input source frequency in Hz");
scanf("%f", &freq);
printf("What is the core efficiency for this frequency");
scanf("%f", &effic);

// All parameters are computed for a given input voltage
// upwards in steps of 1V. Hit "ESC" to exit.
for (i = int(primv); i< int(100*primv); i++)
	{
	secarea = (sqrt (powerout)) / 5.58; // 5.58 is a constant
	tpv = pow(10, 8) / (4.44 * bmax * secarea * freq);
	primt = (primv * tpv);
	secndt = (secndv * tpv);
	powerin = powerout / effic;
	primc = powerin / primv;
	secndc = powerout / secondv;
	printf("\n Transformer design for primary coil voltage =  %0.1f Volts",primv);
	printf("\n Cross section area of the core =  %0.1f sq. inch or %0.1f sq. cm");
	printf(secarea, secarea*pow(2.54,2));
	printf("\nTurns per Volt for both coils = %0.1f turns / volt", tpv);
	printf("\nNumber of turns in the primary = %0.1f ", primt);
	printf("\nNumber of turns in the secondary = %0.1f ", secndt);
	printf("\nCurrent flowing in the primary = %0.3f mA", primc*pow(10,3));
	printf("\nCurrent flowing in the secondary = %0.3f uA", secndc*pow(10,6));
	printf("\n");
	primv++;
	printf("\n Hit ESC key to exit or type Enter key to continue\n\n");
	control = getch();
	if (control == 27)
	goto exit_1;
     	}
exit_1:
	return(0);
}
//=====================================================

Other Design Ideas

http://www.elecdesign.com/Articles/ArticleID/1684/1684.html

http://www.elecdesign.com/Articles/ArticleID/3503/3503.html

http://www.elecdesign.com/Articles/ArticleID/4425/4425.html

http://www.elecdesign.com/Articles/ArticleID/4745/4745.html

http://www.edn.com/archives/1996/091296/19di1.htm

http://www.edn.com/article/CA404523.html

http://www.edn.com/article/CA69080.html

 
>