Rough Notes

Chris' Rough Notes

Questions:

  • What is the purpose of the gate driver?

  • What is field oriented control?

  • Why is the input to the gate driver PWM instead of GPIO output?

    • Still not 100% sure, but I believe the inputs are indeed PWM… I think the idea is as you vary the PWM duty cycle, it too varies the speed of the motor. BUT the rate at which you cycle through your states would also vary the speed of the motor right??

  • Are we using back EMF to determine the orientation? How does this work with field oriented control?

    • I don’t believe the gate driver that we selected uses field oriented control. It is a very complex algorithm that usually comes directly with an IC to control the motors for us.

    • Yes, using back EMF to determine motor orientation looks like the simplest way to achieve sensorless bldc control.

 

Final thoughts:

  • The input to the gate driver is PWM.

    • If you want the fet off then you need a 0% duty cycle but any duty cycle >0% corresponds to the fet being on but only that percent of the max current

    • This would provide torque control?

  • To increase and decrease the speed of the motor, you would vary the rate you cycle through the motor states

  • We would use Back EMF to determine the best time to transition to the next state

    • This is read using the ADC

  • We would have a startup sequence to determine the initial orientation of the motor

  • We need to be able to read PWM or DSHOT

 

Final Thoughts part 2:

Components of controlling a bldc motor:

  • Controlling Fets: based on the current gate driver selected, the inputs are 6 pwm signals for the 6 n channel fets. By varying the duty cycle you are varying the amount of current that can flow through the fet (I think) and thus varying the strength of the generated magnetic field, effectively varying the speed of the motor

  • Back EMF: Since at any given moment, on 2 or the 3 phases are driven, the other phase is left floating, leaving it subject to back EMF (generated by a coil moving through magnetic field…in this case generated by the permanent magnets). Based on this back EMF, one can detect the optimal point to switch the state of the motor to the next one based on the level of back EMF

    • I believed it can be detected via simple GPIO edge interrupts or reading through ADC

  • Startup sequence: Since back emf is not generated when the rotor is stationary, there is no way to tell what the starting position is. What can be done tho, is energy the coil with a known pattern, which will force the motor in a known position. Then, the motor sequencing states can start from there.

  • Input reading: both PWM and DSHOT will require detecting edges to read the entire “frame” of data. Most likely will be implemented via GPIO edge interrupts and timers.

    • Nice to have: detect whether PWM or DSHOT is being used automatically

  • Varying speed: Originally I thought you vary the speed based on varying the rate you cycle through the motor states, but I believe varying the states is achieved by increasing the duty cycle of the 6 input pwm signals.

 

Field Oriented Control:

Field Oriented Control of Permanent Magnet Motors

https://www.microchip.com/stellent/groups/sitecomm_sg/documents/training_tutorials/en532365.pd

https://www.ti.com/lit/an/spraby9/spraby9.pdf?ts=1686201299203&ref_url=https%253A%252F%252Fwww.google.com%252F

  • After watching this video, it seems very possible to implement this algorithm ourselves instead of sourcing an IC that does it for us…

  • The main transforms related to this algorithm are simple trig calculations

  • The part I am unfamiliar with is the PI (from PID) loop, not sure how to implement one of those things but that is not something we need to look into for the hardware.

  • One thing to look into is how fast we need this algorithm to run and if our current micro can support it

  • We need to be able to determine the speed of the motor as well as the position of the rotor.

  • What hardware components are required to facilitate this algorithm without a dedicated FOC IC?

 

 

Upon having a discussion, we came to the following conclusions:

  • We want to see our own custom ESC being used in the future on a comp drone. For this to be possible it needs to perform with similar quality to a COTS ESC. The only way to do this will be to implement FOC (trapezoidal will not be good enough)

  • The plan is to find an IC that implements FOC for us that is made for our sized load. Implementing FOC by ourselves will be extremely difficult to tune and get working reliably

 

Field Oriented Control (FOC) - A Deep Dive