Main Dimensions of a DC Machine-C++ Program

Well I think I have written about my love for “Electrical Machine Design” or “Design of Electrical Apparatus” even earlier. The best part is in real life DEA is done using computer algorithms. (Well I would guess with some aid from operators.) Well you see the difference between Electrical related Software and others is that the former can never be made completely fool proof. Meaning you would have to know what you are dealing with if you want to use the program. One of my other interests is of-course coding. This whole semester, the only thing I found engaging in college was the “Power System Simulation Lab”. So I decided to try a bit of coding for DEA.

I set out to write a simple program that would find the main dimensions of the machine provided with the necessary input. I am not posting the code or links to the .exe file downloads just yet because I think it needs some refinement. Also I think it would be a better idea to test it extensively before releasing the same. I do intend to release them later though.

I wrote a program that took into account the various possible inputs such that the user would not have to do much of manual calculations himself. But there’s a thin line between writing a good program and writing more code than is necessary. So I have left a few chinks in the armour for now and hence it will not calculate for any data you provide it. For instance you either have to input the Power Developed in the armature ‘Pa’ or the Rated Power Output of the machine ‘P’ combined with the efficiency. I have however not added the option of entering the armature voltage and current as of now. So you would be required to manually calculate power from them. (I could easily have done this and maybe I will before I upload the source code.)

Another issue as of now is that I am not going to perform any constraint checks. Well this is a little complicated. It’s definitely do-able, but I’ll reserve that too for later. I tried it out on a couple of problems from “A Course in Electrical Machine Design” by A.K.Sawhney and thankfully it worked. (Not that there is anything to it) I am simply presenting screen shots of the outputs along with the problem numbers.

Example 9.1:


Example 9.2:


Having used MATLAB, I find finding errors in C++ a bit painful. With M-files, you can check values of variables in the Main Window (Isn’t it called that ?) and find out where you have gone wrong. But of-course C++ has features that MATLAB doesn’t. Both have their own advantages.


11 thoughts on “Main Dimensions of a DC Machine-C++ Program

  1. Dear Karthik,
    I am working on design of PMDC motors…Can you please send your programs to me. (both MATLAB and C\C++).

  2. Hi Ravi,

    Nice to know that you are working on PMDC machines. Are you a student ? and if so form where ? My programs will be made available on my blog.Unfortunately I haven’t quite completed work on the same. Will upload it at the earliest.


  3. Hi, karteek
    I have completed my masters in EEE and now working in Bangalore, and here we manufacture PMDC motors for automotive applications.
    I am into Design and Development. Hence your programs will be of very much Use. Any way I assure, I dont use them for any commercial purpose. It will be only for my understanding only. If you can mail me, that will be very good.

  4. Nice..!!
    To See , that you have taken so much of an effort to code for this , thought simple it must be..
    How about putting up the code now..

    Also Am Currently in My Final year , any tips you would like to give to get done with the exam..
    I say “get done” probably cause maybe I don’t share the same passion as you have and take Sawhney to be quite volumunous.. How about just Nagoor Kani.. That seems simpler , Sawhney its difficult to get the Portions , more of a Bakshi series fan.

    Am in SVCE right now , which College were you in..??

  5. karthik!

    me and my colleagues are now in our final year in college, we have special project that would calculate and plot torque-speed characteristic, speed-torque char and others. im having problems with my paper, especially in the Related studies part, can i feature your idea? or can give me other sources to be used as our related literature.

    hoping for your favorable response.

    im from MSU-IIT, philippines.

  6. @Ravi/Krooked Hades,

    I am terribly sorry to disappoint, but I don’t think my codes will really help. They are way to amateurish and more of a hobbist’s codes. Moreover I don’t even know where they are right now. But when I do come up with better code, I shall either put it up or mail it to you or something.

    Well, everyone has their own choices. It doesn’t really matter which book you study from as long as you know what you are doing.

    Not much effort went into it. (Though it should have) And you are right in saying that it was pretty easy to code this.

    If I had any ideas on Electrical Machines that is new, I’d be applying for patent. Unless you are planning on doing that, you will find plenty of established ideas in good Text books. 😀

  7. can i get the program
    a also previously had sent you message
    can i request the ebook “A Course in Electrical Machine Design” by A.K Sawhney
    i really beed it
    pleasa reply

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s