Skip to content

9. Electroincs production

Summary

This week I worked on electronics production. In the group task, we tested and documented the parameters for milling PCBs such as feed rate, spindle speed, and depth of cut. For my individual work, I designed, milled, and soldered my own microcontroller development board and successfully tested it. It was a very practical and interesting week where I learned the complete process of PCB fabrication.

Group assignment:

File Preparation

This week we had to design and produce our own PCBs using KiCad. We started by setting up the milling machine and testing its parameters. To begin, we used the test file provided by Neil and tried milling it several times until we achieved a clean and accurate result. After a few attempts, we successfully produced a proper PCB — this process helped us understand how important machine calibration and correct settings are for high-quality board fabrication.

Here is our SRM-20 — a desktop milling machine made by Roland, designed for precise machining of small parts and printed circuit boards (PCBs). It has a working area of 203 × 152 × 60 mm, a spindle speed range of 3,000 – 7,000 rpm, and connects easily via USB. The SRM-20 is ideal for in-house PCB fabrication, offering high precision, reliability, and an easy-to-use interface perfectly suited for Fab Lab environments.

Our design file was in .png format, but to make the SRM-20 mill the PCB, we needed to convert it into a .gcode or .rml file. To do this, we used a special type of software called a slicer or CAM tool. In this program, we imported the PNG file and specified the machine parameters — such as the working area size, spindle speed, tool type, and tool diameter. This step is essential to generate the correct toolpath so the milling machine can accurately cut the PCB according to the design.

We used Mods to convert our file into G-code. Mods is a browser-based program with an intuitive interface and ready-made settings, which makes it very convenient for PCB fabrication. In Mods, I simply uploaded my PNG file, entered the parameters of the SRM-20 milling machine — such as tool size, spindle speed, and cut depth — and the program automatically generated the toolpath file needed for milling.

In the first image, you can see the main menu of the Mods program. I selected “programs” to open a ready-made module for PCB milling.

Here, I clicked “open program” to choose the correct template for generating the machine code.

At this stage, I selected “mill 2D PCB”, which is used to convert a PNG file into G-code suitable for PCB milling.

This is the full Mods interface for G-Code Mill 2D PCB. In this step, I configured the tool parameters, cut depth, and feed rate, and then generated the final G-code file for the SRM-20 milling machine.

In this step, I used the “read png” module in Mods. Here, I clicked “select png file” to upload my PCB design image. This module reads the PNG file and prepares it for toolpath generation by sending the image data to the next module. After uploading the PNG file, the image of the PCB test pattern appeared on the screen. At the bottom, I could see the file details such as DPI (5000.49), pixel size, and physical dimensions. This confirmed that the image was correctly loaded and scaled for precise milling.

This module is the V-bit calculator in Mods. Here I entered the parameters of the milling tool: tip diameter, angle, feed speed, and offsets. The module automatically calculated the cut width and cut depth for accurate PCB milling using a 30° V-bit.

This image shows the mill raster 2D module. I defined the tool diameter, cut depth, offset number, and milling direction (climb). After entering all parameters, I clicked “calculate” to generate the toolpath for my PCB.

Here you can see the generated toolpath. The blue and red lines represent the movement of the milling tool. This preview helped me verify that the traces were correctly processed before exporting the final G-code file.

Milling Process

We converted the file into G-code for milling, and then proceeded to the actual PCB cutting process using the SRM-20 milling machine. At this stage, we set up the machine, fixed the copper board, inserted the milling bit, and started the cutting process according to the generated toolpath.

These are the milling bits I used for PCB fabrication. For this process, I selected a 0.1 mm V-bit with a 30° angle, which is suitable for fine and precise PCB trace cutting. Here, I was mounting the milling bit into the collet of the SRM-20 spindle. It’s important to tighten the bit carefully to ensure accuracy and avoid tool vibration during the milling process.

This image shows the SRM-20 milling machine ready for operation. The work area was cleaned, and I prepared the surface for placing the copper board securely before starting the milling. To fix the copper-clad board to the machine bed, I used double-sided tape. This method provides a firm grip and keeps the board completely flat during the milling process, preventing unwanted movement or uneven cuts.

We started the milling process using the SRM-20 machine, and here you can see the results. We made several attempts, adjusting the parameters in Mods each time to improve the quality of the traces. We also used a proper copper-clad board (FR1), cleaned the surface with alcohol to remove grease and dust, and made sure the milling bit was perfectly aligned and tightened straight. After fine-tuning the settings, we achieved clean and accurate PCB traces.

Attempts:

Download gcode file click here

Conclusion

This week I learned the complete process of PCB production, from file preparation to milling and testing. I worked with the SRM-20 milling machine, adjusted parameters in Mods, and learned how different settings affect the quality of the traces. At first, we had several unsuccessful attempts, but after carefully calibrating the machine, cleaning the copper surface, and aligning the milling bit correctly, we achieved a clean and precise result.

I also learned how to generate G-code files, choose the right milling tools (0.1 mm, 30°), and securely fix the material using double-sided tape. This experience gave me a much deeper understanding of electronic fabrication, precision, and the importance of proper preparation before machining.

Individual assignment:

File Preparation

Here is my Schematic.

PCB Design Description

This is the schematic of my microcontroller development board that I designed in KiCad. The board is based on the ESP32 microcontroller and includes several essential sections, each serving a specific purpose.

Microcontroller (ESP32) - The main component of the board. It handles all logic, communication, and processing tasks. It provides multiple GPIO pins for input and output connections.

Input and Output Headers - These connectors are used for attaching external sensors, buttons, or other devices. They allow easy testing and expansion of the board’s functionality.

Power Section - This part provides stable 3.3V power to the ESP32 and other components. It ensures the board operates reliably without voltage drops.

LED Indicator - I added an LED connected through a resistor to indicate power status or basic output signals. It helps to visually confirm that the board is powered and functioning.

UART Connector - This header is used for programming and serial communication with the ESP32 via USB-to-UART adapter. It allows uploading code and monitoring serial output.

Then, I exported the gerber and drill files.

I already have the Gerber file of my PCB design. The next step is to convert it into a PNG or SVG file, so I can import it into Mods for toolpath generation. In Mods, I will then convert the image into G-code, which will be used by the SRM-20 milling machine to mill the PCB precisely according to my design.

To convert the Gerber file into a PNG, I used a tool called Gerber2PNG. It’s a very convenient and easy-to-use program that quickly transforms Gerber files into high-resolution images. This step is important because Mods only accepts PNG or SVG formats to generate the G-code needed for PCB milling. Using Gerber2PNG helped me accurately prepare the image for the next stage — creating the milling path for the SRM-20 machine.

Next, I opened the Gerber2PNG online tool. This program allows converting Gerber files into PNG images, which are required for the Mods workflow used in PCB milling. I clicked “Выбрать файл” (Choose file) to upload my Gerber files.

Here, I selected all the generated Gerber and Drill files from my project folder and uploaded them to Gerber2PNG. These files include copper layers, solder masks, silkscreen, and drill data for the complete PCB layout.

After uploading, I set the conversion mode to “Generate All” and pressed “Generate PNG”. This option creates all necessary layer images — traces, outline, and drill holes — in one step.

Finally, the converted PCB layers were displayed, and I downloaded them as a ZIP file using the “Download ZIP” button. These PNG files are now ready to be imported into Mods, where they can be converted into G-code for milling with the SRM-20 machine.

Drill file and outline file

Traces file

I converted my PNG file into G-code using the Mods program. I already described this process earlier above — you can scroll up to see the detailed explanation and screenshots of how I used Mods to generate the toolpath for milling.

PCB milling process

Traces milling process

I mounted the 0.1 mm milling bit onto the spindle very carefully to make sure it was perfectly straight and there was no vibration, ensuring smooth and accurate cutting. Then I opened the VPanel software from Roland, which is used to control the SRM-20 milling machine.

Inside VPanel, I set the home position so the milling would start exactly where I needed. I also set the Z-axis zero point by lowering the tool gently to touch the surface of the copper board. After double-checking the machine, the tool, and the material fixation, everything was ready.

Finally, I pressed the “Cut” button to start the milling process. The PCB traces were cut cleanly and smoothly without any problems — the result came out very well.

Outline and drill milling process

Next, I proceeded to mill the outline and drill files using a 0.8 mm milling bit. At first, I didn’t realize that I needed to reduce the cutting speed for these operations, and because of that, I broke a few milling bits. After learning from those mistakes, I carefully set the home position again and made sure not to change it — otherwise, the board would not be aligned properly. Then, I started the milling process, beginning with the drill file and followed by the outline file, ensuring that the PCB edges and holes were clean and precisely cut.

Download PCB files click here

Soldering and testing process

I started soldering all the components onto my PCB. I began with the SMD components and the microcontroller, since they require more precision and a stable base before adding other parts. After that, I soldered the DIP components such as headers and connectors.

I set the soldering iron temperature to 350°C, which is ideal for this type of work. It’s important not to exceed 350°C, because if the temperature is too high, the copper traces on the PCB can easily peel off or get damaged. By maintaining the correct temperature and careful technique, I achieved strong and clean solder joints on all components.

This was my series of attempts completed within 24 hours — I didn’t sleep the entire night until I finally achieved a perfect working PCB. Throughout the process, I made several mistakes and learned valuable lessons.

The first problem was the poor quality of the material — the copper board I used was uneven and caused inconsistent milling results. I learned that it’s better not to save money on materials; always use high-quality FR1 boards and clean the surface with alcohol before milling.

The second issue was with the tool mounting system. My machine uses a 6 mm collet, while my milling bits were 3 mm, so I had to use an adapter. At first, I over-tightened the bit, which caused a slight misalignment and tool vibration, damaging the PCB traces.

The third mistake was the cut depth setting. Initially, I set it to 3 mm, which was too deep. With each attempt, I reduced it until I found the optimal depth of 1 mm — this gave clean traces without damaging the copper surface.

After correcting all these issues, I finally produced a working PCB that was milled cleanly and tested successfully. This long and intense day taught me patience, precision, and the importance of material quality and calibration in PCB production.

I programmed my PCB using a UART-TTL programmer in VS Code with the ESP-IDF environment provided by Espressif. After uploading the firmware, I connected a stepper motor to the ESP32 and supplied external power to ensure the motor had enough torque to rotate properly. Everything worked perfectly on the first try — the motor moved exactly as expected.

I’m very proud of this result because I went through the entire process myself: I designed the PCB, milled it on the SRM-20, soldered all the components, and finally programmed and tested it successfully. This achievement gives me strong motivation to keep learning, improving my skills, and developing even more powerful and advanced projects in the future.

Here is the code I used

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "esp_log.h"

static const char *TAG = "STEPPER";

#define IN1  14
#define IN2  27
#define IN3  26
#define IN4  25

static const int step_seq[4][4] = {
    {1, 0, 0, 0},
    {0, 1, 0, 0},
    {0, 0, 1, 0},
    {0, 0, 0, 1}
};
static void sаtepper_set_pins(const int pins[4])
{
    gpio_set_level(IN1, pins[0]);
    gpio_set_level(IN2, pins[1]);
    gpio_set_level(IN3, pins[2]);
    gpio_set_level(IN4, pins[3]);
}

static void stepper_step(int step, int delay_ms)
{
    // для full-step 4 шага
    int idx = step % 4;
    stepper_set_pins(step_seq[idx]);
    vTaskDelay(pdMS_TO_TICKS(delay_ms));
}

void app_main(void)
{
    gpio_config_t io_conf = {
        .mode = GPIO_MODE_OUTPUT,
        .pin_bit_mask = (1ULL<<IN1) | (1ULL<<IN2) | (1ULL<<IN3) | (1ULL<<IN4),
        .pull_down_en = 0,
        .pull_up_en = 0,
        .intr_type = GPIO_INTR_DISABLE
    };
    gpio_config(&io_conf);

    ESP_LOGI(TAG, "Start stepping...");

    int delay_ms = 3;     // скорость: меньше — быстрее
    int steps = 2048;     // кол-во шагов (для 28BYJ-48 ≈ 2048 шагов = 1 оборот)

    while (1) {

        for (int i = 0; i < steps; i++) {
            stepper_step(i, delay_ms);
        }

        vTaskDelay(pdMS_TO_TICKS(500));


        for (int i = steps - 1; i >= 0; i--) {
            stepper_step(i, delay_ms);
        }

        vTaskDelay(pdMS_TO_TICKS(1000));
    }
}

Conclusion

This week was one of the most intense and rewarding experiences I’ve had so far in the Fab Academy. In just 24 hours, I went through multiple failed attempts, faced mechanical issues, and dealt with material quality problems - but I never gave up.

From this assignment, I learned that precision, patience, and proper preparation are key factors in PCB fabrication. Every small detail matters - from the type of material used and the correct milling bit alignment to the depth of cut and tool calibration.

I also gained valuable hands-on experience with the Roland SRM-20, Mods, and ESP-IDF environments, completing the full process - from schematic design and milling to soldering and programming.

Seeing my ESP32-based board finally working and controlling a stepper motor was a proud moment for me. This week taught me not only technical skills but also engineering discipline and perseverance - essential qualities for any embedded systems and robotics engineer.