Recently the Chinese ESC design utilizing the ATMEGA which we have been flashing with Bernard Konze's firmware has been disappearing from the market. This was the push I needed to finally decide to design and build a replacement. Collaborating with a friend, we worked on it over the summer. It is finished and I think it came out pretty well. I call it ESC32:
Design goals:
- Extremely fast implementation of requested throttle setting
- Ability to take high rate input
- Multiple input protocols
- Ease of programming, real-time debugging
- Efficient
- Inexpensive
The final specifications read:
- STM32F103 72Mhz MCU - 32bit ARM
- Firmware written in straight C
- SWD connector for real-time debugging
- Input via PWM IN / UART / I2C
- 1KHz PWM update rate capable
- All N-FET design with gate drivers
- At least 40A continuous with proper cooling, maybe much more
- 2S => 5S battery
- Option to power logic side via UART or PWM IN +5v
- Command Line Interface for testing / parameter modification / back channel
- 8KHz => 64KHz PWM out
- Current sensing / limiting
- Regenerative braking capable
- Closed loop control mode - experimental
- Lots of RAM and CPU cycles available for advanced control techniques
- BOM cost < $20 at quantity
* image courtesy of TC Pictures, LLC.
It is a drop-in replacement for the ESC's that I have been running with AutoQuad and will take standard PWM input up to 450Hz. I will eventually design new high rate PWM timing which will bring this rate up to 1KHz. It is a definite improvement over the ATMEGA design. Your flight controller can ask for large, quick changes in throttle and it is able to implement them very fast. This allows PID output to be tuned to be more aggressive and results in much smoother control.
Start ups are very smooth and I have not yet found a motor it could not start. It uses oversampling techniques which allow it to accurately control a BLDC motor down to 200RPM. Early indications based on some initial head to head testing with other ESC's show the it is very power efficient. This comes from the fast switching of the N-FETs due to the use of gate drivers. Less time is spent in the on-off / off-on transitions, so less power is used, less heat generated. No special heat sinks or cooling should be necessary for typical 10 to 20 amp usage. This also means that you can use higher PWM output rates without too much of a hit to efficiency.
* image courtesy of TC Pictures, LLC.
As the ESC is an extremely important component of multi-rotor UAV's, it is critical that it keeps running, no matter what. So you can imagine the amount of testing necessary before you can start to trust a new design with your expensive machine. There are a handful of people flying the ESC32 now and I myself have perhaps 10 hours without incident so far. There may still be problems, but I am fairly confident that it is trustworthy. It's all I fly now.
Comments
Would like to see the code and schematic on this one. I hope you go open source!
Looks very interesting and useful to the Arducopter - esp with the back channel to report power usage etc.
I'm also interested in hardware - I want a more advanced ESC but don't really want to mess about with reflashing a HK esc which has an underpowered chip etc anyway.
Nice work, please keep the group updated with progress and plans etc
Thanks Bill. That sounds excellent
Actually current is a very good measure of what is going on. If you dramatically slow down a motor by force, holding the throttle steady, the current will rise very quickly. If the motor is still turning in a predictable way (for instance there are still zero crossings being detected) the current limiter should start to kick in, reducing the voltage presented to the motor. If orderly zero crossings are missed for a period of time, you can conclude that the motor is not free to spin properly and should be shutdown.
Yes or stuck in someone :) Interesting, I agree that a restart might not make sense. Do you think it will ever be possible to have reliable sensors that measure the forces on the props? Allowing the motor power to be cut very early in a crash and maybe also switching the esc/motor to free wheel mode.
Actually, yes. The ESC will detect a start problem or failure during running and go into an error mode. I guess you could have the ESC periodically try to restart the motor, but in such a case there is probably a good reason for the failure - like the propeller being buried in the ground after a crash :)
Bill, your usual great work :) i don't want to go off topic because these escs look like a great package just as they are!
The parrot ar drone (toy) has an interesting feature. It's motor controllers can detect if a motor has failed to start or has a connection problem. The feedback is used as a safety feature to prevent the quad from starting. I'm not sure if the controller is able to detect other motor problems at other times but I would be interested to hear any ideas you come up with. Thanks again
Randy: I think the way to do it is use reliable and fast PWM as the throttle channel and an I2C bus as a non-critical back channel to communicate between all of the ESCs and the FC.
Andrew: Flashing through the UART leverages STM's bult-in bootloader. I think that I2C flash would be possible via a custom bootloader.
A very astute individual noticed that a CAN interface can be mapped to the CTS/RTS signals of the UART port and a second UART port can be mapped to the I2C pads. So through dumb luck, you can add CAN as yet another viable interface type.
As to open source - maybe, probably, I don't know. There's no general hardware availability yet so it does not much matter at the moment.
Sounds great. Maybe with these babies, I'll approach 1/2 hour long flight times out of my 6000mah battery pack. Hopefully, they'll be able to retail for a decent price. Is this open source? Will the eagle files be made available?
Jeff, not sure if these can be flashed, but they are considered by some "ESC experts" to be a good and cheap ESC: http://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=...
And they are currently available, so hurry! I just bought 14! :-)
Sorry, not trying to spam Bill's thread! I hope his ESCs make it to market, they sound like a very powerful solution to all those people trying to reflash existing ESC for better performance.