Author Topic: The Living PCB Design Thread  (Read 384263 times)

0 Members and 1 Guest are viewing this topic.

Offline jrmobley

  • Posts: 5
  • Location: Seattle
Re: The Living PCB Design Thread
« Reply #450 on: Tue, 03 January 2017, 04:06:21 »
Hey all.  I am new to this thread. I have not touched anything on the electrical side of building keyboards, and have only built boards based on PCBs designed by others.

I am the developer behind http://builder.swillkb.com.  Ironically, I started it because I was not confident in my cad skills and thought I should automate the plate layout.  Now it does quite a bit more than I was expecting when I started, but I have always had the pipe dream of being able to produce a PCB that goes with the layout specified.

The biggest hurdle I think I am going to have with this is the auto routing for the pcb.  I am only just starting to look into what I would need to do to even get something primitive built.

So my question is. What algorithms should I be researching, and what auto routing systems are best suited to designing keyboards. I know the following exist, but not much beyond that.

Maze router,
Line probe router,
Channel router,
Area routers,
Switchbox routing

Given my current skill level, I will probably have to spend a couple months just learning stuff. I would not expect to actually have anything written for about 6 months and really, who knows at that point.

If anyone has resources you can share that you think would be required reading for me, please share a link. If you have ideas or suggestions, please let me know as well.

Thanks for the help everyone. Happy new year. If you have not checked out the builder recently, you guys may be interested in the new custom polygon features I finally finished adding to the builder over the holidays.

Hi swill and everybody.  I'm new to this thread too, and to geekhack and to the mechanical keyboard scene.  I'm pretty blown away by all the great stuff going on here.  I am working on my own keyboard project and, like you, I have ended up working on software to generate drawings instead of using CAD tools.  Your plate builder was definitely an inspiration to me!

I spent some time trying to learn KiCad, but it drove me crazy with its terrible interface.  And so much of the layout of a keyboard PCB is just begging for automation, I decided just to learn about the Gerber format and develop some code to generate my PCB artwork directly from keyboard-layout-editor data.  I was also inspired by the work at http://pcbmode.com.

For my project, the keyboard controller is not going to be on the same board as the key switch matrix, so that simplifies things quite a bit for me.  Also, I have no interest in LEDs, which also simplifies my problem.  I am trying to avoid the general trace routing problem altogether by sticking to a simple design with columns on the front and rows on the back.  Right now I am basically cloning the TrueFox layout.  It's not exactly the layout I want, but it is close, and I can get the keycaps for it, so it's a good start.  The obvious matrix would be 16 columns by 5 rows, but that is an inefficient use of 21 GPIO.  So the most interesting thing that I think I am doing is using an 8x10 matrix where the columns are sort of folded in half and there are two matrix rows per physical row of keys.  Also, I am using copper pours for the rows and columns, which makes it easier to embed a key module without worrying about routing traces.

I have a long way to go, but maybe this image of my work in progress can help explain where I am going with it.

156665-0

Sorry if that is hard to read.  My code is a broken refactoring mess right now and that is the only image I have around to share.  This is my first post and I'm a noob with forum software, so I hope the image shows up...

-JR

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: The Living PCB Design Thread
« Reply #451 on: Tue, 03 January 2017, 06:22:28 »
Hey all.  I am new to this thread. I have not touched anything on the electrical side of building keyboards, and have only built boards based on PCBs designed by others.

I am the developer behind http://builder.swillkb.com.  Ironically, I started it because I was not confident in my cad skills and thought I should automate the plate layout.  Now it does quite a bit more than I was expecting when I started, but I have always had the pipe dream of being able to produce a PCB that goes with the layout specified.

The biggest hurdle I think I am going to have with this is the auto routing for the pcb.  I am only just starting to look into what I would need to do to even get something primitive built.

So my question is. What algorithms should I be researching, and what auto routing systems are best suited to designing keyboards. I know the following exist, but not much beyond that.

Maze router,
Line probe router,
Channel router,
Area routers,
Switchbox routing

Given my current skill level, I will probably have to spend a couple months just learning stuff. I would not expect to actually have anything written for about 6 months and really, who knows at that point.

If anyone has resources you can share that you think would be required reading for me, please share a link. If you have ideas or suggestions, please let me know as well.

Thanks for the help everyone. Happy new year. If you have not checked out the builder recently, you guys may be interested in the new custom polygon features I finally finished adding to the builder over the holidays.

Hi swill and everybody.  I'm new to this thread too, and to geekhack and to the mechanical keyboard scene.  I'm pretty blown away by all the great stuff going on here.  I am working on my own keyboard project and, like you, I have ended up working on software to generate drawings instead of using CAD tools.  Your plate builder was definitely an inspiration to me!

I spent some time trying to learn KiCad, but it drove me crazy with its terrible interface.  And so much of the layout of a keyboard PCB is just begging for automation, I decided just to learn about the Gerber format and develop some code to generate my PCB artwork directly from keyboard-layout-editor data.  I was also inspired by the work at http://pcbmode.com.

For my project, the keyboard controller is not going to be on the same board as the key switch matrix, so that simplifies things quite a bit for me.  Also, I have no interest in LEDs, which also simplifies my problem.  I am trying to avoid the general trace routing problem altogether by sticking to a simple design with columns on the front and rows on the back.  Right now I am basically cloning the TrueFox layout.  It's not exactly the layout I want, but it is close, and I can get the keycaps for it, so it's a good start.  The obvious matrix would be 16 columns by 5 rows, but that is an inefficient use of 21 GPIO.  So the most interesting thing that I think I am doing is using an 8x10 matrix where the columns are sort of folded in half and there are two matrix rows per physical row of keys.  Also, I am using copper pours for the rows and columns, which makes it easier to embed a key module without worrying about routing traces.

I have a long way to go, but maybe this image of my work in progress can help explain where I am going with it.

(Attachment Link)

Sorry if that is hard to read.  My code is a broken refactoring mess right now and that is the only image I have around to share.  This is my first post and I'm a noob with forum software, so I hope the image shows up...

-JR
Cool. That looks like a fun project. What language are you developing in?  How have you found the Gerber format to work with? I was also planning to export a Gerber file.  Are you building everything from scratch, or are you using some sort of engine for designing the components and exporting the final files?

Offline kolec94

  • Posts: 111
Re: The Living PCB Design Thread
« Reply #452 on: Tue, 03 January 2017, 07:33:24 »
Hey all.  I am new to this thread. I have not touched anything on the electrical side of building keyboards, and have only built boards based on PCBs designed by others.

I am the developer behind http://builder.swillkb.com.  Ironically, I started it because I was not confident in my cad skills and thought I should automate the plate layout.  Now it does quite a bit more than I was expecting when I started, but I have always had the pipe dream of being able to produce a PCB that goes with the layout specified.

The biggest hurdle I think I am going to have with this is the auto routing for the pcb.  I am only just starting to look into what I would need to do to even get something primitive built.

So my question is. What algorithms should I be researching, and what auto routing systems are best suited to designing keyboards. I know the following exist, but not much beyond that.

Maze router,
Line probe router,
Channel router,
Area routers,
Switchbox routing

Given my current skill level, I will probably have to spend a couple months just learning stuff. I would not expect to actually have anything written for about 6 months and really, who knows at that point.

If anyone has resources you can share that you think would be required reading for me, please share a link. If you have ideas or suggestions, please let me know as well.

Thanks for the help everyone. Happy new year. If you have not checked out the builder recently, you guys may be interested in the new custom polygon features I finally finished adding to the builder over the holidays.
ok so what are you going to use as a controller diodes and other components?
do you have pcb models for different switch types?
led holes?

So right now I don't have anything, but I do have an idea of the things I will need.  I don't have modules built yet for switch and led layouts.  I will likely do SMD diodes and resistors (for LEDs, when I support them).  Ideally, I would build a standard footprint I use for every switch and use it everywhere.  That will make things easier from the dev side.  I have not talked to MOZ or Melvang about this yet, but I basically want to use something like a simplified Enabler PCB as the base switch component.  I know through hole is less daunting for builders, but I think most people are capable of soldering SMD (I was without much practice).  I think it is probably important to support SMD because it makes it easier to automate pick and place of components.  If people end up running small group buys based on the output, I think it gets us one step closer to a fully automated process.

The controller is a bit of a different story.  I would ideally like to give people options, but I have to start somewhere.  The ones that are on my radar would be something like; the SMD footprint for an ATMEGA32U4 (or similar), through hole pin set for the teensy (or similar).

My goal is to help enable builders and people with ideas to make it happen, so I am trying to solve the lowest common denominator with the most value to start with.  Then we go from there... 

To me, the auto routing is the biggest blind spot for me.  I know it is possible, but I also know it is non-trivial, so I have to get comfortable with how I am going to solve that before I get to deep into the weeds on some of the other pieces.  With the builder right now, I have the capability to draw vector files (svg+) and I already have the location of all the switches.  It would not be hard for me to start with a drill hole output, or even draw essentially the enabler at every switch location and just not route it.  Obviously not an end game solution, but it is a start.  It gets me to the point of being able to produce something of value.  With that as a starting point, I may be able to output as KiCad and people could manually route the pcb. 

Anyway, this is longer than I was planning to write.  There is a lot of ground I have to cover before I get to an end game solution, but I think there is probably a lot of value in some of the baby steps.  :)
ok how many layers are you wanting to use?
i would make the switch with diodes and everything a module for the switch
the issue i see is the matrix and getting a schematic from the layout and making sure that they are wired correctly in a schematic

kbparadise v60 blues

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: The Living PCB Design Thread
« Reply #453 on: Tue, 03 January 2017, 08:09:09 »


Hey all.  I am new to this thread. I have not touched anything on the electrical side of building keyboards, and have only built boards based on PCBs designed by others.

I am the developer behind http://builder.swillkb.com.  Ironically, I started it because I was not confident in my cad skills and thought I should automate the plate layout.  Now it does quite a bit more than I was expecting when I started, but I have always had the pipe dream of being able to produce a PCB that goes with the layout specified.

The biggest hurdle I think I am going to have with this is the auto routing for the pcb.  I am only just starting to look into what I would need to do to even get something primitive built.

So my question is. What algorithms should I be researching, and what auto routing systems are best suited to designing keyboards. I know the following exist, but not much beyond that.

Maze router,
Line probe router,
Channel router,
Area routers,
Switchbox routing

Given my current skill level, I will probably have to spend a couple months just learning stuff. I would not expect to actually have anything written for about 6 months and really, who knows at that point.

If anyone has resources you can share that you think would be required reading for me, please share a link. If you have ideas or suggestions, please let me know as well.

Thanks for the help everyone. Happy new year. If you have not checked out the builder recently, you guys may be interested in the new custom polygon features I finally finished adding to the builder over the holidays.
ok so what are you going to use as a controller diodes and other components?
do you have pcb models for different switch types?
led holes?

So right now I don't have anything, but I do have an idea of the things I will need.  I don't have modules built yet for switch and led layouts.  I will likely do SMD diodes and resistors (for LEDs, when I support them).  Ideally, I would build a standard footprint I use for every switch and use it everywhere.  That will make things easier from the dev side.  I have not talked to MOZ or Melvang about this yet, but I basically want to use something like a simplified Enabler PCB as the base switch component.  I know through hole is less daunting for builders, but I think most people are capable of soldering SMD (I was without much practice).  I think it is probably important to support SMD because it makes it easier to automate pick and place of components.  If people end up running small group buys based on the output, I think it gets us one step closer to a fully automated process.

The controller is a bit of a different story.  I would ideally like to give people options, but I have to start somewhere.  The ones that are on my radar would be something like; the SMD footprint for an ATMEGA32U4 (or similar), through hole pin set for the teensy (or similar).

My goal is to help enable builders and people with ideas to make it happen, so I am trying to solve the lowest common denominator with the most value to start with.  Then we go from there... 

To me, the auto routing is the biggest blind spot for me.  I know it is possible, but I also know it is non-trivial, so I have to get comfortable with how I am going to solve that before I get to deep into the weeds on some of the other pieces.  With the builder right now, I have the capability to draw vector files (svg+) and I already have the location of all the switches.  It would not be hard for me to start with a drill hole output, or even draw essentially the enabler at every switch location and just not route it.  Obviously not an end game solution, but it is a start.  It gets me to the point of being able to produce something of value.  With that as a starting point, I may be able to output as KiCad and people could manually route the pcb. 

Anyway, this is longer than I was planning to write.  There is a lot of ground I have to cover before I get to an end game solution, but I think there is probably a lot of value in some of the baby steps.  :)
ok how many layers are you wanting to use?
i would make the switch with diodes and everything a module for the switch
the issue i see is the matrix and getting a schematic from the layout and making sure that they are wired correctly in a schematic

Yes. I have to have a way to verify the wiring works as expected.

Right now I am planning to use 2 layers.

Offline kolec94

  • Posts: 111
Re: The Living PCB Design Thread
« Reply #454 on: Tue, 03 January 2017, 08:12:25 »


Hey all.  I am new to this thread. I have not touched anything on the electrical side of building keyboards, and have only built boards based on PCBs designed by others.

I am the developer behind http://builder.swillkb.com.  Ironically, I started it because I was not confident in my cad skills and thought I should automate the plate layout.  Now it does quite a bit more than I was expecting when I started, but I have always had the pipe dream of being able to produce a PCB that goes with the layout specified.

The biggest hurdle I think I am going to have with this is the auto routing for the pcb.  I am only just starting to look into what I would need to do to even get something primitive built.

So my question is. What algorithms should I be researching, and what auto routing systems are best suited to designing keyboards. I know the following exist, but not much beyond that.

Maze router,
Line probe router,
Channel router,
Area routers,
Switchbox routing

Given my current skill level, I will probably have to spend a couple months just learning stuff. I would not expect to actually have anything written for about 6 months and really, who knows at that point.

If anyone has resources you can share that you think would be required reading for me, please share a link. If you have ideas or suggestions, please let me know as well.

Thanks for the help everyone. Happy new year. If you have not checked out the builder recently, you guys may be interested in the new custom polygon features I finally finished adding to the builder over the holidays.
ok so what are you going to use as a controller diodes and other components?
do you have pcb models for different switch types?
led holes?

So right now I don't have anything, but I do have an idea of the things I will need.  I don't have modules built yet for switch and led layouts.  I will likely do SMD diodes and resistors (for LEDs, when I support them).  Ideally, I would build a standard footprint I use for every switch and use it everywhere.  That will make things easier from the dev side.  I have not talked to MOZ or Melvang about this yet, but I basically want to use something like a simplified Enabler PCB as the base switch component.  I know through hole is less daunting for builders, but I think most people are capable of soldering SMD (I was without much practice).  I think it is probably important to support SMD because it makes it easier to automate pick and place of components.  If people end up running small group buys based on the output, I think it gets us one step closer to a fully automated process.

The controller is a bit of a different story.  I would ideally like to give people options, but I have to start somewhere.  The ones that are on my radar would be something like; the SMD footprint for an ATMEGA32U4 (or similar), through hole pin set for the teensy (or similar).

My goal is to help enable builders and people with ideas to make it happen, so I am trying to solve the lowest common denominator with the most value to start with.  Then we go from there... 

To me, the auto routing is the biggest blind spot for me.  I know it is possible, but I also know it is non-trivial, so I have to get comfortable with how I am going to solve that before I get to deep into the weeds on some of the other pieces.  With the builder right now, I have the capability to draw vector files (svg+) and I already have the location of all the switches.  It would not be hard for me to start with a drill hole output, or even draw essentially the enabler at every switch location and just not route it.  Obviously not an end game solution, but it is a start.  It gets me to the point of being able to produce something of value.  With that as a starting point, I may be able to output as KiCad and people could manually route the pcb. 

Anyway, this is longer than I was planning to write.  There is a lot of ground I have to cover before I get to an end game solution, but I think there is probably a lot of value in some of the baby steps.  :)
ok how many layers are you wanting to use?
i would make the switch with diodes and everything a module for the switch
the issue i see is the matrix and getting a schematic from the layout and making sure that they are wired correctly in a schematic

Yes. I have to have a way to verify the wiring works as expected.

Right now I am planning to use 2 layers.
ok what cad software are you using for this?

kbparadise v60 blues

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: The Living PCB Design Thread
« Reply #455 on: Tue, 03 January 2017, 08:30:42 »


Hey all.  I am new to this thread. I have not touched anything on the electrical side of building keyboards, and have only built boards based on PCBs designed by others.

I am the developer behind http://builder.swillkb.com.  Ironically, I started it because I was not confident in my cad skills and thought I should automate the plate layout.  Now it does quite a bit more than I was expecting when I started, but I have always had the pipe dream of being able to produce a PCB that goes with the layout specified.

The biggest hurdle I think I am going to have with this is the auto routing for the pcb.  I am only just starting to look into what I would need to do to even get something primitive built.

So my question is. What algorithms should I be researching, and what auto routing systems are best suited to designing keyboards. I know the following exist, but not much beyond that.

Maze router,
Line probe router,
Channel router,
Area routers,
Switchbox routing

Given my current skill level, I will probably have to spend a couple months just learning stuff. I would not expect to actually have anything written for about 6 months and really, who knows at that point.

If anyone has resources you can share that you think would be required reading for me, please share a link. If you have ideas or suggestions, please let me know as well.

Thanks for the help everyone. Happy new year. If you have not checked out the builder recently, you guys may be interested in the new custom polygon features I finally finished adding to the builder over the holidays.
ok so what are you going to use as a controller diodes and other components?
do you have pcb models for different switch types?
led holes?

So right now I don't have anything, but I do have an idea of the things I will need.  I don't have modules built yet for switch and led layouts.  I will likely do SMD diodes and resistors (for LEDs, when I support them).  Ideally, I would build a standard footprint I use for every switch and use it everywhere.  That will make things easier from the dev side.  I have not talked to MOZ or Melvang about this yet, but I basically want to use something like a simplified Enabler PCB as the base switch component.  I know through hole is less daunting for builders, but I think most people are capable of soldering SMD (I was without much practice).  I think it is probably important to support SMD because it makes it easier to automate pick and place of components.  If people end up running small group buys based on the output, I think it gets us one step closer to a fully automated process.

The controller is a bit of a different story.  I would ideally like to give people options, but I have to start somewhere.  The ones that are on my radar would be something like; the SMD footprint for an ATMEGA32U4 (or similar), through hole pin set for the teensy (or similar).

My goal is to help enable builders and people with ideas to make it happen, so I am trying to solve the lowest common denominator with the most value to start with.  Then we go from there... 

To me, the auto routing is the biggest blind spot for me.  I know it is possible, but I also know it is non-trivial, so I have to get comfortable with how I am going to solve that before I get to deep into the weeds on some of the other pieces.  With the builder right now, I have the capability to draw vector files (svg+) and I already have the location of all the switches.  It would not be hard for me to start with a drill hole output, or even draw essentially the enabler at every switch location and just not route it.  Obviously not an end game solution, but it is a start.  It gets me to the point of being able to produce something of value.  With that as a starting point, I may be able to output as KiCad and people could manually route the pcb. 

Anyway, this is longer than I was planning to write.  There is a lot of ground I have to cover before I get to an end game solution, but I think there is probably a lot of value in some of the baby steps.  :)
ok how many layers are you wanting to use?
i would make the switch with diodes and everything a module for the switch
the issue i see is the matrix and getting a schematic from the layout and making sure that they are wired correctly in a schematic

Yes. I have to have a way to verify the wiring works as expected.

Right now I am planning to use 2 layers.
ok what cad software are you using for this?
Right now, I am not. I have basically built my own cad engine from scratch in Golang because everything I found was bloated and not friendly to be automated.

For the electrical stuff I will probably have to find an engine I can work with. Ideally open source, or at least free, which I can package with my deployments. Do you have suggestions on this front?

Offline kolec94

  • Posts: 111
Re: The Living PCB Design Thread
« Reply #456 on: Tue, 03 January 2017, 11:10:24 »


Hey all.  I am new to this thread. I have not touched anything on the electrical side of building keyboards, and have only built boards based on PCBs designed by others.

I am the developer behind http://builder.swillkb.com.  Ironically, I started it because I was not confident in my cad skills and thought I should automate the plate layout.  Now it does quite a bit more than I was expecting when I started, but I have always had the pipe dream of being able to produce a PCB that goes with the layout specified.

The biggest hurdle I think I am going to have with this is the auto routing for the pcb.  I am only just starting to look into what I would need to do to even get something primitive built.

So my question is. What algorithms should I be researching, and what auto routing systems are best suited to designing keyboards. I know the following exist, but not much beyond that.

Maze router,
Line probe router,
Channel router,
Area routers,
Switchbox routing

Given my current skill level, I will probably have to spend a couple months just learning stuff. I would not expect to actually have anything written for about 6 months and really, who knows at that point.

If anyone has resources you can share that you think would be required reading for me, please share a link. If you have ideas or suggestions, please let me know as well.

Thanks for the help everyone. Happy new year. If you have not checked out the builder recently, you guys may be interested in the new custom polygon features I finally finished adding to the builder over the holidays.
ok so what are you going to use as a controller diodes and other components?
do you have pcb models for different switch types?
led holes?

So right now I don't have anything, but I do have an idea of the things I will need.  I don't have modules built yet for switch and led layouts.  I will likely do SMD diodes and resistors (for LEDs, when I support them).  Ideally, I would build a standard footprint I use for every switch and use it everywhere.  That will make things easier from the dev side.  I have not talked to MOZ or Melvang about this yet, but I basically want to use something like a simplified Enabler PCB as the base switch component.  I know through hole is less daunting for builders, but I think most people are capable of soldering SMD (I was without much practice).  I think it is probably important to support SMD because it makes it easier to automate pick and place of components.  If people end up running small group buys based on the output, I think it gets us one step closer to a fully automated process.

The controller is a bit of a different story.  I would ideally like to give people options, but I have to start somewhere.  The ones that are on my radar would be something like; the SMD footprint for an ATMEGA32U4 (or similar), through hole pin set for the teensy (or similar).

My goal is to help enable builders and people with ideas to make it happen, so I am trying to solve the lowest common denominator with the most value to start with.  Then we go from there... 

To me, the auto routing is the biggest blind spot for me.  I know it is possible, but I also know it is non-trivial, so I have to get comfortable with how I am going to solve that before I get to deep into the weeds on some of the other pieces.  With the builder right now, I have the capability to draw vector files (svg+) and I already have the location of all the switches.  It would not be hard for me to start with a drill hole output, or even draw essentially the enabler at every switch location and just not route it.  Obviously not an end game solution, but it is a start.  It gets me to the point of being able to produce something of value.  With that as a starting point, I may be able to output as KiCad and people could manually route the pcb. 

Anyway, this is longer than I was planning to write.  There is a lot of ground I have to cover before I get to an end game solution, but I think there is probably a lot of value in some of the baby steps.  :)
ok how many layers are you wanting to use?
i would make the switch with diodes and everything a module for the switch
the issue i see is the matrix and getting a schematic from the layout and making sure that they are wired correctly in a schematic

Yes. I have to have a way to verify the wiring works as expected.

Right now I am planning to use 2 layers.
ok what cad software are you using for this?
Right now, I am not. I have basically built my own cad engine from scratch in Golang because everything I found was bloated and not friendly to be automated.

For the electrical stuff I will probably have to find an engine I can work with. Ideally open source, or at least free, which I can package with my deployments. Do you have suggestions on this front?
you should take a look at the kicad api

kbparadise v60 blues

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: The Living PCB Design Thread
« Reply #457 on: Tue, 03 January 2017, 13:54:35 »
I've been reading fellow users' schematics and it looks like that AREF actually requires a 0.1µF capacitor.
Other than that, a resistor is provided to the reset pin, no matter if the HWB has one on its own already.
If both statements are true, I should be good with the following schematic.
Can anyone confirm?
TIA.

My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: The Living PCB Design Thread
« Reply #458 on: Tue, 03 January 2017, 14:34:12 »


Hey all.  I am new to this thread. I have not touched anything on the electrical side of building keyboards, and have only built boards based on PCBs designed by others.

I am the developer behind http://builder.swillkb.com.  Ironically, I started it because I was not confident in my cad skills and thought I should automate the plate layout.  Now it does quite a bit more than I was expecting when I started, but I have always had the pipe dream of being able to produce a PCB that goes with the layout specified.

The biggest hurdle I think I am going to have with this is the auto routing for the pcb.  I am only just starting to look into what I would need to do to even get something primitive built.

So my question is. What algorithms should I be researching, and what auto routing systems are best suited to designing keyboards. I know the following exist, but not much beyond that.

Maze router,
Line probe router,
Channel router,
Area routers,
Switchbox routing

Given my current skill level, I will probably have to spend a couple months just learning stuff. I would not expect to actually have anything written for about 6 months and really, who knows at that point.

If anyone has resources you can share that you think would be required reading for me, please share a link. If you have ideas or suggestions, please let me know as well.

Thanks for the help everyone. Happy new year. If you have not checked out the builder recently, you guys may be interested in the new custom polygon features I finally finished adding to the builder over the holidays.
ok so what are you going to use as a controller diodes and other components?
do you have pcb models for different switch types?
led holes?

So right now I don't have anything, but I do have an idea of the things I will need.  I don't have modules built yet for switch and led layouts.  I will likely do SMD diodes and resistors (for LEDs, when I support them).  Ideally, I would build a standard footprint I use for every switch and use it everywhere.  That will make things easier from the dev side.  I have not talked to MOZ or Melvang about this yet, but I basically want to use something like a simplified Enabler PCB as the base switch component.  I know through hole is less daunting for builders, but I think most people are capable of soldering SMD (I was without much practice).  I think it is probably important to support SMD because it makes it easier to automate pick and place of components.  If people end up running small group buys based on the output, I think it gets us one step closer to a fully automated process.

The controller is a bit of a different story.  I would ideally like to give people options, but I have to start somewhere.  The ones that are on my radar would be something like; the SMD footprint for an ATMEGA32U4 (or similar), through hole pin set for the teensy (or similar).

My goal is to help enable builders and people with ideas to make it happen, so I am trying to solve the lowest common denominator with the most value to start with.  Then we go from there... 

To me, the auto routing is the biggest blind spot for me.  I know it is possible, but I also know it is non-trivial, so I have to get comfortable with how I am going to solve that before I get to deep into the weeds on some of the other pieces.  With the builder right now, I have the capability to draw vector files (svg+) and I already have the location of all the switches.  It would not be hard for me to start with a drill hole output, or even draw essentially the enabler at every switch location and just not route it.  Obviously not an end game solution, but it is a start.  It gets me to the point of being able to produce something of value.  With that as a starting point, I may be able to output as KiCad and people could manually route the pcb. 

Anyway, this is longer than I was planning to write.  There is a lot of ground I have to cover before I get to an end game solution, but I think there is probably a lot of value in some of the baby steps.  :)
ok how many layers are you wanting to use?
i would make the switch with diodes and everything a module for the switch
the issue i see is the matrix and getting a schematic from the layout and making sure that they are wired correctly in a schematic

Yes. I have to have a way to verify the wiring works as expected.

Right now I am planning to use 2 layers.
ok what cad software are you using for this?
Right now, I am not. I have basically built my own cad engine from scratch in Golang because everything I found was bloated and not friendly to be automated.

For the electrical stuff I will probably have to find an engine I can work with. Ideally open source, or at least free, which I can package with my deployments. Do you have suggestions on this front?
you should take a look at the kicad api
Yes. I think that is probably my best bet. Thanks. :)

Offline jrmobley

  • Posts: 5
  • Location: Seattle
Re: The Living PCB Design Thread
« Reply #459 on: Tue, 03 January 2017, 17:09:06 »
Hey all.  I am new to this thread. I have not touched anything on the electrical side of building keyboards, and have only built boards based on PCBs designed by others.

I am the developer behind http://builder.swillkb.com.  Ironically, I started it because I was not confident in my cad skills and thought I should automate the plate layout.  Now it does quite a bit more than I was expecting when I started, but I have always had the pipe dream of being able to produce a PCB that goes with the layout specified.

The biggest hurdle I think I am going to have with this is the auto routing for the pcb.  I am only just starting to look into what I would need to do to even get something primitive built.

So my question is. What algorithms should I be researching, and what auto routing systems are best suited to designing keyboards. I know the following exist, but not much beyond that.

Maze router,
Line probe router,
Channel router,
Area routers,
Switchbox routing

Given my current skill level, I will probably have to spend a couple months just learning stuff. I would not expect to actually have anything written for about 6 months and really, who knows at that point.

If anyone has resources you can share that you think would be required reading for me, please share a link. If you have ideas or suggestions, please let me know as well.

Thanks for the help everyone. Happy new year. If you have not checked out the builder recently, you guys may be interested in the new custom polygon features I finally finished adding to the builder over the holidays.

Hi swill and everybody.  I'm new to this thread too, and to geekhack and to the mechanical keyboard scene.  I'm pretty blown away by all the great stuff going on here.  I am working on my own keyboard project and, like you, I have ended up working on software to generate drawings instead of using CAD tools.  Your plate builder was definitely an inspiration to me!

I spent some time trying to learn KiCad, but it drove me crazy with its terrible interface.  And so much of the layout of a keyboard PCB is just begging for automation, I decided just to learn about the Gerber format and develop some code to generate my PCB artwork directly from keyboard-layout-editor data.  I was also inspired by the work at http://pcbmode.com.

For my project, the keyboard controller is not going to be on the same board as the key switch matrix, so that simplifies things quite a bit for me.  Also, I have no interest in LEDs, which also simplifies my problem.  I am trying to avoid the general trace routing problem altogether by sticking to a simple design with columns on the front and rows on the back.  Right now I am basically cloning the TrueFox layout.  It's not exactly the layout I want, but it is close, and I can get the keycaps for it, so it's a good start.  The obvious matrix would be 16 columns by 5 rows, but that is an inefficient use of 21 GPIO.  So the most interesting thing that I think I am doing is using an 8x10 matrix where the columns are sort of folded in half and there are two matrix rows per physical row of keys.  Also, I am using copper pours for the rows and columns, which makes it easier to embed a key module without worrying about routing traces.

I have a long way to go, but maybe this image of my work in progress can help explain where I am going with it.

(Attachment Link)

Sorry if that is hard to read.  My code is a broken refactoring mess right now and that is the only image I have around to share.  This is my first post and I'm a noob with forum software, so I hope the image shows up...

-JR
Cool. That looks like a fun project. What language are you developing in?  How have you found the Gerber format to work with? I was also planning to export a Gerber file.  Are you building everything from scratch, or are you using some sort of engine for designing the components and exporting the final files?

I am working in Python and I'm writing everything from scratch.  I don't know of any libraries for building circuits with code, other than the scripting interfaces for things like Eagle and KiCad, and I decided I didn't want to get tangled up with those.  After I get the key switch PCB finished, I will have to decide what to do about my controller board.  Will my code be functional enough to use for that?  I plan to prototype a controller on a breadboard first, so maybe I will try Fritzing for that board.

Gerber has been enjoyable.  I am not writing any Gerber output yet, but I am building all of my internal data structures based on the Gerber file structure, so I expect the final output to be a simple process.  The format has some entertaining terminology quirks because of its history as a CAM format for old photo plotters, but basically it is a simple vector graphics drawing format.  The documentation is very good I think.

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: The Living PCB Design Thread
« Reply #460 on: Tue, 03 January 2017, 20:23:23 »


Cool. That looks like a fun project. What language are you developing in?  How have you found the Gerber format to work with? I was also planning to export a Gerber file.  Are you building everything from scratch, or are you using some sort of engine for designing the components and exporting the final files?

I am working in Python and I'm writing everything from scratch.  I don't know of any libraries for building circuits with code, other than the scripting interfaces for things like Eagle and KiCad, and I decided I didn't want to get tangled up with those.  After I get the key switch PCB finished, I will have to decide what to do about my controller board.  Will my code be functional enough to use for that?  I plan to prototype a controller on a breadboard first, so maybe I will try Fritzing for that board.

Gerber has been enjoyable.  I am not writing any Gerber output yet, but I am building all of my internal data structures based on the Gerber file structure, so I expect the final output to be a simple process.  The format has some entertaining terminology quirks because of its history as a CAM format for old photo plotters, but basically it is a simple vector graphics drawing format.  The documentation is very good I think.

I did the original builder (https://github.com/swill/kb_builder) in Python (and FreeCAD), and I got sick of dealing with the crap of a cad software, so I just started from scratch in Golang.

I was chatting with some guys on the kicad IRC, and they basically recommended that I just output to whatever file format I want and skip kicad all together if I want to automate anything.  I had a look at the kicad "api" and its not really an API. It is basically a swig wrapper around the C++ code, so that's not really a good option for me. I could embed the C++ code directly into golang, but I think I am probably going to start by just building from scratch.

My code already works natively with the svg format and I have a pretty good set of polygon features now too. I think I will start by doing svg to Gerber. I see that pcbmode already has that feature, so I can probably understand the conversion from that. Thanks for the link.

This is going to be an interesting project.

BTW, I like your idea for the 8x10 matrix, that's a good idea. Not doing a controller on the board is smart to start with to reduce complexity. Are you just going to do something like a teensy header pin layout in through hole?

I like your project and approach. I think our projects have a lot in common. :)

Offline mrbishop

  • * Maker
  • Posts: 799
  • Location: South Carolina USA
  • Evil Genius
    • Bishop Computer Design web
Re: The Living PCB Design Thread
« Reply #461 on: Tue, 03 January 2017, 21:21:29 »


Cool. That looks like a fun project. What language are you developing in?  How have you found the Gerber format to work with? I was also planning to export a Gerber file.  Are you building everything from scratch, or are you using some sort of engine for designing the components and exporting the final files?

I am working in Python and I'm writing everything from scratch.  I don't know of any libraries for building circuits with code, other than the scripting interfaces for things like Eagle and KiCad, and I decided I didn't want to get tangled up with those.  After I get the key switch PCB finished, I will have to decide what to do about my controller board.  Will my code be functional enough to use for that?  I plan to prototype a controller on a breadboard first, so maybe I will try Fritzing for that board.

Gerber has been enjoyable.  I am not writing any Gerber output yet, but I am building all of my internal data structures based on the Gerber file structure, so I expect the final output to be a simple process.  The format has some entertaining terminology quirks because of its history as a CAM format for old photo plotters, but basically it is a simple vector graphics drawing format.  The documentation is very good I think.

I did the original builder (https://github.com/swill/kb_builder) in Python (and FreeCAD), and I got sick of dealing with the crap of a cad software, so I just started from scratch in Golang.

I was chatting with some guys on the kicad IRC, and they basically recommended that I just output to whatever file format I want and skip kicad all together if I want to automate anything.  I had a look at the kicad "api" and its not really an API. It is basically a swig wrapper around the C++ code, so that's not really a good option for me. I could embed the C++ code directly into golang, but I think I am probably going to start by just building from scratch.

My code already works natively with the svg format and I have a pretty good set of polygon features now too. I think I will start by doing svg to Gerber. I see that pcbmode already has that feature, so I can probably understand the conversion from that. Thanks for the link.

This is going to be an interesting project.

BTW, I like your idea for the 8x10 matrix, that's a good idea. Not doing a controller on the board is smart to start with to reduce complexity. Are you just going to do something like a teensy header pin layout in through hole?

I like your project and approach. I think our projects have a lot in common. :)
If you can output the center point of each switch that would make placing the switches and other components a lot easier as kicads placement allows for direct input of the XY location value of each component. I always do it the harder way and get a spreadsheet going and math and 19.05+19.05 and 19.05/4 ugh brain hurts just thinking about it.

sent from my chess board
Projects
Build to give back, 40% | Alps/Matias Removal ToolUltraHack 67% Hackdura  | ErgoDox case
                             
    

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #462 on: Tue, 03 January 2017, 23:23:47 »
I've been reading fellow users' schematics and it looks like that AREF actually requires a 0.1µF capacitor.
Other than that, a resistor is provided to the reset pin, no matter if the HWB has one on its own already.
If both statements are true, I should be good with the following schematic.
Can anyone confirm?
TIA.

The capacitor on AREF is optional. If you're not going to do any analog sensing you really don't need it. It doesn't hurt in any way to put it there either. Just leave the pin floating (unconnected) if you don't put a capacitor there.

The HWB pin decides what happens when the chip is reset. If it is tied to GND the bootloader starts, if high execution of the firmware starts. It however is a bit dangerous connecting an IO-pin directly to one of the power rails, hence you use a resistor in series. This resistor has got nothing to do with the one on the reset pin. HWB is pretty much just another IO-pin along the rest.

The resistor on the reset pin is a pull-up resistor. It ensures that reset is tied to VCC (much the same way as HWB to GND), but in this case you also have a switch to short the pin out directly to GND. You actually don't need that resistor either as there is an internal pull-up resistor on the reset pin (as well as all other IO-pins).

Edit: Also, I don't know if it has been mentioned, but the value for the capacitor on the crystal depends on the specific crystal you use. You need to figure out the correct value, and then see if it works. Which it probably will, but if not some experimentation may be needed. I wouldn't worry much about it not working though, it probably will.
« Last Edit: Tue, 03 January 2017, 23:41:33 by bpiphany »

Offline jrmobley

  • Posts: 5
  • Location: Seattle
Re: The Living PCB Design Thread
« Reply #463 on: Wed, 04 January 2017, 03:12:44 »


I am working in Python and I'm writing everything from scratch.  I don't know of any libraries for building circuits with code, other than the scripting interfaces for things like Eagle and KiCad, and I decided I didn't want to get tangled up with those.  After I get the key switch PCB finished, I will have to decide what to do about my controller board.  Will my code be functional enough to use for that?  I plan to prototype a controller on a breadboard first, so maybe I will try Fritzing for that board.

Gerber has been enjoyable.  I am not writing any Gerber output yet, but I am building all of my internal data structures based on the Gerber file structure, so I expect the final output to be a simple process.  The format has some entertaining terminology quirks because of its history as a CAM format for old photo plotters, but basically it is a simple vector graphics drawing format.  The documentation is very good I think.

I did the original builder (https://github.com/swill/kb_builder) in Python (and FreeCAD), and I got sick of dealing with the crap of a cad software, so I just started from scratch in Golang.

I was chatting with some guys on the kicad IRC, and they basically recommended that I just output to whatever file format I want and skip kicad all together if I want to automate anything.  I had a look at the kicad "api" and its not really an API. It is basically a swig wrapper around the C++ code, so that's not really a good option for me. I could embed the C++ code directly into golang, but I think I am probably going to start by just building from scratch.

My code already works natively with the svg format and I have a pretty good set of polygon features now too. I think I will start by doing svg to Gerber. I see that pcbmode already has that feature, so I can probably understand the conversion from that. Thanks for the link.

This is going to be an interesting project.

BTW, I like your idea for the 8x10 matrix, that's a good idea. Not doing a controller on the board is smart to start with to reduce complexity. Are you just going to do something like a teensy header pin layout in through hole?

I like your project and approach. I think our projects have a lot in common. :)

Haha, yeah it sounds like both of us would rather spend six months writing our own software than six weeks learning to use ugly software.  No offense to any KiCad fans out there, but, ugh.

My project isn't actually a PC keyboard.  I am making an all-in-one style computer around Raspberry Pi.  So under the keyboard, I'll have the RasPi "motherboard" plus a secondary interface board that will have the keyboard controller as well as some additional interface circuitry, like joystick connectors and maybe a secondary SD card slot.  I'm going for an old school home computer type unit of the 80's.  So the keyboard PCB itself will just have a header connector for connecting to the interface board.  I am making everything through-hole for easy soldering and because I want it to be something you can open up and look at and understand and tinker with.  So, kinda retro.  I think I will be able to use a 28 pin DIP ATmega328P for the controller.  Basically an Arduino.  It will talk to the RaspPi over I2C or SPI.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: The Living PCB Design Thread
« Reply #464 on: Wed, 04 January 2017, 03:34:18 »
The capacitor on AREF is optional. If you're not going to do any analog sensing you really don't need it. It doesn't hurt in any way to put it there either. Just leave the pin floating (unconnected) if you don't put a capacitor there.
Noted. I'm inclined towards leaving it floating then.

The HWB pin decides what happens when the chip is reset. If it is tied to GND the bootloader starts, if high execution of the firmware starts. It however is a bit dangerous connecting an IO-pin directly to one of the power rails, hence you use a resistor in series. This resistor has got nothing to do with the one on the reset pin. HWB is pretty much just another IO-pin along the rest.
That makes sense, thanks. Although, out of sheer curiosity, what do you mean by "bit dangerous"? Would the absence of a resistor fry the IC?

The resistor on the reset pin is a pull-up resistor. It ensures that reset is tied to VCC (much the same way as HWB to GND), but in this case you also have a switch to short the pin out directly to GND. You actually don't need that resistor either as there is an internal pull-up resistor on the reset pin (as well as all other IO-pins).
Is the internal pull-up resistor strong enough for this purpose? I've read they are a bit weak and I would certainly better be safe than sorry and put an external resitor.

Also, I don't know if it has been mentioned, but the value for the capacitor on the crystal depends on the specific crystal you use. You need to figure out the correct value, and then see if it works. Which it probably will, but if not some experimentation may be needed. I wouldn't worry much about it not working though, it probably will.
I'm using a 16MHz crystal with two 10pF electrolytic capacitors because it's the same setup of the Teensy 2.0. I know nothing of crystals, I don't know wheter to choose one or another, nor how to calculate the capacitors' values for it. If you could suggest some reading about it, I would appreciate it.

Thank you for all your answers and your time.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline vvp

  • Posts: 886
Re: The Living PCB Design Thread
« Reply #465 on: Wed, 04 January 2017, 04:51:51 »
I'm using a 16MHz crystal with two 10pF electrolytic capacitors because it's the same setup of the Teensy 2.0. I know nothing of crystals, I don't know wheter to choose one or another, nor how to calculate the capacitors' values for it. If you could suggest some reading about it, I would appreciate it.
Here  is an example what everything should be considered to have your crystal just right. Unfortunately it is not for ATmega32u4 but the approach is the same and maybe you can find an application note for ATmega32u4 too. If you find it then post it here :)
If you do not want to bother with it then use exactly the same crystal with exactly the same capacitors (and the resistor if applicable). There are many 16 MHz crystals and they required different capacitors and some of them also an resistor when paired with a particular MCU. If you do not have the parts for your crystal right then it will probably work but may have imprecise frequency or the crystal may fail sooner (if you e.g. overdrive it).

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #466 on: Wed, 04 January 2017, 05:12:34 »
I've found this design guide for Atmel. Section 5 is about crystals.


The HWB pin decides what happens when the chip is reset. If it is tied to GND the bootloader starts, if high execution of the firmware starts. It however is a bit dangerous connecting an IO-pin directly to one of the power rails, hence you use a resistor in series. This resistor has got nothing to do with the one on the reset pin. HWB is pretty much just another IO-pin along the rest.
That makes sense, thanks. Although, out of sheer curiosity, what do you mean by "bit dangerous"? Would the absence of a resistor fry the IC?

It could if you accidentally drive the pin as an output opposite to the level which it is connected to. As an input there is virtually no current flowing through the resistor and the pin sees the voltage level on the other side of the resistor anyway.


The resistor on the reset pin is a pull-up resistor. It ensures that reset is tied to VCC (much the same way as HWB to GND), but in this case you also have a switch to short the pin out directly to GND. You actually don't need that resistor either as there is an internal pull-up resistor on the reset pin (as well as all other IO-pins).
Is the internal pull-up resistor strong enough for this purpose? I've read they are a bit weak and I would certainly better be safe than sorry and put an external resitor.

I've never used any extra pull-up for the reset. The Teensies don't either, and I've never heard of anyone having troubles with it. You're probably more probable to screw it up by connecting extra stuff (which i have seen), rather than just using it as it was intended to.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: The Living PCB Design Thread
« Reply #467 on: Wed, 04 January 2017, 06:58:15 »
Here  is an example what everything should be considered to have your crystal just right.

I've found this design guide for Atmel. Section 5 is about crystals.
Thanks both for the links.

There are many 16 MHz crystals and they required different capacitors and some of them also an resistor when paired with a particular MCU. If you do not have the parts for your crystal right then it will probably work but may have imprecise frequency or the crystal may fail sooner (if you e.g. overdrive it).
Would you recommend any to buy?

The HWB pin decides what happens when the chip is reset. If it is tied to GND the bootloader starts, if high execution of the firmware starts. It however is a bit dangerous connecting an IO-pin directly to one of the power rails, hence you use a resistor in series. This resistor has got nothing to do with the one on the reset pin. HWB is pretty much just another IO-pin along the rest.
That makes sense, thanks. Although, out of sheer curiosity, what do you mean by "bit dangerous"? Would the absence of a resistor fry the IC?
It could if you accidentally drive the pin as an output opposite to the level which it is connected to. As an input there is virtually no current flowing through the resistor and the pin sees the voltage level on the other side of the resistor anyway.
Got it. Thanks.

The resistor on the reset pin is a pull-up resistor. It ensures that reset is tied to VCC (much the same way as HWB to GND), but in this case you also have a switch to short the pin out directly to GND. You actually don't need that resistor either as there is an internal pull-up resistor on the reset pin (as well as all other IO-pins).
Is the internal pull-up resistor strong enough for this purpose? I've read they are a bit weak and I would certainly better be safe than sorry and put an external resitor.

I've never used any extra pull-up for the reset. The Teensies don't either, and I've never heard of anyone having troubles with it. You're probably more probable to screw it up by connecting extra stuff (which i have seen), rather than just using it as it was intended to.
I'll leave the resistor out then.

Thank you good sirs.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #468 on: Wed, 04 January 2017, 08:44:07 »
To be on the cautious side you can keep the resistor footprint, and just not populate it. Then you have the option to add a resistor if you run into trouble.

Offline swill

  • * Elevated Elder
  • Posts: 3365
  • Location: Canada eh
  • builder & enabler
    • swillkb.com
Re: The Living PCB Design Thread
« Reply #469 on: Wed, 04 January 2017, 08:57:26 »
Haha, yeah it sounds like both of us would rather spend six months writing our own software than six weeks learning to use ugly software.  No offense to any KiCad fans out there, but, ugh.

My project isn't actually a PC keyboard.  I am making an all-in-one style computer around Raspberry Pi.  So under the keyboard, I'll have the RasPi "motherboard" plus a secondary interface board that will have the keyboard controller as well as some additional interface circuitry, like joystick connectors and maybe a secondary SD card slot.  I'm going for an old school home computer type unit of the 80's.  So the keyboard PCB itself will just have a header connector for connecting to the interface board.  I am making everything through-hole for easy soldering and because I want it to be something you can open up and look at and understand and tinker with.  So, kinda retro.  I think I will be able to use a 28 pin DIP ATmega328P for the controller.  Basically an Arduino.  It will talk to the RaspPi over I2C or SPI.

Haha.  Ya, that is pretty accurate.  For me, the builder is a fun project that I do on my own time, so I have to be having fun with it for it to be worth it and for me to be motivated to actually work on it.  So if something takes me 6 months, but I have fun doing it, then it is all good.  I would rather do that than spend 6 weeks working with something I don't really like and then have to maintain that integration for ever. 

Ya, that is a pretty cool project.  If you need a case for your project, you know where to go.  :P

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: The Living PCB Design Thread
« Reply #470 on: Wed, 04 January 2017, 08:59:15 »
To be on the cautious side you can keep the resistor footprint, and just not populate it. Then you have the option to add a resistor if you run into trouble.
Great idea. I guess I need some sort of jumping wire or 0 Ohm resistor in this case, don't I?
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #471 on: Wed, 04 January 2017, 09:08:43 »
To be on the cautious side you can keep the resistor footprint, and just not populate it. Then you have the option to add a resistor if you run into trouble.
Great idea. I guess I need some sort of jumping wire or 0 Ohm resistor in this case, don't I?

No, that would be really bad =D Ask yourself; What would happen if I close that reset switch with a jumper in place of the resistor?.. Just leave it empty.

Offline vvp

  • Posts: 886
Re: The Living PCB Design Thread
« Reply #472 on: Wed, 04 January 2017, 09:14:47 »
Would you recommend any to buy?
Sorry I do not. I'm not using ATmega in my keyboards.

Note: I'm not expert in crystal design. Hopefully if somebody is and notices some errors here then he will point them out. I only read quite a bit about the problem so that my crystals are good enough for a full speed USB.

If you want to have this really easy just take the same parts(*) which are on some ATmega32u4 device which has published schematic with precise part numbers. Maybe take it from some Arduino board. Also place crystal (and the related parts and traces) close to the MCU in a similar way as it is in the PCB of the device you are taking part numbers from. It is not such a big deal in the end. The precisely matching capacitors are mostly about how precise the final oscillation frequency of the crystal will be.  For a keyboard project it is not a big problem because it is not probable you would get more than 0.25% imprecision in the clock (which is required by full speed USB). So in common cases, you can get your load capacitors wrong by about 4 pF and USB will not mind at all. That is good because you will be probably only guessing circuit board stray capacitance which is around 5 - 10 pF. So you can still guess your PCB stray capacitance quite badly and have it working overall.

(*) crystal and its loading capacitors (and also the resistor if applicable)

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: The Living PCB Design Thread
« Reply #473 on: Wed, 04 January 2017, 13:45:11 »
No, that would be really bad =D Ask yourself; What would happen if I close that reset switch with a jumper in place of the resistor?.. Just leave it empty.
Right. It feels like sometimes I don't think.

I'm not using ATmega in my keyboards.
Do you mind if I ask what do you use then? I was wondering about alternative controllers.

And thanks for the explaination about crystals.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline vvp

  • Posts: 886
Re: The Living PCB Design Thread
« Reply #474 on: Wed, 04 January 2017, 14:34:45 »
I use ATxmega64a4u or ATxmega128a4u.
This is not a recommendation from me to use them. They are OK but a bit expensive for a new design. They are slightly less expensive than ATmega32u4 but significantly more expensive than cheap Arm Cortex-M0 MCUs (e.g. STM32F072C).

I happened to use the ATxmega chips because it was very easy to port my favorite firmware to it. A firmware with a LUFA back-end can be ported to atxmega from atmega in about a day (if you know C programming).

Anyway a good thing about ATxmega64a4u or STM32F072 or e.g. MKL27Z128VLH4 is that they do not need crystal for proper USB functionality. I needed a crystal for a non-keyboard project with STM32F3xx MCU.

Offline climbalima

  • Posts: 130
  • Location: Boston MA
  • likes building stuff
Re: The Living PCB Design Thread
« Reply #475 on: Wed, 04 January 2017, 20:27:30 »
One board to rule them all, routed and ready for any occasion ;)
https://geekhack.org/index.php?topic=38414.msg757373#msg757373

Lol im workingon a similar board for 40%. im still in the proto stage, but its 12x4 and supports planck/jd40





Offline rrrsss

  • Posts: 24
Re: The Living PCB Design Thread
« Reply #476 on: Sun, 08 January 2017, 04:56:06 »
glad to see this thread still running! I'm planning to make my own 1column pcbs and a wireless keyboard based on an existing schematic, but still not sure about sending them off to the fab. How and where should I go about reassuring myself? I don't mind uploading the files here, but what should I upload? The kicad_pcb and sch? or the whole folder?

Offline 27.9.2016

  • Posts: 18
Re: The Living PCB Design Thread
« Reply #477 on: Thu, 12 January 2017, 16:25:24 »
My DIY project







What do you thing does it look good? I am planning on etching this PCB by myself with UV process  ;D
« Last Edit: Thu, 12 January 2017, 16:34:57 by 27.9.2016 »

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #478 on: Fri, 13 January 2017, 15:09:00 »
What do you thing does it look good? I am planning on etching this PCB by myself with UV process  ;D

It looks alright, it looks auto-routed.. You could clean up a few wacky vias around the Teensy. With a little bit of effort you could probably straighten a few more things out by re-arranging some more. But on the other hand it will surely work, and time can be spent better =) If you etch at home you may want to increase the trace widths to add some extra margin.

If you're not etching a double sided board you may also want to try to move more of the traces to the same side. I would put all traces around the Teensy on the bottom. Otherwise it will be hard to solder (on a single sided board). The long straight horizontal traces would be easily made from jumper wires, if on the back.. I can't say straight that it's feasible to "reverse" the layers like this, that would take some more experimenting. Silly me, jumpers can of course be placed anywhere =P Also drilling PCB laminates is a b****, and you need to be very accurate for the switches to sit straight. And you need really good alignment if you're doing a double sided board. But hey you'll be really pleased with yourself once you finish =D

To save etchant you can also add copper fills, just make sure they are connected to something (GND preferably) and not floating free. That probably wouldn't impede functionality much in this case, but it's considered bad practice..
« Last Edit: Fri, 13 January 2017, 15:48:50 by bpiphany »


Offline krownedk1ng

  • Posts: 9
Re: The Living PCB Design Thread
« Reply #480 on: Sat, 14 January 2017, 23:54:43 »
Hi everyone,

I'm looking at getting some feedback on my PCB and schematic design that I've been working on. The PCB was laid out by using http://keyboard-layout-editor.com and http://kalerator.clueboard.co/.

I had submitted my schematic on the site a week or so ago for some feedback and have made some adjustments based on the feedback I had gotten. I've attached images of the schematic and PCB at the bottom of the post.

I ended up modifying the AlpsCherry library for Eagle that I grabbed off of GitHub to have SMD LED's instead of the through hole ones that were there by default. I was looking at using these LEDs: link

Are those typically the surface mount LEDs that people use, or am I looking at the wrong ones? I'm looking at just having a single color on the board at this time.

I'd appreciate it if someone could give me feedback on if I should adjust anything on the PCB layout and how I should go about connecting the LEDs to the board. I currently have 3 i/o pins that are not being used on the board. I was thinking about using one of the i/o pins to control the LED's with the use of a switching FET, but wasn't sure if that was the right approach.

Schematic


Microcontroller on PCB


Full PCB

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: The Living PCB Design Thread
« Reply #481 on: Sun, 15 January 2017, 02:41:59 »
https://github.com/ruiqimao/keyboard-pcb-guide#setting-up
A guy on r/MK did this and it is really nice. https://www.reddit.com/r/MechanicalKeyboards/comments/5nzpd2/guide_how_to_make_your_own_keyboard_pcb/
It is indeed, but I have a question about a specific part of this tutorial.


This is where he connects the VBUS to the VCC pins of the MCU; If I get it right, he's connecting the VBUS to the Pin #2 through the capacitor C7 and the other pins are connected through the Pin #2.
It is my understanding that it's a bad practise because the pins receive the current before the capacitor making the decoupling effect minimal or non existant at all.

Would please someone enlighten me?
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #482 on: Mon, 16 January 2017, 15:56:48 »
...receive the current before the capacitor making the decoupling effect minimal or non existant at all.

Nah, that doesn't matter. I think you should see the pin as sitting at a certain voltage level. When the pin consumes charge the voltage drops if there is not enough supply coming through. All traces have some impedance (stopping power to currents/current changes). Long traces more so than short traces. To make sure the voltage on the pins doesn't drop when it eats away on those electrons (especially in high spree short bursts) you want a nice buffer real close by, within grabbing distance. If the electron passes by you on their way into the buffer or not doesn't really matter, it just needs to be close.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: The Living PCB Design Thread
« Reply #483 on: Mon, 16 January 2017, 16:07:09 »
...receive the current before the capacitor making the decoupling effect minimal or non existant at all.

Nah, that doesn't matter. I think you should see the pin as sitting at a certain voltage level. When the pin consumes charge the voltage drops if there is not enough supply coming through. All traces have some impedance (stopping power to currents/current changes). Long traces more so than short traces. To make sure the voltage on the pins doesn't drop when it eats away on those electrons (especially in high spree short bursts) you want a nice buffer real close by, within grabbing distance. If the electron passes by you on their way into the buffer or not doesn't really matter, it just needs to be close.
So would you recommend connecting all the power pins to each other? Underneath the IC maybe?

In a two layers board, is it a good practise to have one a GND plane and the other a power plane? Perhaps a smaller power plane (I think it's called polygon pour) just around the IC?

Excuse all the questions but you do give the good advices and I need them.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #484 on: Mon, 16 January 2017, 16:39:17 »
If you want a truly educated answer you should probably ask at another forum...

I think the recommendation for a two layer board would be to use both sides for GND pour and route power rails individually to pins, stitching the GND plane together generously to maintain short return paths. You probably want to avoid making loops of copper, loops pick up EMI (and emits it). De-coupling at all pins for sure (On a board with separate power planes I believe the consensus is that it's not quite as essential). Some components may have thermal pads which connect to VCC. In that case you need to make local VCC pours, of course.

Loop area that is. You don't want a lot of open space fully enclosed by a conductor. The induced current is equal to the change in magnetic flux, which in turn is proportional to the magnetic field multiplied by the enclosed area. In other words, a thin slot for routing another net doesn't count for much.
« Last Edit: Mon, 16 January 2017, 16:42:23 by bpiphany »

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: The Living PCB Design Thread
« Reply #485 on: Mon, 16 January 2017, 17:10:31 »
GND pour on both sides is what I was doing and I guess I'll stick to that. If I get what you said right, I guess I have to keep the power traces as short as possible.
I'll surely nag you (all) with more questions in the future. Thank you very much for the time being, you're really helpful.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #486 on: Tue, 17 January 2017, 00:31:11 »
It's always good to keep traces short (except in cases where you use properties of the trace itself, like with impedance matching and such). Since power rails are at a constant level they should probably be your least concern lengthwise, as long as they are properly decoupled. The traces between pins and decoupling capacitors are the ones you want to keep short and straight.

There's probably a bunch of general rules to take into account, times they matter more, and times they matter less (like with keyboards that are just very slow). The higher frequency you shift things around with the tricker things get. The USB signals is probably the only place you'd possibly need to take some care, but I think that at the low speed needed for keyboards you should be easy off with just about anything.

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: The Living PCB Design Thread
« Reply #487 on: Tue, 17 January 2017, 14:45:01 »
Thanks for all your insights. I owe you a pizza.
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline krownedk1ng

  • Posts: 9
Re: The Living PCB Design Thread
« Reply #488 on: Fri, 20 January 2017, 19:49:53 »
Hi everyone,

I'm looking at getting some feedback on my PCB and schematic design that I've been working on. The PCB was laid out by using http://keyboard-layout-editor.com and http://kalerator.clueboard.co/.

I had submitted my schematic on the site a week or so ago for some feedback and have made some adjustments based on the feedback I had gotten. I've attached images of the schematic and PCB at the bottom of the post.

I ended up modifying the AlpsCherry library for Eagle that I grabbed off of GitHub to have SMD LED's instead of the through hole ones that were there by default. I was looking at using these LEDs: link

Are those typically the surface mount LEDs that people use, or am I looking at the wrong ones? I'm looking at just having a single color on the board at this time.

I'd appreciate it if someone could give me feedback on if I should adjust anything on the PCB layout and how I should go about connecting the LEDs to the board. I currently have 3 i/o pins that are not being used on the board. I was thinking about using one of the i/o pins to control the LED's with the use of a switching FET, but wasn't sure if that was the right approach.

Schematic
Show Image


Microcontroller on PCB
Show Image


Full PCB
Show Image


Would someone be able to give me some feedback regarding how hook up the LED backlighting in my schematic? I have 3 i/o ports still available and was initially thinking about creating a couple zones of LEDs, which would get PWM'd on and off using some kind of a FET [I was thinking a dual channel FET to control both zones]. Is that the right way to do it? Or is there a better way to approach this? Thanks

Offline 27.9.2016

  • Posts: 18
Re: The Living PCB Design Thread
« Reply #489 on: Mon, 23 January 2017, 14:57:08 »
What do you thing does it look good? I am planning on etching this PCB by myself with UV process  ;D

It looks alright, it looks auto-routed.. You could clean up a few wacky vias around the Teensy. With a little bit of effort you could probably straighten a few more things out by re-arranging some more. But on the other hand it will surely work, and time can be spent better =) If you etch at home you may want to increase the trace widths to add some extra margin.

If you're not etching a double sided board you may also want to try to move more of the traces to the same side. I would put all traces around the Teensy on the bottom. Otherwise it will be hard to solder (on a single sided board). The long straight horizontal traces would be easily made from jumper wires, if on the back.. I can't say straight that it's feasible to "reverse" the layers like this, that would take some more experimenting. Silly me, jumpers can of course be placed anywhere =P Also drilling PCB laminates is a b****, and you need to be very accurate for the switches to sit straight. And you need really good alignment if you're doing a double sided board. But hey you'll be really pleased with yourself once you finish =D

To save etchant you can also add copper fills, just make sure they are connected to something (GND preferably) and not floating free. That probably wouldn't impede functionality much in this case, but it's considered bad practice..


First result of etching. I still have to clean traces, trim edges and the most fun part drill holes  :))

Bottom:


Top:

Offline bpiphany

  • Posts: 1033
  • Location: Stockholm, Sweden
  • bpiph is a special type of crazy. //mkawa
Re: The Living PCB Design Thread
« Reply #490 on: Mon, 23 January 2017, 16:18:43 »
Quote from: krownedk1ng
I'd appreciate it if someone could give me feedback on if I should adjust anything on the PCB layout

You probably want to increase the GND zone clearance. It may be just fine, but it looks really tight, especially since you've used a lot more clearance for everything else.

Where are your decoupling capacitors? They should be right up as close as possible to the 5V pins, one per pin preferably.
« Last Edit: Mon, 23 January 2017, 16:20:15 by bpiphany »

Offline krownedk1ng

  • Posts: 9
Re: The Living PCB Design Thread
« Reply #491 on: Mon, 23 January 2017, 18:08:23 »
Quote from: krownedk1ng
I'd appreciate it if someone could give me feedback on if I should adjust anything on the PCB layout

You probably want to increase the GND zone clearance. It may be just fine, but it looks really tight, especially since you've used a lot more clearance for everything else.

Where are your decoupling capacitors? They should be right up as close as possible to the 5V pins, one per pin preferably.

I had them connected near the USB port before the 0.5A fuse. I changed up my schematic to have them now be located after the fuse.

New IC layout
More

I also set the GND plane isolation to 0.012" [initially set at .005"]

Let me know what you think.

Offline mrbishop

  • * Maker
  • Posts: 799
  • Location: South Carolina USA
  • Evil Genius
    • Bishop Computer Design web
Re: The Living PCB Design Thread
« Reply #492 on: Mon, 23 January 2017, 20:04:24 »
Quote from: krownedk1ng
I'd appreciate it if someone could give me feedback on if I should adjust anything on the PCB layout

You probably want to increase the GND zone clearance. It may be just fine, but it looks really tight, especially since you've used a lot more clearance for everything else.

Where are your decoupling capacitors? They should be right up as close as possible to the 5V pins, one per pin preferably.

I had them connected near the USB port before the 0.5A fuse. I changed up my schematic to have them now be located after the fuse.

New IC layout
More
Show Image

I also set the GND plane isolation to 0.012" [initially set at .005"]

Let me know what you think.
Those traces are NSFW ugh.

sent from my chess board

Projects
Build to give back, 40% | Alps/Matias Removal ToolUltraHack 67% Hackdura  | ErgoDox case
                             
    

Offline krownedk1ng

  • Posts: 9
Re: The Living PCB Design Thread
« Reply #493 on: Mon, 23 January 2017, 20:47:38 »
Quote from: krownedk1ng
I'd appreciate it if someone could give me feedback on if I should adjust anything on the PCB layout

You probably want to increase the GND zone clearance. It may be just fine, but it looks really tight, especially since you've used a lot more clearance for everything else.

Where are your decoupling capacitors? They should be right up as close as possible to the 5V pins, one per pin preferably.

I had them connected near the USB port before the 0.5A fuse. I changed up my schematic to have them now be located after the fuse.

New IC layout
More
Show Image

I also set the GND plane isolation to 0.012" [initially set at .005"]

Let me know what you think.
Those traces are NSFW ugh.

sent from my chess board

Anything in particular that doesn't look right with the traces?

Offline mrbishop

  • * Maker
  • Posts: 799
  • Location: South Carolina USA
  • Evil Genius
    • Bishop Computer Design web
Re: The Living PCB Design Thread
« Reply #494 on: Mon, 23 January 2017, 20:57:56 »
Quote from: krownedk1ng
I'd appreciate it if someone could give me feedback on if I should adjust anything on the PCB layout

You probably want to increase the GND zone clearance. It may be just fine, but it looks really tight, especially since you've used a lot more clearance for everything else.

Where are your decoupling capacitors? They should be right up as close as possible to the 5V pins, one per pin preferably.

I had them connected near the USB port before the 0.5A fuse. I changed up my schematic to have them now be located after the fuse.

New IC layout
More
Show Image

I also set the GND plane isolation to 0.012" [initially set at .005"]

Let me know what you think.
Those traces are NSFW ugh.

sent from my chess board

Anything in particular that doesn't look right with the traces?
I was trying to say the looked really good and neat. Ignore me

sent from my chess board

Projects
Build to give back, 40% | Alps/Matias Removal ToolUltraHack 67% Hackdura  | ErgoDox case
                             
    

Offline krownedk1ng

  • Posts: 9
Re: The Living PCB Design Thread
« Reply #495 on: Mon, 23 January 2017, 21:01:51 »
Quote from: krownedk1ng
I'd appreciate it if someone could give me feedback on if I should adjust anything on the PCB layout

You probably want to increase the GND zone clearance. It may be just fine, but it looks really tight, especially since you've used a lot more clearance for everything else.

Where are your decoupling capacitors? They should be right up as close as possible to the 5V pins, one per pin preferably.

I had them connected near the USB port before the 0.5A fuse. I changed up my schematic to have them now be located after the fuse.

New IC layout
More
Show Image

I also set the GND plane isolation to 0.012" [initially set at .005"]

Let me know what you think.
Those traces are NSFW ugh.

sent from my chess board

Anything in particular that doesn't look right with the traces?
I was trying to say the looked really good and neat. Ignore me

sent from my chess board

In that case, thank you very much.

Offline HeroXLazer

  • Posts: 70
Re: The Living PCB Design Thread
« Reply #496 on: Fri, 03 February 2017, 17:03:29 »
If I want to use a Teensy 2.0 instead of a SMD, how would I connect a mini USB on my PCB to a Teensy 2.0?

Offline TalkingTree

  • Posts: 2452
  • Location: Italy (142)
    • My projects
Re: The Living PCB Design Thread
« Reply #497 on: Sat, 04 February 2017, 02:24:21 »
If I want to use a Teensy 2.0 instead of a SMD, how would I connect a mini USB on my PCB to a Teensy 2.0?
Predispose a USB connector and a header with 5 pads on your PCB, cut a USB mini cable on the type-A end and solder it to the header, finally connect the Mini-B end to the Teensy.
The picture below should give you the idea.

(click to enlarge)
My opensource projects: GH80-3000, TOAD, XMMX. Classified: stuff

Offline HeroXLazer

  • Posts: 70
Re: The Living PCB Design Thread
« Reply #498 on: Sat, 04 February 2017, 21:20:47 »
If I want to build a breakout board for USB-A. Do the mounting (left and right) have to be connected to anything?

Offline pomk

  • Posts: 470
  • Location: Finland
Re: The Living PCB Design Thread
« Reply #499 on: Sun, 05 February 2017, 05:20:09 »
Not really. According to spec you could connect them to the casing of the keyboard, but no one seems to be doing that.