Giter VIP home page Giter VIP logo

kicad-kbplacer's Introduction

kicad-kbplacer

CircleCI

KiCad plugin for mechanical keyboard design. It features automatic key placement based on popular layout description from keyboard-layout-editor

Motivation

All PCB's for mechanical keyboards shares common properties which creates great opportunity for scripting. Although this project does not aim to provide complete automatic PCB generation tool it speeds up development process by reducing tedious element placement task.

Features

  • Automatic keys and diodes placement
  • Support for different annotation schemes
  • Basic track routing
  • Key rotation support
  • User selectable diode position in relation to key position

demo

Some examples can be found in examples directory.

Installation

To install release version of this plugin, use KiCad's Plugin and Content Manager (available since version KiCad 6.0).

pcm

In order to work with latest version of plugin, checkout this repository and copy (or link) content of kbplacer directory to one of the KiCad's plugin search paths. For more details see this guide.

For KiCad 5.1 compatible version see tag v0.1

How to use?

Direct usage

  • Create switch matrix schematic which meets following requirements:

    • Each switch has dedicated diode with same annotation number
    • Symbols are ordered by Y position
    • Diodes are column-to-row configuration (COL = Anode, ROW = Cathode)

    schematic-example

  • Create new PCB and load netlist

  • Obtain kle-serial compatible layout json file (note: this is not json which can be downloaded directly from keyboard-layout-editor website. Expected json format can be seen in examples directory.

    For conversion you can use https://adamws.github.io/kle-serial or keyboard-tools.xyz/kle-converter

  • Run kicad-kbplacer plugin

  • Select json layout file and plugin options and click OK.

    plugin-gui

Diode placement and routing

By default diodes are placed like shown below. This placement may not work for all switch and diode footprints combinations.

Before After
default-before default-after

To use custom diode position, manually place D1 diode and run plugin with Use first switch-diode pair as reference for relative position option enabled. Remaining switch-diode pairs will be placed same as the first one.

Before After
custom-before custom-after

Some custom diodes positions may be to difficult for router algorithm. In the above example it managed to connect diodes to switches but failed to connect diodes together.

Switch-to-diode routing is not done with proper auto-routing algorithm and it is very limited. It attempts to create track in the shortest way (using 45° angles) and doesn't look for other options if there is a collision, leaving elements unconnected.

If first switch-diode pair is routed before plugin execution, as shown below, kicad-kbplacer instead of using it's built in routing algorithm, will copy user's track. This allow to circumvent plugin's router limitations.

Before After
custom-with-track-before custom-with-track-after

Demo project

For example demo project see demo directory. This project contains 4x4 switch matrix with already generated layout json file (kle_internal.json) in expected by plugin format. It requires keyswitch-kicad-library to be installed. Use this project to validate plugin installation.

As a service

This plugin is part of my another project. See keyboard-tools

Troubleshooting

  • See stacktrace
  • See created kbplacer.log file (in PCB directory)

kicad-kbplacer's People

Contributors

adamws avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.