Overview

This application note presents the motor control theory needed to drive a BLDC motor and contains a comparison between the sensored and sensorless motor control, a typical implementation of a power stage, modulation techniques as well as a detailed description of the custom PIM.

Moreover, the document covers a detailed presentation of bipolar switching, which is the focus of this example.

To obtain the position of the rotor, the zero-cross point detection method is covered, using a comparator with a variable voltage reference consisting of a virtual neutral of the motor.

The motor starts at an initial position after an alignment routine. This is done so that at start-up the motor follows the generated open-loop waveform.

At compile-time, the user can select the mode the motor must run in, open- or closed-loop.

A potentiometer on the MCLV-2 board provides a value read by the ADC that is used to compute a duty reference for the waveform timer, and this reading, along with the current, is done asynchronously from the motor logic drive of the software. This part runs in the main loop, while the motor control runs on interrupts to get the best response time possible.

At the end of this document, the user can find a brief introduction to tuning the parameters of the firmware to obtain the desired results.

This application example uses the following peripherals:

Prerequisites:

  1. 1.Software:
    • Microchip Studio 7 Integrated Development Environment (IDE) with AVR DX Device Family Pack (DFP 1.7.85 or newer)
  2. 2.Hardware:

The MCLV-2 Development Board is targeted to control either a brushless motor or a permanent magnet synchronous motor in sensored or sensorless operation. In this demo, it will be used in conjunction with the AVR128DA48 or AVR128DB48 Motor Control PIMs to drive a brushless motor in sensorless operation. The board offers a driver for the three phases, a way to measure feedback signals, and an on-board op amp. An additional configuration board is used with the AVR128DB48 PIM because the internal operational amplifier signals are routed differently.

This demo will use some other features of the MCLV-2 board like the programming interface and the serial interface to receive information about the working parameters of the motor. Additionally, there are LEDs, buttons and a potentiometer on the board that provide a user interface to show which PWM outputs are active, to set the direction of the motor and to start and stop it, and to change the speed of the motor.