Home Forums Nazca Directional Coupler in Nazca

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #5541
    AleksandarK
    Member

    Dear developers,

    I am wondering how can a Directional Coupler,

    Directional Coupler

    like in the picture above, be implemented in nazca?

    I have the latest Nazca-Design package.

    Thanks in advance.

    #5544
    Xaveer
    Moderator

    Dear Aleksandar,

     

    There are many ways to do this. The example below uses the built-in demofab cross-section. You can use a very similar implementation for your own technology, by following the cross-section tutorial https://nazca-design.org/implement-a-cross-section/. You can make your directional coupler into a building block and re-use it many times by encapsulating it in a cell and adding pins to it. Look at https://nazca-design.org/crate-bb-using-polygon/ for inspiration.

    Here’s an example for the directional coupler, using sinebend curves.

    
    import nazca as nd
    import nazca.demofab as demo
    
    with nd.Cell("Coupler") as coupler:
        # Upper arm
        demo.shallow.sinebend(distance=100, offset=-40).put(0, 50)
        demo.shallow.strt(length=20).put()
        demo.shallow.sinebend(distance=100, offset=40).put()
    
        # Lower arm
        demo.shallow.sinebend(distance=100, offset=40).put(0, -50)
        demo.shallow.strt(length=20).put()
        demo.shallow.sinebend(distance=100, offset=-40).put()
    
        # Add pins
        nd.Pin("a0").put(0, 50, 180)
        nd.Pin("a1").put(0, -50, 180)
        nd.Pin("b0").put(220, 50, 0)
        nd.Pin("b1").put(220, -50, 0)
    
    coupler.put(0, 0)
    coupler.put(0, -200, 10)
    
    nd.export_plt()
    

    Xaveer

    #5547
    AleksandarK
    Member

    Thank you very much!

    That solves my problems.

    #5548
    Ronald
    Keymaster

    To make it more robust Xaveer’s example can be parametrized and pins can be set by reference:

    import nazca as nd
    import nazca.demofab as demo
    
    def coupler(length=20, sep=100, gap=20):
        with nd.Cell("Coupler") as C:
            # Upper arm
            u1 = demo.shallow.sinebend(distance=100, offset=-0.5*(sep-gap)).put(0, 0.5*sep)
            demo.shallow.strt(length=length).put()
            u2 = demo.shallow.sinebend(distance=100, offset=0.5*(sep-gap)).put()
    
            # Lower arm
            l1 = demo.shallow.sinebend(distance=100, offset=0.5*(sep-gap)).put(0, -0.5*sep)
            demo.shallow.strt(length=length).put()
            l2 = demo.shallow.sinebend(distance=100, offset=-0.5*(sep-gap)).put()
    
            # Add pins
            nd.Pin("a0", pin=u1.pin['a0']).put()
            nd.Pin("a1", pin=l1.pin['a0']).put()
            nd.Pin("b0", pin=u2.pin['b0']).put()
            nd.Pin("b1", pin=l2.pin['b0']).put()
        return C
    
    coupler().put(0, 0)
    coupler(length=40, gap=5, sep=50).put(0, 100, 10)
    
    nd.export_plt()

    Note that setting pins by reference can be done using the ‘pin’ keyword. This will automatically copy all pin properties to the new pin.

    # p is pin
    nd.Pin("a0").put(p) # set the new pin at the position of p
    nd.Pin("a0", pin=p).put() # copy all properties of p and put it on the position of p

    Ronald

    #5557
    AleksandarK
    Member

    Thank you Roland. That is helpful as well!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.