mathjax

2013-02-24

winding pattern generator:

finally wrote the winding pattern generator for an arbitrary number of phases, source:
winding pattern generator
It was written in python 3.x so you'll need to run it. It out put the phase as a number and the direction of the winding as the sign. If any of you end up using it, it would be awesome to hear suggestions, or added features or what you might like to see next.

But yeah so this is that motor winder thing I was talking about, it was accidentally lost while playikng the game of musical partions while reinstalling things on the laptop.
But I rewrote it! and here is.
It gives you a winding pattern for a n-phase, m-pole and k*2 pole motor. If you're too lazy to open up the code to look at it, here's the most important part of it:


def pattern_gin(slot_edeg, phase_slice):
 
    phase = m.floor((slot_edeg % 180)/ phase_slice)#actually calculates the phase for the slot

    if (phase % 2 == 0):#dictates the direction of each winding
        if slot_edeg >= 180:
            phase_sign = '+'
        else:
            phase_sign = '-'
    else:
        if slot_edeg >= 180:
            phase_sign = '-'
        else:
            phase_sign = '+'
    return phase_sign, phase

This is the function that defines the phase and direction of a winding on one stator tooth.
As the input it takes the electrical degree position and the electrical degrees of each phase and matches them up...its really not that exciting.

I've been learning haskell and I'm considering making some sort of simulator