Sensorless Brushless Motor Control using a propeller - Anyone done it?
Cluso99
Posts: 18,069
I searched the Obex and Forums and could not find anything relevant.
I want to replace the ESCs usually driving the motors on a QuadCopter. This will require 6 pins to control the MOSFETs (3 being PWM but only 1 active at a time)and 3 pins for the BEMF feedback zero crossing, per motor. I will need to do a little multiplexing here, but for now just getting 1 motor running is required first.
Has anyone done anything like this before?
BTW I have seen the app notes on other micros, so I have a reasonable handle on what is required. I don't wish to reinvent the wheel if its been done before.
I want to replace the ESCs usually driving the motors on a QuadCopter. This will require 6 pins to control the MOSFETs (3 being PWM but only 1 active at a time)and 3 pins for the BEMF feedback zero crossing, per motor. I will need to do a little multiplexing here, but for now just getting 1 motor running is required first.
Has anyone done anything like this before?
BTW I have seen the app notes on other micros, so I have a reasonable handle on what is required. I don't wish to reinvent the wheel if its been done before.
Comments
is there any specific difference of a Brushless motor to a normal DC motor, functioning wise? shouldn't you be able to use the same code?
By normal DC motor you do mean one with brushes and a commutator which is totally the opposite of a Brushless motor which uses multiple phases (think steppers but not) and in this case relies on the back EMF to detect when to "commutate" electronically. As you may have guessed then these motors are "poles" apart.
So I found this document Direct Back EMF Detection Method for Sensorless Brushless DC
It describes a different method of detecting the back-EMF. Don't know if this is common knowledge today as it is from 2003.
best regards
Stefan
Here is a good description of BLDC motors and how to drive them:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2125¶m=en542235
It's just so damn hard to beat the economy of commercial ESCs . Yesterday I ordered two 60A ESCs. Cost was a whole US$13/ea. The 30A ESCs ordered a few days before were less than $7. For what they do - and how well they do it - it is positively astounding! The Prop makes talking to them fall-off-a-log easy.
OTOH...If you are designing your own closed loop control system, it could be a great benefit to have instantaneous shaft RPM information. But that could be accomplished through an inductive pickup on one of the three-phase lines or an optocoupler between two of the lines.
Leon: Cluso99 has already seen the AppNote.
I would imagine that your circuit would look something similar to this ...
http://forums.parallax.com/attachment.php?attachmentid=67697&d=1266079979
...Only the mosfet would be replaced with a complementary N-MOS / P-MOS inverter capable of supplying the adequate current to your motor. Essentially you would have three of these circuits, each staggered on L1,L2, or L3. You'd only need one of the "TACH" outputs, however separate "Enable/Disable" would be beneficial for initial 'startup'. Based on the TACH feedback though, the "Enable/Disable" would ideally be used to regulate the speed.
Reference thread:
http://forums.parallax.com/showthread.php?119874-Hard-Drive-Stepper-Motor-with-high-speed-spin-up-circuit&p=881285&viewfull=1#post881285
However, when all 4 ESCs are added, and the wiring complexity, a prop controlled set of BLDC motor controls comes into the realm of possibility.
What is required for a QuadCopter is
4 pins for 4 servo inputs (from Radio Control)
2 pins for I2C for sensors (gyro, accelerometer, compass, pressure/temp, and perhaps later GPS)
24 pins for 4 sets of 6 motor mosfet controls
2 pins left for 4 sets of BEMF detection (unknown pins as yet and may require some multiplexing due to lack of pins and ADC support)
So, you can see I have an uphill battle to squeeze this circuit into a prop, but if I can, then the price becomes affordable and the pcb becomes quite small. Even if I have to use 2 props, it is still affordable. Mosfets are readily available and cheap with high currents and voltages and low RDSon of <20mohms. 6 are required for each motor. Preferably an N & P pair for each winding. This also means little heat generated too.
I am presently unsure of the RPM of the motors - I am currently expecting 20,000 rpm may be required.
Microchip an1160 does back emf sensing using a majority function (whatever that is?). Of the three or so methods I tried it seems to be the best, and it doesn't appear to use much of the processing power of the dspic33 its based on. I can't see why one prop couldn't do it with some assembly coding. The only thing I'm not real clear on is the necessary adc sampling rate, but I think one mcp3004 per motor at 200ksps would probably work. I know the 33 has a 1.1msps rate, but the way the function works I don't think that is a factor.
Here is a little background of how to drive a BLDC (brushless) motor. The motors we are interested in are the outrunner brushless kind as used in model aircraft, etc.
They have three windings and they can be star or delta mode. We will look at the star mode.
At any instance in time, one winding will be have power applied from V+ (11.2V in my application) switched via a P channel Mosfet. The voltage will be controlled by PWM. Another winding will have Ground applied via an N channel Mosfet. The third winding is used to detect Back EMF (BEMF) and look for the zero crossing point. This zero-crossing will give 1/2 the time (from the start of the applied voltage to the pair of windings till now) and will be the time left before the power is switched to another pair of windings. The same concept applies to each set of winding pairs driven, with the third winding used for BEMF detection.
Now, the propeller is able to generate the PWM quite simply. So, it is only a matter of detecting the zero crossing time and appropriately adjusting the power to step to the next pahse at the appropriate time. The PWM output pin should be able to be simply changed by software. There is a small dead time used during the switching.
The hardest part will be the circuitry to detect the zero crossing (which is actually 1/2 of the power supply, which is ~11.2V in my case). This is done by a voltage divider set of resistors, and a cap to form a low pass filter, and an ADC.
Once a single motor can be driven, then the circuitry can be developed to minimise the number of pins used to drive 4 motors.
Generally the upper mosfet is driven by PWM and the lower mosfet is remains on for the complete duration of it's on time. Therefore, it may be possible that these could be latched.
The other possibility is using another micro to do the ADC zero detection.
Here is a good "flash" animation of the motor windings activity and the zero crossing point http://bldc.wikidot.com/bldc-and-8051
Another savings on standalone ESCs are the voltage regulators. Most escs come equipped to provide 5V as reasonable current for powering the servos and receiver. In out case, we do not have servos and we only require a small 5V and 3V3 supply, so this is an overkill in 4 ESCs.
I've been using a IRF7338 complementary FET pair in a controller I recently designed. For my application, the fets are wired as a CMOS inverter directly driven from a prop pin. I get clean output transitions in the ~40ns range, but the full switching event takes ~125ns. I'm using this FET pair at 5v and 1A but it can do a bit more. (I also have a simple capacitor-diode-resistor level shifter to drive the N-fet. This has quirks but works great for what I want)
Lawson
I am planning to drive the MOSFETs with a dual NPN & PNP transistor with internal bias resistors. Nice, compact and cheap!
As for the MOSFETs, I am unsure as I have a few alternatives. Use a dual N & P channel Mosfet (limited to about 8A, so may require parallel mosfets) or use single N & P mosfets where I can get >20A simply. Packages are either SOIC8 or TO252-4/5.
This is a subject dear to my heart.
I am building a high speed spindle for my tabletop mill, and have purchased some hobby BLDC motors and a 1000 Amp (Yes, 1KA peak) ESC. My wish is also to build my own mosfet driver from a prop, as I wish to be able to taylor my parameters. Tests with the commercial ESC have driven the motor to 60,000 RPM, as that is my target, but I'm not sure how long the bearings will last ast it screams quite loud. Thes products seem mostly made in China, and it is very difficult to get good information in the documentation, as wel as the telephone support..... the very polite lady has no understanding of the difference between delta and star, or bearing life. They just regurgitate the poor specs in the data sheet.
So my question is, have you (or anyone please) found a good industrial source for these motors? The hobby items seem to be very compact... several HP in a few cubic inches.... quite a feat, but not likely industrial enogh for me.
Thanks,
Peter (pjv)
At 60,000 rpm = 1,000 rps and 6 commutations per rev = 6,000 steps per second = 167us per step.
I have not investigated the PWM min/max for this. However, with 80MHz clock, a cycle is 12.5ns (and 50ns for most pasm instructions). At 100MHz (10ns).
Postedit: I goofed and incorrectly wrote us instead of ns. Therefore, we have 10,000 times that, so should be possible (not improbable as I originally stated).
Looking at my BLDC motors (FC2811) they are 1200KV (1200rpm per volt = 13,200 rpm for 11V). I don't expect they will ever be run at this speed.
I would imagine that you have done some exhaustive research in this matter. When it comes to motor control, I have always found the best information at STMicroelectronics. They have several evaluation boards available to testing and developing BLDC motor drivers. I believe the technology is referred to as ST7 within their website, but of course this is using their drivers and such, but maybe you can get a few ideas by searching it out. STMicro provides good layout, design considerations, app notes, schematics, etc...
Once again, I don't know if this will help, but here is an additional doc of general info explaining BLDC and how to drive them.
Bruce
EDIT: Actually the ST7 is their uC controller family. I will update this post with better info when I find it.
EDIT: Added a few docs that may help.
EDIT: Also refer to L6229 for lower current (I did not provide docs for this chip)
This is likely a under-estimate. Most out-runners have an internal or electronic gear ratio that is sometimes referred to as a spin factor.
Cluso99, it is very possible that your motor has 12 coils & 14 magnets, and therefore a 7 : 1 internal gear ratio---or spin factor.
Your motor will most likely will complete 42 commutations in order to produce 1 revolution of the propeller.
Another configuration is 12 coils & 12 magnets, and creates a 6 : 1 Spin Factor
I have seen these motors produce 1 hp easy. Perhaps PJV is referring to a 60,000 stator rpm. A speed control can be rated at 60,000 rpms
with 3 coils and 2 magnets, but it's ability to make rpm decreases with a greater spin factor as the number of coils and magnets increase.
The internal gear ratio or spin factor is # of magnets / 2.
Many of these motors are wired for a delta configuration.
And if you need it, I have a lots of good information and resources if you need them.
Bill M.
Do you need an inrunner (normal brushless motor) or an outrunner? There are Industrial resources for these type motors, mainly as industrial fan motors.
If you want to dig much deeper into these motors, the book: Brushless Permanent Magnet Motor Design by Duane Hanselman is good, but costly resource.
Bill
rcgroups is worth a search, lots of people working on motors and controllers alike.
Graham
Clouso99: you missed the PWM trick in my previous post. Basically, if you (temporarily) ground both drive legs of a running BLDC motor, the voltage of the "star point" also moves to ground. In that case, zero back emf on the floating leg exactly corresponds to a zero voltage output from the floating leg. I've attached the source paper. It has a nice overview of other sensing methods, and also discusses the limitations of this commutation scheme. (i.e. 100% duty cycle is infeasible)
I also ran across the mic422(3,4,5) in another thread here. looks like an awesome FET driver for low voltage H-bridges. I've also seen dedicated 3-phase and half-bridge FET driver chips. Most of the FET bridge drivers also include a boot-strap power supply to generate ~Vcc+10v and level translators so that all N-channel fets can be used. Some of the FET drivers also include logic to prevent turning on the high and low side switches of a bridge leg so are much more tolerant of coding errors.
Lawson: Yes, I did miss your point. This may mean that the PWM has to be controlled manually because we would need to synchronise with the point when all mosfets are off. I guess this way we will have total control of the deadband as well.
Wouldn't the grounding have an effect on the motor? Perhaps it is so short that it is insignificant.
As for the mosfet drivers, all are expensive when compared to using cheap ESCs. I am trying to replace the ESCs with a cheaper alternative, based on the fact we have 4 sets and less wiring. If this cannot be achieved, then may as well use cheap ESCs.