Shop OBEX P1 Docs P2 Docs Learn Events
How do you detect the phase angle of BEMF? — Parallax Forums

How do you detect the phase angle of BEMF?

lardomlardom Posts: 1,659
edited 2012-09-21 08:26 in Propeller 1
I'm studying sensorless BLDC motors and I plan to breadboard my own ESC as part of the learning process. I read that commutation should occur at the back-emf zero-crossing points. It seems pretty clear that the commutation instruction should execute somewhere before 180° and 360°. Moreover the speed of the motor demands that the execution of the commutation instruction be fine tuned. Is there a counter mode for this?.

Comments

  • Erik FriesenErik Friesen Posts: 1,071
    edited 2012-09-19 08:25
    I suggest starting with a known good hardware platform with this. Its a real challenge getting the software right, without fighting hardware. The Microchip bldc starter kit is pretty bulletproof, I used it for developing a small esc. It uses the standard hardware explorer pinout, you could put a 44pin prop and mcp3208 on a board that would plug right into the system. It could be that someone else has a starting point already.

    Catching the zero crossing points can be a real challenge, and there is different ways to get there. I like the Mchip system because it uses a software comparing algorithm rather than hardware comparators. It works reasonably well for me in my application, although at super high electrical rpm its a bit tough. I run a 7 pole motor at up to 4500rpm which makes 31500 erpm. This requires close to a 30khz sampling rate to work properly.

    Not sure if you can use a counter for this, probably some way.
  • SRLMSRLM Posts: 5,045
    edited 2012-09-19 12:45
    Somebody else made a P8X32A BLDC controller, but he disappeared. I hope I didn't scare him away: http://forums.parallax.com/showthread.php?140049-Sensorless-BLDC-controller
  • PublisonPublison Posts: 12,366
    edited 2012-09-19 13:36
    SRLM wrote: »
    Somebody else made a P8X32A BLDC controller, but he disappeared. I hope I didn't scare him away: http://forums.parallax.com/showthread.php?140049-Sensorless-BLDC-controller

    MarkT was just on yesterday. I don't think he's been scared off...yet. :)
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-09-19 14:04
    I was playing with the idea a while back but this has since been on a back burner.

    Test #1 - http://www.youtube.com/watch?v=s-T-zPbFwSg
    Test #2 - http://www.youtube.com/watch?v=4tB_rH8evgc

    The idea is to energize two coils at a time in proper sync and use the non energized coil for feedback.
    In the video, this was just a proof of concept test and I'm only energizing 1 coil at a time (thus the reason for the kick start in rotation, which may not entirely be a bad feature to implement ... <- think old prop planes) the adjacent coil feeds a comparator providing an output signal to the Propeller. The Propeller in turn provides a properly timed pulse to turn on the Mosfet which drive the coil to move the motor ... and the process repeats.

    So to answer the question within the title of this thread "How do you detect the phase angle of BEMF?" ... it can be done with a comparator connected to 2 of the three phases... you could use 3 comparators staggered among the phases to obtain a timing pulse from each phase.

    Note: Keep in mind your mosfets need to handle current spikes in upwards of 190 Amps ! ... Yes, this is insane, but these are very brief pulses, and in order to create enough drive and motor torque, you need to be able to provide that kind of energy in very short bursts.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2012-09-19 14:15
    190 amps? Thats pretty high, not?
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-09-19 14:23
    "190 amps? Thats pretty high, not? " ... the typical coil resistance is .2 Ohms or less for each phase ... driving more than one coil with a 12 V supply can create a significant current requirement.
  • TappermanTapperman Posts: 319
    edited 2012-09-19 14:24
    Note: Keep in mind your mosfets need to handle current spikes in upwards of 190 Amps ! ... Yes, this is insane, but these are very brief pulses, and in order to create enough drive and motor torque, you need to be able to provide that kind of energy in very short bursts.

    You mean like this?

    http://www.mouser.com/Search/ProductDetail.aspx?R=STGE200NB60Svirtualkey51120000virtualkey511-STGE200NB60S

    or MOSFET's only?

    ... Tim
  • lardomlardom Posts: 1,659
    edited 2012-09-19 14:26
    @Erik Friesen, Thanks for the link. I downloaded a couple of the PDFs.
    @SRLM, Good thread, I'll subscribe to it. What are your formulas about? :smile:
    BTW, I don't have an o'scope so I can't see hysteresis or the phase difference between voltage, current and magnetic flux so I'll be doing a lot of guessing. If I'm 'in the neighborhood' it'll be satisfactory. My goal is only to understand how it works.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2012-09-19 14:27
    Ok, but the inductance in the coil limits that unless the rpms are pretty low. Its rather interesting to use an amp probe when debugging.

    That mosfet would seem overkill to me.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-09-19 14:46
    Yes, that mosfet is overkill ... 'most' ESC's parallel 2 or sometimes 3 mosfets to combine their efforts. The mosfets are generally rated for 60Amps each, but can handle upwards of 100Amps when pulsed.
  • lardomlardom Posts: 1,659
    edited 2012-09-19 14:49
    @Beau Schwabe, I also saw the video where you made a CD drive spin ultra fast.Have you posted any code or schematics?
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-09-19 16:13
    lardom,

    There is no code for the Hard Drive motor spin, it's all analog circuitry ... here is a link to the schematic and other info ... http://forums.parallax.com/showthread.php?119874-Hard-Drive-Stepper-Motor-with-high-speed-spin-up-circuit

    The idea is the same though, although the Hard Drive motor uses far less current to operate.

    Edit: Initially I used the same circuit for the Brush-less motors as I did with the Hard Drive motor. An all analog approach. What I found is that it did work, but my mosfets were getting extremely hot. Using the Propeller to condition the pulse to the mosfet (width and timing position) reduced the amount of heat generated by the mosfet significantly. It still could be done with a pure analog approach with careful design but it was much easier just to insert a Propeller in-line of the signal to produce a 'cleaner' signal to the gate of the mosfet and to keep the time spent in the linear operating region to a minimum.
  • Mark_TMark_T Posts: 1,981
    edited 2012-09-19 16:37
    Publison wrote: »
    MarkT was just on yesterday. I don't think he's been scared off...yet. :)

    Indeed! My technique was to use 3 comparators to determine cross-overs and they share common reference - IIRC I tried both using supply/2 and averaging the three phases to get the reference. Some LPF to reduce PWM noise before the comparators. One comparator left over from the LM339 quad comparator for future current-limit sense.

    Prop code maintained some PID-like state to track phase (in other words feed back some of the error as phase correction, some as frequency correction). To lock rpm the PWM ratio was similarly controlled from the rpm error. I also believe my PWM scheme was different from the usual.

    You need to be able to detect loss of lock, I think I settled with convolving the comparator outputs with the expected perfect 3-phase signals and detecting several cycles in a row with a below-threshold score - backing off to open-loop startup routine (more sophisticated method would be to try to determine current rpm and re-establish lock).

    I should go back and look at what I ended up with and post more info about it in Projects forum: I got good behaviour eventually (although the startup open-loop phase needs tuning, I used tiny, medium and large motors for testing and never got all of them truly happy with same startup loop.
  • ErNaErNa Posts: 1,752
    edited 2012-09-21 01:36
    Hi, lot of information can be found here: http://scolton.blogspot.de/ More or less incredible, he just doesn't use the propeller ;-(
  • lardomlardom Posts: 1,659
    edited 2012-09-21 08:26
    @ErNa, Thanks. Shane Colton has created an excellent tutorial.
Sign In or Register to comment.