Skip to main content
Associate III
March 17, 2024
Question

Clark and Park implementation code

  • March 17, 2024
  • 1 reply
  • 2616 views

This is the first time I have to implement a PMDC motor control system.

There are 3-phase sine currents need to be converted into d-q components using Clark and Park.

I don't have the motor to test yet, so with the DAC I created three 120° phase-shifted sine waves that I need to convert into d-q components. This is an example of the code I wrote:

luke514_0-1710682162081.png

My questions are:

1) Is this code sufficient for conversion?

2) Is there an implementable library that performs these calculations? I found only this, but it is not clear to me what it can do

Can anyone, in general, give me some more information on how to proceed?

This topic has been closed for replies.

1 reply

cedric H
Technical Moderator
March 18, 2024

Dear @luke514,

ST provides a complete implementation of FOC algorithm available here. Feel free to download the MCSDK and generate a simple project for your hardware (select one of the provided motors if you don't have one). A lot of documentation is provided with the MCSDK,

We unfortunately do not have the bandwidth to provide feedback on user's code. I let the community answer.

Regards

Cedric