Skip to content
Snippets Groups Projects
README.md 13.3 KiB
Newer Older
  • Learn to ignore specific revisions
  • Jake Read's avatar
    Jake Read committed
    # CBA Circuit Best Practices
    
    Notes for beginners and reference for experts on the nuts and bolts of circuit design and manufacturing. This repo also includes libraries of some common components from the Fab Lab inventory for Eagle and KiCAD.
    
    # Design
    
    ## Schematics and Boards
    
    
    Jake Read's avatar
    Jake Read committed
    No matter what software you're using, it's important to understand the two representations we use to describe circuits.
    
    Jake Read's avatar
    Jake Read committed
    The ```schematic``` is a nonphysical space where we can describe which outputs or inputs from our various components are connected to one another. In a schematic, we find part ```symbols``` that pave ```pins```, these are connected to one another on ```nets```.
    
    Jake Read's avatar
    Jake Read committed
    ![labelled_schem](eagle/examples/xmega-demo/schematic.png)
    
    Jake Read's avatar
    Jake Read committed
    Critically, we can connect nets to one another by simply assigning them the same name. This is a useful trick that you will probably encounter many times in the wild. Also important to note are ```supply``` components, like the **gnd** and **v+** or **+3v3** etc symbols, which are simply symbolic representations of similarely named nets.
    
    Jake Read's avatar
    Jake Read committed
    It's not-not useful to recall that schematics are also nice visual diagrams of what we want our circuits to do. There's no harm in making them look medium-nice. :bowtie:
    
    Jake Read's avatar
    Jake Read committed
    The ```board``` representation is where our design meets the physical world. Here we find ```footprints``` that have ```pads``` that are connected to one another via ```traces, vias, and pours``` i.e. copper.
    
    Jake Read's avatar
    Jake Read committed
    ![labelled_board](eagle/examples/xmega-demo/routed.png)
    
    Jake Read's avatar
    Jake Read committed
    In Eagle, `boards` and `schematics` should be automatically associated with one another. This is referred to as 'forward/back annotation' - but typically goes one way: from the schematic to the board. It's best, while we're starting, to treat this relationship as a directional one. I.E. when you're deleting a component, do so in the schematic, otherwise you will introduce inconsistencies and Eagle might abandon you.
    
    Jake Read's avatar
    Jake Read committed
    KiCAD uses a different system, where we save a `netlist` from our schematic, and open that in a board editor. This is partially an opinion about the division between the two practices, and partially a historic artefact of KiCAD's development as a collection of not-unrelated softwares.
    
    Jake Read's avatar
    Jake Read committed
    ## Symbols and Footprints
    
    Jake Read's avatar
    Jake Read committed
    Our circuit assemblies are made of `schematics` that are diagrams of our `boards`, and so the components we use to put them together have a similar split; we call them `symbols` and `footprints`.
    
    Jake Read's avatar
    Jake Read committed
    A `symbol` is a diagram of a part, and the `footprint` is the 'landing' that we need in order for the part to be successfully included in our circuit. The matching copper for us to hook the IC to.
    
    Jake Read's avatar
    Jake Read committed
    ![mosfet](images/parts-mosfet-sot23.png)
    ![mosfet](images/parts-mosfet-to252.png)
    
    Jake Read's avatar
    Jake Read committed
    Symbols can have multiple footprints: the same or similar silicon divices can be packaged in varying sizes for circuit integration.
    
    Jake Read's avatar
    Jake Read committed
    ![micro](images/parts-xmega-tqfp.png)
    ![micro](images/parts-xmega-qfn.png)
    
    Jake Read's avatar
    Jake Read committed
    To make your own symbols or footprints, I can recommend [Autodesk's Tutorial, starting here](https://www.autodesk.com/products/eagle/blog/library-basics-part-1-creating-first-package-autodesk-eagle/) and for KiCAD, the [symbol](https://www.youtube.com/watch?v=LaUd8WfFooU), [footprint](https://www.youtube.com/watch?v=LaUd8WfFooU), and [the association](https://www.youtube.com/watch?v=IIPKGoW0VBY).
    
    Jake Read's avatar
    Jake Read committed
    ## Libraries
    
    Jake Read's avatar
    Jake Read committed
    To organize collections of parts, we use `libraries` of devices: paired symbols and footprints. For eagle, I've included our CBA libraries in the [**eagle/parts** directory](eagle/parts) of this repo. I've also included the [sparkfun libraries](https://github.com/sparkfun/SparkFun-Eagle-Libraries) as I commonly use their connectors library for pin-headers. Parts in the `fablab` library *should* all be available in fab labs, but it's best to check with actual inventory before designing a circuit. It's also likely that parts in the inventory are not yet in the library: if you find this to be the case, and you make a footprint for a part you would like to use (or find one online) please push a merge request, or raise an issue in this repo!
    
    Jake Read's avatar
    Jake Read committed
    The [fablab inventory](https://docs.google.com/spreadsheets/u/1/d/1U-jcBWOJEjBT5A0N84IUubtcHKMEMtndQPLCkZCkVsU/pub?single=true&gid=0&output=html) includes all of the circuit components that *should* be available in the lab.
    
    Jake Read's avatar
    Jake Read committed
    ## Manufacturing
    
    Jake Read's avatar
    Jake Read committed
    Different methods of circuit manufacture have different constraints. We commonly call these `design rules` - they define a variety of things, the most important being the `trace/space` dimension: how thin can we make a trace, and how much gap must we leave between each different signal? The next important question is about how small our minimum drill size is: this sets the diameter of our vias.
    
    Jake Read's avatar
    Jake Read committed
    For 'most' fabricators, a lenient (easy to fab) trace/space is `8/8mil` (mil: 1/1000 of an inch: 8mil: 0.2032mm), with a 0.35mm minimum sized hole (that's 13.8mil). For some reason, we commonly refer to 'mil' for traces and mm for holes. The world is full of idiosyncrasies. Fabricators who can't do this are really, really not worth the time.
    
    Jake Read's avatar
    Jake Read committed
    For the circuit milling we do in the lab, we set our space by the width of our end-mills: the 1/64th endmills are 15.625mil in diameter, so for some error band I use a 16mil space, and to avoid accidentally milling traces away, I typically set a 12mil trace. 12/16 means it is occasionally difficult to mill footprints for newer component packages like a QFN. Drilling holes under 1/32" is also a pain, so I'll normally set my minimum drill to 32mil.
    
    Jake Read's avatar
    Jake Read committed
    In any case, if you'd rather not think about any of this, I've included some Eagle design rules files in this repo in the [**eagle/design-rules** folder](eagle/design-rules). You can load these into eagle in the board-design window through `edit >> design rules`, or the `drc` command. Once you've done this, you can run the 'drc' command to check if your design violates any of the rules.
    
    Jake Read's avatar
    Jake Read committed
    TODO: want to keep a list of manufacturer design-rules files or board templates (grid etc) for two- and four- layer fab at factory.
    
    Jake Read's avatar
    Jake Read committed
    #### Automating the generation of trace.png and cutout.png files
    
    Jake Read's avatar
    Jake Read committed
    Matt Keeter wrote a Python script that opens up Eagle and exports a number of pngs using ImageMagick. Last I know, this is tested for Eagle 7- or 8.
    
    Jake Read's avatar
    Jake Read committed
    
    To get this script to run, use the following steps:
    
    Jake Read's avatar
    Jake Read committed
    * Save [eagle/scripts/eagle_png.py](eagle/scripts/eagle_png.py) into the folder where you keep your Eagle project folders containing .brd and .sch files
    
    Jake Read's avatar
    Jake Read committed
    * Install [ImageMagick](https://www.imagemagick.org/script/index.php)
    * Create a polygon over your .brd design on the Milling layer (number 46)
    * Set the isolate value for the polygon to a number greater than 16, this will ensure there's enough black space for mods to generate toolpaths in (see image below)
    
    Jake Read's avatar
    Jake Read committed
    ![eagle/scripts/isolate.png](eagle/scripts/isolate.png)
    
    Jake Read's avatar
    Jake Read committed
    * Save your .brd file and close Eagle
    * Run eagle_png using the following command `python eagle_png.py board_folder/board_name.brd`
    * The script should have saved several .png files into the folder where the .brd file is
    
    > **Note:** With later versions of Eagle (9.0.1+), by default it is configured to show text similar to "1-16" ontop of each via. This comes through even when exporting your final image. To remove this artifact, type the following in the commandline: `SET Option.ViaLength 0`
    
    ### SMT Manufacture
    
    
    Jake Read's avatar
    Jake Read committed
    TODO: doc here for more advanced manufacture; particularly the simple step to stencil and reflowing boards!
    
    [Adafruit already has some great notes on SMT manufacturing.](https://learn.adafruit.com/smt-manufacturing/overview)
    
    Jake Read's avatar
    Jake Read committed
    
    #### L1: boardfab, solder by hand
    
    
    Jake Read's avatar
    Jake Read committed
    #### Export
    Making Gerbers
    
    
    Jake Read's avatar
    Jake Read committed
    #### L2: paste, stencils, and tweezers
    
    #### L3: diy pnp
    
    #### L4: circuit assembly
    For assembly, some miters tips are  
    - circuithub
    - lightspeed manufacturing (in MA)
    - tempo automation
    - maybe worth trying jlc/easyeda - just have to constrain boards to parts they have (probably)
    
    
    Jake Read's avatar
    Jake Read committed
    # Component Notes
    
    Jake Read's avatar
    Jake Read committed
    Half the struggle of EE (in practice) is finding the right components to assemble your circuits with. Below are my own very rough notes on parts-that-I-have-once-used-or-thought-about, that I will be maintaining here to help in the search.
    
    Jake Read's avatar
    Jake Read committed
    
    ## LEDs
    
    LED | VDrop | mA | R for 3v3 LVL
    ---
    White 0805 1516-1085-1-ND  | 3.1 | 20 | 10R
    Red 0805 516-1427-1-ND | 1.8 | 20 | 75R - * mark is backwards
    Green 0805 516-1434-1-ND | 2.2 | 20 | 55R
    Blue 0805 516-1445-1-ND | 3.4 | 20 | -5R (haha)
    Yellow 0805 516-1433-1-ND | 2.1 | 20 | 60R
    
    ## Connectors, Cable
    
    poke-in 2p 478-9533-1-ND
    
    JST-SH 6 Positions Vertical  455-1792-1-ND
    JST-SH 6 Positions Horizontal 455-1806-1-ND
    JST-SH 8 Positions Horizontal 455-1808-1-ND
    
    JST SH Cable 8 Pin Reversed 2" 455-3000-ND
    JST SH Cable 8 Pin Reversed 6" 455-3004-ND
    JST SH Cable 8 Pin Reversed 12" 455-3008-ND
    JST-SH Cable 6 Pin Normal 6" 455-3015-ND
    JST-SH Cable 6 Pin Reversed 6" 455-3003-ND
    
    Vertical RJ12 WM10468CT-ND
    Horizontal RJ12 WM5567CT-ND or WM5567TR-ND in 150 +
    Plug End RJ12 AE10315-ND
    
    RJ45 Jack - RJE73-188-00140CT-ND
    RJ45 Plug - AE10316-ND
    RJ45 Jack tab up - RJHSE-5384-ND
    RJ45 Jack tab up smd - 732-3164-1-ND
    RJ45 Cable 100F - A0082R-100-ND
    RJ45 Tool - K582-ND
    
    RJ10 Jack 609-4469-1-ND
    
    USB Micro 609-4613-1-ND
    
    Power Spade 18-20 AWG 277-11144-ND
    Power Spade 14-18 AWG 277-11150-ND
    Power Spade Molex Small WM9606-ND
    Power Spade Molex Large WM9610-ND
    Power Pin M3x3mm tall 732-5270-1-ND
    Power Pin M3x4mm tall 732-5271-1-ND
    Power Spacer M3x3mm tall  	732-7087-1-ND
    Power Pin M3x6mm tall 732-5273-1-ND
    Power Pin M2.5x6mm tall  732-7102-1-ND
    Pogo Pin  ED90385-ND
    
    SAMTEK-10-Debug SAM8796-ND
    CHEAP-10-Debug 1175-1629-ND
    
    CRIMP M3s 16-20AWG  277-11117-ND
    
    Mezzanine ATK Female (Tops [Mother Boards]) H1215-ND
    Mezzanine ATK Male (Bottoms, 3mm Stack) H10686-ND
    Mezzanine ATK Male (Bottoms, 4mm Stack) H10691-ND
    
    miniPCIE A123340CT-ND
    
    Nice Power Terminals conn free WM10425CT-ND
    
    'power series' power conn
    https://www.digikey.com/catalog/en/partgroup/power-series/26832?mpart=1744042-1&vendor=17
    A112198-ND
    A102007-ND
    1744042-1-ND
    
    2x10 952-2359-ND -> gray and fancy 609-4473-1-ND
    2x10 SAM14005CT-ND (lower profile)
    8mm spacers, 732-7113-1-ND
    10mm spacers, 732-7119-1-ND
    2x10 0.1" 15.75mm x 2.8mm SAM1066-10-ND
    2x10 0.1" 15.75mm x 5.84mm S2061E-10-ND
    
    USB Micro AB 609-4613-1-ND
    
    Molex Edge Crimp-in Connectors EDGEMATE 172159
    
    |---|---|
    | **Fancy IDC Connectors** | - |
    | Part | PN |
    | micro-match 'value' 12 cable-to-plug | A120909CT-ND |
    | picoflex 12 cable-to-plug | WM19224-ND |
    | micro-match 'value' 12 plug-to-board | A120906CT-ND |
    | picoflex 12 plug-to-board | WM14097CT-ND |
    | 12-conductor ribbon 0.05" pitch | 3M157824-10-ND |
    | picoflex 20 plug-to-board | WM3966CT-ND  |
    
    ## Cables, Wiring
    
    100ft 16AWG Silicone Red CN665R-100-ND
    100ft 16AWG Silicone Black CN662B-100-ND
    
    ## Sensors
    
    10 bit Absolute AEAT-6600 516-2636-ND
    10 bit Absolute AEAT-6600 Diametric Magnet 469-1076-ND
    Hall Effect DRV5053 296-41083-1-ND
    HALL Discrete S5712
    Hall Discrete Mag 469-1020-ND
    RTD 1k oHm -  223-1563-1-ND
    Distance Time of Flight 4m  497-18884-1-ND  VL53L1
    Distance TOF 2m 497-16538-1-ND pin-compat w/ VL53L1 (is VL53L0)
    
    ## Magnets
    
    6x2.5mm Diametric 469-1070-ND (ok for as5047)
    8x2.5mm Diametric 469-1076-ND (good for as5047)
    0.25" x 0.25" (for pnp feet) 469-1003-ND
    
    ## uC
    
    ATSAMD51 ATSAMD51J18A-MUTCT-ND
    ATSAMD51J19 (ada type) ATSAMD51J19A-MU-ND
    ATXMEGA - ATXMEGA256A3U-MH-ND
    
    ## Power
    
    3.3V ldo 600mA AP2112 - AP2112K-3.3TRG1DIDKR-ND
    
    3.3V buck 2A TS30012-M033QFNRCT-ND
    5v buck 2A 24V  TS30012-M050QFNRCT-ND
    5v buck 2A 40V TS30042-M050QFNRCT-ND
    Integrated Buck ... 1.2A, fancy 1589-1756-1-ND
    
    5v LDO Buck Drop-In Switching Module 2A 945-3042-ND
    5v Module 12W 1866-4374-ND
    5v Mean Well Module 2A 1866-3625-ND
    5v Mean Well Module 3A 1866-3633-ND
    5v Module Switching 2A 811-2657-ND
    
    DRV8323xx -
    UCC27212: 4A, 120V gate driver
    1460-1069-6-ND - TMC262 Step Gate Driver
    620-1769-1-ND - A4955 H-Bridge Gate Driver
    
    TPW4R008NHL1QCT-ND - bldc fet candidate
    497-15314-1-ND - N23 pnpair
    TSM6502CRRLGDKR-ND - N23 pnpair alternate
    800-3745-1-ND - N17 pnpair
    
    CSD88548 - 40V Half Bridge 296-46923-1-ND
    CSD88599 - 60V Half Bridge 296-48289-1-ND
    
    ## Comm
    
    CP2102n USB UART - 336-3693-ND
    
    RS485 Driver 2/0 296-9964-5-ND
    RS485 Driver 2/2  296-14348-6-ND
    RS422 1/1 Full Duplex w/ term LTC2855IDE#PBF-ND
    Optoisolator 2/0 516-2172-5-ND
    
    ## Heat
    
    thermal tape 3M10315-ND
    heatsinks
     - Adafruit Heatsink 1528-1698-ND
     - 21x21mm 345-1098-ND
     - 28x28x6.5 345-1111-ND
     - 28x28x9 345-1100-ND
     - 19x19x6mm 294-1146-ND 7.1deg/W
     - 41x41x9mm  294-1103-ND  4.5deg/w
     - 40x40x12 294-1162-ND 1.9 deg/w
     - 40x40x9  294-1160-ND  2.5 deg/w
     - 40x40x6  294-1158-ND 3.3 deg/w
     - 41x41x25.4 ATS1329-ND  2.4 deg/w
    
    fans
     - 50x50x15mm 102-4367-ND
     - 50x50x20mm  603-1359-ND
    
    ## Switch
    
    Slide Switch 563-1340-1-ND
    Switch for hella AC Amps 360-1897-ND
    Safety Stop Kill for PSU Z1504-ND
    Reset Line CKN10685CT-ND
    Reset Line 90deg P16767CT-ND
    Hella IEC C13 486-2264-ND
    Power Entry 486-3979-ND
    Power Entry 10A Fuse 486-1226-ND
    
    ## Passives
    
    4.7uH 2A 72Mohm  587-2407-1-ND
    6.8uH 2.3A 52Mohm 587-3462-1-ND
    10uH 0.15A 360M 0805 445-17073-1-ND
    
    100uF 35v SMD 6.6dia PCE3951CT-ND
    0805 Diode -  478-7802-1-ND
    TVS Diode - SMAJ30ALFDKR-ND
    40V 3A Diode - - FSV340FPCT-ND
    16MHz Resonator - 1253-1339-1-ND
    
    16MHz Crystal SER4370CT-ND
    RCT 32 kHz XC1617CT-ND
    
    4700uF 35v 493-1088-ND 18d x 7.5l x 35.5
    100uF 450V 1572-1660-ND same above
    150uF 6.6x6.6 SMD Aluminum PCE5017CT-ND
    47uF 400V P13546-ND  ibid
    
    ### Shunt Resistors
    
    3mOhm 1% 3W 2512 CRE2512-FZ-R003E-3CT-ND
    50mOhm 1% 3W 2512 CRA2512-FZ-R050ELFCT-ND
    100mOhm 1% 3W 2512 CRA2512-FZ-R100ELFCT-ND
    
    ### Solder Paste
    
    SMD291AX250T3-ND