“From remote Internet of Things (IoT) controlled garage door openers and windows to satellite propulsion controllers, brushless DC (BLDC) motors are increasingly used in many different applications. For BLDC motors, designers face the problem that the control algorithms required to drive the motor are complex and often specialized. This makes it difficult for the average engineer to get the motor up and running in a reasonable amount of time.
Author: Jacob Beningo
From remote Internet of Things (IoT) controlled garage door openers and windows to satellite propulsion controllers, brushless DC (BLDC) motors are increasingly used in many different applications. For BLDC motors, designers face the problem that the control algorithms required to drive the motor are complex and often specialized. This makes it difficult for the average engineer to get the motor up and running in a reasonable amount of time.
Developers often have to choose between a software-based solution that runs on a microcontroller (a flexible software solution, but also places a computational burden on the microcontroller), or use an application-specific integrated circuit (IC) . The latter encapsulates the complete BLDC motor control functionality and transfers BLDC control from the host to it.
This article begins by discussing the difference between a microcontroller-based software solution and a dedicated hardware chip solution, and then dives into how to use Allegro MicroSystems’ A4964KJPTR-T, a motor driver designed to simplify BLDC motor control for automotive applications. This article will show how to interact with the A4964KJPTR-T and some best practices to avoid unexpected behavior.
A Minimalist Introduction to BLDC Motors
BLDC motors provide efficient torque delivery over a wide speed range with low noise and without the mechanical friction of brushed motors. Controlled by current rather than voltage, BLDC motors are versatile and vary in shape, size and cost depending on the application.
For example, TRINAMIC Motion Control’s QBL4208-41-04-006 is a 24 V, 4000 RPM motor that provides up to 0.06 Nm of torque (Figure 1). The motor is lightweight (0.662 lb) and offers developers several options for motor control, such as through sensorless operation using back electromotive force (BEMF), or using a built-in sensor that reports position.
Figure 1: The QBL4208-41-04-006 is a 24 V, 4000 RPM BLDC motor that provides a little over 0.06 Nm of torque at top speed. (Image source: TRINAMIC Motion Control GmbH)
For more torque, designers can use the QBL4208-41-04-025, also from TRINAMIC Motion Control (Figure 2). This is a 24 V, 4000 RPM BLDC motor that provides a little over 0.25 Nm of torque.
Figure 2: TRINAMIC Motion Control’s QBL4208-41-04-025 is a 24 V, 4000 RPM BLDC motor that provides a little over 0.25 Nm of torque at top speed. (Image source: TRINAMIC Motion Control GmbH)
A BLDC motor is driven by a three-phase wire, creating a magnetic field, which in turn pushes the permanent magnets, moving the stator and turning the motor.
In theory, this sounds easy, but in practice, driving a BLDC motor is quite complex, and developers have the choice of using a software framework to drive the motor, or opting for a dedicated chip solution.
Software and Specialized Chip Solutions
Developers should consider several factors when solving the problem of how to turn a BLDC motor. These factors basically boil down to:
・BOM cost and labor cost
・Board complexity and software complexity
・Maintenance time and cost
From a hardware standpoint, going the software route can be very attractive, as a dedicated chip solution would add some extra cost to the BOM. If you don’t use a dedicated chip, you can remove this cost and buy a microcontroller for very little money and put all the control algorithms into the microcontroller. It seems like a win-win, but teams often fail to consider the full ramifications of the decision.
Yes, the BOM cost is reduced, but there is an extra burden on the microcontroller to process the BLDC status data and drive the motor continuously. If the microcontroller is also sampling other sensors, communicating with radios, and controlling other devices, software development and maintenance costs can skyrocket if you’re not careful.
However, the software-based solution in the microcontroller offers flexibility because the team can fine-tune its motor control algorithm. Using software doesn’t mean things are always going to be extremely complicated.
For example, moving motor control algorithms into a microcontroller typically uses more RAM and requires a lot of flash memory. However, if the team uses a microcontroller designed for motor control, such as the F280049CRSHSR motor control microcontroller from Texas Instruments, the algorithm is already built into the library in the microcontroller’s ROM. This means that the only extra code added to the application is the function calls to the library, which does all the heavy lifting.
However, turning a BLDC motor is not just a matter of software, it also requires hardware. Figure 3 shows an application example using the C2000 microcontroller of which the F280049CRSHSR is a member. This diagram illustrates everything needed to drive a BLDC motor and the options available. In addition to the microcontroller, some kind of three-phase power stage is required to drive the three phases of the BLDC motor, making the motor turn.
Figure 3: Texas Instruments’ C2000 microcontroller is designed for motor control applications. This picture is an application example, the microcontroller is in the middle, and the rest are the necessary and optional circuits to drive the BLDC motor. (Image credit: Texas Instruments)
Using a microcontroller to drive a motor is certainly attractive, but what about a dedicated hardware solution? Let’s take a look at the A4964KJPTR-T motor driver chip from Allegro MicroSystems.
A4964KJPTR-T Motor Driver from Allegro MicroSystems
The A4964KJPTR-T motor driver chip from Allegro MicroSystems is a dedicated BLDC motor driver that contains all the capabilities needed to drive a motor (Figure 4). The chip is designed for automotive applications and works with N-channel MOSFETs for sensorless startup and commutation, requiring minimal external hardware. The A4964KJPTR-T also has a wide operating voltage range from 5.5 V to 50 V, making it suitable not only for automotive systems but almost all standard applications.
Perhaps the most striking feature of the A4964KJPTR-T is that it can interface with a microcontroller or central Electronic control unit (ECU) via a serial peripheral interface (SPI) to configure various registers for motor operation. Obviously, this microcontroller doesn’t need to be as powerful as the one running the motor control algorithm itself.
Figure 4: The A4964KJPTR-T BLDC motor driver operates from 5.5 V to 50 V and provides sensorless startup and commutation. Motor speed is configurable via SPI or a dedicated PWM signal. (Image credit: Allegro MicroSystems)
Also, it makes sense that the A4964KJPTR-T motor speed can also be driven without SPI, just by providing a pulse width modulated (PWM) signal. It has non-volatile memory to store motor settings, which are loaded at power-up, allowing the motor to be controlled using only PWM signals.
From a configuration perspective, the A4964KJPTR-T has 32 addressable 16-bit registers, plus a status register. The Status Register is unique and transfers the first 5 bits on every SPI read/write operation so that software can check the general status for any faults or problems. When writing to the chip, the A4964KJPTR-T does not pass back data, so all status registers can be read.
Among the 32 addressable registers, there are also two special registers. Register 30 is a write-only register and register 31 is a read-only register. The write-only register allows the developer to set the demand input, the duty cycle rate at which the motor is driven, with a value between 0 C 1023. The data of the read-only register changes according to the request data written to the register 29 (ie, the read-back select register). This register allows retrieval of various telemetry information such as:
・ Motor speed
・ Average supply current
・ Supply voltage
・ Chip temperature
・ Demand input
・Applied bridge peak duty cycle
・Applied phase advance
In addition to these special registers, the remaining 30 registers allow tuning for specific motor applications and enable or disable faults such as current limit and gate drive faults.
Dedicated motor drivers make sense, storing the various configurations needed to run the motor in dozens of configuration registers. This greatly eliminates the software overhead that a microcontroller would otherwise incur, and perhaps more importantly, greatly reduces software development and maintenance costs. Driving the BLDC is nothing more than sending PWM (which does not incur any overhead on the microcontroller), or enabling the motor bits and providing an SPI based demand input to turn the BLDC.
A4964KJPTR-T Tips and Tricks
Connecting the A4964KJPTR-T is simple, here are a few “tips and tricks” developers should keep in mind to simplify and speed up their development, such as:
• The status register is returned through the SPI interface every time it is written to the chip, rather than being used as a dedicated addressable register. This means that the driver code needs to monitor the SPI bus SDO line for status information when writing to the chip.
• Fault information is included in the status register, but an overview of the chip status for each SPI transaction is seen in the first five bits when the microcontroller provides address access information. This data can be used to determine if any problems have occurred.
• There are two unique registers in the memory map, one read only and one write only. This is simple, but be careful not to try to read a write-only register, doing so will write any dummy data in the read sequence into that register.
・The chip has non-volatile memory that can be used to store default parameters. These parameters are loaded into RAM and used at startup. To ensure the chip boots into the ready state most efficiently, a “safe” boot value should be written to the chip.
• If the end device is used in a noisy or heavily radiated environment, it is a good idea to design application code to periodically revalidate configuration data. The chip configuration is stored in RAM, which means it’s vulnerable to cosmic rays, bit reversals, and all the weird, rare events that can happen in electronics.
BLDC motor implementations for automotive, IoT, or other applications are fairly common, but driving can be complex. To deal with software complexity, developers can use a dedicated BLDC motor driver such as the A4964KJPTR-T, which encapsulates all motor control functions.
While software is still required to interact with the chip, the microcontroller running the software only needs to set the configuration settings and the A4964KJPTR-T will take care of driving the motors. When trying out the A4964KJPTR-T, developers will find that following the “tips and tricks” provided can help save a lot of time and trouble.