<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PMSM Controller on &gt; Mattias Zurković</title><link>https://mattiasz.com/blog/categories/pmsm-controller/</link><description>Recent content in PMSM Controller 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/categories/pmsm-controller/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>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>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></channel></rss>