Raw is an open-source printed circuit board by PCBench, from the PCBench/PCBench repository on GitHub, published under the MIT licence. It is a 2-layer board of 18.4 × 15.2 mm with 2 parts on 10 nets, routed with 51 tracks and 0 vias.
README
README.md
PCBench: A Dataset for Printed Circuit Board Routing
PCBench is a dataset for PCB routing task, it includes a dataset consisting of 164 printed circuit boards (PCB), a data augmentation script to expand the dataset for supervised learning (SL) tasks, and a reinforcement learning (RL) environment.
Dataset
Folder Structure
All the PCB designs in our dataset are stored in the folder PCBs, where each PCB design is stored in a subfolder named {author/org}_{PCB_name}_{design_version(optional)}. Below is the folder structure of the dataset.
The raw.kicad_pcb is the raw PCB design file, process.kicad_pcb is the file after cleaning up, final.json stores only routing-related information used for ML tasks. metadata.json stores the meta information for each single PCB design. visual.png is a visualization of each single PCB design. master_meta.json contains metadata of all PCBs and global-level information.
PCB Routing Description Language (PCB-RDL)
We propose a JSON specification (final.json for each PCB design) called the PCB Routing Description Language (PCB-RDL) that expresses a PCB routing problem and its solutions intuitively using basic concepts in order to facilitate research into automated PCB routing using ML. Following figure shows is an example of PCB with marked components in PCB-RDL (Left) and it corrsponding PCB-RDL (Right).
Data Augmentation
Run
The augmentation data can be generated with the script Scripts/Data_augmentation/augmentation.py. To generate 3 samples by randomly extracting 50% nets from the PCB 1Bitsy_1bitsy, please run the following command
text
cd Scripts/Data_augmentation/
python augmentation.py --num_samples 3 --net_ratio 0.5 --pcb_name 1Bitsy_1bitsy
Output
All the generated PCBs will be stored in the folder named augmented_data under Scripts/Data_augmentation/. In augmented_data, all the generated samples will be stored in a subfolder with the name of selected PCB. Each generated sample has the name sample_index.json. For example, the above command will generate the following file under Scripts/Data_augmentation/
The RL environment requires Python >= 3.7. You can simply install the environment with the following commands:
text
git clone https://github.com/PCBench/PCBench.git
cd PCBench
python setup.py install
After installation, open a Python console and type
text
from RLEnv.EnvLayer.PCBRoutingEnv import PCBRoutingEnv
If no error occurs, you have successfully installed the PCB routing environment.
API Usage
The following content shows an example of API usage of PCBRoutingEnv.
text
from RLEnv.EnvLayer.PCBRoutingEnv import PCBRoutingEnv
import random
resolution = [0.5, 0.5]
pcb_folder = '../PCBs/'
pcb_names = ["1Bitsy_1bitsy"]
iters = 30
env = PCBRoutingEnv(resolution=resolution, pcb_folder=pcb_folder, pcb_names=pcb_names)
obs, info = env.reset()
for _ in range(iters):
act = random.randint(0,5)
obs, rew, terminal, _, info = env.step(act)
if terminal:
env.reset()
You can find more examples of customizing functions of reward and state observation from RLEnv/examples.ipynb.
Parts
2
Qty
Value
Footprint
References
1
CONN_02X05
Pin_Headers:Pin_Header_Straight_2x05
P2
1
CONN_02X05
Pin_Headers:Pin_Header_Straight_2x05_Pitch1.27mm
P1
Questions
How big is the Raw PCB?
It measures 18.4 × 15.2 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Raw use?
2 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Raw KiCad files?
From the PCBench/PCBench repository on GitHub, at the commit this page was made from: the board is PCBs/mechkeys_lfk78-jtag/raw.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Can I use the Raw design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).