Refrigerator Compressor Reference Design User Guide
Refrigerator Compressor Reference Design User Guide
Contents
Safety Notice
The safety notices and operating instructions provided should be adhered to, to avoid
a safety hazard.
WARNING – The input AC mains supply, output terminals and other interfaces are NOT
isolated with each other. DO NOT connect any non-isolated device to the board when input
mains supply voltage applied.
WARNING – The output terminals may be at up to 410V with respect to ground, regardless
of the input mains supply voltage applied. These terminals are live during operation AND
for three minutes after disconnection from the supply. Do not attempt to access the
terminals or remove the cover during this time.
CAUTION – The system should not be installed, operated, serviced or modified except by
qualified personnel who understand the danger of electric shock hazards and have read
and understood the user instructions. Any service or modification performed by the user is
done at the user’s own risk and voids all warranties.
Revision A – 12/4/2019
This is the initial released version of the document.
Glossary
1 Introduction
PMSM motor is getting widely used in household electric refrigerator compressors for its
higher efficiency and lower noise over traditional single-phase AC motor. A typical
refrigerator electrical control system has 2 control boards,one is for refrigerator system
control, another for compressor control.
This Refrigerator Compressor Development Reference Design (RCDRD) is intended to aid
the engineers to develop the PMSM compressor control application with dsPIC® Digital
Signal Controllers (DSCs). This development Ref Design is targeted to provide a
competitive sensor-less control solution applies to both Interior Permanent Magnet
Synchronous Motor (IPMSM) and Surface Permanent Magnet Synchronous Motor
(SPMSM) compressor. Both hardware and software are provided.
The rated continuous output current is 0.65A (RMS). This allows up to approximately 250W
continuous output power when running from a 187V to 264V single-phase input voltage in
room temperature environment. The peak output power is 350W for instantaneous high
compressor pressure operation. More details of the RCDRD hardware is provided in
Chapter 2 “Hardware Description”.
This document describes how to use RCDRD prototype 1. Below Fig 1-1 gives the picture
of this Reference Design.
2 Hardware Description
2.1 Introduction
The RCDB is powered from 220V AC grid and controls the compressor motor with
dsPIC33EP64MC202. The input 220V AC voltage is passed through the Filter & protection
circuitry, and then converted to DC voltage by rectifier circuitry. An auxiliary power supply
circuitry supplies non-isolated 15V and 3.3V voltage to MCU, feedback circuitry and three
phases inverter bridge circuitry. Below Fig 2-1 gives the picture of the board while Fig 2-2
shows the block diagram.
UART-USB
/ PICkit™ 4
PICkit™ 3
Isolated
Fridge Compressor Development Board Programming
UART 1
port
15V Power
Supply Square Square
Rectifier 3.3V
wave input wave
Power
Supper MCU circuitry
UART 2 Communic-
ation
DC BUS
Inverter circuitry
Filter &
Feedback
Protection
circuitry
Motor
The RCDB has various functional modules which implement its salient features: EMI filter
& protection, Rectifier, Auxiliary power supply, MCU, Inverter, Feedback circuitry, and
Communication ports. They are marked in the Figure 2-3 and Tab 2-1.
2 3 7 4
1 6 5
surge protection. The EMI filter has two-stages. If only one-stage filter is valid, the CY300,
CY303, CX302, L301 and CX300 should be unsoldered and L301 should be shortened.
AC Input AC Output
2.2.2 Rectifier
This module includes an in-rush current protection, a single-phase full-bridge rectifier and
a DC bus capacitor, as Fig 2-5 below. The in-rush current was suppressed by a power
resistor R305 at the moment of powering on the board. After the DC bus capacitor is full
charged, the power resistor is shortened by relay RL30. The single-phase bridge rectifier
DB300 converts the input alternating voltage at power frequency into constant DC voltage.
VAC VBus
The block diagram of auxiliary power supply is shown in Fig 2-6. The 15V power rail is
stepped down directly from the rectifier output. This eliminates the transformer and high
voltage rate components used in a Flyback approach. A MCP16331 is used to step down
this 15V to 5V.. The MIC5239 LDO regulates the 3.3V from 5V voltage to provide the
control chip dsPIC33EP64MC202 with a clean power supply. Besides the control chip, this
3.3V rail is also to power other digital and analog control circuitry, such as ADC reference,
feedback circuitry. This approach provides nice auxiliary power supply with small power
consumption.
IGBT Driver
The details of all these three auxiliary circuit is shown in Appendix B. Schematic Diagram.
2.2.4 MCU
A dsPIC33EP64MC202 is selected in this design. There is also an approach that a single
chip conducts both refrigerator system control and compressor control job. Microchip
provides many other products in dsPIC33EP or dsPIC33CK series can well meet the
application.
In this design, the chip pinout functionality is listed in table below.
15V VBus
RBST
DBST
HB
VDD CBST
PWMuH
HI HO
PWMuL
LI
Uu
MIC4608 HS
DCLAMP
LO
VSS
Bootstrap Circuit
The high-side driver of MIC4608 is designed to drive a floating N-channel IGBT, whose
source terminal is referenced to the HS pin. A level-shifting circuit in MIC 4608 isolates the
low-side (VSS pin) referenced circuitry from the high-side (HS pin) referenced driver.
Power to the high-side driver is supplied by the bootstrap capacitor (CBST) while the voltage
level of the HS pin is shifted high.
HS Node Clamp
A diode clamp between the switching node and the HS pin is recommended to minimize
large negative glitches or pulses on the HS pin.
More detail of the bootstrap circuit and HS node clamp can be found in MIC4608 datasheet.
2.2.6 Feedback circuitry
DC bus voltage and motor phase current are sampled for motor control and protection.
• DC Bus Voltage Feedback. It is compounded by a voltage divider and a low-pass
RC filter. The divider divides the DC bus voltage to 3.3/443.3V in order to match the
MCU logic levels.
• Motor current feedback. A shunt resistor is located between the emitter of the three
low side switches and the “DC-”. dsPIC33EP64MC202 provides internal operational
amplifiers (Op-Amp) and comparators. They are used for amplifying motor current
and over-current protection. The gain of the Op-Amp is set to 4, the shunt resistor
voltage signal is shifted by 0.2VDC. Hence the motor phase current ranges from -
4.125A to +4.125A.
The location of the feedback circuit is shown in Fig 2-8.
440K
5 AN3
ADC
3.3K
133K
2K
3 C2INI+
8.06K
2
UART1
PICkit™ 4
PICkit™ 3
Isolated
CON
200 Square
CON203 wave
CON202
LD200
UART
communication
CON
201
LD300
CON300 CON100
Compressor
220V AC
If the board driving the compressor was in fault state, the LED will blink as in below error
code
ERR_RCON_IOPUWR ++-+-+++---
ERR_RCON_CM +++-+-+++---
ERR_RCON_WDTO_ISR ++++-+-+++---
ERR_RCON_WDTO_MAINLOOP +-++-+++---
ERR_UNEXPECTED_INTERRUPT_BASE +-+-+-+-++---
In the tab above, a “+” represents LED blinking once with 50% duty @ 1.67Hz. A “-”
represents LED tuning off in the whole cycle of 1.67Hz.
The software of RCDRD is configured for Basic Operation. This chapter describes how to
setup the software, run the compressor and debug the code.
Basic operation is to open the S/W project, configure and build the code and program the
chip on development board.
(1) Start MPLAB X IDE V5.10 and open the project “RCDRD_V1.0.X”.
Note: The project requires MPLAB X IDE V5.10 or later.
(2) Right click on this project on the left tab named “Project”, and select the last item
“Properties”.
(3) The RCDB board is a hot-ground design. It is prohibited to be powered when connects
with any other non-isolated tools and equipment, such as computer, laptop,
oscilloscope, etc. Programmer/Debugger is suggested to program the chip as it can
provide 3.3V to the board for programming.
After applying Programmer/Debugger selection (PICkit 3/PICkit 4), the “PICkit
3”/“PICkit 4” term can be found in “Categories” list in “Project Properties” window.
(4) Build the code by clicking the “Clean and Build Project” button on the toolbar or in the
“Production” menu.
or
(5) After a successful build, connect PICkit 3/PICkit 4 to RCDB CON203.
Download code to the chip by clicking “Make and Program” button on toolbar
Note: Before this step, make sure that the AC power supply is DISCONNECTED
to the board.
(6) Disconnect the PICkit3 with the board. Make sure RCDB is not connected with any
other non-isolated board or equipment.
(7) Connect a compressor or a motor on CON 100, connect the AC power supply on
CON300. Power on the development board. The board now is in STOPPED status, the
LED blinks 50% on @ 0.625Hz.
In terms of RCDRD prototype 1, the only way to run the compressor is by Diagnostic Kernel
function in code. The tool working with Diagnostic Kernel function is X2C Scope plugin and
MCP2200 Isolated USB to UART Demo Board. The X2C Scope is a plugin of MPLAB X
IDE to facilitate the debug job. It provides a complete feature to read and write variables in
dsPIC®’s data memory by means of UART. Furtherly it can plot those variables in a real
time mode.
(1) Install X2C Scope plugin. Select “Plugins” item from “Tools” menu. On “downloaded”
page, click “Add Plugins…” button, select “at-lcm-x2c-mplabscope.nbm” file. Click
“Install” to install X2C Scope plugin.
(2) Open the project properties (as in 3.1(2)) and enable “Load symbols when
programming or building for production (slows process)” during production builds in
“Loading” page.
(3) Connect the MCP2200 Isolated USB to UART Demo Board to computer and RCDB
by Dupont lines.
(4) Download the code to the driver board (as described in 3.1(4)(5)(6)), disconnect all
non-isolated devices.
Note: The code needs to be downloaded every time the board was power off and
on for connecting X2C Scope to MCU on board.
(5) Disconnect the Programmer/Debugger and power on the board
(6) Start X2C Scope by clicking “X2CScope” from “Embedded” on “Tools” menu. The
“X2C Scope Configuration” window will open.
(7) Set the parameters as picture below, select this RCDRD project in “Select Project”
button. Then click “Disconne…” button to connect computer to driver board.
Parameters setting
(8) On “Project Setup” page, “Scope Sampletime” configures the sample interval to
display in scopes time-axis. It must be the same value as the PWM cycle. In RCDRD,
it is 400 us (2.5kHz). The “watch sampletime” configures the refresh interval in the
“X2C Scope Watch” window. It should be bigger than PWM cycle. Click “Set Values”
to apply the setting.
(9) On “Data Views” page, click “Open Scope View” to open “X2C Scope Scope” window.
This window displays the wave form of variables. Click “Open Watch View” to open
“X2C Scope Watch” window. Variables value is displayed and changed in this window.
Only global variables can be added in these two windows.
(10)Add the variables which you want to observe in “X2C Scope Scope” window. For
example, add the reference velocity and feedback velocity, reference id/iq and
detected id/iq, output vd/vq, etc. Click the “SAMPLE” button to start sampling variables
and show the waves.
Scope window
Watch window
(11)At the end of the operation, remember to click “Connected” button to disconnect X2C
Scope to board.
In FDCRD, there is a Test Harness component which provides an easy method to modify
the control operation mode of the commutation and motor control loops. It represents
several runtime parameters which are used to put the system into certain test modes. In
combination with other adjustable parameters used in motor control application, we can
debug and test proper operation of the compressor and board. it is tightly coupled to
commutation and motor control loops, as picture below.
(4) Set ωe (3) Set id/iq (2) Set Vd/Vq
FOC
id* Current PI Ud* U * Usa*
single shunt
SVPWM in
Inv Clarke
Inv Park
- controler PWM
Usb*
iq*
Duty M
e * Velocity PI Current PI Uq* U * Usc* cycle
- controller - controler
Single shunt
process
isa
id i
Clarke
isb Current
Park
iq i sample
isc
d
(5) Set fe
dt
(6) Set θ
Tab 3-1 Brief summary of the Test Harness features and setting
on-off Parameter setting Control Setting
motor.t motor.t motor.t motor.t motor.tes motor.tes motor.t
Setting system motor.tes motor.t
esting. esting. esting. esting. ting.overr ting.overr esting.
Data.te ting.overr esting.
overrid overrid overrid overrid ideOmeg ideComm operati
sting.k ideTheta overrid
eVdqC eVdqC eIdqC eIdqC aElectric utationFr ngMod
Features ey Electrical es
md.d md.q md.d md.q al equency e
Set Vd and Vq 53670 value value —— —— —— —— —— 1 ——
Motor control is a very motor and application dependency system. Compressor motor
control brings even more challenge in reliable startup and unbalanced load in every
mechanism revolution. RCDRD is targeted to provide an easy way to run with different part
number compressor. This chapter describes how to use RCDRD to run a compressor other
than the developers were using for debug and test.
To run a different compressor, some parameters need a modification to fit with the
compressor. All code files need to be modified are the header files in folder “parameters”
besides one C source file “opamp_comparator.c” in folder “hal”.
(1) Because dsPIC® is a fixed-point controller, the motor parameters cannot be used
straightly in code since they are fractional data. Therefore, we must convert the
physical units to fixed point PU format (mostly Q15). “tuning_params.xlsx” is provided
to implement this conversion. There are many parameters in the “tuning_params.xlsx”
file, which are described as below.
In order to get the fixed-point parameters, the motor parameters should be input in
“tuning_params.xlsx” as below.
The fixed-point format value is then be generated in the purple background cells. To
avoid saturation, resolution loss and truncation error caused by Q15 implementation,
it is recommended that the fixed-point data should be in the range of 6000-26000. If
the fixed-point data falls out of the recommended range (greater than 26000), the scale
“Q” should be adjusted to achieve the recommended range.
(2) Modify over-current threshold in register CVR (CVRCON<3:0>) in C source file
“hal/opamp_comparator.c”.
(3) Modify the parameters of estimator Angle Tracking Phase-Locked Loop (ATPLL) in
header file “parameters/atpll_params.h”.
(4) Modify software over-current threshold value of stall detection in header file
“parameters/fault_detect_params.h”.
(6) Modify parameters of Maximum Torque Per Ampere (MTPA) algorithm in header file
“parameters/mtpa_params.h”.
(10)Go back to Chapter 3 “Setup and Run” to program and run the code.
Only a few parameters in the table above need fine-tuning when changing a compressor.
They are described as below.
The Kxx_Q (KIP_Q, KII_Q, KWP_Q and KWI_Q) is the scaler. Kp and Ki is multiplied by
2^Kxx_Q to get final PI controller data used in code. During the very early stage of the
debug job, changing this scaler value rather than Kp (Ki) will help reducing the debug time
to find a rough Kp (Ki) value.
5 Known Issues
Work Around: Restart the MPLAB X and redownload the program to the board.
• Scenery 2: Sometimes the chip might fall in watchdog overtime protection. It
could be caused by some mistake when modifying the code. Check LED (LD200)
blink to get the chip operation status.
Work Around: Power off the RCDB. Re-connect the UART1 port and power on
the board.
Appendix B. Schematics