AN414 STMICROELECTRONICS | Alldatasheet

Document overview

  • Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
  • PDF pages: 14

Technical content

motor driven by a chopper. The chopper is driven by a high frequency PWM signal. adjusts directly the motor speed. losses, due to lower current ripple. ■ The DC operation allows to reduce the acoustic noise, especially at 100 Hz. Figure 1. Block diagram Table 1 lists the microcontroller products concerned by this application note. Table 1. Applicable products

Figure 2. AC universal motor versus permanent magnet DC motor The DC motor has a lower current ripple and therefore higher efficiency.

1 Principle

The drive is supplied from the rectified mains voltage, and consists of a chopper driven by a PWM signal generated by the ST6265C microcontroller. The motor voltage control is achieved by measuring the rectified mains voltage with the analog-to-digital converter present on the ST6265C MCU and adjusting the PWM signal duty cycle accordingly: the voltage seen by the motor is the product of the supply voltage by the PWM duty cycle. So the motor speed can be stable even if the mains voltage ripple is high, as the MCU corrects the duty cycle according to this ripple. This avoids the use of a speed measurement device and a speed regulation loop. If this voltage measurement / duty adjustment process is carried out often enough, it also results in reducing motor current ripple, and therefore copper and motor iron losses, thus improving motor efficiency. The ripple period being 10 milliseconds (for 50 Hz mains), the later process must occur at least every millisecond to get a large ripple reduction. In our example, the voltage compensation loop lasts 380 micro-seconds. This drive also implements a power limitation: the motor current is measured by the analog-to-digital converter of the ST6265C MCU, and is used, together with the DC mains voltage, to compute the electrical power taken up by the motor. If it exceeds the maximum programmed power, the PWM signal duty cycle is reduced in real time by the ST6265C to stay below this maximum. This limitation requires only a few discrete components used to measure the current (2 resistors, a diode and a capacitor make up a peak current detector), it is otherwise fully software. Our application features a 300 watts maximum power, but this value can be easily adjusted by modifying a data table in the program, therefore allowing a very short design modification time if the drive must be used with various motors. 2 Why use a microcontroller? The classical implementation of such a high frequency chopper usually involves an application-specific circuit, and some analog circuitry to implement the additional features such as voltage compensation, power limitation or other. At first look, a microcontroller should reduce the overall cost of the electronics, as a single chip would ideally replace several chips. The real world is not so simple: the ST6265C outputs the PWM signal with a 5 volts level, so a buffer is needed to drive the IGBT with 15 volts, which takes 2 or 3 signal transistors. The MCU must be supplied with a voltage between 3 and 6 volts, and the 15 volts must be generated, so we need a small auxiliary supply to extract 5 and 15 volts from the mains. In addition, the MCU cannot generally replace the fast transistor protection needed for the IGBT, as its response time is in the range of 10 micro-seconds, while less than 1 micro-second is required. In conclusion, the MCU approach comes out at the same price, or slightly more expensive than the analog one, at least if we only account for components costs. We must, however, consider the overall system cost, not only the components cost of one function. Three factors at least should be considered: 1. In many cases, the appliance driven by the motor includes some kind of user interface: buttons, potentiometers, LED displays, even LCD displays. If the analog approach is used, more circuitry will be needed to interface them with the motor drive. With the

Why use a microcontroller? AN414 4/14 Doc ID 1876 Rev 2 ST6265C MCU approach, the MCU itself can sense the buttons, potentiometers, drive LEDS... In some existing appliances, the analog approach is used in conjunction with a microcontroller, the latter being dedicated to the user interface. This is obviously a waste, as one ST62 MCU could take care of both tasks. If we consider the case of LCD displays, which are becoming more and more popular, a dedicated LCD driver circuit is generally used to interface them to a micro. We have implemented a software LCD drive function in the ST6265C MCU, using its free output pins; the ST6265C MCU can at the same time run the motor, drive the LCD and sense the user speed demand (in our case, two buttons "faster" and "slower"). (Cf. ref. [4] page 12). 2. Time-to-market and design time must be considered: the ST6265C MCU software contains all the characteristics of the application; it is much faster, if the application must be modified, to modify software than hardware especially when OTP parts are used for volume production. We have implemented a software motor power limitation: the motor characteristics are known by the software in the form of a look up table. If the application must accommodate a different motor type, it is very quick to modify the data table in the software. Most modifications of the application can be achieved by simple software modifications. If the ST6265C MCU replaces an ASIC, the time and money saved when it is necessary to modify the initial design goes without saying. The ST62 MCU can also be used to customize the application: to limit the stock inventory, several applications, for example a low-end and high-end vacuum cleaner can use the same electronics board, with the same MCU, but the MCUs have different softwares, or the software is programmed into the ST62T65Cxx order codes (OTP version of ST6265C) at the end of the board assembly line. 3. The MCU lets you do things that are not possible otherwise. Simple examples are: a) Execute pre-programmed sequences of motor speeds, diagnostic faults and alert the user (with temperature sensors, speed sensors, ... or sometimes without them, by deducing motor speed from current, or temperature from cumulated current ...). b) Store in non-volatile memory (EEPROM) user settings which must be saved when power is turned off.

3 Application description

Figure 3. Permanent magnet DC motor control with ST6265C MCU and IGBT resistor bridge to measure the loop DC voltage, Ud. compensation and a motor power limitation described later.

  • PWM timer: it must be autoreload to leave the CPU free for other tasks, and fast to obtain high switching frequencies.
  • Analog-to-digital converter, necessary to measure the DC voltage and the motor current.
  • Good noise immunity to withstand the chopper and brush sparks proximity.
  • A watchdog for safe operation MCU Supply 15 V 5 V Buffer User interface UdVdd PWM Peak current detectoe Vss Ic IGBT 0 V M MS19690V1

analog-to-digital converter and a fast PWM generator. Figure 4. ST6260C / ST6265C Block diagram

3.2 PWM control

tasks after it has programmed the frequency and duty cycle of the PWM signal.

  • The duty cycle can be adjusted by software from 0 to 100%. The maximum frequency is: 31.25 kHz with a resolution of 256 steps (0.4% resolution). For our application, we chose a frequency of 8 kHz. ROM WATCHDOG SPI RAM 128 EEPROM 128 PWM TIMER TIMER A/D CONVERTER PORT A PORT B PORT C8 BIT CPUTIMER

8 BIT DAT A BUS

Figure 5. PWM timer operation (Operation of the Autoreload PWM timer: The CPU

3.3 Voltage compensation

  • Obtain a motor speed insensitive to mains voltage variations (static performance),
  • Reduce acoustic motor noise and dissipation by reducing the motor current ripple (dynamic performance). The average motor voltage Vmot must be kept constant. The duty cycle d is modulated as a function of the direct voltage Ud around a reference point given by:
  • User request duty cycle (d0),
  • Nominal direct voltage (Udnom). Vmot = d x Ud Vmot = constant = d0 x Udnom To achieve this function, Ud is measured using the A/D converter of the ST6265C and quantized on 32 levels, and d0 is quantized on 16 levels. A duty cycle correction is picked up from a look-up table versus Ud and d0. Then the correction is added to d0 and the sum d is loaded in the PWM timer register. The table could also contain values chosen specifically for the application. In order to reduce motor current ripple, the control loop must be fast, so as to minimize the time between voltage reading and duty cycle updating. TIMER PWM OUTPUT 255 COMPARE t REGISTER 000 SWITCHING PERIOD DUTY CYCLE MS19693V1

Figure 7. Voltage Compensation (Dynamic performance: motor current ripple

3.4 Motor power limitation

The program repetitively measures Imot and Ud using the A/D converter of the ST6265C. and decreases d if it is larger than d_max. "non-limited" condition, in order to avoid oscillations or jerks.

0 Amps --

Figure 8. Motor power limitation performance

3.5 Program highlights

additional software or enlargement of the look-up tables. for example, to store user adjustments which must be saved when the power is off.

4 Conclusion

Microcontrollers are often limited to controlling and monitoring the user interfaces. This paper describes a digital solution based on a general purpose MCU with on-chip PWM generator, the ST6265C. Besides the user interface such as an LCD drive, the MCU controls directly a DC motor with few external components and sophisticated control. A simple instruction set and the use of look-up tables allow for a short time-to-market, while avoiding the investment into an ASIC circuit. The demonstrated concept is applicable to home appliances (food processor, washing machine, refrigerator, HVAC ...) and to industrial applications where high speed accuracy is not required (pumps, fans ...).

5 References

[1] - Microcontroller and TRIAC on 120/230 v mains A.N 392/A - Ph. RABIER and L. PERIER (SGS-THOMSON Microelectronics) [2] - Design with microcontrollers in noisy environment A.N 435 - L. PERIER (SGS-THOMSON Microelectronics) [3] - Versatile and cost-effective induction motor drive with digital three phase generation A.N 424 - B. MAURICE, JM. BOURGEOIS, B. SABY (SGS-THOMSON Microelectronics) [4] - Direct Software LCD Drive with ST621x and ST626x A.N 594 - T. CASTAGNET, J. NICOLAI, N. MICHEL (SGS-THOMSON Microelectronics)

The permanent magnet motor drive schematic is shown in Figure 9. Figure 9. Complete schematic of the permanent magnet motor drive

6 Revision history

Table 2. Document revision history 05-Feb-2013 2 Modified title and part numbers to include ST6265C and ST6260C. ST62T65 MCU replaced with the ST62T65Cxx order codes.