Difference between revisions of "Brushless control"

From DIDEAS Wiki
Jump to: navigation, search
(Motor speed with FOC vs SINE)
(Inverters)
Line 87: Line 87:
  
 
=Inverters=
 
=Inverters=
The process of transforming the mathematical voltage into a PWM signal that drives an H-bridge is called inversion.   
+
A devices that transforms a DC voltage into an AC voltage is called an [http://en.wikipedia.org/wiki/Inverter_%28electrical%29 electrical inverter].   
  
With FOC, generally space vector modulation (SVM) is used.  The most claim advantage of SVM is that the harmonic content of the modulation is lower than other methods.  However, SVM is relatively computationally expensive and somewhat complicated to implement.
+
Most discussions of FOC, generally use space vector modulation (SVM) to drive the inverter.  The most claim advantage of SVM is that the harmonic content of the modulation is lower than for other modulations methods.  However, SVM is relatively computationally expensive and somewhat complicated to implement.
  
==Naive inverter implementation==
+
==Naive inverter modulation ==
 
Given 3 voltages: Vu,v,w one could create the PWM duty cycle to be a linear transformation (gain and offset) of the desired voltage.
 
Given 3 voltages: Vu,v,w one could create the PWM duty cycle to be a linear transformation (gain and offset) of the desired voltage.
  
Line 106: Line 106:
 
http://18.85.17.197/wiki_img/3phase_voltage_1.png
 
http://18.85.17.197/wiki_img/3phase_voltage_1.png
  
==Better inverter==
+
==Better inverter modulation ==
  
 
At any point one of the 3 phase voltages can be considered to be the smallest of the three.  As it is the voltage across a Y wound motor that is important, we could assign this minimum voltage to be zero and adjust the other voltages.  Assuming that at this moment, Vu is the smallest, then the 3 voltages we actually apply to the motor are:
 
At any point one of the 3 phase voltages can be considered to be the smallest of the three.  As it is the voltage across a Y wound motor that is important, we could assign this minimum voltage to be zero and adjust the other voltages.  Assuming that at this moment, Vu is the smallest, then the 3 voltages we actually apply to the motor are:
Line 124: Line 124:
 
http://18.85.17.197/wiki_img/3phase_voltage_2.png
 
http://18.85.17.197/wiki_img/3phase_voltage_2.png
  
This inversion algorithm can be applied to both sine drive and FOC drive outputs.
+
This better inverter modulation could be applied to both sine drive and FOC drive outputs.
  
  
 
==SVM==
 
==SVM==
http://www2.electronicproducts.com/Motors_and_controls_Space-vector_modulation_vs_sinusoidal_commutation-article-JUNCOP1-JUN2002.aspx
 
 
[http://scholar.lib.vt.edu/theses/available/etd-2798-1216/unrestricted/chap2.pdf PDF]
 
[http://scholar.lib.vt.edu/theses/available/etd-2798-1216/unrestricted/chap2.pdf PDF]
[http://en.wikipedia.org/wiki/Space_vector_modulation]
+
[http://en.wikipedia.org/wiki/Space_vector_modulation SVM at Wikipedia]

Revision as of 20:29, 22 August 2009

There are essentially 3 types of three phase brushless control that I know of:

  1. Block commutation (sometimes also called trapezoidal)
  2. Sine wave drive
  3. Field oriented control.

Block commutation

Block commutation is basically the type of commutation that exist in a brushed motor. The 3phase brushless has 3 coils - with block commutation, voltage is applied across two of them. The 3rd coil is 'floating'.

negative implications:

  1. The effective resistance is larger than necessary - as the current sees the series resistance of 2 coils.
  2. The torque isn't constant. This is due to the fact that the magnetic field created by a pair of coils has a fixed direction, however the torque is provided by B cross I (???) and thus is rotor angle dependent.
  3. As a fraction of the force from above isn't in the correct (axial) direction - the current used to create the off axis force is wasted.

positive implications:

  1. Sensing for control is simpler. The voltage on the 3rd phase can be used to estimate the rotor angle for commutation. (But not recommended for robotics!)
  2. A hall sensor can be used instead of an encoder.
  3. The computer computation requirements are low - even for torque control.
  4. The same PWM control code can be used to drive a brushed motor. (2 of the 6 hall sensors states are used and control the direction.)

Sinusoidal drive

Sinusoidal drive eliminates the 3 negatives of block commutation. With this type of drive, the voltage (or current) at each of the 3 terminals is commanded to be a sine wave. The phase difference between each sine wave is 120 degrees. (How this voltage is commanded with PWM / Hbridge is another discussion [inverters] later.) Because current generally flows though all 3 coils, the coil resistance is on the average reduced as the current enters 1 coil, and exits splitting between 2 coils. The result is the minimum resistance is 3/4 that of block commutation.


My implementation of voltage mode sine drive is as simple as :

  • V1 = Vo * sin(0 + encoder angle)
  • V2 = Vo * sin(2pi/3 + encoder angle)
  • V3 = Vo * sin(4pi/3 + encoder angle)

Using sine drive and current mode requires either a model and feed forward (not tried), or a PI control loop. The required (desired) coil current current equations follow voltage equations above:

  • Ix = Io * sin(THETAx + encoder angle)

If IAx is the actual current in each equation - this the PI controller command is:


If IAx is the actual current in each coil(x), then the PI equations are:

  • Vx = kp*(Ix - IAx) + ki * intg(Ix-IAx)

Note, that the integral needs to be limited to avoid "wind up". I generally limit the wind up so as to contribute at most 100% to the PWM voltage.

The primary problem with this time of control loop is that it is bandwidth limited. The frequency of the voltage is at least that of the rotor rotation rate (or with a 4 pole motor, twice the frequency). At high rotor speeds, the PI output has a phase shift WRT desired output. This has the effect decreasing efficiency, as in the motor the magnetic field now longer is in the direction that creates maximum torque.

Field oriented control (FOC)

Field oriented control solves the phase shift problem at high RPMs by transforming the control loop into the rotating reference frame of the rotor. It is also sometimes said that the 3 phase brushless is transformed into a brushed motor. Clark and Park transforms are involved here.

I won't try to explain the full theory PDF but it can be outlined:

  • Measure two coil currents: Iu and Iv. These currents are 120 degrees apart and are in the stator frame.
  • Transform (Clarke) them into an orthogonal pair of currents (Ialpha, Ibeta). These currents are time varying and in the stator frame.
  • Transform (Park) the orthogonal currents (I alpha, beta) into the rotating, rotor, reference frame. The new currents are called Id and Iq and are actually now constants when the 3 phase currents are the correct sine waves! The Iq 'current' produces torque, and the Id 'current' applies a force that compresses the magnets. This Id term is useful as it can me used to change the effective speed an torque constants of the motor, and also be used to dump (regen) energy into the motor.
  • Apply a the PI control loop to the transformed Iq and Id (actual) currents.
    • Vq = kp * (Iq_desired - Iq_actual) + ki * intg(Iq_desired - Iq_actual)
    • Vd = kp * (Id_desired - Id_actual) + ki * intg(Id_desired - Id_actual)
    • Normally Id_desired is zero, and Iq_desired is proportional to the torque desired on the rotor.
  • These Vq and Vq terms are analogous to the voltage and currents that would be applied to a brushed motor.
  • Transform (w/inverse Parke) Vq, Vd back to the stator frame. The result is Valpha, Vbeta.
  • Transform (w/inverse Clarke) the orthogonal Valpha, Vbeta into the 3 phase 120 degree voltages: Vu,v,w. The 3 phase voltages are then inputs to the PWM modulator.

Feedforward and PI control

The preceeding discussions use a PI control loop to compute a command voltage that will adjust the actual currents (over time) toward the desired currents. The advantage of this PI approach is that is doesn't require knowledge of the motor parameters and continues to produce useful outputs as those parameters change over reasonable values.

With feed-forward control, the voltage required to produce a desired motor current (Io) is directly computed:

Vx = Ks * Omega + L di/dt + IoR

  • Ks is the speed constant
  • Omega is the rotational velocity of the rotor
  • L is the motor inductance
  • di/dt is the time rate of change of the current though the coil. If I = Io sin(omega * t), then di/dt = Io*omega*cos(omega * t)
  • Io is the desired motor current
  • R is the motor / coil resistance.

Note, that with a brushed motor (or in the rotor frame of brush-less), the di/dt term is nearly zero. Thus:

Vq = Ks * Omega + Io*R

A hybrid FF and PI control loop can be implemented:

Vcmd = Vq + kp * (Iq_desired - Iq_actual) + ki * intg(Iq_desired - Iq_actual)

If the FF model is accurate, then Idesired and Iactual should be equal. Thus one's knowledge of the motor parameters can be tested with the magnitude of the integral term.

Motor speed with FOC vs SINE

It is often claimed that FOC permits a larger voltage to be applied across the motor when compared with a pure sine wave drive. Eg with sine drive the full supply voltage isn't available to drive the motor. However, I believe this wisdom is incorrect - as the output of a FOC drive *should* be 3 sine waves spaced 120 deg apart. The likely source of this fable is the result of the typical naive implementation of the sine wave PWM inverter used in sine drives.

Inverters

A devices that transforms a DC voltage into an AC voltage is called an electrical inverter.

Most discussions of FOC, generally use space vector modulation (SVM) to drive the inverter. The most claim advantage of SVM is that the harmonic content of the modulation is lower than for other modulations methods. However, SVM is relatively computationally expensive and somewhat complicated to implement.

Naive inverter modulation

Given 3 voltages: Vu,v,w one could create the PWM duty cycle to be a linear transformation (gain and offset) of the desired voltage.

  • For example:
    • if Vu = 0.5 * Vsupply * sin(theta)
    • then in a positive voltage only system we shift the output up by half the supply voltage:
    • Vu_output = Vu + Vsupply / 2
    • The necessary PWM duty cycle to produce this voltage is:
    • PWMdc = Vu_output/Vsupply

However, if the voltages are 120 shifted sine waves, then when one of the voltage is maximum, the other two are 60 degrees away from their minimums. Thus the maximum voltage across the motor is 0.75*Vsupply.

http://18.85.17.197/wiki_img/3phase_voltage_1.png

Better inverter modulation

At any point one of the 3 phase voltages can be considered to be the smallest of the three. As it is the voltage across a Y wound motor that is important, we could assign this minimum voltage to be zero and adjust the other voltages. Assuming that at this moment, Vu is the smallest, then the 3 voltages we actually apply to the motor are:

  • Va = Vu - Vu
  • Vb = Vv - Vu
  • Vc = Vw - Vu

When Vv is the minimum:

  • Va = Vu - Vv
  • Vb = Vv - Vv
  • Vc = Vw - Vv

etc.

Notice now, all the voltages are zero or positive. http://18.85.17.197/wiki_img/3phase_voltage_2.png

This better inverter modulation could be applied to both sine drive and FOC drive outputs.


SVM

PDF SVM at Wikipedia