Recommended books/resources

Hello, You guys are doing great. I really appreciate that. Kindly can you guys recommend books/resources to understand algorithms used in ODrive firmware such as FOC, PID and other algorithms/techniques?

Thank you

1 Like

I like Electric Motors and Drives by Hughes and Drury for general electric machine stuff and it covers FOC (though I’ve not read this section). It doesn’t seem to explicitly cover PID although there are millions of tutorials online on PID control.

1 Like

Regarding PID control, Brian Douglas does a load of beautifully explained YouTube lectures on control and he’s naturally covered PID. It’s not in the context of motor control but it’s directly transferable.

Finally if you want something a bit more intense then there’s a CalTech textbook on control. Chapter 11 covers PID


This website has a nice intuituion-based explanation of FOC:

This paper has a nice explanation of different commutation methods and some of the math behind FOC. The discussion of this stuff starts on page 86 in the pdf, or page 69 as labelled. The rest of the paper is super awesome too, but less related.


Hello,urdman.Thanks for your reply for the “recommended books/resources”.
If you have got the book “The Fundamentals of Control Theory”.Would mind to share the pdf of the book for us to study.Thank you very much!

Thank you guys for your feedback. I will have a look at them :slightly_smiling_face:

For the basics, I recommend “Motors for Makers” by Matthew Scarpino. You don’t have to be an engineer to read it, but even if you are you’ll learn something.

Thank you @Wetmelon, does this book discuss about field oriented control?

I found this summary quite useful. It covers everything from the basics of magnetism concepts up to FOC of BLDC motors and is written for a general engineering audience.

1 Like

Thank you @Richard_Parsons. Thats quite a nice summary. I have watched teaching old motors new tricks series also by Dave Wilson from TI. He explains them in very good way.

1 Like

This book is literally $1, not $200+ like some textbooks. Just buy it.

Edit: to be fair to OP, the author does mention getting it for free from a friend as an option since he’s released it under a creative commons license. I still can’t believe someone here that will spend hundreds of dollars on motors and controllers wouldn’t support an author of a great book for $1.

1 Like

Okay,Thanks for you to share the link .I’m going to buy the book now.

1 Like

We were discussing this in the Discord chat yesterday. Here’s some more good resources:

This paper talks about optimizing motor sizing and lots of other stuff:

This is a good descriptor of motors, simplified to 1 pole pair:


I have read some resource files about FOC, but don’t understand the deriving of Kp and Ki clearly.
In the FOC controller, we applied the PI regulator to calculate the inputs for Inverse Park Transform. So the most important thing what we should do is to calculate the value of Kp and Ki.
There is a PPT try to describe the thesis of how to get the Kp and ki in a simple way.
If anybody also has the resource for the way to derive the Kp and Ki, share the link for learning, thanks very much.


My favorite resources are in order of terse to verbose:

Basic intro:

Good summary reference of the main equations:

Very in-depth exposition of all of the relevant theory:


Hey everyone. This is a copy and paste from the recommend reading list found here. A few of the books (James Maveys thesis, TI motor compendium) have already been mentioned above but I will include them here again anyway for completness.

The following is a list of texts and resources which I have found helpful when learning about permanent magnet synchronous motors. The items are roughly arranged from beginner to expert. As some of these texts are difficult and expensive to purchase I recommend you check your local library.

Electric motors

This text provides you with a gentle introduction to the basic concepts of related to magnetism, torque production and motor control for a range of different motor types. While this text is useful for developing a high level overview of the field it does not provide the level of understanding required for advanced motor control or electric motor design.

More of a quick reference guide than a consolidated book, this PDF covers the most common concepts and terms that you will encounter when first learning about electric motors There is also a lecture available by the same author which focuses more on field oriented control (FOC).

This increasingly famous 2009 masters thesis stands alone from the rest in that it goes to great lengths to develop a well cited first principles understanding of electric machines. The first three chapters will introduce you step-by-step to the fundamental concepts and derivations required for a true understanding of torque production and electric motor constants. The second half of the book takes an equally painstaking approach to advanced motor control theory.

According to their website, “CWIEME is the world’s largest coil winding, electric motor and transformer manufacturing exhibition series” and its associated YouTube channel contains a large number of lectures on a wide range of topics. Unlike most of the other sources listed here, this channel gives you a gimps into the cutting edge developments being made in the world of electric motors and electric vehicle drive trains. These three lectures by James Hendershot are of particular interest.

As the name suggests, this 824 page tome focuses almost exclusively on permanent magnet machines. While prior knowledge of electric motors is helpful, it is not required. This text is especially helpful for those who wish to design their own electric motor. It provides a suggested road map for designing, building and testing of an electric motor and goes into great detail about the engineering design considerations and compromises that must be made. If you can, try and obtain the more recent 2010 revised version of this text (ISBN 978-0-9840687-0-8)

I have yet to read this text but it comes highly recommended.


QUT Robot Academy

For those like myself who don’t have any formal background in robotics I found this open course by Queensland University of Technology to hit just the right note. Structured at an undergraduate level it is both approachable for those new to the topic but also detailed enough to be useful.

1 Like

Let me expand on that by rewriting the electrical equations with separate inductance:

\begin{align} V_d &= L_d \dot{I_d} + R I_d - \omega L_q I_q \\ V_q &= L_q \dot{I_q} + R I_q + \omega L_d I_d + \omega \lambda_m \end{align}


  • V is phase voltage, in volts
  • I is phase current, in amperes
  • L is phase inductance, in henry
  • R is phase resistance, in ohm
  • \omega is electrical frequency, in rad/s
  • \lambda_m is permanent magnet flux linkage, in V/(rad/s), where rad/s is electrical frequency.

The torque equation is:

T = pp \frac{3}{2} (\underbrace{\lambda_m I_q}_{T_{PM}} + \underbrace{(L_d - L_q) I_d I_q}_{T_{\mathcal{R}}})


  • T is torque in Nm,
  • pp are the number of pole pairs
  • the T_{PM} term corresponds to permanent magnet torque
  • the T_{\mathcal{R}} term corresponds to reluctance torque

The electrical equation can also be written in state space format:

\begin{pmatrix} L_d \dot{I_d} \\ L_q \dot{I_q} \end{pmatrix} = \begin{pmatrix} -R & \omega L_q \\ -\omega L_d & -R \end{pmatrix} \begin{pmatrix} I_d \\ I_q \end{pmatrix} + \begin{pmatrix} V_d \\ V_q - \omega \lambda_m \end{pmatrix}

It may be interesting to absorb the inductance into the state on both sides:

\begin{pmatrix} L_d \dot{I_d} \\ L_q \dot{I_q} \end{pmatrix} = \begin{pmatrix} -R/L_d & \omega \\ -\omega & -R/L_q \end{pmatrix} \begin{pmatrix} L_d I_d \\ L_q I_q \end{pmatrix} + \begin{pmatrix} V_d \\ V_q - \omega \lambda_m \end{pmatrix}

This is mostly nice to directly observe that the poles are at -R/L \pm j \omega if L = Ld = Lq.

1 Like

Hi,pyuxing,I have the same focus on the deriving of Kp and Ki like you,I clicked the link you shared but the content can’t access,can you share more links about the PI parameters determine if you have?Thanks a lot!

Just to add to this very helpful answer: the link provided by Richard_Parsons for Electric Motors and Drives: Fundamentals, Types and Applications is for the 2nd edition; the book is now on the 5th edition, which includes a greatly expanded section on brushless motors (as compared to the 4th edition; I assume the 2nd edition is even less informative). So, while it’s still meant to be an overview for users (not designers) of electric motors, the 5th edition is likely to be much more useful to ODrive users than the 2nd edition.

1 Like