<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent Posts on &gt; Mattias Zurković</title><link>https://mattiasz.com/blog/</link><description>Recent content in Recent Posts on &gt; Mattias Zurković</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 29 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://mattiasz.com/blog/index.xml" rel="self" type="application/rss+xml"/><item><title>Agentic PCB Development</title><link>https://mattiasz.com/blog/agentic-pcb-development/</link><pubDate>Thu, 29 Oct 2026 00:00:00 +0000</pubDate><guid>https://mattiasz.com/blog/agentic-pcb-development/</guid><description>&lt;h2 id="background"&gt;Background&lt;/h2&gt;
&lt;p&gt;Recently I started designing a control board for hobby-style brushless motors. Part of this requires actually developing a PCB: schematics, component placements, and traces. In my daily work life as a software engineer, I have re-structured my workflow to leverage the power of AI Agents: I use agentic skills and loops to fully automate any manual and high-effort tasks, for example the act of writing software.&lt;/p&gt;
&lt;p&gt;Agents excel in this kind of work: repetitive, high-effort (for a person), and testable tasks. Since I have not touched KiCad in several years, I thought I would develop an agentic harness to do just that: build the PCB for the motor controller.&lt;/p&gt;</description></item><item><title>Building a Database in Rust from Scratch - GaribalDB</title><link>https://mattiasz.com/blog/garibaldb-database-in-rust/</link><pubDate>Thu, 22 Oct 2026 00:00:00 +0000</pubDate><guid>https://mattiasz.com/blog/garibaldb-database-in-rust/</guid><description>&lt;h2 id="background"&gt;Background&lt;/h2&gt;
&lt;p&gt;One of the main pieces of advice I give as a software engineer is to understand the fundamentals. A piece of advice I have heard that is similar is &amp;ldquo;understand the layer below&amp;rdquo;. Essentially, to know how the tools and systems you use are actually built. The main advantage I have noticed in this comes up during the decision making process during design reviews. For example, when evaluating several technologies, knowing the layer below helps drive which criteria actually matter.&lt;/p&gt;</description></item><item><title>Custom Mountain Bike Suspension Yoke</title><link>https://mattiasz.com/blog/custom-mountain-bike-suspension-yoke/</link><pubDate>Sun, 05 May 2024 10:37:00 -0700</pubDate><guid>https://mattiasz.com/blog/custom-mountain-bike-suspension-yoke/</guid><description>&lt;h3 id="project-goal"&gt;Project Goal&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Test CNC capabilities and quality of JLC PCB&amp;rsquo;s CNC machining service&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The part I decided to design is a replacement suspension yoke for my YT Capra Core 2, here is the final result mounted on the bike:&lt;/p&gt;
&lt;p&gt;&lt;img src="img-01.png" alt=""&gt;&lt;/p&gt;
&lt;h3 id="the-process"&gt;The Process&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Took off existing suspension yoke from mountain bike&lt;/li&gt;
&lt;li&gt;Re-model it in Solidworks&lt;/li&gt;
&lt;li&gt;3D print to test fitting on bike&lt;/li&gt;
&lt;li&gt;Generate engineering drawings for tolerances and threads&lt;/li&gt;
&lt;li&gt;Upload to JLCPCB for quote - it was ~$60 USD&lt;/li&gt;
&lt;li&gt;Wait 1.5 weeks for it to arrive&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="results"&gt;Results&lt;/h3&gt;
&lt;p&gt;&lt;img src="img-02.jpg" alt=""&gt;&lt;/p&gt;</description></item><item><title>Pseudo-FOC Controller - Simulations and Initial Prototype</title><link>https://mattiasz.com/blog/pseudo-foc-controller-simulations-and/</link><pubDate>Tue, 18 Jan 2022 16:40:00 -0800</pubDate><guid>https://mattiasz.com/blog/pseudo-foc-controller-simulations-and/</guid><description>&lt;p&gt;As a part of my FOC controller, I am developing an intermediate project - the &lt;em&gt;Pseudo-FOC Controller.&lt;/em&gt; This post will introduce the theory, simulations, and an initial prototype of the project. At its core, this controller uses sinusoidal commutation, which is being implemented through the inverse Park and Clarke transforms.&lt;/p&gt;
&lt;h2 id="project-goals"&gt;Project Goals&lt;/h2&gt;
&lt;p&gt;The goals of this project are listed below:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Control torque, speed, and position of a PMSM - specifically for gimbal and drone grade motors&lt;/li&gt;
&lt;li&gt;Develop a PCB for the controller&lt;/li&gt;
&lt;li&gt;Develop auto-tuning algorithms for controller gains&lt;/li&gt;
&lt;li&gt;Develop an auto-calibration sequence for the rotor position sensor&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="bldc-vs-pmsm"&gt;BLDC vs PMSM&lt;/h2&gt;
&lt;p&gt;A key point of confusion is motor classification of permanent magnet machines - specifically between &lt;em&gt;Brushless DC Motors&lt;/em&gt; (BLDCs) and &lt;em&gt;Permanent Magnet Synchronous Motors&lt;/em&gt; (PMSMs). In my experience/readings, the differing factors is in their back-emf profile: BLDCs having a trapezoidal BEMF and PMSMs having a sinusoidal BEMF.&lt;/p&gt;</description></item><item><title>Completion of the VFD - PCB and Demo</title><link>https://mattiasz.com/blog/completion-of-vfd-pcb-and-demo/</link><pubDate>Mon, 13 Dec 2021 10:45:00 -0800</pubDate><guid>https://mattiasz.com/blog/completion-of-vfd-pcb-and-demo/</guid><description>&lt;p&gt;This past week the PCB order was delivered from JLCPCB. The traces came out great:&lt;/p&gt;
&lt;p&gt;&lt;img src="img-01.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The VFD PCBs&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I used THT components since I was not familiar with JLC&amp;rsquo;s SMT service and I had plenty of the required components stocked. From the image below, the modulation index (MOD INDEX) potentiometer is not being used since I decided manual amplitude adjustment is not required.&lt;/p&gt;
&lt;p&gt;&lt;img src="img-02.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The assembled PCB with component&lt;/em&gt;&lt;/p&gt;</description></item><item><title>VFD Updates - More Prototyping and PCB Design</title><link>https://mattiasz.com/blog/vfd-updates-more-prototyping-and-pcb/</link><pubDate>Wed, 01 Dec 2021 21:56:00 -0800</pubDate><guid>https://mattiasz.com/blog/vfd-updates-more-prototyping-and-pcb/</guid><description>&lt;p&gt;Several things have been done since the initial prototype: the prototype has been further tested, the motor has been validated, and the PCB has been designed and sent to the FAB. Here is an image of the rendered board:&lt;/p&gt;
&lt;p&gt;&lt;img src="img-01.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The PCB render&lt;/em&gt;&lt;/p&gt;
&lt;h3 id="prototype-validation"&gt;Prototype Validation&lt;/h3&gt;
&lt;p&gt;The prototype has been changed - specifically gate and pull-down resistors were added. A big change is that the inverter generates a 12 V peak to peak signal which is then boosted up to 120 V RMS by a transformer and powers the motor. This was done instead of having a 120 V sine wave be generated as an isolated power supply would be needed for the logic components, however the current being drawn at the inverter stage is significantly higher. Here are some key waveforms generated by the inverter.&lt;/p&gt;</description></item><item><title>VFD Inverter Prototyping</title><link>https://mattiasz.com/blog/vfd-inverter-prototyping/</link><pubDate>Wed, 24 Nov 2021 22:49:00 -0800</pubDate><guid>https://mattiasz.com/blog/vfd-inverter-prototyping/</guid><description>&lt;p&gt;I began prototyping the VFD circuit discussed in the previous post, specifically the inverter stage. I modified it to be a single-phase full bridge inverter instead of the three-phase simulated. This is due to me using a single-phase shaded pole induction motor for testing down the line - 120 V, 60 Hz on the nameplate. Here is an image of the circuit:&lt;/p&gt;
&lt;p&gt;&lt;img src="img-01.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Full-bridge inverter circuited&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Before making the circuit, I simulated the inverter in LTSpice. Similar to the PSIM simulation, a bipolar switching scheme is being generated for the SPWM signal.&lt;/p&gt;</description></item><item><title>Variable Frequency Drive for Induction Motors - Overview and Design</title><link>https://mattiasz.com/blog/variable-frequency-drive-for-induction/</link><pubDate>Tue, 16 Nov 2021 20:28:00 -0800</pubDate><guid>https://mattiasz.com/blog/variable-frequency-drive-for-induction/</guid><description>&lt;p&gt;I began a new project to design and construct a Variable Frequency Drive (VFD) for AC induction motors. The purpose of this project is for me to apply some of my power electronics knowledge of inverter design and also aid me in my FOC project since the power stage of this drive is similar (FOC just has more complex control algorithms). This post will cover some the high level design considerations and some preliminary simulation of the VFD.&lt;/p&gt;</description></item><item><title>AS5048A Magnetic Encoder and STM32</title><link>https://mattiasz.com/blog/as5048a-magnetic-encoder-and-stm32/</link><pubDate>Thu, 07 Oct 2021 22:14:00 -0700</pubDate><guid>https://mattiasz.com/blog/as5048a-magnetic-encoder-and-stm32/</guid><description>&lt;p&gt;This past week I began to write the controller firmware - mainly playing with the AS5048A angular position sensor from AMS. Here is the &lt;a href="https://ams.com/documents/20143/36005/AS5048_DS000298_4-00.pdf/910aef1f-6cd3-cbda-9d09-41f152104832" target="_blank" rel="noopener"&gt;datasheet&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="img-01.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;This sensor will be used to get the rotor position and then compute the resulting electrical angle for the Clarke/Park transforms and also it will be used to find rotor speed for the out loop.&lt;/p&gt;
&lt;p&gt;I will be using an STM32F446 board to run the loop as it has a high clock speed. The AS5048A sends its measurements over SPI. Below is the read package sent from the sensor:&lt;/p&gt;</description></item><item><title>First Post on a AC Servo Drive Project + Current Loop Simulation</title><link>https://mattiasz.com/blog/first-post-on-ac-servo-drive-project/</link><pubDate>Mon, 20 Sep 2021 22:27:00 -0700</pubDate><guid>https://mattiasz.com/blog/first-post-on-ac-servo-drive-project/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Over the past year I have been working on a motor driver for an AC hobby motor (total time about a month due to school and work) - I decided to document my past developments and continue the project as I am less busy. I looked back and refined what I wanted out of this motor drive.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have precise control of position, speed, and torque of an AC motor&lt;/li&gt;
&lt;li&gt;No torque ripple in output&lt;/li&gt;
&lt;li&gt;Controller should be suitable for a wide range of PMSM motors&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Goals&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Revised CNC Mill Design</title><link>https://mattiasz.com/blog/revised-cnc-mill-design/</link><pubDate>Wed, 15 Sep 2021 12:48:00 -0700</pubDate><guid>https://mattiasz.com/blog/revised-cnc-mill-design/</guid><description>&lt;p&gt;In the last post I fixed some of the clearance and parts issues for the x-axis assembly for the CNC mill. I since applied these same changes to all axes and dialed in most of the components. Here is a image of the full system:&lt;/p&gt;
&lt;p&gt;&lt;img src="img-01.png" alt="Version 2 of the CNC mill design."&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Version 2 of the CNC mill design.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The entire assembly weighs 48 kg which is on the lighter side. To fix this I plan on casting epoxy granite around the y-axis base to add both mass and damping properties.&lt;/p&gt;</description></item><item><title>CNC Mill Axis Assembly Updates</title><link>https://mattiasz.com/blog/cnc-mill-axis-assembly-updates/</link><pubDate>Mon, 13 Sep 2021 22:07:00 -0700</pubDate><guid>https://mattiasz.com/blog/cnc-mill-axis-assembly-updates/</guid><description>&lt;p&gt;In the previous post I mentioned my concerns with the height and amount of parts needed for each axis assembly. The main problem was due to the ball screw (SFU1204) alignment bearings being tall (39 mm). This meant the guide rails and linear bearings needed to match that height in order for the table to clear (to get the full build area range).&lt;/p&gt;
&lt;p&gt;Here is the updated design:&lt;/p&gt;
&lt;p&gt;&lt;img src="img-01.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The SFU1204 ball screw is being used, along with the BF/BK10 end housings. However, instead of MGN15H linear rails and bearings, a higher profile HGH 25 rails are being used with HGH 25CA linear bearings (&lt;a href="https://www.aliexpress.com/item/1005001597258922.html?spm=a2g0o.productlist.0.0.13f43f20SdjOhC&amp;amp;algo_pvid=ec6a0915-6b43-444c-b9c2-86136c461d7d&amp;amp;algo_exp_id=ec6a0915-6b43-444c-b9c2-86136c461d7d-11&amp;amp;pdp_ext_f=%7B%22sku_id%22%3A%2212000017446206167%22%7D" target="_blank" rel="noopener"&gt;linked here is the plan&lt;/a&gt;). The total height of bearing on rail is 40 mm, which gives 1 mm of clearance which should be enough (if not i can purchase precision &lt;a href="https://www.aliexpress.com/item/32961382024.html?spm=a2g0o.productlist.0.0.fa646ecfhxgI13&amp;amp;algo_pvid=27afc59b-bcc4-4a1e-985e-2e0f537e1ddf&amp;amp;aem_p4p_detail=202109132200533101173026187140075773395&amp;amp;algo_exp_id=27afc59b-bcc4-4a1e-985e-2e0f537e1ddf-0&amp;amp;pdp_ext_f=%7B%22sku_id%22%3A%2266430723709%22%7D" target="_blank" rel="noopener"&gt;1-5 mm spacers&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>CNC Mill CAD Design</title><link>https://mattiasz.com/blog/cnc-mill-cad-design/</link><pubDate>Sat, 11 Sep 2021 17:53:00 -0700</pubDate><guid>https://mattiasz.com/blog/cnc-mill-cad-design/</guid><description>&lt;p&gt;I started the CAD design for the CNC mill. I had several requirements and goals in mind that led the design process.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The mill can be constructed with the tools available to me&lt;/li&gt;
&lt;li&gt;Minimal parts&lt;/li&gt;
&lt;li&gt;Re-usability of sub-assemblies&lt;/li&gt;
&lt;li&gt;Strong frame&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I came up with this design. The work area is 250 x 180 x 150 mm in the x-y-z directions respectively. I mostly focused on the x and y axes and need a better design for the z gantry where the spindle is attached. There are some shortcomings which will be discussed below.&lt;/p&gt;</description></item><item><title>First Post for a DIY CNC Machine</title><link>https://mattiasz.com/blog/cnc-making/</link><pubDate>Wed, 08 Sep 2021 20:41:00 -0700</pubDate><guid>https://mattiasz.com/blog/cnc-making/</guid><description>&lt;p&gt;I have been wanting to have access to a CNC machine for milling materials. There are several good options available however I think it would be interesting to design and develop one from scratch while also it being cheaper.&lt;/p&gt;
&lt;p&gt;I need to flesh out the requirements for this project however at a high level the CNC machine should be able to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mill aluminium parts at decent speeds&lt;/li&gt;
&lt;li&gt;Have a cost of ~$1500 CAD&lt;/li&gt;
&lt;li&gt;Be compact to fit in my laundry or garage&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While looking online there are several good designs that hobbyists use to create their CNC mills.&lt;/p&gt;</description></item></channel></rss>