when to read BEMF from BLDC motor phases..

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is jogging my memory a bit now... I thought I had it all working perfectly with atmega164 in the past and I did.

But now I migrated to atxmega32A4 and all the problems came back lol...

Ok with atmega164 I used a PWM and 6 pins with an AND gate to only PWM the 3 high side mosfets. Then I read the bemf using resistor deviders plus a small value capacitor to filter the reading. It all worked perfectly.

Now with atxmega32A4 I am using pattern generation, where ALL 6 pins are PWMed (no AND gate required). I dont seem to have any option for only PWMing the high side pins. I have to do ALL of them. Now I sort of remember from all the readings I did back then, that this is kind of not suitable for reading BEMFs at the PWM pulse? Does anyone have a clearer view on this?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://scholar.lib.vt.edu/theses...
Ah hhm... looks like I definitely need the old scheme back! I must measure BEMF using the high side PWM only mode! low side must be turned ON all the time. :(
HHm... I think I could do this using xmega32A4....I need separate PWM signals via A, B, and C. And just have to use output override option...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

oh no this is a big problem now.... :(
It seems I can only put out PWM via high side (A, B, C) using atxmega32A4 if I do not use the AWEX pattern generation mode. But rather use the timers in dedicated 3 different PWM channels and thus output 3 channels via the 3 pins. Problem is these pin orders are different when you configure it this way...ie: pin0->A, pin1->B, pin2->C timer channels. This is different to AWEX pinouts. So I must change my board design :(

Unless someone tells me I could still use AWEX to do this someone how? Have I missed something?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://www.atmel.com/dyn/resourc...

this document seems to contradict itself by saying in 4.1.2 is recommended way of driving the BLDC (Both high side and low side PWM). And then later in the document it bases the equations (Section 4.2.3) on how high side is turned off but the low side is kept on!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok so I have found a way to generate PWM on high side only and no PWM on low side but only pulse the cummutation signals.

AWEX->DTHSBUF = LOW_SIDE_PATTERN(DRIVE_PATTERN_STEP0_CCW);
AWEX->DTLSBUF = HIGH_SIDE_PATTERN(DRIVE_PATTERN_STEP0_CCW);

Macro LOW_SIDE_PATTERN selects the low side bits from the commutation pattern, HIGH_SIDE_PATTERN selects the high side bits from the commutation pattern.

The AWEX should be configured such that:

AWEX->CTRL = AWEX_PGM_bm | AWEX_DTICCAEN_bm | AWEX_DTICCBEN_bm | AWEX_DTICCCEN_bm;

The above will make sure common waveform from CCA is pulsed through to all AWEX PWM channels.

I have managed to drive my motor in open loop mode. Still struggling with my ADC read back values, hence closed loop isnt working yet. :(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The people from Parammatta mental hospital will visit you shortly..... :)

And how did you manage the last post 20 minutes BEFORE the previous one??
Posted: Oct 22, 2011 - 12:18 PM
Posted: Oct 22, 2011 - 11:58 PM

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lol thanks....yeah I have been going mad, trying to get my motor spinning in cosed loop!
I have no idea how that date glitch came about...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
trying to get my motor spinning in cosed loop...I have no idea how that date glitch came about

You have invented a time machine!! The motor must be running at 88mph :lol:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OMG OMG OMG OMGGGGGGGGGGG!!!! I am soooo excited!!!!!!!!!!
I got it I got it I got it!!!!! xmega32A4 is now working to drive my BLDC motor! using closed loop!!!!

wow! the problem was in the commutation timer! I had to use the NORMAL mode which allows the top to be fairly high and so the CCA and CCB can vary to whatever value the commutation timing requires (as long as they are bellow the max PER value).

Perviously I had it set to SS (Single slope PWM) mode and my method of commutating wasnt suitable for that mode.

Ok so now is the improvement time! :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

holly shit! Sorrrry guys had to swear!!!!
I just spun it for a while at 115200 RPM, and I have to tell you its an amazing whirly noise!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Way Cool

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yeahhh whats the top speed you can get these days using the commercial ESCs? Does anyone know? I will soon be posting my design work here :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

my God.... I have bumped up the PWM freq to 115.2KHz and now I just ran the motor to 164000RPM! I could go more as I still have some duty cycle left to play with. But I get the feeling the motor will explode!!! I reached that speed, without any propeller with only 2Amp!!!

I cannot tell you how superior the noise is guys! I am going to have to do a video on this very sooon.

What impresses me is that the mosfets run wayyyyy cooler at such high freq PWM switching, than the original 57.6KHz.

I am thinking 115.2KHz PWM is probly the highest I should keep it at. Because I am running the micro at (14746500*2)MHz. So by having no prescaler if I produce a PWM with freq of 115.2KHz, I will get a resolution of duty cycle of 8 bits (256 duty cycle changes). Anyone has any thoughts?

I better put some clothing on, still in my underwear!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have just released these videos on youtube :) on how to make a controller for BLDC motors...

http://www.youtube.com/watch?v=4...

http://www.youtube.com/watch?v=i...

http://www.youtube.com/watch?v=8...

Hope they are useful to you guys who are struggling..