This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Help me in selecting Microcontroller for Trapezoidal based BLDC motor control application.

Other Parts Discussed in Thread: STRIKE

Hello,

I am in process of selecting MCU for the automotive electric vehicle application. The requirement is as below...

1. BLDC motor control with Trapezoidal control (MCU should have 6 channel PWM with possibility of 3 complementary pairs for regenerative braking).

2. HALL sensors (3) sensing on Input Capture Interrupt (both Low to High and High to Low edge selection should be possible) to compute the motor frequency and also to apply commutation.

3. Cycle by Cycle current Control feature must be available. (If current in phases increases above a higher threshold, the h/w ckt will generate an edge and feed it to MCU. MCU has to accept it as interrupt and without intervention of s/w, it should stop PWM. After that it should let s/w execute the isr. When the current falls below lower threshold, the h/w ckt will generate exactly opposite edge and feed it to MCU. MCU has to accept it as an interrupt and without intervention of s/w, it should now start PWM without losing the synchronisation)

4. CAN communication available

5. Separate UART - 1

6. 12 bit ADC for sensing battery voltage, motor current, h/w temperature

7. In addition, 2-4 timers (16 bits), and other general MCU features like Watchdog, GPIOs, sleep mode and so on.

8. The sample code for trapezoidal control (closed loop if possible) will be of advantage (since I can use input capture and PWM source code as is).

9. Availability of CAN based bootloader source code.

I am ready to talk to FAE personally and discuss about this application and select the MCU as well as toolchain with eval board for this. I can share further details on email.

  • Young staff - none too musically gifted - strive to, "Strike the right note" in responding.

    Your #3 seems (most) in need of clarification:

    • you note, "the h/w ckt will generate an edge" - yet there is "no mention" of such h/w's location.   (w/in MCU or external - that matters - does it not?)
    • you continue, "MCU has to accept it (that edge)  as interrupt."    Why - most of the MCU's here have, "Dedicated PWM Fault Inputs" - thus NO interrrupt is required!   (the proper signal edge arriving at the PWM Fault Input can cause "All 6 PWM Outputs to become "INACTIVE.")
    • should the "cycle by cycle current fault" clear (likely due to the cessation of PWM) you direct, "Generate exactly opposite edge and feed it to MCU.   MCU has to accept it as an interrupt."   Again, why?    The MCU's PWM Fault Input employs a "timed cessation" of PWM outputs - thus the "PWM Generation's recovery - once the fault input has cleared - is "automatic!"
    • the synchronization you mention (may) be bounded by the PWM's frequency & the duration of the PWM Fault Input's output cessation.

    All of the above may (often) be gleaned via a thorough read of the MCU manual & Peripheral Driver Library User guide.    However do note that not all MCU's w/in this (strategically named) "Other" category include "PWM Generator Modules" - which are required - to achieve the described, "Response to & protections resulting from "Over-Current" detection."     Serious designs may require the employ of (external) hardware (i.e. fast responding, analog voltage comparators) rather then opting for the MCU's (duplicative, internal ones.)    Use of the MCU's ADC channels to monitor BLDC Phase Currents (may) succeed - yet there are, "Order of Magnitude DELAYS IMPOSED" - thus the "Timely & Orderly" PWM Shutdown is (likely) compromised!   (very worth considering)

    The MCU's ADC channels are "FINE" for general Current Measurement & Control - not so much when (near) IMMEDIATE PWM Cessation is required!   (to prevent destruction of a costly "Power Output Stage.")

    As an "extra" Over-Current Protection Mechanism - our small Tech firm often has the "External Analog Comparator" (monitoring Phase Current) provide the "Enable/Disable" signal to the Power Stage's Gate Driver ICs - yielding SAFETY (even) should the MCU have completely FAILED!    (Regulatory Approval Agencies LOVE this design subtlety!)     While you have repeatedly emphasized, "Without the intervention of s/w" - have you not (discounted) the occurrence of a "more general, MCU Failure!"    The far broader design approach (illustrated here) employs that (much desired) - extended reach!

    Note too - poster's & this "List in response" are incomplete.   There exist (other) "BLDC Control areas of engagement" - which prove demanding - and often require extensive, "Real World, FOCUS & Experience" to fully/properly recognize, understand & successfully implement...

    The well-considered "blend" of (both) MCU and external device control usually results in the "best practice" design implementations.

  • Please find my clarification -

    • you note, "the h/w ckt will generate an edge" - yet there is "no mention" of such h/w's location.   (w/in MCU or external - that matters - does it not?

    Yes... I meant external h/w ckt that senses the motor overcurrent (a comparator ckt) and then toggles the o/p level. This o/p serves as an i/p to MCU to just disconnect PWM from engine to PWM pins. 

    • you continue, "MCU has to accept it (that edge)  as interrupt."    Why - most of the MCU's here have, "Dedicated PWM Fault Inputs" - thus NO interrrupt is required!   (the proper signal edge arriving at the PWM Fault Input can cause "All 6 PWM Outputs to become "INACTIVE.")
    • should the "cycle by cycle current fault" clear (likely due to the cessation of PWM) you direct, "Generate exactly opposite edge and feed it to MCU.   MCU has to accept it as an interrupt."   Again, why?    The MCU's PWM Fault Input employs a "timed cessation" of PWM outputs - thus the "PWM Generation's recovery - once the fault input has cleared - is "automatic!"

    The idea here is to save the few usec which is good enough for current rise suddenly. The MCU should turn off/disconnect PwM the moment it receives some edge on one of the pins. I have expertise to design the external h/w ckt that does generate the edge during both events that is current crossing high value and falling below low value. I have already worked on the similar concept with different MCU in past. So, from h/w side I am pretty confident that it works instantaneously. However, few MCUs may expect the pwm disable happening through s/w isr... meaning it takes at least 3-4usec from the event. And this time is enough to damage the h/w outside. 

    If MCU PWM engine has dedicated i/p to switch off pwm without Interrupt... I am okay with that also. However, it is advisable for s/w to know  what happened outside. But that can be still managed somehow. 

    However, PWM timing cessation, looks a concern. It should only decouple PWM engine output from the MCU pins... so that pwm doesn't reach the Inverter ckt.

    • the synchronization you mention (may) be bounded by the PWM's frequency & the duration of the PWM Fault Input's output cessation.  By

    By synchronisation I meant that PWM should remain internally on, so that whenever current falls below somethreshold, it can be connected back to outside ckt exactly at the same phase and level as it would be in absence of interrupt based shutdown.

    Sir, h/w problems of complete failure of MCU... I will handle in h/w design. I have started the thread only for MCU selection that too with specific requirement. Also, if "Other Microcontrollers Forum" is not right platform for this thread then please tell me which forum should I post this question to? Usually, there are series of MCU that is motor control application specific. I will try to look for that on your website too.

  • Hello,

    Thank you - such "in depth" response is always appreciated.    This posting "keys" to your posting (just above.)    Kindly note that my small, Tech firm is "independent" from this forum vendor - yet have over ten years of "highly focused, hands-on" design experience w/BLDC Controllers - employing ARM MCUs.    (those here & elsewhere - to include ARM Cortex M0, M3, M4 & M7)

    Point by point review:

    • External analog comparator(s) - as 3 are required (one for each phase) use of a "Quad Comparator" is particularly advantaged.   (even when - especially when - the MCU provides similar!)   Regulatory Agencies (especially) look w/"favor" upon such, "Safety Techniques - independent from & non-reliant upon the MCU!")
    • Appears that you have "retreated" from your past objective of, "Interrupt triggered - PWM Cessation."    Good that - this vendor's "PWM Fault Inputs" prove more effective & faster than your "interrupt driven" (solution - initially proposed.)
    • You now write, "The MCU should turn off/disconnect PWM the moment it receives some edge on one of the pins."    And - that is precisely what the MCU achieves - when that "edge" (to include level) is presented to (any) PWM Fault Input.   (only 1 such Fault Input may control all 3 PWM Generators - producing 6 PWM outputs.)
    • You write, "However, PWM timing cessation, looks a concern. It should only decouple PWM engine output from the MCU pins."    Again - as past detailed - that is exactly the means by which the "PWM Fault Input" performs!   All 6 PWM outputs are rendered "inactive" during the PWM Cessation period.     (we may have (some) language issues in play...)
    • Your (new) requirement (for the MCU to "know" of an "Over-Current") is sound & may be easily achieved by, "strapping the PWM Fault Input to a "Timer/Counter" input."   (2 birds - 1 stone)  
    • MCU Selection - again - we are "outsiders" (just like you) yet often "Specify" this vendor's products to our clients.   (some even "giants" - w/over 1B (USD) in annual Sales.)

    Do note that each/every one of the methods described are available upon (ALL "Other" MCUs) which include PWM Generators!   This vendor offers more advanced MCUs (C2000 & Hercules series & TMS570) which you may access & compare.   And - should "cost" be an issue - even an "M0" may serve as an effective BLDC Controller...

  • You are welcome.    Perhaps your "musical skills" enable "hitting a note" which frames "one or both of our detailed responses (properly) GREEN!"