Field Oriented Control using dsPic33

Alan B said:
Nice results! How exactly are the halls being used in the FOC algorithm?

They suppy the rotor angle data to the Park and inverse Park transforms.
 
Burtie said:
Alan B said:
Nice results! How exactly are the halls being used in the FOC algorithm?

They suppy the rotor angle data to the Park and inverse Park transforms.

If these Hall sensors are digital they provide 60 degree windows of angle information which is insufficient accuracy for FOC. Are they interpolating or doing something more clever with the Halls?
 
Alan B said:
If these Hall sensors are digital they provide 60 degree windows of angle information which is insufficient accuracy for FOC. Are they interpolating or doing something more clever with the Halls?

Check out post #4 on the first page for a bit more info.
 
Alan B said:
With FOC having a separate current term for flux / field weakening, why introduce timing advance errors into the algorithm?

Changing the timing, or adjusting the Id/Iq ratio ---I think it adds up to be the same thing ?
 
Changing the flux vector is orthogonal to the torque magnetization vector, while rotating the reference mixes the two vectors. For small angles they are pretty similar while for larger angles they would deviate and rotation would cause a greater loss of torque because the torque vector would be reduced by the cosine of the angle shift. I don't mean to give you a hard time, just trying to understand it myself. It is great that you are working with this and getting things to go. Makes me more interested in getting a kit and doing some experiments as well, and that's how we learn.

You are in a good situation to try both timing angle shift and current vector adjustments as I think your software has all three knobs?
 
If you want to keep the torque (q) the same, you are going to have to add more current overall, whether you alter the timing, or increase magnitude of the flux vector (d), -no difference ?

Not sure what you mean by 'mixes the two vectors' , the d and q vectors are always orthogonal ?
 
I recently tested AN1017 - Sinusoidal Control of PMSM Motors on the PICDEM MCLV development board. This is similar to Burtie's mod as it uses hall sensors to determine motor position. On my initial test I manged to blow one of the wimpy FET's on the board. I have since replaced it and uploaded another video. This code has the motor run a bit faster than Burtie's code (2323rpm vs. 1740rpm). It also increases the current to maintain speed under light loading. It allows for forward and reverse operation by turning the pot left and right of center. My motor runs more smoothly (less noise) and a bit faster at WOT in the CCW direction compared to CW which is most likely a result of the skewed hall placement. I would like to outfit this motor with internal halls (120 degrees) and am unsure as to where (between which stator teeth) to place them. I recall it was different for delta vs. wye windings...

[youtube]wqtW4poaKG0[/youtube]
 
A bit more progress...

mauimart said:
I forgot to mention but also noticed that when I put a small load on the motor the speed reduces and input current remains the relatively constant. When I load the motor while driven with the other algorithms the input current will increase to keep the speed constant.

Martin, If you want make more torque available from your MCLV board running the FOC code, you can modify the code as follows:

Normally there is a bus current monitoring circuit which will activate a fault pin to shut down the PWM output when the bus current reaches a certain threshold, (it causes the screeching noise from the motor when it is active).
You can disable the fault pin by changing this line in file PMSM.c

// FLTACON = 0x0087; // All PWM into inactive state, cycle-by-cycle, PWM1, 2, 3 controlled by fault-A
FLTACON = 0; // burtiemod -disable PWM fault shutdown

But be careful not to blow too many fuses / MOSFETS when trying it out :eek:

This is begining to feel more like a useable bit of kit :)


mauimart said:
... I would like to outfit this motor with internal halls (120 degrees) and am unsure as to where (between which stator teeth) to place them. I recall it was different for delta vs. wye windings...

Some discussion about D/Y hall placement here

http://endless-sphere.com/forums/viewtopic.php?f=30&t=15686&p=359209&hilit=biff#p358949


Burtie
 
New cheap chinese oscilloscope

Cheap chinese oscilloscope.jpg

Get one --you will love it.


Showing the sinusoidal drive from the FO controller, (with 20khz SVM signal filtered out).
Bottom two traces are phase to ground.
Top trace is the diffeence between the two traces ( i.e. the voltage accross 1 phase)


Picture below shows same signals, but for trapezoidal drive (running AN957)
 
Got the demo board running well enough to try a low lower dyno run,
-comparing the efficiency of the FO algorithm against the standard trapezoidal one.

Dyno run at low power.jpg

Using Identical hardware to run both algorithms, and motor hall sensors with neutral timing,
This is what I found

FOC efficiency at 1400rpm.jpg

Trapezoidal efficiency at 1400rpm.jpg


Slightly disappointing not to see any efficiency increase using the FOC yet.

Burtie
 
ctirad said:
Nice. I like the wide LCD.
How is the quality compared to other similary priced chinese scopes like Rigol or Uni-t?

Can't speak for the Rigol or Uni-t, but the build quality of this Atten seems first-rate.
 
Following my disappointment at finding this FOC algorithm to produce no better efficiency (yet) than the simple six step algorithm, I found this quote from Teh Stork on page 11 of Arlo's power stage thread:

Teh Stork wrote
...before going apeshit over FOC; this is on a BLAC engine. A BLDC engine (trapezoidal bemf) with a six-step commutation can be just as efficient and well behaved as a BLAC sine controlled engine.

It's really dissappoiting to lay down countless hours down into optimizing FOC for use on a BLAC motor, then to have the same or better experience with a cheaper BLDC motor. I hate my HS3540 and 12fet for working as nicely as it does. Only optimalization is field weakening, thats as easy to implement on a blac as a bldc motor.

Sounds like you have already been down this road Stork ?
 
Burtie said:
ctirad said:
Nice. I like the wide LCD.
How is the quality compared to other similary priced chinese scopes like Rigol or Uni-t?

Can't speak for the Rigol or Uni-t, but the build quality of this Atten seems first-rate.


Where did you get it? Which model is it? Thanks!
 
The Rigol seems top quality as well. Dont worry about the fact its chineese and hela cheep. It has great fetures and works well. The ds1052e is a 50Mhz scope and up gradeable to the 100Mhz (1102 is the same scope) with a soft ware or hard ware hack.
 
Burtie said:
Following my disappointment at finding this FOC algorithm to produce no better efficiency (yet) than the simple six step algorithm, I found this quote from Teh Stork on page 11 of Arlo's power stage thread:

Teh Stork wrote
...before going apeshit over FOC; this is on a BLAC engine. A BLDC engine (trapezoidal bemf) with a six-step commutation can be just as efficient and well behaved as a BLAC sine controlled engine.

It's really dissappoiting to lay down countless hours down into optimizing FOC for use on a BLAC motor, then to have the same or better experience with a cheaper BLDC motor. I hate my HS3540 and 12fet for working as nicely as it does. Only optimalization is field weakening, thats as easy to implement on a blac as a bldc motor.

Sounds like you have already been down this road Stork ?

Yep, using Atmels evaluation boards - with some modifications.

What you've quoted me on is true, but there is some factors that makes FOC desirable:
1. FOC is more robust, in case of a sensor failure.
2. FOC decreases current ripple seen by capacitors*
3. FOC is silent compared to six-step.
4. Field weakening can substantially increase speed of motor, and you need FOC to realize this.

* Just how this works I've been in much debate about. Current ripple seen by caps is due to inductance x pwm frequency and voltage applied. But there is another variable, the back emf. The back emf is constant in FOC, but in six step it changes abruptly at the sector switches.

I've moved to water cooling. Air conduction cooling is unsuitable for high-power in a small package.

If you want to see efficiency improvement of FOC vs six step, make your decoupling worse (lossy) or lower the pwm frequency.

For a thorough readthrough of FOC, search up Shane coltons paper on FOC, also explains why is it suited for BLDC motor.

Oh, and one thing - you're using a purely resistive load, this is far from a real setup witch has to deal with inductance forcing currents to flow.
 
To be honest, I like FOC because of the higher efficiency it gives but i full well realize it's probable
just a few %. The advantage in this is not so much higher speed or bigger range, for me with my
'plastic' stator efficiency is good 'cause it means less watts dissipated in my stator. But, it really is
'miereneuken' as we say in Holland (ant-frocking).

Once you have it, there are some good things it gives you. It gives you automatic timing
compensation. This is especially important for high erpm motors above the L/R frequency.
Also, it's very easy to implement very smooth torque control and braking (regen) control.
Multi-motor setups need good torque control based controllers, not to have any problems
with motor synchronisation and what not.

I developed my own flavor of FOC... I'm happy I did (took quite some evenings to get it going
but now it only takes me 8 equations to implement FOC) because it gives me access to very advanced controllers at a very low cost. The parts costs are nowhere near what Kelly or Sevcon are asking for their controllers, plus based on the low speed these controllers are limitted to makes me think they are not build in an elegant way but very cumbersome (with lots of difficult parameters, hard to set up etcetc). Do they even sell something in the 1 kW range, a perfect size for ebikes ?
 
Teh Stork said:
What you've quoted me on is true, but there is some factors that makes FOC desirable:
1. FOC is more robust, in case of a sensor failure.
2. FOC decreases current ripple seen by capacitors*
3. FOC is silent compared to six-step.
4. Field weakening can substantially increase speed of motor, and you need FOC to realize this.

...Oh, and one thing - you're using a purely resistive load, this is far from a real setup witch has to deal with inductance forcing currents to flow.


Im glad there are something to be gained for all the extra complication then :wink: :D
I have certainly noticed the quieter operation.

The demo board was driving a real motor in the test ( C80-100 ) , the array of lamps is just to load the generator on the dyno.

Dyno Motor-Generator set.jpg



Lebowski said:
To be honest, I like FOC ...Once you have it, there are some good things it gives you. It gives you automatic timing
compensation. This is especially important for high erpm motors above the L/R frequency.

Also, it's very easy to implement very smooth torque control and braking (regen) control.

Can regenerative braking be achieved on an FOC system by simply commanding a negative torque value ?

Could we make it sound really grand by calling it a Kinetic Energy Recovery System (KERS) :mrgreen:
 
Looking at your measurement bench... Are the motor and generator delta wound or WYE ? How much losses are
inherent to this and not attributable (oh man what a difficult word) to the controller algorithm ?
 
They are both wound Delta. Any inefficiency in the generator does not affect the result.

The output is calculated from speed and torque measurements. Torque is measured directly from the motor frame
 
Burtie said:
They are both wound Delta. Any inefficiency in the generator does not affect the result.

The output is calculated from speed and torque measurements. Torque is measured directly from the motor frame

Very cool ! Hadn't though of that one :D Be fun to see the results of my controller... You'll have to
rewind the motor in WYE first though to make my stuff look good and shiny :mrgreen:
 
Back
Top