Commit b4a747ac authored by Sam Calisch's avatar Sam Calisch
Browse files

add coil to hex spiral

parent 375ed272
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -127,8 +127,9 @@ def main():
frame_bolt_d = 4.1 #mm, diameter of bolt holes
wire_pitch = 2*.088 #mm, pitch, .088 = measured diameter (.080) + .008 mm slop (10% applied)
N = 11 #number of turns
N = 19 #number of turns, must be odd
Nr = 4 #number of radial layers in the hex lattice
lead_length = 20
#make frame
frame = []
......@@ -142,21 +143,52 @@ def main():
circle(.5*(v0+v1), frame_bolt_d, 'frame'),
]
#make magnet grid and air hole grid
magnets = [];
magnets += [circle(V2(0,0),mag_d,'magnets_a')]
#for each of the (2*Nr-1)*(Nr) points in the grid, what are the starting and ending angles
coil_params=[
[(90,330), (150,30), (210,360+90), (270,360+30), (210,90), (270,30), (210,360+90), (150,270)],
[(90,330), (270,360+150), (330,450), (270,150), (330,90), (270,360+150), (330,360+90), (150,270)],
[(210,330), (360+150,270), (330,450), (270,150), (330,90), (270,360+150), (330,360+90), (150,270)],
[(360+210,330), (150,360+30), (360+210,330), (270,150), (330,90), (270,360+150), (330,360+90), (150,270)],
]
#make magnet grid, air holes, and coils
crvs = [];
crvs += [circle(V2(0,0),mag_d,'magnets_a')]
for i in range(3): #3-fold angular symmetry
vr = V2(cos(i*2*pi/3),sin(i*2*pi/3))
vth = V2(cos(i*2*pi/3+pi/2),sin(i*2*pi/3+pi/2))
vk = V2(cos((i+1)*2*pi/3),sin((i+1)*2*pi/3))
for j in range(Nr):
for k in range(Nr+1):
magnets += [circle(2*s32*vr*(j+1) + 2*s32*vk*k, mag_d, 'magnets_a')]
crvs += [circle(2*s32*vr*(j+1) + 2*s32*vk*k, mag_d, 'magnets_a')]
if k<Nr:
magnets += [
crvs += [
circle(2*s32*vr*(j+.5) + 2*s32*vk*k + .5*s*vth, mag_d, 'magnets_b'),
circle(2*s32*vr*j + 2*s32*vk*k + s*vth, hole_d, 'holes'),
]
]
#coils
for l in range(N):
dd = (l - (N-1)/2)*wire_pitch
crvs += [ arc(2*s32*vr*(j+.5) + 2*s32*vk*k + .5*s*vth, s+dd, coil_params[k][2*j][0]+i*120, coil_params[k][2*j][1]+i*120,'coils' ) ]
if j<Nr-1 or k>0:
crvs += [ arc(2*s32*vr*(j+1) + 2*s32*vk*k, s+dd, coil_params[k][2*j+1][0]+i*120, coil_params[k][2*j+1][1]+i*120,'coils' ) ]
#make traverses
for l in range(N):
dd = (l - (N-1)/2)*wire_pitch
crvs += [ arc(2*s32*(vr+vk)*Nr, s+dd, 270+i*120, 180+i*120,'coils' ) ]
crvs += [ arc(2*s32*vr*(Nr-1) + 2*s32*Nr*vk, s+dd, 270+i*120, 360+i*120,'coils' ) ]
if l<N-1:
crvs += [ arc(2*s32*vr*(Nr-.5) + 2*s32*Nr*vk - .25*wire_pitch*vr, s*(sqrt(3)-1)+dd+.5*wire_pitch, 180+i*120, 0+i*120,'coils' ) ]
#make leads
v0 = 2*s32*vr*(Nr-.5) + 2*s32*Nr*vk - .25*wire_pitch*vr
r0 = .5*(s*(sqrt(3)-1) - N/2.*wire_pitch)*vr
r1 = .5*(s*(sqrt(3)-1) + N/2.*wire_pitch)*vr
crvs += [
line( v0-r0, v0-r0+lead_length*vth, 'coils' ),
line( v0+r1, v0+r1+lead_length*vth, 'coils' ),
]
if __name__ == '__main__':
main()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment