cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

user_2884081
New Contributor II

I have been trying to use the Kit 037 to control a BLDC motor using FOC. The kit is working fine with the included motor, but when I try to make it work with my own motor (RoboDrive ILM 25x 04) it fails at high speed.

As far as I know, only these parameters should be modified:

int32_t   Motor_i32PolePairs      = 4;    // the pole pairs of rotor

float32_t Motor_f32Ld             = 0.006;  // the d axis inductance  

float32_t Motor_f32Lq             = 0.006; // the q axis inductance 

float32_t Motor_f32Res            = 1.1;    // the resistance between two phases

float32_t Motor_f32Ke             = 2.83;   // inductive voltage constant between two phases,RMS value

I have observed that information in the datasheet does not match the values in the example project "Sensorless FOC Motor Control". The datasheet states that the line to line resistance is 0.8 ohm, while the value in the firmware is 1.1. Why is this?

How is the "inductive voltage constant between two phases,RMS value" calculated?

Also, how to obtain the other values (Ld, Lq and voltage constant)?

I know that my motor has 7 pole pairs, 0.5ohm of terminal resistance, 170uH terminal inductance, 24V rated voltage and 24kRPM rated speed.

Is there a document or something I can read to better understand the other parameters and the firmware algorithm? I would like to change the closed loop parameters too, but can't find what does everyone of them do in the algorithm.

0 Likes
1 Solution
JobinT_31
Employee

The Appnote you are referring to is using the project attached with it. Please download and try that.

Thanks

Jobin GT

View solution in original post

0 Likes
11 Replies
JobinT_31
Employee

Hi,

Please refer the below Application note, if you haven't referred yet.

http://www.cypress.com/documentation/application-notes/an93637-psocr-4-sensorless-field-oriented-con...

This gives much detail on theory and firmware implementation FOC motor control project.

Thanks

Jobin GT

0 Likes
user_2884081
New Contributor II

Hi,

Yes, I have already visited it. However, the "Appendix E: Adapting the Design to Other Motors" seems to be outdated. These are not the parameters found in the example code I have.

Help for calculating the values Ld, Lq and voltage constant would be much appreciated, thanks.

0 Likes
user_2884081
New Contributor II

Hi,

I have been revisiting the Application Note and found some outdated things. I would like to know if there is an updated version, or if there will be one for the current firmware version.

Also, has there been any changes in the hardware? In the Kit 037 User Guide, it is stated that the board 042 must be set to 5V, but the Application Note selects 3.3V, and advices to disconnect it from the PC. I bought the board a while ago, when the AN was up to date, can I still use the Kit 037 User Guide?

0 Likes
user_2884081
New Contributor II

Hi,

Is there a way to speed up the PWM? I read that for higher speeds it can be necessary to use a higher PWM frequency. How can it be done?

Also, why is the IDAC for Ibus current limit set to 150uA? Isn't it a very low value?

0 Likes
JobinT_31
Employee

Hi,

You might need to go through the code to modify PWM frequency, since once speed up you may need to verify the algorithm flow, which is depending on speed.

There is no recent updates on Code, Kit , or Application note.

The board and code is designed to drive the motor included with the kit. So for using a different motor, you might need to develop a new board, if the motor specs are outside to what the board is designed for.

Thanks

Jobin GT

0 Likes
user_2884081
New Contributor II

Hi,

Where in the code can I find that? I guess the PWM are calculated in the function "Svm_Calc(&MotorCtrl_stcSvmCalc);" found in line 717 of "motor_ctrl.c", but I can't access the definition of that function. How can I change the PWM frequency in the code?

If there are no updates in code, kit or AN, why are the parameters shown in the section "Adapting the Design to Other Motors" in the AN93637​ ​different from the parameters found in my code?

What are the specs range of the board?

Thanks.

0 Likes
JobinT_31
Employee

Hello,

Can you confirm which project you are using.

I just download the project from http://www.cypress.com/documentation/application-notes/an93637-psocr-4-sensorless-field-oriented-con...

AN93637 PSoC 4 Sensorless Field-Oriented Control (FOC).zip (PSoC Creator 3.1)

It doesn't have file motor_control.c.

And I can confirm the project have file Cymc_MAL.c file and here you can change the PWM parameters.

Thanks

Jobin GT

0 Likes
user_2884081
New Contributor II

Hi,

I'm using the "Sensorless FOC Motor Control" example project from the Cypress Kit-037.

For me, it is located here:

C:\Program Files (x86)\Cypress\CY8CKIT-037 Motor Control EVK\1.0\Firmware\Example Projects\Sensorless FOC Motor Control

0 Likes
JobinT_31
Employee

The Appnote you are referring to is using the project attached with it. Please download and try that.

Thanks

Jobin GT

View solution in original post

0 Likes
user_2884081
New Contributor II

Is there a document explaining the example I'm using with the same depth?

0 Likes
JobinT_31
Employee

The kit user guide is the only document. On theory both project should be similar, you can see the theory resembles. Corresponding parameter tuning can be seen at: 5.5.6 Adapting the Code Example to another Motor.

You can find the theory at: 5.5 Sensorless FOC Motor Control Code Example

in user guide.

Thanks

Jobin GT

0 Likes