Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V_neutral_Offset #17

Closed
MarcP75006 opened this issue Jun 3, 2021 · 6 comments
Closed

V_neutral_Offset #17

MarcP75006 opened this issue Jun 3, 2021 · 6 comments

Comments

@MarcP75006
Copy link

Hello,
it is not clear to me where the V_Neutral_Offset used to calculate V_Neutral for BEMF zero-crossing detection comes from (electrically, I mean).
Also, how did you measure the raw V_Neutral_Offset values in the "explanation_parameters" graph shown in the readme file ? In other words, how could I measure it at various duty cycles in order to find the V_neutral[n] parameters with my own setup ?

Thanks a lot for your help.

@BrixInMotion
Copy link
Contributor

Hi @MarcP75006
this is a very nice (and tricky) question!
Imagine you have a Y-connected BLDC motor. If you apply a voltage to two of the phases (the third left floating), the two inductances form a voltage divider and thus in the middle 1/2 Vcc should be measured. This is your V_neutral (the reference potential).
Unfortunately most motors have no possibility to access their Y-Point, so we need another solution.
In theory it thus should be possible, to build an external voltage divider on the board, that simulates your V_neutral.
You can see this in the middle image on page 4 of the board manual.
The reason, why the resistors are larger on the high-side than on the low-side, is because Arduino ADC only take 5V maximum.

Practically you see that it's not that simple. I first recognized it watching this Oszi-screenshot that there is a huge difference between the "theory-V_neutral" and where the real V_neutral voltage level should be.

So if you need to tune these values yourself, the hardest part will be to find a single operation point where your BLDC turns in closed loop BEMF mode. This can only be done with trial and error and playing around with the values. As soon as it's rotating smoothly, you can increase/decrease your dutycycle by 10, and adjust you V_neutral-offset again.

Generally be aware that this is still more or less just a workaround and not 100% reliable for serious applications. Also please use a power supply with current limitation to avoid damage to your motor.

Hope this somehow answered you questions. Let me know if you need more info.
Regards

@MarcP75006
Copy link
Author

MarcP75006 commented Jun 7, 2021

Great thanks for your reply.

Let's see if I got it correctly :

The method compares the BEMF voltage to half the DC bus voltage assuming that the zero crossing events occur when the BEMF is equal to DC/2. We cannot measure directly DC+ and DC- at the coils, and DC/2 at the neutral point. So we derive DC/2 from the following:

ADC_VDD_2 read by the A0 pin is already scaled down to Vsupply/2 by a voltage divider on the BLDC-SHIELD_IFX007T and further scaled down by a 1/4.7 voltage divider (R32/R28 on the shield) for 5V compatibility.

Since V_neutral (DC/2) on the neutral point of the two energized coils is proportionnal to both ADC_VDD_2 and the dutycycle,
V_neutral is first calculated as
V_neutral = A0_value * (DutyCycle / 255)
and '+ 0.5' rounds off the floating point result to the nearest integer.

But because DC/2 is non zero and increases with duty cycle, a V_neutral_offset whose value also depends on the duty cycle, has to be substracted.

Am I right?

Best regards.

@BrixInMotion
Copy link
Contributor

Jip, that's correct!

@mariammiron
Copy link

Hello,

I am working on my side to try to construct the code for the sensorless configuration having your current library as a guide, but I am obtaining no movement for the close loop part where the BEMF is used to synchronize the bridges. I was wondering why there is no code available already and if Arduino UNO is strong enough to carry out this application.

Thanks in advance!

@MarcP75006
Copy link
Author

Hello,
there was an example for the BEMF control of motors but the file was deleted few months ago, I do not know why.
Here is a copy of it. It is very basic and works fine with a Uno, and should be only considered as a starting point for a project.

Good luck.

`
/**

  • This example code if for sensorless brushless motor application. The motor should be connected to the outputs U V and W.
  • Refer to the README.md in this folder.

*/

#include "IFX007T-Motor-Control.h"
uint8_t DutyCycle = 1; //0-255 1 for keyboard input
bool direction = 0; // 0 or 1

//Create an instance of 'IFX007TMotorControl' called 'MyMotor'
IFX007TMotorControl MyMotor = IFX007TMotorControl();

void setup()
{
Serial.begin(115200);
Serial.println(" Infineon BLDC motor test! ");

MyMotor.begin();
// Adapt the following values according to the README if necessary
MyMotor.MotorParam.MotorPolepairs = 4; // Amount of polepairs. If your motor has 8 poles, it has 4 pole PAIRS)
MyMotor.MotorParam.SensingMode = 0; // If you use a Hallsensor set 1, for sensorless application 0

MyMotor.MotorParam.V_neutral[0] = 160; // High dutycycle, when V_neutral is const
MyMotor.MotorParam.V_neutral[1] = 120; // Value of high V_neutral
MyMotor.MotorParam.V_neutral[2] = 50; // Low dutycycle, when V_neutral is const
MyMotor.MotorParam.V_neutral[3] = 46; // Value of low V_neutral
MyMotor.MotorParam.Phasedelay[0] = 200; // High dutycycle, when phasedelay is const
MyMotor.MotorParam.Phasedelay[1] = 123; // Value of high phasedelay
MyMotor.MotorParam.Phasedelay[2] = 120; // Low dutycycle, when phasedelay is const
MyMotor.MotorParam.Phasedelay[3] = 80; // Value of low phasedelay

MyMotor.configureBLDCMotor(MyMotor.MotorParam);
}

void loop()
{
MyMotor.setBLDCDutyCyclespeed(direction, DutyCycle);
if (Serial.available() > 0)
{
uint8_t in = Serial.read();
MyMotor.DebugRoutine(in); //To set speed (and Parameters) via Keyboard input. See Documentation.
}

}`

@mariammiron
Copy link

Thank you so much for the help @MarcP75006!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants