Sinusoidal control of BLDC Motor

Status
Not open for further replies.
Hi,
Thank you very much for the reply. No it is not the same board but micro is dspic33ev family, motor is also different. I am very scared with the project not getting enough confidence in concept. Compilation is ok. I am struck with terms like over modulation. Can you help me to know what it is?
 

Can you post a photo of the board (where all the connections can be seen?).

If the PWM is fed with a large duty cycle (for a long period), the resulting sine wave will have large distortions near the top: that will be basically over modulation.
 

I am really sorry but not attempted to flash the code. I am trying to figure out using excel sheet. I still have so many doubts in theory that I am scared to test it. Is it possible for you to review and correct if i send all the calculations and the steps i plan to do in sequence?
 

The dsPIC is only a microcontroller that you are using to (i) produce the PWM that is used to feed to the drivers of the motors and (ii) sense as input the outputs of the Hall sensors. The input of the Hall sensors decide the current speed of the motor and the input from the potentiometer decide the desired speed of the motor and the MCU decides how to change the PWM to make the set speed equal to the actual speed.

The microchip software has several more fancy stuff display features but they are not part of the main feature and can be safely ignored in the test phase.
 



Very confused with the following information, unable to figure out if it is a mistake but iam not sure if there can be in such an official document.
The confusion is at the beginning of Sector I as per Table 10 A = 1, B = 0, C =0; Vab = VDC, Vbc=0V, Vca = -VDC. Now as per the Figure 16. The start of sector I, the Va-b is not starting with 0V which is indicated by the line why? By the end of the first sector the Va-b should be 0 as per the table, but in the diagram it is not why? Please help. One of the most difficult things to understand for me.
 

I admit there is less explanation and more confusion. Let me try in smaller steps.

Consider the table 10; each of the nodes (marked A/B/C) can have either 0/1. So there are 2^3 possibilities. All of them are listed in table 10. The first and last rows are two extreme cases where all the three terminals (A and B and C) are at 0 or 1. In these two extreme cases there are no potential differences between phases and they correspond to the centre point (the marking is confusing). The vertices of the hexagon in Fig 12 are marked correctly.

Consider fig 12: this is a vector diagram (note that the vertices are marked U_(CBA). U001 is corresponding to line 2 in table 10. Same way line 4 and 6 in table 10 correspond to U010 and U100. All these three cases have only one of the nodes (A/B/C) turned on. There are three more cases (U110, U101 and U011) where two nodes have voltage applied and the third node is at zero. We have already eliminated two cases U111 and U000- they do not figure in the Fig 12.

Take a quick look at Fig 15: For the start, do not worry about the details; just see the features. See this diagram along with Fig 12. They are related (contain the same info) but shown differently.Fig 12 says the three vectors (C/B/A) move around the hexagonal diagram U001 -> U011 -> U010 -> U110 -> U100 -> U101 -> U001 (the start).

You note some feature: only one vector changes (the two others stay the same) between two consecutive vectors. Now see Fig 15: sector 1 to 2- fat line changes; sector 2 to 3, dotted line changes and sector 3 to 4, the thin line changes. So qualitatively you can understand the graphs. Why the small changes in the values of the voltages that stay constant? That comes from the vector tips to the circle edges in Fig 10. I will not go into details because you can calculate yourself.

Now see Fig 16. Also see FIg 15 together so that you can understand. In Fig 15, the voltages are measured with the center point but in Fig 16, we measure line to line voltage. We just focus on VC-VB (the dotted line in Fig 16).

Between sectors only one vector changes: B -> A -> C -> B -> A -> C (these three nodes are supplied by PWM A/B/C.

The dotted line in Fig 16 is the difference between the solid line and the dotted line in Fig 15. (we get a smooth curve because of PWM)

You need to work out the details: how do we suddenly get negative values?
 
Hint: to get a sine wave, the vector must move on the circle. The three axes are the three lines 120 angles to each other. To calculate the in-between points, we need the sine table. The VDC in table 10 is not equal to 100%; that must be clear.
 
Thank you for your support. I am not sure if i am following the theory I think it is beyond my thinking. Finally as per the program I have implemented the excel sheet. It seems to be matching with the expected result. If you can review and confirm then I can go ahead and implement it in real hardware. I have done this calculations for 200 rpm.
 

Attachments

  • cal_ver3.zip
    297.6 KB · Views: 73

Hi,

Just a comment on the chart:
* the waveform seems to be correct.
* I wonder about the large offset in X-axis. Is the unit of the axis "Voltage"?

You could simply verify waveform ifyou calculate and show the voltage differences. V1-V2, V2-V3, V3-V1

Klaus
 

I have added the V1-V2, V2-V3, V3-V1 columns. These are the calculations i have done but not sure if they are correct. Please advise.
Column Z:
PDC1-PDC2

Column AA:
PDC2-PDC1

Column AB:
PDC3 - PDC1

Column AC:
V1-V2 = 12*Column Z/100; The assumption is for 100% the Voltage applied is 12V and for PDC1-PDC2 what is the value?
Similarly Column AD and AE.

The X - axis is the Sno or the time. I need to do some work in aligning properly. In the next version I will do it.
The Y - axis is the Voltage on the phases.
 

Attachments

  • cal_ver4.zip
    396.3 KB · Views: 71

* I wonder about the large offset in X-axis. Is the unit of the axis "Voltage"?

X-axis is the phase- according to the software, 1024 units corresponds to 360 and roughly I see that all the three lines complete one cycle within the 1024 horizontal points.

Y-axis may be somewhat problematic; that should be the voltage axis but I need to see his results.

The software is not high quality- they calculate all quantities high precision (long long - i.e., 64 bits but use finally 32 buts and finally shift out 15 bits to get numbers that have poor resolution) but finally voltage on each phase should not be so large.

- - - Updated - - -

X axis in post 28 and post 30 are not same; the axis in post 28 is correct; see my comment in post 31.

This is appearing correct but you need to codify it. Why do you think it is complicated? If I can understand it, anyone can!!!
 

Sorry I tried to change it for 300 rpm in the same excel sheet. May be because of that some mistake happened. I will cross verify again. But Y axis voltage calculations are correct? Please help.
 

Y axis voltage calculations are correct?

What is the col numbers? I cannot go through all the individual numbers but I see the calculations in a qualitative manner.

I think half_t_0 value is too large. It means poor PWM because voltage changes only little.
 

I think half_t_0 value is too large. It means poor PWM because voltage changes only little.
Do I need to make any changes in the code? Is it ok if i can go ahead and implement the logic in C? Please advise.
 

Hi,

* I wonder about the large offset in X-axis. Is the unit of the axis "Voltage"?
Sorry, I meant Y-axis.

Klaus
 

I have created the flow diagram of the algorithm. Please provide your valuable feedback.
 

Attachments

  • Algorithm_Ver1.pdf
    36.2 KB · Views: 100

Your program flow looks correct. You need to consider

1. Motor has two states: running and stopped;
2. Your program must implement two changes: motor coming upto the set speed and motor coming to rest from the set speed. Some software also implement a brake (rapid stop) function.

I shall look into the exel sheet once more when I am free...
 

Finally I flashed the code and seems to be running the speed increases if i increase the reference speed. Thank you for the support. Really require some more help to actually understand in detail as i have never worked on motor application. But I am not sure if i am driving it properly, since i thought i will see sine wave between phase voltages but i am seeing a trapezoidal kind of waveform not sure. I could not capture the waveform i will attach the waveform as soon as i capture them. But I am still struck with these two questions.

1. The equation
Code:
/* for calculation for PHASE_INC */
/* maximum range of angle, meaning 65536 is divided by fPWM/felectrical */
/* resulting the folowing constant, which is divided by ticks of timer */
#define PHASE_INC_CALC 384000UL //(FCY/(PDIV*2*FPWM)*65536)
I tried to really understand what is the equation but not able to understand. Why fPWM is coming into picture? What is 2 and 65536?

2. The second question is how to control Torque and Speed since both are changing the duty cycle? I don't understand this? Please help.
 

Let me try to explain in simple terms.

One sine cycle corresponds to one 360 change in phase. Therefore one cycle (360deg) should correspond to one rotation of the armature.

However, almost all common motors have more than one pole-pairs. If the motor has, say 10 pole pairs we shall see that one cycle of the current through the motor will cause rotation of one pole pair from the current step to the next equivalent step.

In the same manner, if your motor is having 10 pole pairs, you will see 10 pulses coming out from each sensor if you turn the motor by hand one full cycle.

If your motor is having PM construction, you can feel when you turn the rotor by hand because the rotor will latch at every pole pairs.

In other words, one current cycle from the power line will turn the motor only by 1/10 of a turn. Hence 10 cycles of the current must flow before the motor moves one whole cycle. Thus physical cycle and electrical cycle can be different.

Now for the above calculation, we ignore the physical cycle. We focus on 360 degree for the time being. If you want the motor to turn x RPM, it is x/60 rotation per sec or x*360/60 degree (mechanical) rotation per sec or x*n*360/60 current cycle per second where n is the number of pole pieces.

Now you need to focus on the PWM frequency. Let us say it is 10 kHz pwm. We have 10000 pulses per sec. We must increment the phase such that 10000 pwm pulses cover x*n*360/60 degrees. This basically becomes the phase-inc ---> x*n*360/60 divided by 10000.

Why 2? They are trying the center the pulse but the idea is not difficult.

Interesting point is that if you have low PWM frequency, you cannot run the BLDC motor very fast. The same circuits are used for gas centrifuges that run at 100000 rpm- the motors are simple to design but the driver is rather tricky.

- - - Updated - - -

First concentrate on the speed: if the phase-inc is const, the motor is running at a constant speed. If you want to increase the speed, you need to calculate new phase-inc (it depends on x, the RPM) and slowly increase (or decrease) the phase-inc over a period of few seconds to get the new speed. Torque is current dependent. Let us leave it for the time being. If the thing is working we shall return back to this point later. The computations must be done in integer mode.
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…