Commit 31bd39b2 authored by Sam Calisch's avatar Sam Calisch

added impactor power board

parent 105cd9d1
Pipeline #987 passed with stage
in 4 seconds
from koko.lib.pcb import *
from koko.lib.sam import *
class BarrelJackSMD(Component):
pw = 2.8/25.4
ph = 2.4/25.4
_pad = chamfered_rectangle(-.5*pw,.5*pw,-.5*ph,.5*ph,.01)
_via = s2d.circle(0,0,.065)
pins = [
Pin(.192,.177+.5*ph,_pad,'V'),
Pin(.437,.177+.5*ph,_pad,'V2'),
Pin(.192,-.177-.5*ph,_pad,'GND'),
Pin(.437,-.177-.5*ph,_pad,'GND2'),
]
vias = [Via(.197,0,s2d.circle(0,0,.5*.065)),
Via(.374,0,s2d.circle(0,0,.5*.073))]
shadow = s2d.rectangle(0,.58,-.18,.18)
class TH2(Component):
_pad = rectangle(-.05,.05,-.1,.1)
pins = [Pin(-.1,0,_pad,'A'),Pin(.1,0,_pad,'B')]
vias = [Via(p.x,p.y,circle(0,0,.02)) for p in pins]
class Pheonix_WTB(Component):
_pad = rectangle(-.4*1.2/25.4,.4*1.2/25.4, -.5*3.4/25.4,.5*3.4/25.4)
_pad_big = chamfered_rectangle(-1.15/25.4,1.15/25.4,-2.8/25.4,2.8/25.4,.01)
pins = [
Pin(-1.5*2.5/25.4, -6.6/25.4,_pad,'1'),
Pin(- .5*2.5/25.4, -6.6/25.4,_pad,'2'),
Pin( .5*2.5/25.4, -6.6/25.4,_pad,'3'),
Pin( 1.5*2.5/25.4, -6.6/25.4,_pad,'4'),
Pin( -12.7/25.4/2, 0, _pad_big),
Pin( 12.7/25.4/2, 0, _pad_big),
]
vias = []
shadow = rectangle(-6/25.4,6/25.4,-8.3/25.4,2.8/25.4)
class Header_Stepper(Component):
''' For bipolar stepper
'''
_pad_header = chamfered_rectangle(-0.06, 0.06, -0.022, 0.022,.007)
pins = [
Pin(0, -0.15, _pad_header, 'A1'),
Pin(0, -0.05, _pad_header, 'A2'),
Pin(0, 0.05, _pad_header, 'B1'),
Pin(0, 0.15, _pad_header, 'B2'),
]
prefix = 'J'
vias = []
shadow = s2d.rectangle(-.06,8/25.4,-.18,.18)
width = 1
height = 3
pcb = PCB(0,0,width,height,chamfer_distance=.2)
class M6_Hole(Component):
pins = [Pin(0,0,circle(0,0,.001))]
prefix='V'
vias = [Via(0,0,circle(0,0,3.1/25.4))]
shadow = circle(0,0,5.5/25.4/2)
'''
hole_y = .25
hole = M6_Hole(.5*width, hole_y)
pcb += hole
hole = M6_Hole(.5*width, height-.25)
pcb += hole
pow = BarrelJackSMD(0.05,1.5,0,'pow')
pcb += pow
switch = Pheonix_WTB(.5,.75,180,'switch')
pcb += switch
sol = TH2(.5*width,height-.75,0,'solenoid')
pcb += sol
pcb.connectV(pow['GND2'],pow['GND'],width=.06)
pcb.connectV(pow['V2'],pow['V'],width=.06)
pcb.connectD(pow['GND2'],[pow.x+.6,pow.y+.35],sol['A'],width=.06)
pcb.connectD(switch['2'],[switch['2'].x,switch['2'].y+.1],[pow.x+.75,pow.y+.45],sol['B'],width=[.04,.04,.06,.06,.06,.06,])
pcb.connectV(switch['3'],pow['GND'],width=[.04,.06])
pcb.connectD(switch['4'],[switch['4'].x-.15,switch['4'].y],[pow['V'].x-.14,pow['V'].y-.1],pow['V'],width=.06)
pcb.connectV(switch['1'],[switch['4'].x,switch['4'].y-.14],switch['4'],width=.04)
'''
hole = M6_Hole(.5*width, .25)
pcb += hole
hole = M6_Hole(.5*width, height-.75)
pcb += hole
pow = BarrelJackSMD(.7,.6,90,'pow')
pcb += pow
switch = Pheonix_WTB(.3,1.3,180,'switch')
pcb += switch
sol = TH2(.5*width,height-.25,0,'solenoid')
pcb += sol
pcb.connectV(pow['GND2'],pow['GND'],width=.06)
pcb.connectV(pow['V2'],pow['V'],width=.06)
#pcb.connectD(pow['V2'],switch['4'],width=.04)
pcb.connectD(pow['V2'],switch['2'],width=.04)
pcb.connectV(switch['4'],[switch['2'].x,switch['2'].y+.15],switch['2'],width=.04)
pcb.connectD(sol['B'],[sol['B'].x+.1,sol['B'].y],pow['GND2'],width=.05)
pcb.connectD(switch['1'],[switch['1'].x,switch['1'].y+.2],[sol['A'].x-.3,sol['A'].y-.1],sol['A'],width=[.04,.04,.06,.06,.06,.06])
pcb.connectD(switch['3'],[switch['3'].x,switch['3'].y-.8],[pow['GND'].x-.1,pow['GND'].y-.16],pow['GND'],width=.04)
osx = .1
osy = .0
os = rectangle(-osx,width+osx,-osy,height+osy)
pcb.custom_cutout = pcb.cutout + (os-os)
cad.shapes = pcb.layout()
#cad.shape = pcb.traces+(pcb.cutout-pcb.cutout)
#cad.shape = pcb.cutout+(pcb.traces-pcb.traces)
#cad.shape = pcb.custom_layers['wj']['layer']
\ No newline at end of file
Markdown is supported
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