When it comes to building precise motor control systems, optical encoders are often the chosen solution. But what if you want to take the BLDC motor in your drawer and transform it into a high-performance servo motor with precise position and speed control, without the high price tag? In this project, we will use Infineon's TLE5012B magnetic encoder to upgrade your BLDC motor to be used for robotics, automation, and more.
Sensorless BLDC MotorBLDC motors have become increasingly popular in various applications due to their high efficiency, reliability, and compact design. Traditionally, BLDC motors are controlled using sensorless techniques, which estimate the motor's position and speed based on back-EMF measurements. While this approach is cost-effective and widely adopted, it has its limitations. Sensorless control methods can be prone to errors, particularly at low speeds or during transient conditions, which can affect the motor's overall performance and precision.
Benefits of adding the TLE5012BIn contrast, using a magnetic encoder like the TLE5012B enables precise position and speed control, even at low speeds or during dynamic changes. By providing accurate and reliable feedback, the encoder allows for the implementation of advanced control techniques like Field-Oriented Control (FOC), which can significantly improve the motor's torque response, reduce ripple, and increase overall efficiency.Here are a few bullet points highlighting the key features of the TLE5012B magnetic encoder:
- Resolution: Up to 15 bits (32768 steps per revolution)
- Interfaces: SPI, PWM, IIF, Hall Switch Mode (HSM), Short PWM Code
- Sensing technology: Giant Magneto Resistance (GMR)-based principle
- Package: QFN (5 mm x 5 mm)
- Operating temperature range: -40°C to 150°C
First, attach a diametrically magnetized magnet to the motor shaft, ensuring it is aligned with the encoder's sensing axis.
The magnet can be either glued to the shaft or mounted via an adapter:
Now we have to mount the sensor on the same axis as the magnet. Most motors feature a screw mount on the back, which can be leveraged for easy installation with the use of an adapter:
To simplify the process, we designed a compact PCB that houses the TLE5012B sensor and necessary components, making it a plug-and-play solution for any controller.
The shown adapter can be ordered directly here.
To integrate the TLE5012B magnetic encoder with the motor, mount the encoder 1 -2 mm from the motor shaft.Final assembly on the motor:
The hardware schematic is very simple, it consists of three main parts. First, we have the sensor:
We placed decoupling capacitors on the supply voltage and connected all the necessary pins. Since the sensor utilizes SSC communication, we need to add a resistor to connect MOSI to MISO, to establish the SSC line.
Additionally, we integrated a 12-pin connector to output the SPI and IIF signals and also provides the option to add pull-up resistors if they are not available on the control board.
List of components on the board:Reference Value Part NumberC10 100nF 885012206046 provided by Würth ElektronikR11 R12 R13 R14 4.7kOhm 560112110245 provided by Würth ElektronikR15 2.2kOhm 560112116046 provided by Würth
ElektronikJ12 12pin 61301221121 provided by Würth ElektronikU101 TLE5012B Infineon or Mouser
PCB can be easily ordered using Aisler : aisler.net/p/CSHKMJZP
Arduino API, WICED API and a C++ API are available inside this github repository:https://github.com/Infineon/TLE5012-Magnetic-Angle-SensorA C library is also available for download
After importing the library to your project you need to do the following steps:1. Include the header file: #include "TLX5012B.h"2. Creating the following structures:
TLX5012B_SSC_FRAME_ANGLE_t frame;
TLX5012B_CONFIG_t sensor_config = {
.ifHandler =
{
.inc_if_receive_fptr = NULL,
.pwm_if_receive_fptr = NULL,
.spc_if_receive_fptr = NULL,
.ssc_if_send_receive_fptr = &**YOUR_SPI_TRANSMIT_FUNCTION**
},
.sensorType = TLX5012B_TYPE_E1000
};
3. Initialize the sensor:
TLX5012B_CONFIG_STATUS_t sensor_status = TLX5012B_Init_Auto(&sensor_config);
4. To get the Angle Value, call the following function:
TLX5012B_SSC_GetAngleFrame(&frame);
The angle value can be read by reading the variable: frame.angleValue;
You now have a BLDC motor with position feedback at a resolution of 0.01° !
The shown adapter can be ordered directly here.
Even if you choose not to use our PCB or adapter, I hope that parts of this article will help in designing your own project using the magnetic angle sensor TLE5012B.
If you have any questions, please don't hesitate to contact me.Special thanks to Aisler for manufacturing the PCBs and to Würth Elektronik for providing the collateral parts.
Comments
Please log in or sign up to comment.