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
Hi Bill, so when can we start buying some of these ESC32s? :)
I've asked tc and he said no idea.
The algorithm is of my own design. The technique is simple trapezoidal control with commutations directed by detecting zero crossing events.
I've found that digital ZC detection that is normally employed on an MCU which does not have proper ADC's (like small PICs) can be problematic, especially at low RPMs.
Hi Bill,
I was wondering which algorithm you used to control the BLDC, and maybe some hardware/software ?
Last year I also made a ESC based on a dsPIC, it runs great during flight but it still can be improved much and also the start-up is not great.
I have used I2C to communicate with the 4 ESC's without any problems.
Randy, most UARTs (including those on the STM32) support operation in a multi-drop mode. There are a variety of ways to wire things; you can use RS-422/485 differential signalling (requires a line driver) as in many industrial applications, or you can use LIN (the ST UARTs also support this).
For low to moderate-rate reporting, LIN is actually a pretty solid option.
Hey, I am debating on whether or not I should wait for these incredible ESC's to come out or pickup a new set for my Y6. I pull about 40a max load per motor, could I adapt or heatsink these enough to maintain that? What are you looking at for a release date and possible price points? I am just trying to figure it out because I need a plan to allot my Christmas funds :)
Thank you!
Nice! So what´s the timeline for availability?
Put me up on the list for 10 of them, please. :)
George: Yes, if the number of poles of the motor are known, then commutation time is directly related to motor RPM.
What you are asking about, commanding RPM based on input PWM, is called closed loop mode. The ESC actively controls the speed of the motor to achieve a particular RPM commanded by the input channel.
I have an experimental implementation of closed loop mode available via the CLI on the UART interface. It implements a simple PID controller to quickly achieve and hold the requested RPM. You can also enable or disable regenerative braking in this mode, to speed up reduction in speed requests and perhaps capture some of the otherwise lost energy.
I say experimental as I have not spent much time testing or tuning it. I will try to devote some time in flight experiments with this mode at some future date.
@Roman,
The problem with uart though is it only supports two micros talking to each other right? I suppose you could have one master talking and an near infinite number listening but in this case, it's more likely that it'd be 4 ESCs talking and one master listening..which wouldn't really work on a single UART on the master. Bit banging takes CPU..better spent on flying. SPI is there, everybody supports it, more reliable than i2c...anyway, I'm just one voice..
Hi Bill, sory for little off-top, but I MUST ask you. My problem lies outside of common RC tasks, but it is about deep ESC logics.
Is it possible to measure motor speed from an ESC or your ESC? Any kind of output - from pulse series to calculated speed is suitable. Also, is it usually possible to associate certain PWM value with certain motor speed, or typical ESC is not suited for this kind of task?
I ask about this because i'm trying to invent a musical instrument, in which tone is generated by a motor, and its exact speed is crucial. Thanks.
Nice work! I've some esc using the same cpu.