Abstract: This document is intended to introduce how to use Sunplus SPMC75F2413A MCU as the main controller to perform DC inverter air condition.
Keyword: SPMC75F2413A, PS21865A, Fuzzy Control
1 Introduction
With the development of our national economy and the improvement of people's material and cultural life, air conditions have been widely used in various situations. With features of energy saving, low noise, constant temperature control, all-day running, low frequency compensation and instantly achieving the set temperature, an inverter air condition has greatly improved in performance and become increasingly popular with people. The popularization of inverter technology is provided with technical support through the wide use of MCU technology, the successful application of inverter technology and fuzzy control technology in the embedded control system, as well as the rapid development of semiconductor power devices.
In this application, the DC inverter air condition is composed of an indoor unit and an outdoor unit. The main controller of the outdoor unit is SPMC75F2413A which is a designated design for motor control applications. By offering remarkable features, it is easy to make modularized and intelligent products, of which control parameters have open structures so as to facilitate interfacing with various compressors, thus can upgrade the products in the shortest time according to the manufacturer's requirement. In this way, the products have superiority in time to market. Following are the key features of the controller:
1. Fuzzy control: In order to control the operating speed of the compressor, the working of outdoor fan and other loads, set up fuzzy logic relationships among the parameters of indoor temperature, outdoor temperature, pipe temperature, compressor exhaust temperature, compressor overload protection temperature and compressor current, etc.
2. BLDC driving technology based on back Electromotive Force (or back EMF) position detection.
3. Module control protection circuit: If a module generates a protection signal, the PWM output will be disabled by the hardware interrupt so as to protect the module and the signal will be transmitted to the main controller module properly.
4. EMC and reliability design technology: After mastering interference mechanism, following are significant for hardware design: Power supply circuit, filter circuit parameters, PCB board ground line and signal line; as well as software tolerance technology.
2 Device Feature
This application is using IPM and SPMC75F2413A microcontroller to develop DC inverter air condition. Following are the features of SPMC75F2413A:
SPMC752413A, a new 16-bit microcontroller in u'nSP? family, is a designated design for the target fields of many industrial and home appliance inverter control. With its powerful timers and PWM output function, SPMC752413A can drive various motors easily.
The SPMC75F2313A operates at 0~24MHz under 4.5~5.5V. The memory includes a 32K-word flash ROM plus a 2K-word working SRAM; other features include 64 programmable multi-functional I/Os; five 16-bit general-purpose timers (which support capture input/PWM compare match output function); two dedicated configurable timer period registers; programmable watchdog; low-voltage reset/supervision; 8-channel 10-bit analog-to-digital conversion. Following are the detailed features:
·Sunplus 16-bit u'nSP? processor (ISA 1.2)
·Operating voltage:
-Core: 4.5V~ 5.5V
·Operating speed: 24MHz
·Operating temperature: -40 ℃~85 ℃
·On-chip memory:
-32KW (32K×16) Flash
-2KW (2K×16) SRAM
·On-chip PLL based clock generation
·Watchdog timer
·10-bit analog-to-digital converter
-8 multiplexed input channels
-10us (100KHz) conversion time
·Serial communication interface
-UART
-SPI
·Up to 64 GPIO pins
·Power management
-2 power-down modes: Wait and Standby
-Each peripheral can be powered down independently
·2 compare match timers
·5 16-bit general-purpose timers
-2 for PWM
-2 for rotor speed capturing
-1 for speed loop
·Center- or edge-aligned PWM outputs
·Emergency PWM outputs shutdown with external fault protection pins
·Programmable dead time control
·PWM service and fault interrupt generation
·Capable of driving AC induction and BLDC motors
·Embedded In-Circuit-Emulation Circuit
3 System Introduction
As mentioned above, this DC inverter air condition consists of two parts: the indoor unit and the outdoor unit. The indoor unit adopts the SPMC701FM0A as the main controller to configure logic states; while the outdoor unit adopts the SPMC75F2413A as the main controller to drive the inverter motor of the DC compressor. Figure 3-1 demonstrates the system structure of the DC inverter air condition.

Figure 3-1 System Structure of DC Inverter Air Condition
Basic working process:
1 The main controller (SPMC75F2413A) of the outdoor unit continuously receives the control command and state information from the indoor unit, and then controls the outdoor unit, four-way valve and compressor accordingly.
2 Meanwhile, the current state and temperature of outdoor unit will be fed back to the indoor unit.
3 Considering the state and the temperature of the indoor unit as well as the returned parameters from the outdoor unit, the indoor unit will coordinate the entire operation process.
4 Hardware Design
Although we know the entire system is composed of the two parts: indoor unit and outdoor unit, here we will only describe the outdoor unit in detail.
4.1 System Structure
The outdoor unit is composed of IPM power module, back EMF position detection circuit, switch power module, outdoor fan driving circuit, SPMC75F2413A MCU, and power line communication circuit. The schematic diagram is shown in Figure 4-1.

Figure 4-1 Outdoor Unit Schematic
4.2 MCU Control Circuit
Figure 4-2 displays the main control module composed of 'nSP SPMC75F2413A and its basic peripheral. CON5 is the probe connector to the built-in ICE. The MCU control circuit is the centre of the entire outdoor unit, which is responsible for transmitting the controlling signals to make the system run normally.

Figure 4-2 MCU Control Circuit
4.3 Power Circuit
Figure 4-3 shows an EMI power line filter and a soft startup circuit. Via CON1, CON3 and CON5, the 220VAC power is input and then filtered by the surge absorber ZNR3 to protect electronic devices; L1, C2, C1, C5 and C3 constitute EMI filter circuit for filtering electromagnetic interference; RL1, RT2, and D1 form the soft startup circuit for avoiding high current shock at power-on.

Figure 4-3 EMI Power Line Filter
Figure 4-4 displays a DC/DC power supply circuit which is composed of TOP234 and corresponding peripheral circuits. This circuit outputs +18V and +12V supplied for the system. The +18V voltage is regulated to +15V via IC21 and to +5V via IC22 for IPM operation.. The +12V voltage is regulated to +5V via the linear voltage regulator (IC20) for SPMC75F2413A and other digital devices operation.

Figure 4-4 DC/DC Power Supply Circuit
4.4 Outdoor Fan Driving Circuit
The outdoor fan uses a BLDC motor with Hall sensor as its controller, of which the driving circuit consists of the SMA5118 and power driving optical coupler TLP251 (see Figure 4-5). The driving process is: First, input PWM signal generated from SPMC75F2413A to TLP251 for optical isolation; next, input the output signal to the power driving module SMA5118 for power synthesis; finally, output the signal to drive the fan to work normally.


Figure 4-5 Outdoor Fan Driving Circuit
4.5 Compressor Power Driving Circuit
Figure 4-6 shows the compressor power driving circuit which is composed of an IPM power driving circuit (PS21865A) and a PWM optical coupler drive circuit. The driving process is: First, input PWM signal generated from SPMC75F2413A to TLP251 for optical isolation; next, input the output signal to the power driving module SMA5118 for power synthesis; finally, output the signal to drive the compressor to work normally.



Figure 4-6 Compressor Power Driving Circuit
4.6 Back EMF Position Detection Circuit
Figure 4-7 shows the back EMF position detection circuit which consists of a voltage comparator and the corresponding resistor-capacitor (RC) network. This circuit is designed for detecting the rotor position of the BLDC motor without a Hall sensor. When a BLDC motor rotates, the stator winding will generate a back EMF which is related to the rotor position, depending on which the rotor position can be detected.

Figure 4-7 Back EMF Position Detection Circuit
4.7 Power Line Communication Circuit
Power line communication circuits are shown in Figure 4-8 (indoor unit) and Figure 4-9 (outdoor unit). In fact, the circuit is a half-duplex current loop converter supplied by the indoor unit, which makes use of power supply and a special communication cable to form a current loop between the indoor unit and the outdoor unit. By using the UART module built in SPMC75F2413A, this circuit provides a reliable communication loop between the indoor unit and the outdoor unit.

Figure 4-8 Power Line Communication Circuit (Indoor Unit)

Figure 4-9 Power Line Communication Circuit (Outdoor Unit)
5 Software Design
The outdoor system is mainly designed for the following four purposes:
1. Communicate and coordinate with the indoor unit.
2. Drive and control the compressor of the outdoor unit.
3. Drive and control the outdoor fan.
4. Drive and control the four-way valve.
As listed above, the first part contains the serial port ISR, command interpreter and main loop control. The serial port ISR receives data packet coming from the indoor unit, and process them accordingly to ensure the correctness of the command and the data; the command interpreter is used to interpret the indoor unit commands and process them accordingly. The main loop is shown in Figure 5-1.

Figure 5-1 Main Loop
The second part, compressor driving and controlling, includes BLDC motor driving, motor acceleration/deceleration control device, and motor start & stop controller. Among them, the key is the BLDC motor driving.
SPMC75F2413A, a dedicated design for motor control application is equipped with two same sets of inverter motor drivers for driving two BLDC motors simultaneously, thus it is fairly convenient for the implementation of the DC inverter air condition. By taking SPMC75F2413A as the main controller, the software design of compressor driving becomes simple, it only needs the rotor position information provided by the back EMF position detection circuit (shown in Figure 4-7). In addition, SPMC75F2413A contains a special driving protection circuit for properly protecting the compressor and its driving circuit.
Since indoor & outdoor units and compressor are all driven by the BLDC motor, they have the same driving structure.
6 Epilogue
The inverter control development requires real-time and readable code by mixing C and assembly languages. 'nSP? IDE provides a user-friendly interface to embed ASM routine in C code or C routine in assembly code.
SPMC75F2413A features rich hardware resources including two timers and 17 IO pins to use. With this built-in dedicated hardware, it is quite easy to develop inverter control on SPMC75F2413A. Because of these tremendous features built inside the SPMC75F2413A plus satisfied engineering support guaranteed from Sunplus, one of the Top 20 IC design companies worldwide, SPMC75F2413A is one of best solutions in the industry today for general inverter and home appliance markets.
7 Reference
[1] Lei Sixiao, Li Bocheng, and Lei Xiangli, Sunplus 16-Bit Microcontroller's Fundamental and Application, XIDIAN University Press.
[2] Sunplus Technology, SPMC75F2413A Programming Guide V1.1.
[3] Mitsubishi Electronics, PS21865A Data Sheet.
|