FM3, Inverter Sensor Washing Machine
FM3, Inverter Sensor Washing Machine
Cypress Semiconductor
198 Champion Court
San Jose, CA 95134-1709
[Link]
Contents
Copyrights
© Cypress Semiconductor Corporation, 2015-2016. The information contained herein is subject to change without notice.
Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a
Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor
intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an express
written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-
support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The
inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use
and in doing so indemnifies Cypress against all charges.
Trademarks
All other trademarks or registered trademarks referenced herein are property of the respective corporations.
Source Code
Any Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by
and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty
provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create
derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom
software and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as
specified in the applicable agreement. Any reproduction, modification, translation, compilation, or representation of this Source
Code except as specified above is prohibited without the express written permission of Cypress.
Disclaimer
CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described
herein. Cypress does not assume any liability arising out of the application or use of any product or circuit described herein.
Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure
may reasonably be expected to result in significant injury to the user. The inclusion of Cypress’ product in a life-support
systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all
charges.
Use may be limited by and subject to the applicable Cypress software license agreement.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 2
Contents
Contents
1. Introduction .................................................................................................................................................................... 5
1.1 Purpose ................................................................................................................................................................. 5
1.2 Definitions, Acronyms and Abbreviations .............................................................................................................. 5
1.3 Document Overview .............................................................................................................................................. 6
1.4 Reference Documents ........................................................................................................................................... 6
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 3
Contents
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 4
1. Introduction
1.1 Purpose
This user manual describes Cypress inverter sensor washing machine solution, and describes how to use
inverter washing machine FW library.
This document will help you acquire a quick understanding of how to build a washing machine project and how to
debug the motor with inverter sensor washing machine FW library.
The document introduces the basic information of the washing machine solution including hardware, firmware,
initial functions, basic motor setting functions and FOC drive modules. When you have understood these
contents, you can get an overview of a whole washing machine project. And you can run a motor following the
demo project step.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 5
Introduction
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 6
2. System Hardware Environment
The following lists the MCUs used in washing machine inverter board
CPU chip: MB9AF111K/ MB9AF312K
CPU Frequency: 40MHz
MCU pin number: 48pin
RAM Space: 16Kbytes
Code Space: 128Kbytes
Demo HW version: WM-MAINBORAD-V0.3.1
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 7
3. Development Environment
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 8
4. System Firmware Design
4.1 FW Feature
The features of the sensor inverter washing machine solution are shown in Table 2
Table 2. Feature List of Sensor WM Solution
Field Weaken Control Run motor in field weaken area to raise speed
FOC Control Using FOC control algorithm
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 9
System Firmware Design
4.2 FW Structure
There are 5 layers in the FW structure of IAR, which are shown in Figure 1.
Figure 1. Structure of FW
The C source and Header files which are included in each layer are shown in Table 3
Table 3. Directory Description of Project
H03_module, Algorithm folder for basic motor control such as FOC frame transform , SVPWM,
module
S03_module math, PID, filter
H04_app, Application folder for the files of application functions such as speed and position
app generator by hall sensor, protection, motor start-up, field weaken, brake, weight,
S04_app OOB,UART, and etc.
H05_User,
user Customer interface folder for the files for motor Configuration and HW setting
S05_User
Note: if you want to quick start the motor, you can refer to the setting for user layer at 9.2.1 FW
Interface Configuration and Chapter 5. System Function
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 10
System Firmware Design
The sub-files in each folder are shown in Figure 2 and the structure of header files is the same as C files.
Figure 2. Sub-files in Each Layer
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 11
System Firmware Design
User
Layer User interface Main program entrance Interrupt vectors
App Layer
Hall Self Check HW Self Check Single Shunt Sample
Module
Layer
Clarke Transformer Inverse Clarke PI Regulator
Transformer
Park Transformer Inverse Park SVPWM
Transformer
LPF Math A/D Sample
Drive Layer
Global Layer
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 12
System Firmware Design
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 13
System Firmware Design
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 14
5. System Function
This chapter introduces the system function of the macro definition, global structure definition, and function
definition in detail.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 15
System Function
typedefstruct
{
int16_t i16WmCommandSpdRpm;//the command speed of drum from UART or debugger
online,unit:rpm
int16_t i16WmTargetSpdRpm;//the middle speed for the reference speed of speed
PI,unit:rpm
int16_t i16WmSpdRpmRt; //the real-time drum speed of washing machine
int16_t i16WmSpdRpmLPF; //the filtered drum speed of washing machine
int16_t i16MotorSpdRpmRt;//the real-time motor speed of washing machine
int16_t i16MotorSpdRpmLPF;//the filtered motor speed of washing machine
char_tcWorkMode; //wash or spin work mode
char_tcRunStatus; //run status: 0--stop,1--Run
char_tcRunDir; //run direction: CW or CCW
uint16_t u16FaultCode; //protection fault code
uint8_t u8InitStage; //the start initial state machine
uint16_t u16Vbus; //the DC bus voltage, unit:V
uint16_t u16VbusLpf; //the DC bus voltage lpf value
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 16
System Function
SpdSt_stcSpdSet
The structure is used to set the drum speed. It is the global structure for the Speed Set module that is realized in
file ‘S04_app/ SpeedSet.c’. Detailed information can be found in the comments for each variable, the variables in
this structure are not recommended to modify.
typedefstruct stc_SpdSet
{
int16_t i16SetSpeed; //setting speed of drum, unit:rpm
int16_t i16SetSpeedPre; //previous setting speed of drum,
unit:rpm
uint16_t u16SpdChgTime; //speed change time from spd A to B
uint16_t u16CommandSpeed;//the command speed of drum,unit:rpm
char_t cWorkMode; //the WM working mode: wash or spin
uint16_t u16SpdChgCounter;//the speed regulate counter
uint8_t u8SpdChgStep; //the speed change step for speed
regulate
Char_t cMotorStartFlag;//motor start flag
Char_t cMotorStopFlag; //motor stop flag
char_tcRotateDir; //motor running direction
uint16_t u16AcceLmt; //the acceleration limit at speed up
uint16_t u16DeceLmt; //the acceleration limit at speed down
uint16_t u16SpeedMax; //the maximum speed limit of drum speed
uint16_t u16SpeedMin; //the min speed limit of drum speed
} stc_SpdSet_t;
stc_SpdSet_t SpdSt_stcSpdSet;
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 17
System Function
Motor_Offset
The AD middle points of amplifier part on the HW are got in this structure. If the middle voltage of the amplifying
circuit for the phase current is changed, the AD offset result will also be changed.
Motor_Offset
AD middle point for current Iu AD sample
AD middle point for current Iv AD sample
AD middle point for current Iw AD sample
2048 = 2.5V, the offset error threshold is set by
‘AD_OFFEST_MAX_VALUE’
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 18
System Function
Startup_stcCtrl
The structure is used for the motor start-up control. The detailed information can be found in the comments for
each variable.
Limit_stcCalc
The structure is used for the FOC current and voltage limitation to ensure the reliability of the inverter. The
detailed information can be found in the comments for each variable.
FieldWeaken_stcCtrl
The structure is used for filed weaken control. The detailed information can be found in the comments for each
variable.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 19
System Function
Spd_stcPar
The structure is used for outputting the rotor speed calculation result. The detailed information can be found in
the comments for each variable.
Id PI Enable
Iq PI Enable
SpeedPI Enable
Field weaken PI Enable
Field weaken execution flag
Speed PI execution flag
Execute cycle of Id PI
Execute cycle of Iq PI
Execute cycle of speed PI, unit: ms
Execute cycle of field weaken PI, unit :ms
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 20
System Function
Pid_stcSpdPI
The structure is used for the speed PI regulator. The detailed information can be found in the comments for each
variable.
Pid_stcIqPI
The structure is used for the q-axis current ‘Iq’ PI regulator. The detailed information can be found in the
comments for each variable.
Pid_stcIdPI
The structure is used for the d-axis current ‘Id’ PI regulator. The detailed information can be found in the
comments for each variable.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 21
System Function
FieldWeaken_stcPiParam
The structure is used for field weaken PI regulator. The detailed information can be found in the comments for
each variable.
OOB_stcCtrl
The structure is used for OOB detect. The detailed information can be found in the comments for each variable.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 22
System Function
UnStop_stcParam
The structure is used for un-stop running. The detailed information can be found in the comments for each
variable.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 23
6. Event Function
The primary functions for the motor inverter control are introduced in this chapter
Prototype Description
Hall_CaptureOn(); The hall status check at the first electrical cycle of the motor by the query
mode when the power is on
UnStop_Run() The main function for the un-stop running
Spd_EstimateCalculate() The speed calculate function by the estimator
Spd_Calculate() The speed calculate function by the estimator and hall module
Motor_Sense() The phase current restoration from ADC converter
ClarkeTransform(&Motor_3sCurrent, The function of the Clarke frame transform
&Motor_2sCurrent)
ParkTransform(&Motor_2sCurrent, The function of the Park frame transform
&Motor_2rCurrent)
Posi_Estimate(…) The function of the rotor position estimator
Posi_Calculate() The function of the rotor position calculation from the estimator and hall
module
Angle_Generate() The function of the rotor position generation
Current_PI(…) The d/q current PI regulator
Startup_HallMotor() The motor start-up function for the hall sensor motor
InvertParkTransform(…) The function of the inverse Clarke frame transform
InvertClackeTransform(…) The function of the inverse Park frame transform
SVPWM_Calc(…) The SVPWM function
Write_MFT_OCCP(…) The function for the OCCP register setting according to the SVPWM
calculate result
Weight_LoadMeasure() The function for the weight
OOB_Detect() The function for the OOB
Protect_HallLost(…) The protection function for the hall lost detect
Protect_OpenPhase(…) The protection function for the open phase detect
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 24
Event Function
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 25
7. Driver Function
The MCU peripheral resources used for motor control are introduced in this chapter.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 26
8. Interrupt Function
voidInitNVIC(void)
{ // INT priority
ConfPriorityForIRQ(16 + MFS3RX_IRQn, 4, PRI_LEVEL_6); //UART receive
ConfPriorityForIRQ(16 + MFS3TX_IRQn, 4, PRI_LEVEL_6); //UART Transmit
ConfPriorityForIRQ(16 + WFG_IRQn, 4, PRI_LEVEL_0); //watchdog
ConfPriorityForIRQ(16 + EXINT0_7_IRQn, 4, PRI_LEVEL_0);//outside int
ConfPriorityForIRQ(16 + SWDT_IRQn, 4, PRI_LEVEL_1);//software watch dog
ConfPriorityForIRQ(16 + ADC0_IRQn, 4, PRI_LEVEL_2); //adc0
ConfPriorityForIRQ(16 + ADC1_IRQn, 4, PRI_LEVEL_4); //adc1
ConfPriorityForIRQ(16 + FRTIM_IRQn, 4, PRI_LEVEL_3); //frt
ConfPriorityForIRQ(16 + OUTCOMP_IRQn, 4, PRI_LEVEL_6); //outcompare
ConfPriorityForIRQ(16 + BTIM0_7_IRQn, 4, PRI_LEVEL_5); //hall
}
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 27
Interrupt Function
8.3.1 MFT
The multifunction timer is used to generate the interrupt for the motor control algorithm and trigger the AD
sample at the zero point.
Figure 7. Free Run Timer Interrupt
ISR_MFT_FRT
Free run timer 0, UP/DOWN mode, PWM cycle: 62.5 us, 16K Hz
ISR_Hall
One motor electrical cycle
Hall signal Voltage High or Low level
H
Hall Edge
change Motor speed
interrupt calculate and rotor
and base phase angle core
timer over
flow
interrupt
Base timer Count Over Flow
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 28
Interrupt Function
8.3.3 DTTI
The DTTI0 is used to trigger the HW fault protection from the IPM. When the phase current is large enough to
trigger the HW over-current fault, the interrupt is got and all of the drive signals for the motor control will shut off
immediately.
Figure 9. DTTI Interrupt
ISR_MFT_WFG
IPM fault signal low voltage
H
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 29
9. Demo System
This chapter introduces one example of inverter washing machine project and help you run a motor quickly.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 30
Demo System
Hall port
Note:
If there are only 2 hall signals on the motor, the hall A and B line can be only connected to the inverter’s
Hall A and Hall B port. Don’t connect to the Hall C port on the board.
VCC and GND must be connected rightly, otherwise the hall won’t work properly and the motor will also
not run.
2. Connect motor’s U, V, W phase lines to inverter board, shown as below.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 31
Demo System
U, V, W
J-Link
Note:
If there is no isolator between the J-link and the HW, you must unplug the AC power and use the battery of your
note book.
4. Connect AC power to Inverter board, shown as below.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 32
Demo System
AC Power
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 33
Demo System
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 34
Demo System
Motor Parameter.
Figure 17. Motor Parameter Set
DEGREE(210),DEGREE(150),DEGREE(270)};
#endif
WM Parameter Setting
Figure 18. Washing Machine Parameter Setting
Note:
The washing machine type must be correctly set, the drum running direction maybe reversed by the
incorrect setting.
The transmission ratio of the motor for the washing machine must be correctly set also. Otherwise the
drum speed will be incorrect. Wm_TransRate =1 for the DD and DDM washing machine.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 35
Demo System
The carrier frequency of the washing machineis16KHz. The phase current AD sample frequency is 16 KHz. And
the dead-time of the SVPWM is 2µs
B. Basic setting for HW
The basic settings for the HW can be set in the H file ‘H05_user/ CustomerInterface.h’
ADC Port and Coefficient Setting
Figure 20. ADC Port Setting
The Demo Board’s current sample resistor is 0.02Ω, current amplification factors 10 times, DC Bus voltage
sample factor is 96.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 36
Demo System
The hall I/O is recommended to connect to the port the same as HW demo due to the special MCU peripheral
usage.
Selectable Function Setting
Figure 23. Function Selection
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 37
Demo System
The advanced functions are set in this part, if you want to run the hall and HW check functions, the variable:
FW_TEST_MODE can be set to TRUE to run these functions.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 38
Demo System
PI Parameter Setting
Figure 27. PI Parameter Setting
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 39
Demo System
UART Setting
Figure 29. UART Setting
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 40
Demo System
Speed Setting
Figure 30. Speed Setting
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 41
Demo System
Un-Stop Setting
Figure 32. Un-Stop Parameter Setting
Protection Setting
The protection setting is just the prompt. The detailed information can be found in the FW.
Figure 33. Protection Parameter Setting
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 42
Demo System
9.2.2 HW Check
The HW performance can be self-checked by the HW check module.
If the HW has been already used for a long time, this module can be ignored. And the motor can be normally
started as shown in section ‘9.2.4 Run Motor.’
Note: The HW performance must be validated and the related FW setting must be also correctly set, otherwise
the hall self-check and the motor may not run well.
[Link] FW Setting
Set the variable FW_TEST_MODE TRUE to 1 to make the control system run in debug mode.
Set the real DC bus that is measured by multi-meter between the PN points on the HW to the macro definition as
following:
#define DC_INPUT 310 //the DC input voltage to inverter board in test mode, unit:V
Click the debugger button to connect the J-link, and paste the global structure
‘HwCheck_stcPar’ into the Live Watch in the IAR debug online.
Enable the HW check function by the variable ‘cStart’ that is shown in Table 11,the HW performance such as DC
sample and HW over-current point can be self-checked by this function.
Table 11. Global Structure for HW Check
HW checkstartcommand
HW checkstopcommand
HW check finished flag
Flag for HW check error
Flag for DC voltage check error
Flag for current sample check error
Value of the HW over-current protection
When the HW check finished flag ‘cover’ is set to ‘1’, the HW check result is output by the global structure as
shown in Table 11
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 43
Demo System
[Link] FW Setting
Set the variable FW_TEST_MODE TRUE according to Figure 24 to make the control system run in debug mode
Figure 34. Macro Definition for the Test Mode
Set the ‘motor pole pairs’ according to the motor SPEC from manufacturer to the flowing variable.
/** UI_0101 Configuration motor parameter */
uint8_t Motor_pole_pairs = 12; // the pole pairs of rotor
floatMotor_CurrentMax = 6.0; //max peak phase current,unit,A
floatMotor_Rs = 6; // phase resistor of motor,unit:ohm
floatMotor_Ls = 24; // phase inductance of motor,unit:mH
Motor_Rs: This parameter is used for the hall check validation and it can be measured by multi-meter.
Motor_Ls: This parameter is used for the hall check validation.
Set the washing machine parameters according to the following variables.
/** UI_0102Configuration WM parameter */
char_tWM_cType = DD; // washing machine type:DD,DDM,BLDC,BLDCM, just copy it
floatWm_TransRate= 1; // TransRate of washing machine, DD-->1, BLDC-->TBD
Click the debugger button to connect the J-link, and paste the global structure
‘HallCheck_stcPar’ into the Live Watch in the IAR debug online.
Enable the hall check function by the variable ‘cStart’ as Table 12 and the hall information of the motor can be
self-checked by this function. When the hall check finished flag ‘cover’ is set to ‘1’, the hall information is output
by the global structure as Table 12 and Figure 35.
Note: the load in the drum must be empty for the hall check.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 44
Demo System
=
Hall checkstartcommand
Hall checkstopcommand
Hall check finished flag
Hall check stage
Flag for Hall check error
Flag for Hall number error
Flag for Hall status error
Flag for Hall check time-out error
The hall number of the motor
The status list table
The CCW angle table
The CW angle table
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 45
Demo System
DEGREE(270),DEGREE(210),DEGREE(330)};
#endif
MOTOR_ID: The motor ID for user, if the new motor is used for the debug, the motor can be set in the region ‘#if
0== MOTOR_ID’ and set the MOTOR_ID = 0. If the motor runs well with these motor parameters, these
parameters can be fixed and added at the end of the ‘S05 user/CustomerInterface.c’’. And you can switch the
motor debug more conveniently and quickly if you have the debugged parameter
Motor_pole_pairs : lt must be got by the manufacturer
Motor_CurrentMax: It can be got by the manufacturer or determined by the phase peak current at
the motor brake stable stage
Motor_Rs: The parameter of motor phase resistor, it can be measured by the multi-meter.
Motor_Ls: The parameter of motor phase inductance.
Motor_HallStatuList[7]: The hall status change sequence, it can be self-checked and filled sequentially according
to buffer ‘HallCheck_stcPar .u8StatusTable[8]’ that is shown in Figure 36
Motor_HallAngleCCW[7]: The hall angle matched with each hall status for CCW running, it can be self-checked
and filled sequentially according to buffer ‘HallCheck_stcPar .i32Q22_AngleCCW[8]’ that is shown in Figure 35
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 46
Demo System
Note:
Due to the check error, the angle can be set to the integrate number nearby. If
‘HallCheck_stcPar .i32Q22_AngleCCW[1]=269’ is shown in Figure 35, we fill the buffer
‘Motor_HallAngleCCW[1]=270’ as Motor_HallAngleCW[7]: The hall angle matched with each hall status for CW
running, it can be self-checked and filled sequentially according to buffer
‘HallCheck_stcPar .i32Q22_AngleCW[8]’ that is shown in Figure 36
A D B
And you can take the Table 13 for your detailed reference for the speed command.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 47
Demo System
Motor_stcRunParam.
Drum Direction Motor’s status
i16WmCommandSpdRpm
>0 CCW Running
<0 CW Running
=0 Stop Stop
Note:
All of the command speed from the debugger or UART is defined as the drum speed.
Do not click the button D to break the FW running, the HW over-current or DC over fault may appear and
damage the HW if you do that.
4. Watch the important variable to check the motor running performance such as whether the real motor is
achieved the command speed and running speed is stable. Detailed meaning about the important variable is
shown in the previous section ‘5.2 Global Structure and Variable Definition’ for your reference.
Motor_stcRunParam. Drum
Description
i16WmCommandSpdRpm Direction
30~50 CCW The Drum speed runs at 30~50rpm for the wash mode
-30~-50 CW The Drum speed runs at 30~50rpm for the wash mode
The Drum speed runs at 89rpm for the OOB detection before the
89 CCW
spin mode
400 CCW The Drum speed runs at 400rpm for the pre-spin
The Drum speed runs at 100rpm to drain away water by the host
100 CCW
after the pre-spin
1000 CCW The Drum speed runs at 1000rpm for the spin mode
1200 CCW The Drum speed runs at 1200rpm for the spin mode
0 Stop motor The motor will stop working
The default speed changing time is 10, which means 1s as shown in 9.2.1.2Advanced Variables Setting.
If you want to change the default acceleration, you can disable the UART macro definition ’UARTEN ’ in UART.h
and set the default acceleration ‘DefaultAcce’ or the maximum acceleration ‘SpdSet_u16AcceLmt’ as you want.
When the motor needs to reverse the running direction, you should stop the motor and then restart the motor to
run in another direction.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 48
Demo System
9.3 Troubleshooting
9.3.1 Motor Start-up
When the motor can’t start-up normally, there may be 2 reasons:
1. The Hall Angle found in debug mode is fault. Even if the washing machine’s load is empty, it also can’t
Start-up.
2. The startup parameter is not set correctly. User should change the parameter in ‘S05_user/Customer
Interface.c’ and refer to the section ‘Motor Start-up’
9.3.2 Protection
When the motor is stopped without the normal stop command, the protection fault may appear, you can see the
value of the variable ‘Motor_stcRunParam.u16FaultCode’ in the watch window and the code is assigned by the
bit OR operation. The fault codes for each protection are shown as below. You can match the value with these
fault codes to find what protection is performed.
#define NORMAL_RUNNING 0x0000 //no error
#define OVER_VOLTAGE 0x0001 //DC bus over-voltage
#define UNDER_VOLTAGE 0x0002 //DC bus under-voltage
#define SW_OVER_CURRENT 0x0004 //over-current
#define MOTOR_OVER_CURRENT 0x0008 //over-current of HW
#define MOTOR_LOSE_PHASE 0x0010 //motor lose phase
#define NO_CONECT_COMPRESSOR 0x0020 //no motor connected
#define AD_MIDDLE_ERROR 0x0040 //current sample 2.5V offset error
#define SF_WTD_RESET 0x0080 //FW watch dog reset
#define MOTOR_LOCK 0x0100 //motor lock
#define UNDEFINED_INT 0x0200 //undefined interrupt
#define HW_WTD_RESET 0x0400 //HW watch dog reset
//washing machine fault code
#define POWER_OVER 0x0800 //motor over-power
#define IPM_TEMPOVER 0x1000 //IPM over current
#define HALL_LOST 0x2000 //Hall lost fault
#define COMM_ERROR 0x4000 //communicate error code
#define SINK_ERR 0x8000 //IPM circuit fault
There may be different processing logic about the protection.
The fault code may not be cleared except the DC bus voltage protection for the inverter DEMO. That is the FW
may not run again when the protection fault happens. You can access the variable
‘Motor_stcRunParam.u16FaultCode’ to make your own protection processing logic.
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 49
Demo System
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 50
10. Additional Information
For more Information on Cypress semiconductor products, visit the following websites:
English version address:
[Link]
Chinese version address:
[Link]
Please contact your local support team for any technical question
America: [Link]
Other: [Link]
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 51
11. Revision History
Document Title: FM3, Inverter Sensor Washing Machine Firmware User Manual
Document Number:002-04442
FM3, Inverter Sensor Washing Machine Firmware User Manual, Doc. No. 002-04442 Rev. *A 52