How does it work?
Magnetic Rotary 3 Click as its foundation uses the AS5147U, a high-resolution rotary position sensor for fast absolute angle measurement over a full 360-degree range from ams AG. The AS5147U continuously generates the angle information, which the different interfaces can request from the device. The internal 14-bit resolution is available by readout register via the SPI interface, while the resolution on the ABI output can be programmed for 10 or 14 bits. It is also equipped with a Dynamic Angle Error Compensation block that corrects the calculated angle regarding latency by using a linear prediction calculation algorithm.
The core of the AS5147U represents a CMOS technology Hall-effect magnetic sensor that converts the magnetic field component perpendicular to the surface of the chip into a voltage. The signals coming from internal Hall sensors are amplified and filtered before their conversion by the ADC and then processed by the CORDIC block to compute the angle and magnitude of the magnetic field vector. The intensity of the magnetic field is used by the automatic gain control (AGC) to adjust the amplification level to compensate for temperature and magnetic field variations.
Magnetic Rotary 3 Click communicates with MCU through a standard SPI interface supporting the common SPI mode, SPI Mode 1, allowing a host MCU to read 14-bit absolute angle position data from the AS5147U. This Click board™ also comes with onboard headers reserved for incremental and commutation signals of their respective A/B/I and U/V/W signals alongside embedded self-diagnostics, including magnetic field strength too high, magnetic field strength too low or lost magnet, and other related diagnostic features. Incremental movements are indicated on ABI signals with a maximum resolution of 16384 steps / 4096 pulses per revolution.
Besides, brushless DC (BLDC) motors are also controllable through a standard UVW commutation interface with a programmable number of pole pairs from 1 to 7. At constant rotation speed, the latency time is internally compensated by the AS5147U, reducing the dynamic angle error at the SPI, ABI, and UVW outputs, while at higher speeds, the interpolator fills in the missing ABI pulses and generates the UVW signals with no loss of resolution. The AS5147U allows selection between a UVW output interface and a PWM-encoded interface on the W pin, which can be seen as an absolute angle position.
This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Magnetic
Applications
Can be used to support BLDC motor commutation for the most challenging automotive applications
On-board modules
AS5147U – rotary position sensor for fast absolute angle measurement over a full 360-degree range from ams AG
Key Features
Good resolution for motor and position control, independent output interfaces, self-diagnostics, immune to external stray field, low power consumption, and more
Interface
SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on Magnetic Rotary 3 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
J1 | ABI | Unpopulated | Commutation Signal Connection Header |
J2 | UVW | Unpopulated | Incremental Signal Connection Header |
Magnetic Rotary 3 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Rotation Angle Range | 0 | – | 360 | deg |
Core Resolution | – | 14 | – | bit |
Maximum Speed | – | – | 14500 | RPM |
Operating Temperature Range | -40 | +25 | +120 | °C |
Software Support
We provide a library for the Magnetic Rotary 3 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for Magnetic Rotary 3 Click driver.
Key functions
-
magneticrotary3_write_register
This function writes a desired data to the selected register by using SPI serial interface. -
magneticrotary3_read_register
This function reads data from the selected register by using SPI serial interface. -
magneticrotary3_get_angle
This function reads the absolute position raw data and converts it to degrees (Angle).
Example Description
This example demonstrates the use of Magnetic Rotary 3 Click board™ by reading and displaying the magnet’s angular position in degrees.
void application_task ( void )
{
float angle;
if ( MAGNETICROTARY3_OK == magneticrotary3_get_angle ( &magneticrotary3, &angle ) )
{
log_printf( &logger, " Angle: %.1f degreesrnn", angle );
Delay_ms ( 100 );
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.MagneticRotary3
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.