• It works !!!

    Shree Kumar10/16/2024 at 15:41 0 comments

    After a few days of hacking, I am able to auto-generate this jig to help soldering those 17 berg headers for my AtiVEGA board! Basically I should be able to lay the jig on my soldering table, insert the through hole parts, place the PCB and solder away!

    I've written the tool in a reasonably generic manner - now it's a matter of cleaning up and parameterizing the code and then anyone can make one for their board! To that end, I am opening and checking against open source and community boards. The more funkier the board outline, the more inclined I am to test it !

    There are many parameters, so it makes sense to use a configuration file rather than many command line parameters.   That's my TODO for the next few days. I also have to print the jig next, and see if any tweaks to the parameters are needed.

  • Meshing the shells

    Shree Kumar10/14/2024 at 06:31 0 comments

    In the last log, I showed how the "shells" - or holders for each TH component are created. These shells need to be linked. It wasn't hard to figure out a way to do it.  Anyone familiar with the 3D printing has seen the cool vornoi shapes, and probably heard the term "delaunay" triangulation.  Basically, this computes a set of triangles linking a set of points.  We can use the centers of each of the shells as the points, and we'll get a mesh. Simple to do in OpenSCAD.

    The "base" of the components have to be solid of course - the image above hides them to show that the centers are linked together.  The delaunay mesh gives us a few benefits:

    1. it saves plastic, directly resulting in a cost saving both of time and material.  For reference, the typical thing people do when the create manual jigs is add a solid base plate - which obviously takes more plastic and thus time to print.
    2. it gives us a reasonably solid structure
    3. it enhances the visibility of the components, when they are inserted in the printed jig. If the plastic hits something - e.g. a component you've already assembled - it easy to see exactly what's going wrong.

    Here is what the resulting structure would look like - when it is placed relative to the assembled board:

    In today's development, I also ensured that the shells don't extend all the way to the PCB.  In my board, I had a few SMD components close to the throughhole parts - e.g., near the RPi connector, there were some pull-up resistors. When the shells are built, their 1.2mm thichness intersects the SMD component.  By not extending the shell all the way till the PCB, we can avoid this.  This also gives me extra visibility into a side view of the components. When I eventually place the components and the actual PCB, I will be able to see and verify for myself that all the components are in fact sitting flush with the PCB.  Here is what your view would look like, from the side:

    So, this is getting exciting as it builds up.  Fingers itching to print again, but delaying gratification for now one more time. The next step would be to import the outline of the PCB ('edge cuts' layer), and link it to this model. Lot of materials available on this - as many have built jigs to hold PCBs in place, holding stencils in place for SMD paste application etc.

  • Basic Validation

    Shree Kumar10/13/2024 at 15:08 0 comments

    Took the step 0 for this project. I needed basic proof that I can pull this off.  Basically a minimal implementation that can read a KiCAD board, process it and create something that tells me this will work. I am developing this first and foremost to work for me. Here is AtiVEGA with the results of today's work:

    This is a screenshot of FreeCAD. Essentially overlays two models - a STEP file exported from KiCAD and a CSG file exported from OpenSCAD.  The CSG file represents the 3D printed parts. that will serve as the holders for the 3D printed components. These are shown in gray with red lines. As you can see, they sit damn well ! How well ? Here is a top view of the left hand top corner of the PCB. If you zoom in, you will see a tiny sliver of green between the 3D printed part model and the through hole components. That gap is 0.1 mm and the thickness of the shell itself is 1.2 mm.
    Let's zoom in a bit more
    Sliced it - layer height 0.35mm to make the Z lines visible !
    My hands are itching to print, but my mind tells me to wait. To check the tolerance and fit, I'll have to print anyways. I use cut headers a lot of times, as the commonly available headers are 2x40. That will foil my tolerance tests. But in general this looks neat. This approach will work. I am convinced.

    How does this work ? In short, my script iterates over all the TH components. Loads their 3D models. And transforms them to their final position on the board (notionally at least!).  The simplest method to hold the TH components in place is with a simple shell, as shown above.  But how do we compute the shell ?

    A simple method (KISS for now) projects the 3D model of the component (e.g. 2x20 berg header) onto 2D space - say the top layer. Just drop the Z components, that will do. As a result, you get a whole lot of (x,y)s - essentially points that represent the 3D model.  Now, you take a convex hull.  This is guaranteed to encompass all points.  It also has a nice property that it wont "hug" the model in its nooks and crannies - e.g. the gaps between the 2.54 mm spaced plastic housing. The below picture in wireframe should make this clear.

    Will this approach work for every component ? Definitely not. But does it have to - again not, at least initially. I'll probably include simple overrides at the component and footprint level so that the generic nature of the tool is preserved. That way, anyone using it can even make use of most of the generic functionality - and include their own overrides flexibly.

    Now that step 0 is done - here are my next steps:

    1. close the holes with caps so that the components can slide in and sit (now, won't that be satisfying!). This is simple, and I can easily accommodate components of various heights.
    2. add a frame on which the PCB will sit. Need to dig into more "pcbnew" for this, and/or lookup stencilframer.
    3. merge the caps into the frame. A simple slab matching a bit more than the PCB shape will do, but it will be fun to come up with ways to save plastic in the 3D print ! Premature optimization is the root of all evil, says Knuth.  But yet, me starts the think! 

  • And thus it begins!

    Shree Kumar10/12/2024 at 04:57 0 comments

    thejas32-testbed was my first PCB in a very long time. My soldering skills had gone to the dogs. Age exacerbated this problem. Those impacted SMD components.

    The real pain I ended up faced was aligning the through hole components. During the review, Atharva had adviced me to consolidate connectors. I had shot down his suggestions, as I was determined to keep pin groups logical. This is a learning board, and it made little sense to group pins that are not logically related. Soldering dual row pins gives reasonable results, but dealing with single row pins - and especially 2 pin headers is a pain. Inconsitent height across adjacent rows, as well as angled soldering makes the assembled PCB not only harder to use, but also ugly to look at. Thus, I had mostly postponed assembling more PCBs.

    After I returned from a break, I had an idea. What if I could make a 3D printed jig that would properly keep the TH components in place while soldering ? I developed the ideas a bit. I also searched online. Surprisingly, I didn't find many good results. First, a manually created jig. I also found a hackaday article  about  stencilframer . The first comment on the article was

     used to make 3D printed jigs to hold through hole connectors and stuff while I’m soldering the other side, but modeling these by hand takes time.

    Also, this video shows a full cycle of the workflow, while highlighting importance of tolerances and multiple iterations to nail the design. For people designing their jigs themselves, this is fine - but ideally this should be a configurable parameter. Doesn't fit ? Measure, regenerate, reprint. Done. Remember the settings for the print material (accounting for shrinkage, etc) and use those again. Sweet! On further reading, I also found this thread on the KiCAD forum, where the OP notes (in April 2023)

    ...I didn’t find much prior art...

    By then I had already started hacking. This lead me to feeling around KiCAD's python API, convex hulls, and blender python API (hello again!). I created a STL for a simple sleeve around a 2x10 pin berg header.

    Essentially images above show a 1.6 mm shelll, precisely 0.1 mm away from the berg header, placed at the exact location of the component derived from the board file.

    How will this work ? For a start, we can load the PCB design in KiCAD, find components, get to their 3D models, compute such structures using the meshes. Finally, assemble them all together, account for height differences and integrate them with the outline of the PCB with a neat slot for the PCB to fit. Many ideas running in my head - including avoiding connectors, securely attaching the PCB while soldering, ensuring the components fit snug on the bottom side, etc. I am sure there are plenty anybody else who needs a tool like this will come up with.

    The idea sitting in my head for a day lead me to understand various possibilities.

    What could one do with a full blown implementation ?

    1.  Accurately assemble through hole components on a PCB (Goal #1) 
    2. Component holders for GridFinity :) Yeah, totally snug fits!
    3. Faster SMD soldering for chips such as SOIC without fiddling with tweezers and such
    4. Automate case building maybe ?!
    5. PCB testing jig!

    At this point, I say, stop! This is useful. Start a new project!